/* ==========================================================================
   Algallaf — design system & layout
   RTL-first: logical properties everywhere (inline-start = right in Arabic).
   Sections: 1 Tokens · 2 Base · 3 Layout · 4 Components · 5 Header/Footer
             6 Home · 7 Archives · 8 Single/Reading · 9 Forms · 10 Utilities
   ========================================================================== */

/* 1. TOKENS ----------------------------------------------------------------- */
:root {
	/* Colour */
	--c-navy: #0f1b2d;
	--c-navy-2: #1a2a42;
	--c-navy-3: #2a3c58;
	--c-green: #0e4d3a;
	--c-green-2: #136049;
	--c-green-soft: #e6efe9;
	--c-gold: #8a6a2f;
	--c-gold-2: #b08d4a;
	--c-gold-soft: #f4ecdb;
	--c-ivory: #faf7f0;
	--c-surface: #ffffff;
	--c-surface-2: #f3eee3;
	--c-line: #e4dccb;
	--c-line-2: #d5cab4;
	--c-text: #1c2330;
	--c-muted: #5b6474;
	--c-danger: #a3262a;
	--c-success: #0e6b45;
	--c-focus: #c9971f;

	/* Typography */
	--f-ui: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
	--f-read: "Noto Naskh Arabic", "Traditional Arabic", "Times New Roman", serif;
	--f-display: "Aref Ruqaa", "Noto Naskh Arabic", serif;

	--fs-xs: .8125rem;
	--fs-sm: .9063rem;
	--fs-base: 1.0313rem;
	--fs-md: 1.1875rem;
	--fs-lg: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
	--fs-xl: clamp(1.5rem, 1.25rem + 1vw, 2rem);
	--fs-2xl: clamp(1.85rem, 1.4rem + 1.8vw, 2.75rem);
	--fs-hero: clamp(2.6rem, 1.6rem + 4.4vw, 5rem);

	--lh-tight: 1.35;
	--lh-ui: 1.7;
	--lh-read: 2.05;

	/* Space (4px base) */
	--s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
	--s-6: 2rem; --s-7: 2.5rem; --s-8: 3.5rem; --s-9: 5rem;

	/* Shape & depth */
	--r-sm: 6px;
	--r-md: 10px;
	--r-lg: 16px;
	--shadow-1: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 1px rgba(15, 27, 45, .04);
	--shadow-2: 0 8px 24px -12px rgba(15, 27, 45, .22), 0 2px 6px rgba(15, 27, 45, .05);

	/* Layout */
	--container: 1200px;
	--measure: 70ch;
	--gutter: clamp(1rem, .6rem + 2vw, 2rem);
	--header-h: 72px;

	--ease: cubic-bezier(.2, .7, .2, 1);
	--pattern: url("../img/pattern.svg");
}

/* 2. BASE ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--c-ivory);
	color: var(--c-text);
	font-family: var(--f-ui);
	font-size: var(--fs-base);
	line-height: var(--lh-ui);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}
html.nav-open { overflow: hidden; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3, h4 { margin: 0 0 var(--s-3); line-height: var(--lh-tight); font-weight: 700; color: var(--c-navy); }
p { margin: 0 0 var(--s-4); }
a { color: var(--c-green); text-decoration-thickness: 1px; text-underline-offset: .25em; }
a:hover { color: var(--c-green-2); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--c-gold-soft); color: var(--c-navy); }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
	position: absolute; inset-inline-start: var(--s-4); top: -60px; z-index: 100;
	background: var(--c-navy); color: #fff; padding: var(--s-2) var(--s-4); border-radius: var(--r-sm);
	transition: top .2s;
}
.skip-link:focus { top: var(--s-3); color: #fff; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 3. LAYOUT ----------------------------------------------------------------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow-head { max-width: calc(980px + var(--gutter) * 2); }
.site-main { display: block; min-height: 50vh; }
.site-main:focus { outline: none; }
.section { padding-block: var(--s-8); }
.section--tight { padding-block: var(--s-6) var(--s-8); }
.section--tint { background: var(--c-surface-2); border-block: 1px solid var(--c-line); }

.layout-aside { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
	.layout-aside { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
	.layout-aside__side { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
}
.layout-aside__main > * + * { margin-top: var(--s-6); }

/* 4. COMPONENTS ------------------------------------------------------------- */

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
	min-height: 44px; padding: .55rem 1.2rem; border-radius: var(--r-sm);
	border: 1.5px solid transparent; font-weight: 600; font-size: var(--fs-sm);
	text-decoration: none; cursor: pointer; line-height: 1.3;
	transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-green); color: #fff; }
.btn-primary:hover { background: var(--c-green-2); color: #fff; }
.btn-outline { border-color: var(--c-navy); color: var(--c-navy); background: transparent; }
.btn-outline:hover { background: var(--c-navy); color: #fff; }
.btn-ghost { color: var(--c-navy); background: transparent; border-color: var(--c-line-2); }
.btn-ghost:hover { border-color: var(--c-navy); color: var(--c-navy); background: var(--c-surface); }
.btn-gold { background: var(--c-gold-2); color: var(--c-navy); }
.btn-gold:hover { background: #c39d57; color: var(--c-navy); }
.btn-outline-light { border-color: rgba(255,255,255,.45); color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--c-navy); }
.btn-lg { min-height: 50px; padding: .7rem 1.6rem; font-size: var(--fs-base); }
.btn-sm { min-height: 38px; padding: .35rem .85rem; font-size: var(--fs-xs); }
.btn-block { width: 100%; }
.icon-btn {
	display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid transparent; background: transparent; color: var(--c-navy); cursor: pointer;
}
.icon-btn:hover { background: var(--c-surface-2); }
.icon-btn .icon { width: 22px; height: 22px; }

/* Eyebrow, section heads */
.eyebrow {
	display: inline-flex; align-items: center; gap: var(--s-2);
	font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0; color: var(--c-gold); margin-bottom: var(--s-2);
}
.eyebrow a { color: inherit; text-decoration: none; display: inline-flex; gap: var(--s-2); align-items: center; }
.eyebrow a:hover { color: var(--c-green); }
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: var(--c-gold-2); }
.eyebrow a::before, .hero__eyebrow::before { content: none; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.section-title { font-size: var(--fs-xl); margin: 0; }
.section-title--sm { font-size: var(--fs-lg); margin: var(--s-7) 0 var(--s-5); }
.section-link { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; white-space: nowrap; }
.section-link .icon { transition: transform .2s var(--ease); }
.section-link:hover .icon { transform: translateX(-4px); }
.block-title { font-size: var(--fs-lg); padding-bottom: var(--s-3); border-bottom: 1px solid var(--c-line); margin-bottom: var(--s-5); }

/* Meta list */
.meta { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); color: var(--c-muted); font-size: var(--fs-sm); }
.meta li { display: inline-flex; align-items: center; gap: .35rem; }
.meta .icon { color: var(--c-gold); width: 1em; height: 1em; }
.meta-table { margin: 0; display: grid; gap: 0; }
.meta-table > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px dashed var(--c-line); }
.meta-table > div:last-child { border-bottom: 0; }
.meta-table dt { color: var(--c-muted); font-size: var(--fs-sm); }
.meta-table dd { margin: 0; font-weight: 600; color: var(--c-navy); font-size: var(--fs-sm); }

