/* Koora City — قسم الأخبار + أزرار هيدر الموقع (1.4.0)
   كل القواعد هنا مربوطة بكلاس على body (kcfx-news / kcfx-hdr)
   فلو قفلت الخيار من إعدادات الإضافة يرجع شكل القالب زي ما هو. */

/* =========================================================
   1) قسم الأخبار — نفس لغة تصميم جدول المباريات
   ========================================================= */

body.kcfx-news .AY_Block[class*="PS_"] {
	--kn-panel: #ffffff;
	--kn-border: #dde1e8;
	--kn-line: #e6e9ef;
	--kn-card: #ffffff;
	--kn-card-border: #e6e9ef;
	--kn-card-hover: #c9cfdc;
	--kn-text: #1d2140;
	--kn-muted: #5f6678;
	--kn-thumb: #eceef2;
	--kn-acc: var(--kcfx-accent, #1b2142);
	--kn-head: linear-gradient(180deg, #f6f7f9 0%, #eceef2 100%);
	--kn-head-line: #dde1e8;
	--kn-head-accent: var(--kcfx-accent, #1b2142);
	--kn-mark-bg: #ffffff;
	--kn-mark-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b2142' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5.5A1.5 1.5 0 0 1 5.5 4h10A1.5 1.5 0 0 1 17 5.5V18a2 2 0 0 0 2 2H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='M17 9h1.5A1.5 1.5 0 0 1 20 10.5V18a2 2 0 0 1-2 2'/%3E%3Cpath d='M8 8h5M8 12h5M8 16h3'/%3E%3C/svg%3E");
	--kn-btn-bg: #ffffff;
	--kn-btn-border: #d9dde5;
	--kn-btn-hover: #f4f5f8;
	--kn-ctl-bg: #f1f3f7;
	--kn-ctl-border: #e1e4ea;

	margin-bottom: 20px;
	overflow: hidden;
	background: var(--kn-panel);
	border: 1px solid var(--kn-border);
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(29, 33, 64, 0.05);
	font-family: var(--kcfx-font, inherit);
}

.Night body.kcfx-news .AY_Block[class*="PS_"] {
	--kn-panel: #131727;
	--kn-border: #22273b;
	--kn-line: #22273b;
	--kn-card: #171c2e;
	--kn-card-border: #22273b;
	--kn-card-hover: #3a4160;
	--kn-text: #eef1f8;
	--kn-muted: #9298b0;
	--kn-thumb: #1c2236;
	--kn-acc: var(--kcfx-accent-night, #ffb547);
	--kn-head: linear-gradient(180deg, #20263b 0%, #1c2236 100%);
	--kn-head-line: #22273b;
	--kn-head-accent: var(--kcfx-accent-night, #ffb547);
	--kn-mark-bg: #262c44;
	--kn-mark-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffb547' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5.5A1.5 1.5 0 0 1 5.5 4h10A1.5 1.5 0 0 1 17 5.5V18a2 2 0 0 0 2 2H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='M17 9h1.5A1.5 1.5 0 0 1 20 10.5V18a2 2 0 0 1-2 2'/%3E%3Cpath d='M8 8h5M8 12h5M8 16h3'/%3E%3C/svg%3E");
	--kn-btn-bg: #131727;
	--kn-btn-border: #2a3047;
	--kn-btn-hover: #171c2e;
	--kn-ctl-bg: #0f1220;
	--kn-ctl-border: #2a3047;
	box-shadow: none;
}

/* الهيدر — نفس هيدر جدول المباريات (ألوان الجدول وشريط البطولات) في الكمبيوتر والموبايل */
body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 58px;
	margin: 0;
	padding: 10px 14px;
	overflow: visible;
	border: 0;
	border-bottom: 1px solid var(--kn-head-line);
	border-radius: 0;
	background: var(--kn-head);
}

body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head h2 {
	display: flex;
	align-items: center;
	gap: 10px;
	width: auto;
	margin: 0;
	padding: 0;
	background: none;
	border-radius: 0;
	color: var(--kn-text);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	text-align: right;
}

/* أيقونة الجرنال */
body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head h2::before {
	content: "";
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--kn-mark-bg) no-repeat center / 18px 18px;
	background-image: var(--kn-mark-icon);
	box-shadow: inset 0 0 0 1px var(--kn-btn-border), 0 1px 2px rgba(29, 33, 64, 0.06);
}

.Night body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head h2::before {
	box-shadow: none;
}

/* العنوان وتحته خط صغير بلون الهوية */
body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head h2 strong {
	position: relative;
	padding-bottom: 5px;
	color: var(--kn-text);
	font-weight: 700;
}

body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head h2 strong::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	width: 26px;
	height: 3px;
	border-radius: 3px;
	background: var(--kn-head-accent);
}

/* زرار "عرض الكل" بدل السهم › */
body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head .WTa {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	margin: 0;
	padding: 0 13px;
	border: 0;
	border-radius: 10px;
	background: var(--kn-btn-bg);
	box-shadow: inset 0 0 0 1px var(--kn-btn-border), 0 1px 2px rgba(29, 33, 64, 0.05);
	color: var(--kn-text);
	font-size: 0;
	line-height: 1;
	opacity: 1;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.Night body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head .WTa {
	box-shadow: inset 0 0 0 1px var(--kn-btn-border);
}

body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head .WTa::before {
	content: "عرض الكل";
	font-size: 13px;
	font-weight: 700;
}

body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head .WTa::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-right: 2px;
	border-bottom: 2px solid currentColor;
	border-left: 2px solid currentColor;
	transform: rotate(45deg);
}

body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head .WTa:hover,
body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head .WTa:focus {
	background: var(--kn-btn-hover);
	color: var(--kn-acc);
	opacity: 1;
}

/* المحتوى */
body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Inner {
	padding: 12px;
	overflow: hidden;
	background: transparent;
}

body.kcfx-news .AY_Block[class*="PS_"] .AYaGrid {
	grid-gap: 10px;
	gap: 10px;
	padding-bottom: 0;
}

body.kcfx-news .AY_Block[class*="PS_"] .gr-item {
	min-width: 0;
}

body.kcfx-news .AY_Block[class*="PS_"] .gr-inner {
	position: relative;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--kn-card-border);
	border-radius: 10px;
	background: var(--kn-card);
	color: var(--kn-text);
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body.kcfx-news .AY_Block[class*="PS_"] .gr-inner:hover,
body.kcfx-news .AY_Block[class*="PS_"] .gr-inner:focus-visible {
	border-color: var(--kn-card-hover);
	box-shadow: 0 6px 18px rgba(17, 20, 40, 0.08);
	transform: translateY(-1px);
}

.Night body.kcfx-news .AY_Block[class*="PS_"] .gr-inner:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

body.kcfx-news .AY_Block[class*="PS_"] .gr-img {
	background-color: var(--kn-thumb);
}

body.kcfx-news .AY_Block[class*="PS_"] .gr-info {
	padding: 10px 12px;
}

body.kcfx-news .AY_Block[class*="PS_"] .gr-info h3,
body.kcfx-news .AY_Block[class*="PS_"] .gr-title {
	display: -webkit-box;
	height: auto;
	max-height: none;
	margin: 0;
	overflow: hidden;
	color: var(--kn-text);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.6;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	transition: color 0.15s ease;
}

body.kcfx-news .AY_Block[class*="PS_"] .gr-inner:hover h3 {
	color: var(--kn-acc);
}

/* ستايل 3 (أفقي: صورة + عنوان) — ده اللي في "آخر الأخبار" */
body.kcfx-news .AY_Block.PS_3 .AYaGrid {
	--post-width: 290px;
}

body.kcfx-news .AY_Block.PS_3 .gr-inner {
	display: flex !important;
	align-items: center !important;
	gap: 12px;
	padding: 8px;
}

body.kcfx-news .AY_Block.PS_3 .gr-img {
	flex: none;
	width: 124px !important;
	min-width: 124px;
	height: 84px !important;
	border-radius: 8px;
}

body.kcfx-news .AY_Block.PS_3 .gr-info {
	flex: 1;
	min-width: 0;
	padding: 0 0 0 4px;
}

/* ستايل 1 (كروت: صورة فوق + عنوان) */
body.kcfx-news .AY_Block.PS_1 .gr-img {
	border-radius: 0;
}

body.kcfx-news .AY_Block.PS_1 .gr-info h3 {
	font-size: 14px;
}

/* ستايل 2 (صورة كبيرة والعنوان عليها) */
body.kcfx-news .AY_Block.PS_2 .gr-inner {
	border: 0;
}

body.kcfx-news .AY_Block.PS_2 .gr-btitle {
	padding: 48px 14px 14px;
	background: linear-gradient(180deg, rgba(10, 12, 28, 0) 0%, rgba(10, 12, 28, 0.85) 100%);
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.6;
	text-shadow: none;
}

/* زرار "المزيد من الأخبار" */
body.kcfx-news .AY_Block[class*="PS_"] .AlbaMorBtn {
	margin: 4px auto 12px;
}

body.kcfx-news .AY_Block[class*="PS_"] .LoadMOreNews {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 190px;
	height: 38px;
	margin: 0 auto;
	padding: 0 18px;
	border: 1px solid var(--kn-ctl-border);
	border-radius: 10px;
	background: var(--kn-ctl-bg);
	color: var(--kn-text);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

body.kcfx-news .AY_Block[class*="PS_"] .LoadMOreNews:hover {
	border-color: var(--kn-acc);
	color: var(--kn-acc);
}

/* موبايل: نفس الهيدر بمقاسات أصغر */
@media (max-width: 700px) {
	body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head {
		min-height: 0;
		padding: 12px;
	}

	body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head h2 {
		gap: 9px;
		font-size: 16.5px;
	}

	body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head h2::before {
		width: 34px;
		height: 34px;
	}

	body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Head .WTa {
		height: 34px;
		padding: 0 11px;
	}

	body.kcfx-news .AY_Block[class*="PS_"] > .AYb_Inner {
		padding: 10px;
	}

	body.kcfx-news .AY_Block[class*="PS_"] .AYaGrid {
		grid-template-columns: minmax(0, 1fr);
	}

	body.kcfx-news .AY_Block.PS_3 .gr-inner,
	body.kcfx-news .AY_Block.PS_1 .gr-inner {
		display: flex !important;
		align-items: center !important;
		gap: 10px;
		padding: 7px;
	}

	body.kcfx-news .AY_Block.PS_3 .gr-img,
	body.kcfx-news .AY_Block.PS_1 .gr-img {
		flex: none;
		width: 112px !important;
		min-width: 112px;
		height: 78px !important;
		border-radius: 8px;
	}

	body.kcfx-news .AY_Block.PS_1 .gr-info {
		flex: 1;
		min-width: 0;
		padding: 0 0 0 4px;
	}

	body.kcfx-news .AY_Block[class*="PS_"] .gr-info h3,
	body.kcfx-news .AY_Block[class*="PS_"] .gr-title {
		font-size: 13.5px;
		line-height: 1.6;
	}
}

/* =========================================================
   2) أزرار هيدر الموقع (القائمة + الوضع الليلي)
   زرار الوضع الليلي بيتظبط في الكمبيوتر والموبايل، أياً كان مكانه في الهيدر.
   ========================================================= */

body.kcfx-hdr #AYaHeader {
	--kh-tile: #f1f3f7;
	--kh-tile-hover: #e8ebf1;
	--kh-border: #e1e4ea;
	--kh-ink: var(--kcfx-accent, #1b2142);
	--kh-thumb: #ffffff;
	--kh-sun: #f2a516;
	--kh-moon: #8a91a6;
	--kh-ring: rgba(27, 33, 66, 0.35);
}

.Night body.kcfx-hdr #AYaHeader {
	--kh-tile: rgba(255, 255, 255, 0.06);
	--kh-tile-hover: rgba(255, 255, 255, 0.1);
	--kh-border: rgba(255, 255, 255, 0.1);
	--kh-ink: #ffffff;
	--kh-thumb: var(--kcfx-accent-night, #ffb547);
	--kh-sun: rgba(255, 255, 255, 0.5);
	--kh-moon: #15110a;
	--kh-ring: rgba(255, 181, 71, 0.45);
}

/* --- زر الوضع الليلي: سويتش شمس/قمر زي أزرار الأيام في الجدول --- */
body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg) {
	position: relative;
	display: inline-flex;
	flex: none;
	width: 76px;
	min-width: 76px;
	height: 40px;
	margin-top: 0;
	margin-bottom: 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--kh-border);
	border-radius: 12px;
	background: var(--kh-tile) !important;
	box-shadow: none;
	color: var(--kh-ink);
	font-size: 0;
	line-height: 0;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg):hover {
	border-color: #cfd4df;
}

.Night body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg):hover {
	border-color: rgba(255, 255, 255, 0.2);
}

/* المربع اللي بيتحرك (هو نفس أيقونة القالب) */
body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg) svg {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 34px;
	height: 32px;
	margin: 0;
	border-radius: 9px;
	background: var(--kh-thumb);
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.16), 0 0 0 1px rgba(16, 24, 40, 0.04);
	color: transparent;
	transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.2, 1), background-color 0.2s ease;
}

