/* Infogatee Encyclopedia Style — frontend.css
 * يعتمد على الخصائص المنطقية (inline-start/end) فيعمل مع RTL وLTR.
 */

:root {
	--ies-nav-h: 60px;
	--ies-nav-a: .72;
	--ies-nav-blur: 14px;
	--ies-primary: #0b6fbf;
	--ies-offset: 80px;
	--ies-font: inherit;
	--ies-text: #1f2933;
	--ies-muted: #6b7785;
	--ies-border: #e3e8ee;
	--ies-soft: #f5f8fb;
	--ies-radius: 10px;
}

html {
	scroll-padding-top: var(--ies-offset);
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* ---------- تنسيق المقال ---------- */

.ies-typo.single-post .entry-content {
	font-family: var(--ies-font);
	font-size: 1.075rem;
	line-height: 2;
	color: var(--ies-text);
}

.ies-typo.single-post .entry-content p {
	margin: 0 0 1.2em;
}

.ies-typo.single-post .entry-content h2 {
	position: relative;
	margin: 2em 0 .9em;
	padding-bottom: .45em;
	font-size: 1.55rem;
	line-height: 1.5;
	border-bottom: 2px solid var(--ies-border);
}

.ies-typo.single-post .entry-content h2::after {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	bottom: -2px;
	width: 72px;
	height: 2px;
	background: var(--ies-primary);
}

.ies-typo.single-post .entry-content h3 {
	margin: 1.7em 0 .6em;
	font-size: 1.25rem;
	line-height: 1.6;
	color: var(--ies-primary);
}

.ies-typo.single-post .entry-content ul,
.ies-typo.single-post .entry-content ol {
	margin: 0 0 1.2em;
	padding-inline-start: 1.6em;
}

.ies-typo.single-post .entry-content li {
	margin-bottom: .4em;
}

.ies-typo.single-post .entry-content a {
	color: var(--ies-primary);
	text-underline-offset: 3px;
}

.ies-typo.single-post .entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--ies-radius);
}

.ies-typo.single-post .entry-content blockquote {
	margin: 1.6em 0;
	padding: 1em 1.3em;
	background: var(--ies-soft);
	border-inline-start: 4px solid var(--ies-primary);
	border-radius: var(--ies-radius);
}

.ies-typo.single-post .entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.ies-typo.single-post .entry-content table {
	width: 100%;
	margin: 1.5em 0;
	border-collapse: collapse;
	font-size: .98rem;
}

.ies-typo.single-post .entry-content th,
.ies-typo.single-post .entry-content td {
	padding: .65em .9em;
	border: 1px solid var(--ies-border);
	text-align: start;
}

.ies-typo.single-post .entry-content th {
	background: var(--ies-soft);
	font-weight: 700;
}

/* ---------- فتات الخبز ---------- */

.ies-breadcrumbs {
	margin: 0 0 .8em;
	font-size: .88rem;
	color: var(--ies-muted);
}

.ies-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: .35em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ies-breadcrumbs li {
	display: inline-flex;
	align-items: center;
	margin: 0;
}

.ies-breadcrumbs li + li::before {
	content: "›";
	margin-inline-end: .35em;
	opacity: .6;
}

[dir="ltr"] .ies-breadcrumbs li + li::before {
	content: "›";
}

.ies-breadcrumbs a {
	color: var(--ies-primary);
	text-decoration: none;
}

.ies-breadcrumbs a:hover {
	text-decoration: underline;
}

.ies-breadcrumbs [aria-current="page"] span {
	overflow: hidden;
	max-width: 32ch;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- معلومات المقال ---------- */

.ies-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .4em 1.2em;
	margin: 0 0 1.4em;
	padding-bottom: .9em;
	border-bottom: 1px solid var(--ies-border);
	font-size: .88rem;
	color: var(--ies-muted);
}

/* ---------- فهرس المحتويات ---------- */