/* Badges & chips */
.badges { display: inline-flex; flex-wrap: wrap; gap: var(--s-2); }
.badge {
	display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px;
	font-size: .75rem; font-weight: 600; background: var(--c-surface-2); color: var(--c-navy-2); border: 1px solid var(--c-line);
}
.badge .icon { width: .95em; height: .95em; }
.badge-pdf { background: #fbeceb; color: #8b2427; border-color: #f1d3d2; }
.badge-video { background: var(--c-green-soft); color: var(--c-green); border-color: #cfe0d6; }
.badge-audio { background: var(--c-gold-soft); color: #6d5222; border-color: #eadcbc; }
.badge-muted { background: #eee; color: var(--c-muted); }
.chips, .filter-chips ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
	display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .3rem .85rem;
	border-radius: 999px; border: 1px solid var(--c-line-2); background: var(--c-surface);
	color: var(--c-navy-2); font-size: var(--fs-sm); text-decoration: none;
}
.chip:hover { border-color: var(--c-green); color: var(--c-green); }
.chip.is-active { background: var(--c-navy); border-color: var(--c-navy); color: #fff; }
.chip-tag { background: transparent; }
.chip__count { font-size: .75em; opacity: .7; }
.filter-chips { margin-bottom: var(--s-5); }

/* Cards */
.card {
	position: relative; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md);
	transition: box-shadow .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.card:hover { box-shadow: var(--shadow-2); border-color: var(--c-line-2); transform: translateY(-3px); }
.card__body { padding: var(--s-5); min-width: 0; }
.card__eyebrow { font-size: var(--fs-xs); font-weight: 600; color: var(--c-gold); margin-bottom: var(--s-2); display: flex; gap: .35rem; align-items: center; }
.card__title { font-size: var(--fs-md); line-height: 1.55; margin-bottom: var(--s-3); }
.card__title a { color: var(--c-navy); text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 100% 100%; transition: background-size .3s var(--ease); }
.card__title a:hover { color: var(--c-green); background-size: 100% 1px; }
/* Whole card clickable via the title link, while keeping inner links usable. */
.card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card .badges, .card-row__actions, .card__more { position: relative; z-index: 1; }
.card__title--serif { font-family: var(--f-read); font-size: 1.25rem; line-height: 1.7; }
.card__excerpt { color: var(--c-muted); font-size: var(--fs-sm); margin-bottom: var(--s-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__more { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: var(--fs-sm); text-decoration: none; }

.card-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card-grid--work { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.card-list { display: grid; gap: var(--s-4); }

/* Row card (research, conferences, announcements) */
.card-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.card-row .card__body { padding-inline-start: 0; }
.card-row__icon {
	display: grid; place-items: center; width: 52px; height: 52px; margin: var(--s-5); margin-inline-end: var(--s-4);
	border-radius: var(--r-sm); background: var(--c-green-soft); color: var(--c-green);
}
.card-row__icon .icon { width: 26px; height: 26px; }
.card-row__actions { grid-column: 2; display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-5) var(--s-5) var(--s-5); padding-inline-start: 0; margin-top: calc(var(--s-3) * -1); flex-wrap: wrap; }
@media (min-width: 820px) {
	.card-row { grid-template-columns: auto minmax(0, 1fr) auto; }
	.card-row__actions { grid-column: 3; flex-direction: column; align-items: flex-end; justify-content: center; align-self: center; padding: var(--s-5); margin: 0; }
}
.card-research .card__excerpt { -webkit-line-clamp: 2; }

/* Media card */
.card-media { display: flex; flex-direction: column; overflow: hidden; }
.card-media__thumb { position: relative; display: block; text-decoration: none; aspect-ratio: 16 / 9; background: var(--c-navy); overflow: hidden; }
.card-media__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card-media__thumb img { transform: scale(1.03); }
.card-media__thumb.is-placeholder, .card-work__cover.is-placeholder {
	display: grid; place-items: center; color: rgba(255,255,255,.85);
	background: var(--c-navy) var(--pattern) center / 64px; background-blend-mode: soft-light;
}
.card-media__thumb.is-placeholder::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(14,77,58,.85), rgba(15,27,45,.92)); }
.placeholder-icon { position: relative; width: 44px; height: 44px; opacity: .8; }
.placeholder-title { position: relative; font-family: var(--f-read); font-weight: 700; font-size: 1.2rem; padding: var(--s-5); text-align: center; line-height: 1.7; color: #fff; }
.play-badge {
	position: absolute; inset-inline-end: var(--s-3); bottom: var(--s-3); z-index: 1;
	display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	background: rgba(255,255,255,.95); color: var(--c-green); box-shadow: var(--shadow-1);
}
.play-badge .icon { width: 20px; height: 20px; margin-inline-start: -2px; }
.card-media .card__body { flex: 1; }

/* Article card */
.card-article { display: flex; flex-direction: column; overflow: hidden; }
.card-article .card-media__thumb { aspect-ratio: 16 / 8; }

/* Sermon card */
.card-sermon { border-top: 3px solid var(--c-green); }

/* Work card */
.card-work { display: flex; flex-direction: column; overflow: hidden; }
.card-work__cover { position: relative; display: block; text-decoration: none; aspect-ratio: 3 / 4; background: var(--c-surface-2); overflow: hidden; }
.card-work__cover img { width: 100%; height: 100%; object-fit: cover; }
.card-work__cover.is-placeholder { background-color: var(--c-green); align-content: center; padding: var(--s-5); }
.book-spine { position: absolute; inset-block: 0; inset-inline-end: 0; width: 12px; background: rgba(0,0,0,.18); }
.book-title { position: relative; font-family: var(--f-read); font-weight: 700; font-size: 1.1rem; line-height: 1.8; text-align: center; color: #fff; border-block: 1px solid rgba(255,255,255,.35); padding-block: var(--s-4); }
.card-work .card__title { font-size: var(--fs-base); }

/* Announcement */
.date-block {
	display: grid; place-items: center; align-content: center; width: 72px; min-height: 76px; margin: var(--s-5); margin-inline-end: var(--s-4);
	background: var(--c-navy); color: #fff; border-radius: var(--r-sm); text-align: center; line-height: 1.1;
}
.date-block__day { font-size: 1.6rem; font-weight: 700; }
.date-block__month { font-size: .75rem; opacity: .85; margin-top: 4px; }
.card-announcement.is-expired { opacity: .75; }
.card-announcement.is-expired .date-block { background: var(--c-muted); }

/* Question */
.card-question { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.card-question .card__body { padding-inline-start: 0; }
.qa-mark {
	display: grid; place-items: center; width: 44px; height: 44px; margin: var(--s-5); margin-inline-end: var(--s-4);
	border-radius: 50%; background: var(--c-gold-soft); color: var(--c-gold); font-family: var(--f-read); font-weight: 700; font-size: 1.3rem;
}
.qa-mark--answer { background: var(--c-green-soft); color: var(--c-green); }

/* Generic card */
.card-generic { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.card-generic .card__body { padding-inline-start: 0; }
.card-generic__icon { display: grid; place-items: center; width: 44px; height: 44px; margin: var(--s-5); margin-inline-end: var(--s-4); border-radius: var(--r-sm); background: var(--c-surface-2); color: var(--c-navy-2); }

/* Panel */
.panel { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-5); }
.panel__title { font-size: var(--fs-md); margin-bottom: var(--s-3); padding-bottom: var(--s-3); border-bottom: 2px solid var(--c-gold-soft); }
.panel__actions { display: grid; gap: var(--s-2); margin-top: var(--s-5); }
.panel__cover { margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-5); border-radius: var(--r-md) var(--r-md) 0 0; overflow: hidden; }

/* Alerts */
.alert { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4) var(--s-5); border-radius: var(--r-sm); border: 1px solid; margin-bottom: var(--s-5); }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert ul { margin: var(--s-2) 0 0; padding-inline-start: 1.2rem; }
.alert .icon { width: 22px; height: 22px; margin-top: 3px; }
.alert-success { background: #e8f4ee; border-color: #b9dcc8; color: #0b4d33; }
.alert-error { display: block; background: #fbeeee; border-color: #efc7c7; color: #7d1d20; }
.alert-error a { color: inherit; font-weight: 600; }
.alert-warning { background: #fff7e6; border-color: #f0dca8; color: #6b4e12; }
.alert-info { background: #eef3f8; border-color: #cfdcea; color: var(--c-navy-2); }

/* Empty state */
.empty-state { text-align: center; padding: var(--s-8) var(--s-5); border: 1px dashed var(--c-line-2); border-radius: var(--r-md); color: var(--c-muted); background: var(--c-surface); }
.empty-icon { width: 42px; height: 42px; color: var(--c-gold-2); margin-bottom: var(--s-3); }
.empty-state p { margin: 0; }

/* Breadcrumbs */
.breadcrumbs { font-size: var(--fs-xs); color: var(--c-muted); margin-bottom: var(--s-4); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-inline-start: .35rem; color: var(--c-line-2); }
.breadcrumbs a { color: var(--c-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--c-green); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--c-navy-2); }
.breadcrumbs .separator { margin-inline: .35rem; color: var(--c-line-2); }
.breadcrumbs .last { display: inline-block; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* Pagination */
.pagination { margin-top: var(--s-7); }
.pagination ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
.pagination .page-numbers {
	display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding-inline: var(--s-3); border-radius: var(--r-sm);
	border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-navy); text-decoration: none; font-weight: 600;
}
.pagination .page-numbers:hover { border-color: var(--c-navy); }
.pagination .current { background: var(--c-navy); border-color: var(--c-navy); color: #fff; }
.pagination .dots { border: 0; background: none; }
.results-count { color: var(--c-muted); font-size: var(--fs-sm); margin-bottom: var(--s-4); }

/* Document viewer */
.doc-viewer { border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); overflow: hidden; }
.doc-viewer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); background: var(--c-surface-2); border-bottom: 1px solid var(--c-line); }
.doc-viewer__title { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; color: var(--c-navy); }
.doc-viewer__title .icon { color: var(--c-gold); }
.doc-viewer__actions { display: inline-flex; flex-wrap: wrap; gap: var(--s-2); }
.doc-viewer__frame { position: relative; height: min(82vh, 980px); min-height: 460px; background: #525659; }
.doc-viewer__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.doc-viewer__fallback { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin: 0; padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); color: var(--c-muted); border-top: 1px solid var(--c-line); }
.doc-viewer__fallback .icon { color: var(--c-gold); }
.doc-viewer__fallback .btn { margin-inline-start: auto; }
@media (max-width: 700px) {
	.doc-viewer__frame { height: 72vh; min-height: 380px; }
	/* Mobile browsers don't render native PDFs inside iframes: show the button instead. */
	.doc-viewer--native .doc-viewer__frame { display: none; }
	.doc-viewer--native .doc-viewer__fallback { padding: var(--s-6) var(--s-4); justify-content: center; text-align: center; flex-direction: column; }
	.doc-viewer--native .doc-viewer__fallback .btn { margin-inline-start: 0; }
}

/* Players */
.media-stack { display: grid; gap: var(--s-5); margin-bottom: var(--s-6); }
.media-stack:empty { display: none; }
.player { margin: 0; }
.ratio, .yt-facade { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: #000; }
.ratio iframe, .ratio video, .yt-facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; }
.yt-facade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,27,45,.45), transparent 55%); pointer-events: none; }
.yt-facade.is-playing::after { content: none; }
.yt-play {
	position: absolute; inset: 0; margin: auto; z-index: 1; width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(255,255,255,.95); color: var(--c-green); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.3);
	transition: transform .2s var(--ease);
}
.yt-play:hover { transform: scale(1.06); }
.yt-play .icon { width: 30px; height: 30px; margin-inline-start: -3px; }
.player-audio { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); }
.player-audio figcaption { display: flex; align-items: center; gap: var(--s-2); font-weight: 700; color: var(--c-navy); margin-bottom: var(--s-3); }
.player-audio figcaption .icon { color: var(--c-gold); }
.player-audio audio { width: 100%; height: 48px; }
.audio-drive { height: 110px; border-radius: var(--r-sm); overflow: hidden; background: #1f1f1f; }
.audio-drive iframe { width: 100%; height: 100%; border: 0; }
.player-links { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-3); font-size: var(--fs-sm); }
.player-links a { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; font-weight: 600; }

/* Share */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.share__label { font-weight: 600; color: var(--c-muted); font-size: var(--fs-sm); margin-inline-end: var(--s-2); }
.share__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 44px; height: 44px; padding-inline: var(--s-3);
	border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-navy-2); text-decoration: none;
	cursor: pointer; font-size: var(--fs-sm);
}
.share__btn:hover { border-color: var(--c-green); color: var(--c-green); }
.share__btn .icon { width: 19px; height: 19px; }
.share__copy.is-done { border-color: var(--c-success); color: var(--c-success); }