body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg) svg * {
	display: none !important;
}

.Night body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg) svg {
	transform: translateX(-36px);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* الشمس (يمين) والقمر (شمال) */
body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg)::before,
body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg)::after {
	content: "";
	position: absolute;
	top: 50%;
	z-index: 1;
	width: 17px;
	height: 17px;
	margin-top: -8.5px;
	pointer-events: none;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
	transition: background-color 0.2s ease;
}

body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg)::before {
	right: 12px;
	background: var(--kh-sun);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.6'/%3E%3Cg stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 2.2v2.2M12 19.6v2.2M2.2 12h2.2M19.6 12h2.2M5.1 5.1l1.6 1.6M17.3 17.3l1.6 1.6M5.1 18.9l1.6-1.6M17.3 6.7l1.6-1.6'/%3E%3C/g%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.6'/%3E%3Cg stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 2.2v2.2M12 19.6v2.2M2.2 12h2.2M19.6 12h2.2M5.1 5.1l1.6 1.6M17.3 17.3l1.6 1.6M5.1 18.9l1.6-1.6M17.3 6.7l1.6-1.6'/%3E%3C/g%3E%3C/svg%3E");
}

body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg)::after {
	left: 12px;
	background: var(--kh-moon);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.6 14.7A8.6 8.6 0 0 1 9.3 3.4a8.6 8.6 0 1 0 11.3 11.3z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.6 14.7A8.6 8.6 0 0 1 9.3 3.4a8.6 8.6 0 1 0 11.3 11.3z'/%3E%3C/svg%3E");
}