.ies-toc {
	margin: 1.6em 0 2em;
	padding: 1em 1.2em;
	background: var(--ies-soft);
	border: 1px solid var(--ies-border);
	border-inline-start: 4px solid var(--ies-primary);
	border-radius: var(--ies-radius);
	font-size: .98rem;
	line-height: 1.7;
}

.ies-toc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
}

.ies-toc__title {
	font-size: 1.1rem;
	font-weight: 700;
}

.ies-toc__toggle {
	padding: .2em .8em;
	background: transparent;
	border: 1px solid var(--ies-border);
	border-radius: 999px;
	color: var(--ies-primary);
	font: inherit;
	font-size: .85rem;
	cursor: pointer;
}

.ies-toc__toggle:hover {
	background: #fff;
}

.ies-toc__list {
	margin: .8em 0 0;
	padding: 0;
	list-style: none;
}

.ies-toc.is-collapsed .ies-toc__list {
	display: none;
}

.ies-toc__item {
	margin: 0;
	padding: .15em 0;
}

.ies-toc__item--l3 {
	padding-inline-start: 1.6em;
	font-size: .94em;
}

.ies-toc__item a {
	display: flex;
	gap: .55em;
	color: inherit;
	text-decoration: none;
}

.ies-toc__item a:hover,
.ies-toc__item a.is-active {
	color: var(--ies-primary);
}

.ies-toc__item a.is-active {
	font-weight: 700;
}

.ies-toc__num {
	flex: 0 0 auto;
	min-width: 1.8em;
	color: var(--ies-primary);
	font-weight: 700;
}

/* ---------- صندوق تنبيه ---------- */

.ies-note {
	margin: 1.5em 0;
	padding: 1em 1.2em;
	background: var(--ies-soft);
	border-inline-start: 4px solid var(--ies-primary);
	border-radius: var(--ies-radius);
}

.ies-note--tip {
	background: #effaf3;
	border-inline-start-color: #1f9d55;
}

.ies-note--warning {
	background: #fff6e6;
	border-inline-start-color: #e08a00;
}

.ies-note__title {
	display: block;
	margin-bottom: .3em;
}

.ies-note__body > :last-child {
	margin-bottom: 0;
}

/* ---------- المشاركة ---------- */

.ies-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5em;
	margin: 2.2em 0 1.5em;
	padding: 1em 0;
	border-top: 1px solid var(--ies-border);
	border-bottom: 1px solid var(--ies-border);
}

.ies-share__label {
	font-weight: 700;
	margin-inline-end: .4em;
}

.ies-share__btn {
	padding: .35em 1em;
	background: #fff;
	border: 1px solid var(--ies-border);
	border-radius: 999px;
	color: var(--ies-text);
	font: inherit;
	font-size: .9rem;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}

.ies-share__btn:hover {
	background: var(--ies-primary);
	border-color: var(--ies-primary);
	color: #fff;
}

/* ---------- شبكات البطاقات ---------- */

.ies-grid {
	display: grid;
	gap: 1.1em;
	grid-template-columns: 1fr;
}

@media (min-width: 600px) {
	.ies-cols-2,
	.ies-cols-3,
	.ies-cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.ies-cols-3 {
		grid-template-columns: repeat(3, 1fr);
	}

	.ies-cols-4 {
		grid-template-columns: repeat(4, 1fr);
	}
}

.ies-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--ies-border);
	border-radius: var(--ies-radius);
	transition: box-shadow .15s, transform .15s;
}

.ies-card:hover {
	box-shadow: 0 6px 18px rgba(20, 40, 70, .08);
	transform: translateY(-2px);
}

.ies-card__thumb {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--ies-soft);
}

.ies-card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.ies-card__body {
	padding: .8em 1em 1em;
}

.ies-card__title {
	margin: 0 0 .35em;
	font-size: 1rem;
	line-height: 1.6;
}

.ies-card__title a {
	color: var(--ies-text);
	text-decoration: none;
}