/* TOC */
.toc { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-4) var(--s-5); font-size: var(--fs-sm); }
.toc__title { font-weight: 700; color: var(--c-navy); margin-bottom: var(--s-2); }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { margin: 0; }
.toc a { display: block; padding: .4rem .6rem; border-inline-start: 2px solid var(--c-line); color: var(--c-muted); text-decoration: none; line-height: 1.6; }
.toc a:hover { color: var(--c-green); }
.toc a[aria-current] { color: var(--c-green); border-color: var(--c-green); font-weight: 600; background: var(--c-green-soft); }
.toc .toc-l3 a { padding-inline-start: 1.4rem; font-size: .92em; }

/* 5. HEADER & FOOTER -------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 247, 240, .96); border-bottom: 1px solid var(--c-line); transition: box-shadow .2s; }
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(250, 247, 240, .88); backdrop-filter: saturate(1.4) blur(10px); } }
.site-header.is-scrolled { box-shadow: 0 6px 20px -14px rgba(15,27,45,.35); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.site-header__inner { display: flex; align-items: center; gap: var(--s-5); min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--c-navy); flex: none; }
.brand:hover { color: var(--c-navy); }
.brand__mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--c-gold-2); }
.brand__mark .icon { width: 34px; height: 34px; }
.brand__name { font-family: var(--f-display); font-weight: 700; font-size: 1.65rem; line-height: 1; padding-top: .2em; }
.brand__logo { height: 46px; width: auto; }
.brand__seal { width: 48px; height: 48px; object-fit: contain; }
@media (max-width: 480px) { .brand__logo { height: 38px; } .brand__seal { width: 40px; height: 40px; } }

.primary-nav { margin-inline-start: auto; }
.primary-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.primary-nav .menu > li { position: relative; display: flex; align-items: center; }
.primary-nav .menu > li > a {
	display: block; padding: .55rem .7rem; border-radius: var(--r-sm); color: var(--c-navy-2); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); white-space: nowrap;
}
.primary-nav .menu > li > a:hover, .primary-nav .menu > li.is-open > a { color: var(--c-green); background: rgba(14,77,58,.06); }
.primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a, .primary-nav a[aria-current] { color: var(--c-green) !important; font-weight: 600; box-shadow: inset 0 -2px 0 var(--c-gold-2); border-radius: 0; }
.sub-toggle { display: inline-grid; place-items: center; width: 26px; height: 32px; margin-inline-start: -6px; padding: 0; border: 0; background: none; color: var(--c-muted); cursor: pointer; border-radius: var(--r-sm); }
.sub-toggle .icon { width: 15px; height: 15px; transition: transform .2s; }
.sub-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.primary-nav .sub-menu {
	position: absolute; top: 100%; inset-inline-start: 0; min-width: 240px; margin: 0; padding: var(--s-2); list-style: none;
	background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--shadow-2);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s;
}
.primary-nav li.is-open > .sub-menu, .primary-nav li:hover > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu a { display: block; padding: .6rem .8rem; border-radius: var(--r-sm); color: var(--c-navy-2); text-decoration: none; font-size: var(--fs-sm); }
.primary-nav .sub-menu a:hover { background: var(--c-surface-2); color: var(--c-green); }
.header-tools { display: flex; align-items: center; gap: var(--s-1); }
.nav-toggle { display: none; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

.header-search { border-top: 1px solid var(--c-line); padding-block: var(--s-4); background: var(--c-ivory); }
.header-search .search-form { max-width: 720px; margin-inline: auto; }

.mobile-nav { border-top: 1px solid var(--c-line); background: var(--c-ivory); max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain; }
.mobile-menu { list-style: none; margin: 0; padding: var(--s-3) var(--gutter) var(--s-6); }
.mobile-menu li { position: relative; border-bottom: 1px solid var(--c-line); display: flex; flex-wrap: wrap; align-items: center; }
.mobile-menu li:last-child { border-bottom: 0; }
.mobile-menu a { flex: 1; display: block; padding: .95rem .25rem; color: var(--c-navy); text-decoration: none; font-weight: 600; font-size: var(--fs-base); }
.mobile-menu .sub-toggle { width: 48px; height: 48px; margin: 0; }
.mobile-menu .sub-menu { display: none; flex-basis: 100%; list-style: none; margin: 0 0 var(--s-3); padding: 0 var(--s-4) 0 0; border-inline-start: 2px solid var(--c-gold-soft); }
.mobile-menu li.is-open > .sub-menu { display: block; }
.mobile-menu .sub-menu li { border: 0; }
.mobile-menu .sub-menu a { font-weight: 500; padding: .7rem .5rem; color: var(--c-navy-2); }

@media (max-width: 1100px) {
	.primary-nav { display: none; }
	.nav-toggle { display: inline-grid; }
	.header-tools { margin-inline-start: auto; }
}
@media (min-width: 1101px) { .mobile-nav { display: none !important; } }

/* Footer */
.site-footer { position: relative; margin-top: 0; background: var(--c-navy); color: rgba(255,255,255,.78); font-size: var(--fs-sm); }
.footer-ornament { height: 6px; background: linear-gradient(90deg, var(--c-green), var(--c-gold-2), var(--c-green)); opacity: .9; }
.site-footer__grid { display: grid; gap: var(--s-7); padding-block: var(--s-8) var(--s-7); grid-template-columns: 1fr; }
@media (min-width: 820px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer a { color: #fff; }
.footer-brand { font-family: var(--f-display); font-size: 2rem; color: #fff; font-weight: 700; margin-bottom: var(--s-3); }
.footer-logo { width: 220px; height: auto; filter: brightness(0) invert(1); opacity: .92; }
.footer-title { color: #fff; font-size: var(--fs-base); margin-bottom: var(--s-4); }
.footer-menu { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--s-5); }
.footer-menu li { break-inside: avoid; margin-bottom: var(--s-2); }
.footer-menu a { color: rgba(255,255,255,.8); text-decoration: none; }
.footer-menu a:hover { color: #fff; text-decoration: underline; }
.footer-mail { display: inline-flex; gap: var(--s-2); align-items: center; text-decoration: none; }
.social { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-4) 0 0; padding: 0; }
.social a { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); color: #fff; }
.social a:hover { background: var(--c-gold-2); border-color: var(--c-gold-2); color: var(--c-navy); }
.social .icon { width: 19px; height: 19px; }
.social--dark a { border-color: var(--c-line-2); color: var(--c-navy-2); }
.social--dark a:hover { color: var(--c-navy); }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-block: var(--s-5); font-size: var(--fs-xs); }
.site-footer__bottom p { margin: 0 0 var(--s-2); }
.site-footer__bottom .reuse { color: rgba(255,255,255,.65); max-width: 90ch; }

/* 6. HOME ------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 80% -10%, #fffdf8 0%, transparent 60%), var(--c-ivory); border-bottom: 1px solid var(--c-line); }
.hero__pattern, .page-head__pattern, .newsletter__pattern {
	position: absolute; inset: 0; background-image: var(--pattern); background-size: 96px; opacity: .07; pointer-events: none;
	mask-image: linear-gradient(to left, #000 0%, transparent 70%); -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 70%);
}
.hero__inner { position: relative; display: grid; gap: var(--s-6); align-items: center; padding-block: var(--s-8) var(--s-9); grid-template-columns: 1fr; }
@media (min-width: 900px) { .hero__inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); padding-block: var(--s-9); } }
.hero__eyebrow { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); font-weight: 600; color: var(--c-gold); margin-bottom: var(--s-4); }
.hero__eyebrow .icon { width: 20px; height: 20px; }
.hero__name { font-family: var(--f-display); font-size: var(--fs-hero); font-weight: 700; color: var(--c-navy); line-height: 1.25; margin-bottom: var(--s-4); letter-spacing: 0; }
.hero__logo { width: min(100%, 560px); height: auto; margin-block: var(--s-2) var(--s-3); }
.hero__role { font-size: var(--fs-md); font-weight: 600; color: var(--c-green); max-width: 46ch; padding-inline-start: var(--s-4); border-inline-start: 3px solid var(--c-gold-2); line-height: 1.8; }
.hero__intro { font-size: var(--fs-base); color: var(--c-muted); max-width: 58ch; line-height: 1.95; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero__portrait { justify-self: center; width: min(78vw, 380px); }
@media (min-width: 900px) { .hero__portrait { justify-self: end; } }

/* Arch frame (mihrab silhouette) */
.arch {
	position: relative; aspect-ratio: 4 / 5; border-radius: 999px 999px var(--r-md) var(--r-md); overflow: hidden;
	background: radial-gradient(120% 80% at 50% 0%, var(--c-green-2) 0%, var(--c-navy) 75%);
	box-shadow: 0 30px 60px -30px rgba(15,27,45,.55), inset 0 0 0 1px rgba(255,255,255,.08);
}
.arch::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); background-size: 80px; opacity: .12; filter: brightness(2.2); }
.arch::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(176,141,74,.55); border-radius: inherit; pointer-events: none; }
.arch img { position: absolute; inset-inline: 0; bottom: 0; width: 100%; height: 94%; object-fit: cover; object-position: top center; }
.arch--sm { aspect-ratio: 4 / 5; }