body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg):focus-visible {
	outline: 2px solid var(--kh-ring);
	outline-offset: 2px;
}

/* --- زر القائمة (بيظهر في الموبايل والتابلت بس): مربع ناعم بخطوط حديثة --- */
body.kcfx-hdr #AYaHeader .hed-btn.op {
	position: relative;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--kh-border);
	border-radius: 12px;
	background: var(--kh-tile) !important;
	box-shadow: none;
	transition: background-color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

body.kcfx-hdr #AYaHeader .hed-btn.op:hover {
	background: var(--kh-tile-hover) !important;
}

body.kcfx-hdr #AYaHeader .hed-btn.op:focus-visible {
	outline: 2px solid var(--kh-ring);
	outline-offset: 2px;
}

body.kcfx-hdr #AYaHeader .hed-btn.op .liwte {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 4px;
	width: 18px;
}

body.kcfx-hdr #AYaHeader .hed-btn.op .line {
	display: block;
	width: 18px;
	height: 2px;
	margin: 0;
	border-radius: 2px;
	background: var(--kh-ink);
	transition: width 0.2s ease;
}

body.kcfx-hdr #AYaHeader .hed-btn.op .line-2 {
	width: 11px;
}

body.kcfx-hdr #AYaHeader .hed-btn.op .line-3 {
	width: 15px;
}