.ies-card__title a:hover {
	color: var(--ies-primary);
}

.ies-card__date {
	font-size: .82rem;
	color: var(--ies-muted);
}

/* ---------- مقالات ذات صلة ---------- */

.ies-related {
	margin: 2em 0 0;
}

.ies-related__title {
	margin: 0 0 .8em;
	font-size: 1.35rem;
}

/* ---------- بطاقات الأقسام ---------- */

.ies-cat {
	display: flex;
	flex-direction: column;
	gap: .2em;
	padding: 1em 1.2em;
	background: #fff;
	border: 1px solid var(--ies-border);
	border-inline-start: 4px solid var(--ies-primary);
	border-radius: var(--ies-radius);
	text-decoration: none;
	transition: box-shadow .15s, transform .15s;
}

.ies-cat:hover {
	box-shadow: 0 6px 18px rgba(20, 40, 70, .08);
	transform: translateY(-2px);
}

.ies-cat__name {
	color: var(--ies-text);
	font-size: 1.05rem;
	font-weight: 700;
}

.ies-cat__count {
	color: var(--ies-muted);
	font-size: .85rem;
}

/* ---------- شريط التقدم وزر الأعلى ---------- */

.ies-progress {
	position: fixed;
	z-index: 99999;
	inset-block-start: 0;
	inset-inline: 0;
	height: 3px;
	background: transparent;
	pointer-events: none;
}

.ies-progress__bar {
	width: 100%;
	height: 100%;
	background: var(--ies-primary);
	transform: scaleX(0);
	transform-origin: left center;
}

[dir="rtl"] .ies-progress__bar,
html[lang^="ar"] .ies-progress__bar {
	transform-origin: right center;
}

.ies-top {
	position: fixed;
	z-index: 9999;
	inset-block-end: 20px;
	inset-inline-end: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	background: var(--ies-primary);
	border: 0;
	border-radius: 50%;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .2s, transform .2s, visibility .2s;
}

.ies-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.ies-card,
	.ies-cat,
	.ies-top {
		transition: none;
	}
}

@media print {
	.ies-nav,
	.ies-ad,
	.ies-progress,
	.ies-top,
	.ies-share,
	.ies-related,
	.ies-toc__toggle {
		display: none !important;
	}
}

/* ==========================================================
 * الناف الثابتة (شفافة + بلورة) والبحث الذي يظهر عند النزول
 * ========================================================== */

@media (min-width: 900px) {
	:root {
		--ies-nav-h: 64px;
	}
}

.ies-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

body.ies-nav-on {
	padding-top: var(--ies-nav-h);
}

.ies-nav {
	position: fixed;
	z-index: 9990;
	inset-block-start: 0;
	inset-inline: 0;
	box-sizing: border-box;
	background: rgba(255, 255, 255, var(--ies-nav-a));
	-webkit-backdrop-filter: saturate(180%) blur(var(--ies-nav-blur));
	backdrop-filter: saturate(180%) blur(var(--ies-nav-blur));
	border-bottom: 1px solid rgba(15, 30, 50, .08);
	color: var(--ies-text);
	font-family: var(--ies-font);
	transition: box-shadow .2s;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.ies-nav {
		background: rgba(255, 255, 255, .97);
	}
}

.ies-nav.is-scrolled {
	box-shadow: 0 6px 24px rgba(15, 30, 50, .08);
}

body.admin-bar .ies-nav {
	inset-block-start: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .ies-nav {
		inset-block-start: 46px;
	}
}

.ies-nav__bar {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 1200px;
	height: var(--ies-nav-h);
	margin-inline: auto;
	padding-inline: 16px;
}