/* Quick access */
.quick { position: relative; z-index: 2; margin-top: calc(var(--s-8) * -1); }
.quick__list {
	list-style: none; margin: 0; padding: var(--s-3); display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-2);
	background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
}
.quick__item { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-2); border-radius: var(--r-md); text-decoration: none; color: var(--c-navy); text-align: center; transition: background-color .2s; }
.quick__item:hover { background: var(--c-ivory); color: var(--c-green); }
.quick__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--c-gold-2); color: var(--c-green); transition: background-color .2s, color .2s, transform .2s var(--ease); }
.quick__item:hover .quick__icon { transform: scale(1.08); }
.quick__icon .icon { width: 26px; height: 26px; stroke-width: 1.3; }
.quick__item:hover .quick__icon { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.quick__label { font-weight: 600; font-size: var(--fs-sm); }
@media (max-width: 560px) {
	.quick__list { grid-template-columns: repeat(3, 1fr); }
	.quick__icon { width: 48px; height: 48px; }
	.quick__label { font-size: var(--fs-xs); }
}

/* Intro */
.intro__grid { display: grid; gap: var(--s-7); align-items: center; }
@media (min-width: 900px) { .intro__grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.prose-sm { font-family: var(--f-read); font-size: 1.125rem; line-height: 2.05; color: var(--c-text); }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.stats a { display: block; padding: var(--s-5); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); text-decoration: none; color: var(--c-muted); transition: border-color .2s; }
.stats a:hover { border-color: var(--c-gold-2); }
.stats strong { display: block; font-size: 2.2rem; color: var(--c-navy); line-height: 1.1; margin-bottom: var(--s-1); }

/* Newsletter */
.newsletter { position: relative; background: var(--c-green); color: #fff; overflow: hidden; }
.newsletter__pattern { opacity: .1; filter: brightness(3); mask-image: none; -webkit-mask-image: none; }
.newsletter__inner { position: relative; display: grid; gap: var(--s-5); align-items: center; padding-block: var(--s-8); }
@media (min-width: 900px) { .newsletter__inner { grid-template-columns: 1fr 1fr; } }
.newsletter h2 { color: #fff; font-size: var(--fs-xl); }
.newsletter p { color: rgba(255,255,255,.85); margin: 0; }
.newsletter__form { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.newsletter__form input[type=email] { flex: 1 1 240px; min-height: 50px; border-radius: var(--r-sm); border: 0; padding-inline: var(--s-4); font: inherit; background: #fff; color: var(--c-text); }
.newsletter__form .btn { min-height: 50px; padding-inline: var(--s-6); }
.form-note { flex-basis: 100%; margin: var(--s-2) 0 0; font-weight: 600; }
.form-note--success { color: #d9f2e3; }
.form-note--error { color: #ffd9d9; }
.form-note--info { color: #fff; }

/* 7. ARCHIVES / PAGE HEAD --------------------------------------------------- */
.page-head { position: relative; overflow: hidden; background: var(--c-surface-2); border-bottom: 1px solid var(--c-line); padding-block: var(--s-6) var(--s-7); }
.page-title { font-size: var(--fs-2xl); margin-bottom: var(--s-3); }
.page-title--single { font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.4rem); line-height: 1.55; max-width: 30ch; }
.page-lead { color: var(--c-muted); max-width: 65ch; font-size: var(--fs-md); margin-bottom: 0; }
.page-head__search { margin-top: var(--s-5); max-width: 640px; }
.page-head .meta { margin-top: var(--s-3); font-size: var(--fs-sm); }

.search-form { display: flex; gap: var(--s-2); }
.search-form input[type=search] {
	flex: 1; min-width: 0; min-height: 48px; padding-inline: var(--s-4); border: 1px solid var(--c-line-2); border-radius: var(--r-sm);
	background: var(--c-surface); font: inherit; color: var(--c-text);
}
.search-form input[type=search]:focus { border-color: var(--c-green); outline: 2px solid rgba(14,77,58,.2); outline-offset: 0; }
.search-form .btn { min-height: 48px; }
@media (max-width: 480px) { .search-form .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

.past { margin-top: var(--s-7); }
.notfound { text-align: center; max-width: 680px; }
.notfound__code { font-family: var(--f-display); font-size: 6rem; color: var(--c-gold-2); line-height: 1; margin-bottom: var(--s-4); }
.notfound__search { max-width: 520px; margin: var(--s-5) auto; }

/* 8. SINGLE / READING ------------------------------------------------------- */
.single-footer { display: grid; gap: var(--s-5); margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--c-line); }
.post-nav { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 700px) { .post-nav { grid-template-columns: 1fr 1fr; } .post-nav__prev { grid-column: 2; text-align: end; } }
.post-nav__link { display: grid; gap: var(--s-1); padding: var(--s-4); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); text-decoration: none; }
.post-nav__link:hover { border-color: var(--c-green); }
.post-nav__label { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-xs); color: var(--c-muted); }
.post-nav__prev .post-nav__label { justify-content: flex-end; }
.post-nav__title { font-weight: 600; color: var(--c-navy); }

.reading { display: grid; gap: var(--s-6); margin-top: var(--s-6); }
.reading:first-child { margin-top: 0; }
.reading__main { min-width: 0; max-width: var(--measure); margin-inline: auto; width: 100%; }
@media (min-width: 1100px) {
	.reading--toc { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
	.reading--toc .reading__main { margin-inline: 0 auto; }
	.reading__toc { position: sticky; top: calc(var(--header-h) + var(--s-4)); max-height: calc(100vh - var(--header-h) - 2rem); overflow: auto; }
}
.reading__cover { margin: 0 0 var(--s-6); border-radius: var(--r-md); overflow: hidden; }

/* Prose — long-form Arabic reading */
.prose { font-size: var(--fs-base); line-height: 1.95; overflow-wrap: break-word; }
.prose--article { font-family: var(--f-read); font-size: clamp(1.125rem, 1.05rem + .3vw, 1.25rem); line-height: var(--lh-read); color: #20252f; }
.prose > * { max-width: var(--measure); }
.prose p { margin: 0 0 1.15em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--f-ui); margin: 1.8em 0 .7em; color: var(--c-navy); scroll-margin-top: calc(var(--header-h) + 1rem); }
.prose h2 { font-size: 1.45em; padding-bottom: .35em; border-bottom: 1px solid var(--c-line); }
.prose h3 { font-size: 1.2em; }
.prose h4 { font-size: 1.05em; }
.prose ul, .prose ol { padding-inline-start: 1.6em; margin: 0 0 1.15em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--c-gold); }
.prose blockquote {
	margin: 1.6em 0; padding: 1em 1.4em; background: var(--c-gold-soft); border-inline-start: 4px solid var(--c-gold-2);
	border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--c-navy-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose a { color: var(--c-green); }
.prose img, .prose figure { border-radius: var(--r-sm); margin-block: 1.5em; }
.prose figcaption { font-family: var(--f-ui); font-size: var(--fs-sm); color: var(--c-muted); text-align: center; margin-top: .5em; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--f-ui); font-size: var(--fs-sm); display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--c-line); padding: .6em .8em; text-align: start; }
.prose th { background: var(--c-surface-2); }
.prose hr { border: 0; height: 1px; background: var(--c-line); margin: 2em 0; }
.prose strong { color: var(--c-navy); }
.prose .wp-block-pullquote { border-block: 2px solid var(--c-gold-2); padding: 1em 0; text-align: center; }
.prose .wp-block-embed, .prose iframe { max-width: 100%; }

.abstract .prose { font-family: var(--f-read); font-size: 1.15rem; line-height: 2; }
.source-note { display: flex; gap: var(--s-2); align-items: center; font-size: var(--fs-sm); color: var(--c-muted); margin-block: var(--s-5); }

/* Q&A */
.qa { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0; padding: var(--s-5); padding-inline-start: 0; border-radius: var(--r-md); margin-bottom: var(--s-5); }
.qa .qa-mark { margin-block: 0; }
.qa--question { background: var(--c-gold-soft); border: 1px solid #eadcbc; }
.qa--answer { background: var(--c-surface); border: 1px solid var(--c-line); }
.qa__label { font-size: var(--fs-base); color: var(--c-gold); margin-bottom: var(--s-2); }
.qa--answer .qa__label { color: var(--c-green); }
.qa__text { font-family: var(--f-read); font-size: 1.15rem; line-height: 2; }
.qa__text p:last-child { margin: 0; }
.ask-cta { text-align: center; color: var(--c-muted); padding: var(--s-4); border: 1px dashed var(--c-line-2); border-radius: var(--r-md); }

/* Series & episodes */
.episode-list { list-style: none; margin: 0; padding: 0; counter-reset: ep; display: grid; gap: var(--s-2); }
.episode { counter-increment: ep; position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); padding-inline-start: 3.4rem; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-sm); }
.episode::before { content: counter(ep, arabic-indic); position: absolute; inset-inline-start: var(--s-3); top: .8rem; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--c-green-soft); color: var(--c-green); font-weight: 700; font-size: var(--fs-sm); }
.episode__title { font-weight: 600; color: var(--c-navy); text-decoration: none; flex: 1; }
a.episode__title:hover { color: var(--c-green); }
.episode--inline { display: block; }
.episode--inline details > summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); cursor: pointer; list-style: none; min-height: 32px; }
.episode--inline details > summary::-webkit-details-marker { display: none; }
.episode--inline details > summary::after { content: ""; width: 10px; height: 10px; border-inline-end: 2px solid var(--c-muted); border-bottom: 2px solid var(--c-muted); transform: rotate(45deg); margin-inline-start: auto; transition: transform .2s; }
.episode--inline details[open] > summary::after { transform: rotate(-135deg); }
.episode__media { display: grid; gap: var(--s-4); margin-top: var(--s-4); }
.episode-list--compact .episode, .episode-list--compact li { padding: .4rem 0; background: none; border: 0; }
.series-context { background: var(--c-surface); border: 1px solid var(--c-line); border-inline-start: 4px solid var(--c-green); border-radius: var(--r-sm); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-6); }
.series-context__title { font-weight: 600; margin-bottom: var(--s-2); }
.episode-list--compact { counter-reset: ep; }
.episode-list--compact li { counter-increment: ep; display: flex; gap: var(--s-2); font-size: var(--fs-sm); }
.episode-list--compact li::before { content: counter(ep, arabic-indic) "."; color: var(--c-gold); min-width: 1.5em; }
.episode-list--compact li.is-current span { font-weight: 700; color: var(--c-green); }