body.kcfx-hdr #AYaHeader .hed-btn.op:hover .line {
	width: 18px;
}

@media screen and (max-width: 1000px) {
	/* يخلي اللوجو في النص بالظبط رغم إن السويتش أعرض من زر القائمة */
	body.kcfx-hdr #AYaHeader .hed-btn.op:has(~ .hed-btn.mo) {
		margin-left: 36px;
	}

	/* زر قفل القائمة الجانبية بنفس الستايل */
	body.kcfx-hdr .AYaMainNav .CloseNave {
		top: 14px;
		left: calc(50% - 18px);
		width: 36px;
		height: 36px;
		border: 1px solid var(--kh-border, #e1e4ea);
		border-radius: 11px;
		background: var(--kh-tile, #f1f3f7);
	}

	body.kcfx-hdr .AYaMainNav .CloseNave .liwte {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
	}

	body.kcfx-hdr .AYaMainNav .CloseNave .line {
		top: 50%;
		left: 50%;
		width: 16px;
		height: 2px;
		margin: -1px 0 0 -8px;
		border-radius: 2px;
		background: var(--kh-ink, #1b2142);
	}

	.admin-bar.kcfx-hdr .AYaMainNav .CloseNave {
		top: 60px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.kcfx-hdr #AYaHeader :is(.hed-btn.mo, [onclick*="skin_switcher"]):not(svg) svg,
	body.kcfx-news .AY_Block[class*="PS_"] .gr-inner {
		transition: none;
	}
}