.ies-nav__brand {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.ies-nav__brand img {
	display: block;
	width: auto;
	max-height: calc(var(--ies-nav-h) - 16px);
}

.ies-nav__name {
	color: var(--ies-primary);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
}

.ies-nav__panel {
	flex: 1 1 auto;
	min-width: 0;
}

.ies-nav__menu {
	display: flex;
	flex-wrap: nowrap;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ies-nav__menu li {
	position: relative;
	margin: 0;
	list-style: none;
}

.ies-nav__menu a {
	display: block;
	padding: 8px 12px;
	border-radius: 8px;
	color: var(--ies-text);
	font-size: .98rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s, color .15s;
}

.ies-nav__menu a:hover,
.ies-nav__menu a:focus-visible,
.ies-nav__menu .current-menu-item > a,
.ies-nav__menu .current-menu-ancestor > a {
	background: rgba(11, 111, 191, .08);
	color: var(--ies-primary);
}

.ies-nav__menu .sub-menu {
	position: absolute;
	z-index: 2;
	inset-block-start: 100%;
	inset-inline-start: 0;
	min-width: 200px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--ies-border);
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(15, 30, 50, .12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .15s, transform .15s, visibility .15s;
}

.ies-nav__menu li:hover > .sub-menu,
.ies-nav__menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* البحث داخل الناف */

.ies-nav__search {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	box-sizing: border-box;
	width: 250px;
	height: 40px;
	margin: 0;
	overflow: hidden;
	background: rgba(15, 30, 50, .06);
	border: 1px solid transparent;
	border-radius: 999px;
	transition: width .25s ease, opacity .2s ease, background .15s, border-color .15s;
}

.ies-nav__search:focus-within {
	background: #fff;
	border-color: var(--ies-primary);
}

.ies-nav__search input[type="search"] {
	-webkit-appearance: none;
	appearance: none;
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0 16px;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--ies-text);
	font: inherit;
	font-size: .95rem;
}

.ies-nav__search input[type="search"]:focus {
	outline: none;
	box-shadow: none;
}

.ies-nav__search button {
	flex: 0 0 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--ies-primary);
	cursor: pointer;
}

/* قبل ظهور البحث (الرئيسية قبل النزول) */
.ies-nav:not(.has-search) .ies-nav__search {
	width: 0;
	border-width: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.ies-nav__toggle {
	display: none;
}

@media (max-width: 899.98px) {
	.ies-nav__toggle {
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		box-sizing: border-box;
		width: 42px;
		height: 42px;
		margin: 0;
		margin-inline-start: auto;
		padding: 0 10px;
		background: transparent;
		border: 0;
		cursor: pointer;
	}

	.ies-nav__toggle span {
		display: block;
		height: 2px;
		background: var(--ies-text);
		border-radius: 2px;
		transition: transform .2s, opacity .2s;
	}

	.ies-nav.is-open .ies-nav__toggle span:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}

	.ies-nav.is-open .ies-nav__toggle span:nth-child(2) {
		opacity: 0;
	}

	.ies-nav.is-open .ies-nav__toggle span:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}

	/* القائمة: لوحة تنزل تحت الناف */
	.ies-nav__panel {
		position: absolute;
		inset-block-start: 100%;
		inset-inline: 0;
		display: none;
		box-sizing: border-box;
		max-height: calc(100vh - var(--ies-nav-h) - 80px);
		overflow-y: auto;
		padding: 8px 12px 14px;
		background: rgba(255, 255, 255, .96);
		border-bottom: 1px solid var(--ies-border);
		box-shadow: 0 14px 28px rgba(15, 30, 50, .1);
	}

	.ies-nav.is-open .ies-nav__panel {
		display: block;
	}

	/* لو صف البحث ظاهر، تنزل اللوحة تحته */
	.ies-nav.has-search .ies-nav__panel {
		inset-block-start: calc(100% + 56px);
	}

	.ies-nav__menu {
		flex-direction: column;
		gap: 0;
	}

	.ies-nav__menu a {
		padding: 11px 12px;
		white-space: normal;
	}

	.ies-nav__menu .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 14px;
		background: transparent;
		border: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	/* البحث: صف كامل تحت الناف يظهر عند النزول */
	.ies-nav__search {
		position: absolute;
		inset-block-start: 100%;
		inset-inline: 0;
		box-sizing: border-box;
		width: auto;
		height: 56px;
		gap: 8px;
		padding: 8px 12px;
		overflow: visible;
		background: rgba(255, 255, 255, .96);
		border: 0;
		border-bottom: 1px solid var(--ies-border);
		border-radius: 0;
		box-shadow: 0 10px 22px rgba(15, 30, 50, .08);
	}

	.ies-nav__search:focus-within {
		background: rgba(255, 255, 255, .96);
	}

	.ies-nav__search input[type="search"] {
		height: 40px;
		background: rgba(15, 30, 50, .06);
		border-radius: 999px;
	}

	.ies-nav__search input[type="search"]:focus {
		background: #fff;
		box-shadow: 0 0 0 2px var(--ies-primary);
	}

	.ies-nav__search button {
		flex: 0 0 40px;
		height: 40px;
		background: var(--ies-primary);
		border-radius: 50%;
		color: #fff;
	}

	.ies-nav:not(.has-search) .ies-nav__search {
		display: none;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.ies-nav.has-search .ies-nav__search {
		animation: ies-drop .22s ease;
	}
}