.version-tabs { list-style: none; margin: 0 0 var(--s-6); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.version-tabs li { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; border-radius: 999px; background: var(--c-surface); border: 1px solid var(--c-line); font-size: var(--fs-sm); color: var(--c-navy-2); }
.version-tabs .icon { color: var(--c-gold); }
.visual-card { margin: var(--s-6) auto 0; max-width: 640px; text-align: center; }
.visual-card img { border-radius: var(--r-md); box-shadow: var(--shadow-2); margin-inline: auto; }
.visual-card figcaption { font-size: var(--fs-sm); color: var(--c-muted); margin-top: var(--s-2); }

.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s-3); }
.gallery-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); }

.announcement-body { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .announcement-body.has-image { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.announcement-body__image { margin: 0; }
.announcement-body__image img { border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.announcement-body .meta-table { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-2) var(--s-5); margin-bottom: var(--s-5); }

/* Biography */
.bio { display: grid; gap: var(--s-7); }
@media (min-width: 960px) {
	.bio { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
	.bio__card { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
}
.bio__card { display: grid; gap: var(--s-3); }
.bio__portrait { max-width: 260px; }
.bio__name { font-family: var(--f-display); font-size: 1.9rem; color: var(--c-navy); margin: var(--s-3) 0 0; font-weight: 700; }
.bio__role { color: var(--c-green); font-weight: 600; font-size: var(--fs-sm); }
.bio__content { max-width: var(--measure); }
.bio__content h2 { font-size: 1.3em; }

/* 9. FORMS ------------------------------------------------------------------ */
.contact-layout { display: grid; gap: var(--s-7); }
@media (min-width: 960px) { .contact-layout { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.form { display: grid; gap: var(--s-5); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); }
.field { display: grid; gap: var(--s-2); }
.field label { font-weight: 600; color: var(--c-navy); }
.req { color: var(--c-danger); }
.field input, .field textarea {
	width: 100%; min-height: 48px; padding: .7rem var(--s-4); border: 1px solid var(--c-line-2); border-radius: var(--r-sm);
	background: var(--c-ivory); font: inherit; color: var(--c-text); line-height: 1.8;
}
.field textarea { min-height: 180px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--c-green); background: #fff; outline: 2px solid rgba(14,77,58,.18); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: var(--c-danger); background: #fff8f8; }
.field-error { color: var(--c-danger); font-size: var(--fs-sm); font-weight: 600; margin: 0; }
.field-hint { color: var(--c-muted); font-size: var(--fs-xs); margin: 0; }
.field.is-over .word-count { color: var(--c-danger); font-weight: 700; }
.form .btn { justify-self: start; }
.alg-hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.checklist { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; gap: var(--s-3); font-size: var(--fs-sm); }
.checklist li { display: flex; gap: var(--s-2); align-items: flex-start; }
.checklist .icon { color: var(--c-green); margin-top: 4px; }
.contact-mail { display: flex; gap: var(--s-2); align-items: center; }

/* 10. UTILITIES & WP -------------------------------------------------------- */
.alignwide { max-width: 1000px; }
.alignfull { max-width: none; }
.wp-caption, .wp-block-image { max-width: 100%; }
.aligncenter { margin-inline: auto; }
.has-navy-color { color: var(--c-navy); } .has-green-color { color: var(--c-green); } .has-gold-color { color: var(--c-gold); }
.has-navy-background-color { background: var(--c-navy); } .has-green-background-color { background: var(--c-green); } .has-ivory-background-color { background: var(--c-ivory); }

@media print {
	.site-header, .site-footer, .share, .post-nav, .related, .doc-viewer__frame, .newsletter, .toc { display: none !important; }
	body { background: #fff; }
	.prose--article { font-size: 12pt; }
}

/* 11. BRAND SKIN — client concept (navy top band, gold calligraphy) ---------
   Applies the client's visual direction on top of the base system:
   navy header + hero + page heads, gold name/seal (CSS masks), gold CTAs,
   beige pill buttons in cards, faint geometric page background.            */
:root {
	--c-gold-light: #d9b872;
	--gold-grad: linear-gradient(180deg, #f0d99c 0%, #d4ab5c 48%, #a97a36 100%);
	--c-on-dark: #efe7d6;
	--c-on-dark-muted: rgba(239, 231, 214, .74);
	--band: radial-gradient(1100px 520px at 85% -20%, #22385a 0%, rgba(34,56,90,0) 60%), linear-gradient(180deg, #13223a 0%, #0f1b2d 100%);
}

/* Logo masks: transparent PNG used as a mask, painted with any token. */
.logo-mask { display: block; background: var(--gold-grad); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }

/* Page background: very faint geometric motif. */
body { background: var(--c-ivory) url("../img/pattern-faint.svg") 0 0 / 240px; }
.section--tint { background-color: rgba(243, 238, 227, .85); }

/* Header */
.site-header { background: rgba(15, 27, 45, .97); border-bottom: 1px solid rgba(176, 141, 74, .35); }
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(15, 27, 45, .92); } }
.site-header.is-scrolled { box-shadow: 0 8px 24px -16px rgba(0, 0, 0, .6); }
.brand, .brand:hover { color: var(--c-on-dark); }
.brand__seal { width: 50px; height: auto; }
.brand__logo { height: auto; width: 150px; }
.brand__name { color: var(--c-gold-light); }
.primary-nav .menu > li > a { color: var(--c-on-dark); }
.primary-nav .menu > li + li::before { content: ""; width: 1px; height: 14px; background: rgba(239, 231, 214, .22); margin-inline-end: 2px; }
.primary-nav .menu > li > a:hover, .primary-nav .menu > li.is-open > a { color: var(--c-gold-light); background: rgba(255, 255, 255, .05); }
.primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a, .primary-nav a[aria-current] { color: var(--c-gold-light) !important; box-shadow: inset 0 -2px 0 var(--c-gold-light); }
.primary-nav .sub-toggle { color: var(--c-on-dark-muted); }
.icon-btn { color: var(--c-on-dark); }
.icon-btn:hover { background: rgba(255, 255, 255, .08); }
.header-search { background: var(--c-navy-2); border-top-color: rgba(255, 255, 255, .08); }
@media (max-width: 480px) { .brand__logo { width: 118px; } .brand__seal { width: 42px; } }

/* Hero */
.hero { background: var(--band); border-bottom: 0; color: var(--c-on-dark); }
.hero__pattern { opacity: .14; filter: brightness(1.8); }
.hero__eyebrow { color: var(--c-gold-light); }
.hero__name { color: var(--c-gold-light); }
.hero__logo { width: min(100%, 580px); margin-block: var(--s-2) var(--s-4); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .25)); }
.hero__role { color: var(--c-on-dark); border-inline-start-color: var(--c-gold-light); }
.hero__intro { color: var(--c-on-dark-muted); }
.hero .btn-primary { background: var(--gold-grad); color: var(--c-navy); border: 0; box-shadow: 0 6px 18px -8px rgba(212, 171, 92, .7); }
.hero .btn-primary:hover { filter: brightness(1.06); color: var(--c-navy); }
.hero .btn-outline { border-color: rgba(239, 231, 214, .55); color: var(--c-on-dark); }
.hero .btn-outline:hover { background: var(--c-on-dark); color: var(--c-navy); }
.arch { background: radial-gradient(120% 80% at 50% 0%, #2a4468 0%, #14243c 75%); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 0 0 2px rgba(217, 184, 114, .75); }
.arch::after { border-color: rgba(217, 184, 114, .45); }

/* Quick access: line icons on cream, as in the concept. */
.quick__list { background: #fff; }
.quick__icon { border: 0; width: 60px; height: 60px; color: var(--c-navy); background: transparent; }
.quick__icon .icon { width: 38px; height: 38px; stroke-width: 1.25; }
.quick__item:hover .quick__icon { background: var(--c-gold-soft); color: var(--c-green); }

/* Inner page heads join the navy band. */
.page-head { background: var(--band); color: var(--c-on-dark); border-bottom: 0; }
.page-head .page-title { color: #fff; }
.page-head .page-lead { color: var(--c-on-dark-muted); }
.page-head .eyebrow, .page-head .eyebrow a { color: var(--c-gold-light); }
.page-head .eyebrow::before { background: var(--c-gold-light); }
.page-head .breadcrumbs, .page-head .breadcrumbs a { color: var(--c-on-dark-muted); }
.page-head .breadcrumbs [aria-current] { color: var(--c-on-dark); }
.page-head .breadcrumbs li:not(:last-child)::after { color: rgba(239, 231, 214, .3); }
.page-head .meta { color: var(--c-on-dark-muted); }
.page-head .meta .icon { color: var(--c-gold-light); }
.page-head__pattern { opacity: .12; filter: brightness(1.8); }
.page-head .search-form .btn-primary { background: var(--gold-grad); color: var(--c-navy); }

/* Buttons in cards: beige pills. */
.btn-soft { background: #efe2c3; color: var(--c-navy); border-color: #e2cf9f; border-radius: 999px; }
.btn-soft:hover { background: #e6d3a6; color: var(--c-navy); }
.btn-gold { background: var(--gold-grad); color: var(--c-navy); border: 0; }

/* Research list: red PDF mark, as in the concept. */
.card-research .card-row__icon { background: #fbeceb; color: #b3261e; }

/* Newsletter keeps the green accent but with gold button. */
.newsletter .btn-gold { background: var(--gold-grad); }

/* Mobile hero follows the concept: small portrait first, then the name. */
@media (max-width: 899px) {
	.hero__inner { padding-block: var(--s-6) var(--s-9); text-align: center; }
	.hero__portrait { order: -1; width: min(44vw, 190px); justify-self: center; }
	.hero__eyebrow, .hero__actions { justify-content: center; }
	.hero__logo { margin-inline: auto; }
	.hero__role { border-inline-start: 0; padding-inline-start: 0; margin-inline: auto; }
	.hero__intro { margin-inline: auto; }
}
@media (max-width: 560px) {
	.quick__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; }
	.quick__list > li { flex: 0 0 33.333%; }
	.bio__portrait { max-width: 200px; margin-inline: auto; }
}

/* Primary actions are gold site-wide (client concept); green stays an accent. */
.btn-primary { background: var(--gold-grad); color: var(--c-navy); border: 0; }
.btn-primary:hover { background: var(--gold-grad); filter: brightness(1.06); color: var(--c-navy); }
.footer-logo { filter: none; opacity: 1; width: 210px; }

/* Research: two cards per row (tablet/desktop), one per row on phones. */
@media (min-width: 820px) {
	.card-list--research { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
	.card-list--research .card-research { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto; }
	.card-list--research .card-row__actions { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; align-self: end; padding: 0 0 var(--s-5); padding-inline-end: var(--s-5); margin: 0; }
}

/* Hero eyebrow: the client's seal (gold) instead of a generic icon. */
.hero__seal { width: 30px; flex: none; }

/* 12. POLISH — progress bar, back-to-top, featured ribbon, entrance motion --- */

/* Reading progress (only meaningful on long-form pages; JS sets the width). */
.reading-progress { position: fixed; inset-block-start: 0; inset-inline: 0; height: 3px; z-index: 60; background: transparent; pointer-events: none; }
.admin-bar .reading-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .reading-progress { top: 0; } }
.reading-progress span { display: block; height: 100%; width: 0%; background: var(--gold-grad, var(--c-gold-2)); transition: width .12s linear; }

/* Back-to-top */
.back-to-top {
	position: fixed; inset-block-end: 22px; inset-inline-end: 22px; z-index: 40;
	display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--gold-grad, var(--c-gold-2)); color: var(--c-navy); box-shadow: var(--shadow-2);
	transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { transform: translateY(-3px); }
.back-to-top .icon { width: 20px; height: 20px; transform: rotate(180deg); }
@media (max-width: 560px) { .back-to-top { inset-block-end: 16px; inset-inline-end: 16px; width: 42px; height: 42px; } }
@media print { .back-to-top, .reading-progress { display: none !important; } }

/* Featured ribbon: small badge at the card's leading (RTL: right) corner. */
.card.is-featured { overflow: visible; }
.card.is-featured::before {
	content: "\2605 مميز"; position: absolute; inset-block-start: -1px; inset-inline-start: var(--s-4); z-index: 2;
	background: var(--gold-grad, var(--c-gold-2)); color: var(--c-navy); font-size: .72rem; font-weight: 700;
	padding: .2rem .65rem; border-radius: 0 0 var(--r-sm) var(--r-sm); box-shadow: 0 3px 8px -3px rgba(0,0,0,.35);
	pointer-events: none; letter-spacing: 0;
}
.card-generic.is-featured::before, .card-question.is-featured::before { inset-inline-start: 60px; }

/* Hero entrance: a gentle one-time fade+rise, skipped for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
	.hero__text { animation: alg-rise .7s var(--ease) both; }
	.hero__portrait { animation: alg-rise .8s var(--ease) .1s both; }
	@keyframes alg-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* Sermon card with a video thumbnail. */
.card-sermon--thumb { display: flex; flex-direction: column; overflow: hidden; }
.card-sermon--thumb .card__body { flex: 1; }