@keyframes ies-drop {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* ==========================================================
 * الإعلانات: مساحات محجوزة ثابتة حتى لا يتحرك التصميم
 * ========================================================== */

.ies-ad {
	--ies-ad-h: 100px;
	box-sizing: border-box;
	clear: both;
	max-width: 100%;
	margin: 1.6em auto;
	overflow: hidden;
	text-align: center;
}

.ies-ad--contain {
	max-width: 1200px;
	padding-inline: 16px;
}

.ies-ad__label {
	display: block;
	margin-bottom: 4px;
	color: var(--ies-muted);
	font-family: var(--ies-font);
	font-size: .72rem;
	line-height: 1.4;
}

.ies-ad__box {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: var(--ies-ad-h);
}

.ies-ad ins.adsbygoogle {
	display: block;
	width: 100%;
}

/* الارتفاع المحجوز لكل نوع (على الموبايل ثم الديسكتوب) */
.ies-ad--leader { --ies-ad-h: 100px; }
.ies-ad--rect   { --ies-ad-h: 280px; }
.ies-ad--tall   { --ies-ad-h: 280px; }
.ies-ad--feed   { --ies-ad-h: 250px; grid-column: 1 / -1; }
.ies-ad--sticky { --ies-ad-h: 52px; }

@media (min-width: 900px) {
	.ies-ad--leader { --ies-ad-h: 100px; }
	.ies-ad--tall   { --ies-ad-h: 600px; }
}

/* إعلان لم يمتلئ: يختفي بمساحته */
.ies-ad.is-empty {
	display: none;
}

/* معاينة المكان الفارغ */
.ies-ad.is-ph .ies-ad__box {
	background: repeating-linear-gradient(45deg, #f5f8fb, #f5f8fb 10px, #edf2f7 10px, #edf2f7 20px);
	border: 2px dashed #b8c6d3;
	border-radius: var(--ies-radius);
}

.ies-ad__ph {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px;
	color: #52606d;
	font-family: var(--ies-font);
	font-size: .85rem;
	line-height: 1.6;
}

.ies-ad__ph strong {
	color: #1f2933;
	font-size: .95rem;
}

.ies-ad__ph small {
	color: #7b8794;
	font-size: .75rem;
}

.ies-ad__ph .ies-ad__warn {
	color: #c2410c;
}

/* في الشبكات يمتد على الصف كله */
.ies-grid > .ies-ad,
.ies-more-target > .ies-ad {
	grid-column: 1 / -1;
	margin-block: .4em;
}

/* السايدبار: العمودي يتبع القارئ */
.ies-ad--side_sticky {
	position: sticky;
	inset-block-start: calc(var(--ies-nav-h) + 16px);
}

/* في الرئيسية: الإعلان داخل ies-wrap يأخذ عرض المحتوى */
.ies-home .ies-wrap > .ies-ad {
	margin-block: 22px 0;
}

/* الشريط الثابت أسفل الشاشة (موبايل فقط) */
.ies-ad--sticky {
	position: fixed;
	z-index: 9998;
	inset-inline: 0;
	inset-block-end: 0;
	display: none;
	margin: 0;
	padding: 4px 8px 6px;
	overflow: visible;
	background: rgba(255, 255, 255, .96);
	border-top: 1px solid var(--ies-border);
	box-shadow: 0 -6px 20px rgba(15, 30, 50, .08);
}

.ies-ad--sticky.is-closed {
	display: none !important;
}

.ies-ad__close {
	position: absolute;
	inset-block-start: -26px;
	inset-inline-end: 8px;
	width: 28px;
	height: 26px;
	padding: 0;
	background: rgba(255, 255, 255, .96);
	border: 1px solid var(--ies-border);
	border-bottom: 0;
	border-radius: 8px 8px 0 0;
	color: var(--ies-muted);
	font-size: 18px;
	line-height: 24px;
	cursor: pointer;
}

@media (max-width: 767.98px) {
	.ies-ad--sticky {
		display: block;
	}

	body.ies-has-sticky-ad {
		padding-bottom: 76px;
	}

	body.ies-has-sticky-ad .ies-top {
		inset-block-end: 92px;
	}
}

/* ==========================================================
 * 1.3.0: البحث فوق الأقسام (ديسكتوب) + قائمة "المزيد"
 * ========================================================== */

@media (min-width: 900px) {
	:root {
		--ies-nav-row1: 54px;
		--ies-nav-row2: 42px;
		--ies-nav-h: calc(var(--ies-nav-row1) + var(--ies-nav-row2));
	}

	/* صف أول: الشعار + البحث. صف ثاني: الأقسام. */
	.ies-nav__bar {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-rows: var(--ies-nav-row1) var(--ies-nav-row2);
		gap: 0 16px;
		align-items: center;
	}

	.ies-nav__brand {
		grid-column: 1;
		grid-row: 1;
	}

	.ies-nav__brand img {
		max-height: calc(var(--ies-nav-row1) - 12px);
	}

	.ies-nav__search {
		grid-column: 2;
		grid-row: 1;
		justify-self: end;
	}

	.ies-nav__panel {
		display: flex;
		grid-column: 1 / -1;
		grid-row: 2;
		align-items: center;
		align-self: stretch;
		border-top: 1px solid rgba(15, 30, 50, .07);
	}

	.ies-nav__menu a {
		padding: 6px 12px;
	}
}

/* سهم صغير بجانب "المزيد" */
.ies-nav__menu .ies-more-link::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-inline-start: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}

.ies-nav__menu .ies-more-item > .sub-menu {
	inset-inline-start: auto;
	inset-inline-end: 0;
	max-height: 70vh;
	overflow-y: auto;
}

.ies-nav__menu .ies-more-item .sub-menu a {
	white-space: normal;
}

.ies-nav__menu li.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (max-width: 899.98px) {
	/* على الموبايل: الأقسام الزيادة مخفية تماماً (بدون مساحة فاضية) لحد ما تضغط "المزيد" */
	.ies-nav__menu .ies-more-item > .sub-menu {
		display: none;
		position: static;
		max-height: none;
		padding: 0;
		padding-inline-start: 12px;
		background: transparent;
		border: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.ies-nav__menu .ies-more-item.is-open > .sub-menu {
		display: block;
	}
}

/* ==========================================================
 * 1.4.1: وضوح الناف على الموبايل (خط أغمق وأعرض + خلفية أقل شفافية)
 * ========================================================== */

@media (max-width: 899.98px) {
	.ies-nav {
		background: rgba(255, 255, 255, .96);
		background: rgba(255, 255, 255, max(var(--ies-nav-a), .96));
	}

	.ies-nav__name {
		color: var(--ies-primary);
		color: color-mix(in srgb, var(--ies-primary) 78%, #000);
		font-size: 1.45rem;
		font-weight: 700;
	}

	.ies-nav__menu a {
		color: #111827;
		font-size: 1.05rem;
		font-weight: 700;
	}

	.ies-nav__search input[type="search"] {
		color: #111827;
		font-size: 1rem;
	}
}

/* ==========================================================
 * 1.5.0: الفوتر الموسوعي (خلفية فاتحة وخط داكن لوضوح أعلى)
 * ========================================================== */

.ies-footer {
	margin-top: 48px;
	background: #f3f5f8;
	border-top: 1px solid rgba(15, 30, 50, .1);
	color: #1f2933;
	font-family: var(--ies-font);
}

.ies-footer__in {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px 0;
}

.ies-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr 1.4fr 1fr;
	gap: 32px;
}

.ies-footer__name {
	color: var(--ies-primary);
	font-size: 1.45rem;
	font-weight: 700;
	text-decoration: none;
}

.ies-footer .custom-logo {
	width: auto;
	max-height: 48px;
}

.ies-footer__about p {
	margin: 12px 0 0;
	color: #374151;
	font-size: 1rem;
	line-height: 1.9;
}

.ies-footer__title {
	display: inline-block;
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--ies-primary);
	color: #0f172a;
	font-size: 1.1rem;
	font-weight: 700;
}

.ies-footer__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ies-footer__list--cols {
	column-gap: 24px;
	columns: 2;
}

.ies-footer__list li {
	margin: 0 0 9px;
	break-inside: avoid;
}

.ies-footer__list a {
	color: #1f2933;
	font-weight: 500;
	text-decoration: none;
}

.ies-footer__list a:hover,
.ies-footer__list a:focus-visible {
	color: var(--ies-primary);
	text-decoration: underline;
}

.ies-footer__bar {
	margin-top: 32px;
	padding: 16px 0 22px;
	border-top: 1px solid rgba(15, 30, 50, .12);
	color: #4b5563;
	font-size: .92rem;
	text-align: center;
}

.ies-footer__bar p {
	margin: 0;
}

@media (max-width: 767.98px) {
	.ies-footer__in {
		padding-top: 28px;
	}

	.ies-footer__grid {
		grid-template-columns: 1fr;
		gap: 26px;
	}

	.ies-footer__list a {
		font-size: 1.05rem;
		font-weight: 700;
	}
}

/* ==========================================================
 * 1.6.1: تثبيت الناف على سفاري/آيفون
 * ========================================================== */

/* خصائص فيزيائية احتياطية لمتصفحات سفاري الأقدم (لا تدعم inset المنطقي) */
.ies-nav {
	top: 0;
	right: 0;
	left: 0;
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
}

body.admin-bar .ies-nav {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .ies-nav {
		top: 46px;
	}
}

/* شريط الإدارة ثابت فقط من 601px؛ تحت ذلك يختفي مع النزول فلا يُترك فراغ فوق الناف */
@media (max-width: 600px) {
	body.admin-bar .ies-nav {
		inset-block-start: 0;
		top: 0;
	}
}

@media (max-width: 899.98px) {
	/* 16px على الأقل في حقول البحث، وإلا يكبّر آيفون الصفحة عند الضغط على الحقل ويزيح الناف */
	.ies-nav__search input[type="search"],
	.ies-search input {
		font-size: 16px;
	}

	/* ارتفاع نافذة آيفون المتغيّر مع شريط العنوان */
	.ies-nav__panel {
		max-height: calc(100vh - var(--ies-nav-h) - 80px);
		max-height: calc(100dvh - var(--ies-nav-h) - 80px);
	}
}
