/* ==========================================================================
   عائلة أبناء الأصفر الليبية — Design System
   ========================================================================== */

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-display: swap;
}
@font-face {
    font-family: 'Amiri';
    src: url('../fonts/Amiri-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Amiri';
    src: url('../fonts/Amiri-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

:root {
    --emerald-950: #051d16;
    --emerald-900: #08281f;
    --emerald-800: #0b3227;
    --emerald-700: #0e4233;
    --emerald-600: #14563f;
    --emerald-500: #1d6b4f;
    --gold-700: #8f6d1c;
    --gold-600: #b08a26;
    --gold-500: #c9a227;
    --gold-400: #d9b95f;
    --gold-300: #e8d49a;
    --sand-50: #fbf8f1;
    --sand-100: #f6f1e6;
    --sand-200: #efe7d6;
    --sand-300: #e4d8c0;
    --paper: #fffdf8;
    --ink: #16221d;
    --ink-soft: #34443c;
    --muted: #6c7a72;
    --line: rgba(11, 50, 39, .12);
    --line-strong: rgba(11, 50, 39, .22);
    --danger: #a83434;
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --shadow-sm: 0 2px 10px rgba(8, 40, 31, .06);
    --shadow: 0 18px 45px -22px rgba(8, 40, 31, .35);
    --shadow-lg: 0 40px 90px -40px rgba(5, 29, 22, .55);
    --font-body: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    --font-display: 'Amiri', 'Times New Roman', serif;
    --header-h: 78px;
    --ease: cubic-bezier(.22, .8, .28, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.85;
    color: var(--ink-soft);
    background: var(--sand-50);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%230b3227' stroke-opacity='.05' stroke-width='1'%3E%3Cpath d='M60 6 84 18v24c0 17-10 27-24 33C46 69 36 59 36 42V18Z'/%3E%3Cpath d='M0 60h120M60 0v120' stroke-opacity='.02'/%3E%3C/g%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--emerald-700); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--gold-700); }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; color: var(--ink); line-height: 1.35; font-weight: 700; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-inline-start: 1.4em; }
button { font-family: inherit; }
::selection { background: var(--gold-300); color: var(--emerald-950); }

:focus-visible {
    outline: 3px solid var(--gold-500);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    top: -60px;
    right: 16px;
    z-index: 300;
    padding: 10px 20px;
    background: var(--gold-500);
    color: var(--emerald-950);
    border-radius: 0 0 10px 10px;
    font-weight: 700;
    transition: top .2s;
}
.skip-link:focus { top: 0; color: var(--emerald-950); }

.container {
    width: min(1240px, 100% - 48px);
    margin-inline: auto;
    position: relative;
}

.section { padding: 96px 0; position: relative; }
.section-sm { padding: 64px 0; }
.section-tint { background: linear-gradient(180deg, var(--sand-100), var(--sand-50)); }
.section-paper { background: var(--paper); }
.section-dark {
    background: var(--emerald-950);
    color: rgba(255, 253, 248, .74);
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: var(--sand-50); }
.section-dark a { color: var(--gold-300); }
.section-dark a:hover { color: var(--gold-400); }

.divider-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--gold-500);
    margin: 8px auto 26px;
}
.divider-ornament::before,
.divider-ornament::after {
    content: "";
    height: 1px;
    width: 64px;
    background: linear-gradient(90deg, transparent, currentColor);
    opacity: .6;
}
.divider-ornament::after { background: linear-gradient(270deg, transparent, currentColor); }
.divider-ornament svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */
.display {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .18em;
    color: var(--gold-700);
    text-transform: uppercase;
    margin-bottom: 14px;
}
.eyebrow::before {
    content: "";
    width: 30px;
    height: 1px;
    background: currentColor;
    opacity: .7;
}
.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head.center .eyebrow::after {
    content: "";
    width: 30px;
    height: 1px;
    background: currentColor;
    opacity: .7;
}
.section-head h2 {
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 46px);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 14px;
}
.section-head p { color: var(--muted); font-size: 17.5px; margin: 0; }
.section-dark .section-head p { color: rgba(255, 253, 248, .62); }
.section-dark .eyebrow { color: var(--gold-300); }
.lead {
    font-size: 19px;
    line-height: 1.95;
    color: var(--ink);
}
.text-muted { color: var(--muted); }
.text-gold { color: var(--gold-500); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    --btn-bg: var(--emerald-800);
    --btn-fg: var(--sand-50);
    --btn-border: var(--emerald-800);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 999px;
    cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s, border-color .25s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover {
    color: var(--btn-fg);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -14px rgba(8, 40, 31, .55);
}
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-gold {
    --btn-bg: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    --btn-fg: var(--emerald-950);
    --btn-border: transparent;
}
.btn-outline {
    --btn-bg: transparent;
    --btn-fg: var(--emerald-800);
    --btn-border: var(--line-strong);
}
.btn-outline:hover { --btn-bg: var(--emerald-800); --btn-fg: var(--sand-50); }
.btn-light {
    --btn-bg: rgba(255, 253, 248, .1);
    --btn-fg: var(--sand-50);
    --btn-border: rgba(255, 253, 248, .35);
    backdrop-filter: blur(6px);
}
.btn-light:hover { --btn-bg: var(--sand-50); --btn-fg: var(--emerald-900); }
.btn-sm { padding: 11px 20px; font-size: 14px; }
.btn-lg { padding: 18px 38px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-ghost {
    --btn-bg: transparent;
    --btn-fg: var(--emerald-700);
    --btn-border: transparent;
    padding: 10px 14px;
}
.btn-ghost:hover { --btn-bg: rgba(11, 50, 39, .06); }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: var(--danger); }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: var(--emerald-700);
}
.link-arrow svg { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.link-arrow:hover svg { transform: translateX(-5px); }

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
    background: var(--emerald-950);
    color: rgba(255, 253, 248, .72);
    font-size: 13.5px;
    position: relative;
    z-index: 60;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 42px;
}
.topbar-links, .topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar a { color: rgba(255, 253, 248, .78); display: inline-flex; align-items: center; gap: 7px; }
.topbar a:hover { color: var(--gold-300); }
.topbar svg { opacity: .8; }
.topbar-sep { width: 1px; height: 14px; background: rgba(255, 253, 248, .22); }
.topbar-note { color: rgba(255, 253, 248, .5); }
.topbar-admin {
    padding: 3px 12px;
    border: 1px solid rgba(255, 253, 248, .22);
    border-radius: 999px;
}
.topbar-admin:hover { border-color: var(--gold-400); }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 253, 248, .92);
    backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .3s, background .3s;
}
.site-header.is-stuck { box-shadow: 0 10px 40px -24px rgba(8, 40, 31, .5); background: rgba(255, 253, 248, .97); }
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--emerald-800); }
.brand:hover { color: var(--emerald-800); }
.brand-mark {
    width: 48px;
    height: 48px;
    color: var(--gold-600);
    flex: none;
    display: grid;
    place-items: center;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
    color: var(--emerald-900);
    letter-spacing: .01em;
}
.brand-text small { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }

.main-nav { display: flex; align-items: center; gap: 3px; }
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 13px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--emerald-700); background: rgba(11, 50, 39, .05); }
.nav-link::after {
    content: "";
    position: absolute;
    right: 13px;
    left: 13px;
    bottom: 4px;
    height: 2px;
    background: var(--gold-500);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .28s var(--ease);
    border-radius: 2px;
}
.nav-link.is-active { color: var(--emerald-800); font-weight: 700; }
.nav-link.is-active::after, .nav-item.is-active > .nav-link::after { transform: scaleX(1); }
.nav-item { position: relative; }
.nav-drop-toggle svg { transition: transform .25s; }
.nav-item.open .nav-drop-toggle svg { transform: rotate(180deg); }
.nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -20px;
    width: 320px;
    z-index: 50;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .22s, transform .22s, visibility .22s;
}
.nav-item.open .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
/* جسر شفاف يغطي الفجوة بين الزر والقائمة حتى لا تنغلق أثناء عبور الماوس */
.nav-dropdown::before {
    content: "";
    position: absolute;
    top: -12px;
    right: -10px;
    left: -10px;
    height: 12px;
}
.nav-dropdown a {
    display: block;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--ink);
}
.nav-dropdown a:hover { background: var(--sand-100); color: var(--emerald-800); }
.nav-dropdown a span { display: block; font-weight: 700; font-size: 15px; }
.nav-dropdown a small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: transparent;
    padding: 11px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; background: var(--emerald-800); border-radius: 2px; transition: transform .28s, opacity .2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero — home
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: min(92vh, 860px);
    display: flex;
    align-items: flex-end;
    color: var(--sand-50);
    overflow: hidden;
    background: var(--emerald-950);
    isolation: isolate;
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: url('../img/hero.jpg') center 42% / cover no-repeat;
    transform: scale(1.03);
    animation: heroZoom 24s var(--ease) both;
}
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1.03); } }
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(5, 29, 22, .72) 0%, rgba(5, 29, 22, .35) 38%, rgba(5, 29, 22, .82) 86%, var(--emerald-950) 100%),
        linear-gradient(90deg, rgba(5, 29, 22, .75), transparent 60%);
}
.hero-frame {
    position: absolute;
    inset: 22px;
    border: 1px solid rgba(232, 212, 154, .22);
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}
.hero-frame::before, .hero-frame::after {
    content: "";
    position: absolute;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(232, 212, 154, .55);
}
.hero-frame::before { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.hero-frame::after { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.hero-inner {
    width: min(1240px, 100% - 48px);
    margin-inline: auto;
    padding: 150px 0 86px;
    position: relative;
    z-index: 2;
}
.hero-copy { max-width: 780px; }
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--gold-300);
    margin-bottom: 24px;
}
.hero-kicker::before, .hero-kicker::after { content: ""; width: 40px; height: 1px; background: rgba(232, 212, 154, .55); }
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(46px, 7.2vw, 92px);
    line-height: 1.08;
    font-weight: 700;
    color: var(--sand-50);
    margin-bottom: 18px;
    text-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.hero-title em { font-style: normal; color: var(--gold-300); }
.hero-sub {
    font-size: clamp(16px, 1.7vw, 20px);
    line-height: 1.9;
    color: rgba(255, 253, 248, .82);
    max-width: 640px;
    margin-bottom: 14px;
}
.hero-verse {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--gold-300);
    border-inline-start: 2px solid rgba(232, 212, 154, .5);
    padding-inline-start: 16px;
    margin: 22px 0 34px;
    line-height: 1.9;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-scroll {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: .25em;
    color: rgba(255, 253, 248, .5);
}
.hero-scroll span {
    width: 1px;
    height: 46px;
    background: linear-gradient(180deg, rgba(232, 212, 154, .8), transparent);
    animation: scrollPulse 2.4s infinite;
}
@keyframes scrollPulse {
    0%, 100% { transform: scaleY(.4); opacity: .3; transform-origin: top; }
    50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

/* Stats strip overlapping hero */
.stats-strip {
    position: relative;
    z-index: 5;
    margin-top: -58px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.stat {
    padding: 30px 26px;
    text-align: center;
    position: relative;
}
.stat + .stat::before {
    content: "";
    position: absolute;
    right: 0;
    top: 24%;
    bottom: 24%;
    width: 1px;
    background: var(--line);
}
.stat-num {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--emerald-800);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}
.stat-num small { font-size: 20px; color: var(--gold-600); }
.stat-label { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* --------------------------------------------------------------------------
   Page hero
   -------------------------------------------------------------------------- */
.page-hero {
    position: relative;
    color: var(--sand-50);
    background: var(--emerald-900);
    overflow: hidden;
    isolation: isolate;
}
.page-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center 40%;
    transform: scale(1.02);
}
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(5, 29, 22, .82), rgba(5, 29, 22, .55) 55%, rgba(5, 29, 22, .88));
}
.page-hero-inner {
    padding: 88px 0 72px;
    max-width: 820px;
}
.page-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(38px, 5.4vw, 62px);
    color: var(--sand-50);
    margin-bottom: 16px;
    line-height: 1.18;
}
.page-hero p { color: rgba(255, 253, 248, .78); font-size: 18px; max-width: 680px; margin: 0; }
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 253, 248, .6);
    margin-bottom: 20px;
}
.breadcrumb a { color: rgba(255, 253, 248, .8); }
.breadcrumb a:hover { color: var(--gold-300); }
.breadcrumb svg { width: 12px; height: 12px; opacity: .5; }

/* --------------------------------------------------------------------------
   Explore tabs (home)
   -------------------------------------------------------------------------- */
.explore-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 48px;
    align-items: stretch;
}
.tab-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
}
.tab-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    text-align: right;
    padding: 24px 10px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    color: var(--muted);
    transition: color .25s, padding .25s;
    position: relative;
}
.tab-btn::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gold-500);
    transform: scaleY(0);
    transition: transform .3s var(--ease);
}
.tab-btn:hover { color: var(--ink); }
.tab-btn[aria-selected="true"] { color: var(--emerald-800); padding-right: 22px; }
.tab-btn[aria-selected="true"]::before { transform: scaleY(1); }
.tab-num {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--gold-600);
    opacity: .6;
    width: 26px;
    flex: none;
}
.tab-btn[aria-selected="true"] .tab-num { opacity: 1; }
.tab-label { display: flex; flex-direction: column; gap: 2px; }
.tab-label strong { font-size: 19px; font-weight: 700; color: inherit; }
.tab-label small { font-size: 13px; font-weight: 400; color: var(--muted); }
.tab-btn svg.tab-arrow {
    width: 18px;
    height: 18px;
    margin-inline-start: auto;
    opacity: 0;
    transform: translateX(6px);
    transition: .25s var(--ease);
}
.tab-btn[aria-selected="true"] svg.tab-arrow { opacity: 1; transform: translateX(0); }

.explore-panels {
    position: relative;
    min-height: 460px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--emerald-900);
    box-shadow: var(--shadow);
}
.tab-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 38px;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity .45s var(--ease), visibility .45s, transform .6s var(--ease);
    transform: scale(1.03);
    isolation: isolate;
}
.tab-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: var(--tab-img, none);
    background-size: cover;
    background-position: center;
    transition: transform 8s linear;
}
.tab-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(5, 29, 22, .12) 0%, rgba(5, 29, 22, .55) 52%, rgba(5, 29, 22, .92) 100%);
}
.tab-panel[aria-hidden="false"] { opacity: 1; visibility: visible; transform: scale(1); }
.tab-panel[aria-hidden="false"]::before { transform: scale(1.06); }
.tab-panel h3 { font-family: var(--font-display); font-size: 32px; color: var(--sand-50); margin-bottom: 10px; }
.tab-panel p { color: rgba(255, 253, 248, .8); font-size: 15.5px; line-height: 1.9; margin-bottom: 20px; }
.tab-panel .btn { align-self: flex-start; }
.tab-panel-tag {
    align-self: flex-start;
    font-size: 11px;
    letter-spacing: .2em;
    padding: 5px 12px;
    border: 1px solid rgba(232, 212, 154, .45);
    border-radius: 999px;
    color: var(--gold-300);
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(201, 162, 39, .35); }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sand-200); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 24px 26px 28px; }
.card-body h3 { font-size: 20px; margin-bottom: 8px; }
.card-body h3 a { color: var(--ink); }
.card-body h3 a:hover { color: var(--emerald-700); }
.card-body p { font-size: 15px; color: var(--muted); margin-bottom: 16px; }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.card-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold-500); }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(201, 162, 39, .12);
    color: var(--gold-700);
    border: 1px solid rgba(201, 162, 39, .25);
}
.badge-emerald { background: rgba(11, 50, 39, .07); color: var(--emerald-700); border-color: rgba(11, 50, 39, .16); }
.badge-muted { background: rgba(108, 122, 114, .1); color: var(--muted); border-color: rgba(108, 122, 114, .2); }

/* Feature figure */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}
.split.reverse .split-media { order: 2; }
.media-frame {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--sand-200);
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3.2; }
.media-frame.tall img { aspect-ratio: 3 / 4; }
.media-caption {
    position: absolute;
    right: 18px;
    bottom: 18px;
    left: 18px;
    padding: 12px 16px;
    background: rgba(5, 29, 22, .72);
    backdrop-filter: blur(8px);
    color: rgba(255, 253, 248, .85);
    font-size: 12.5px;
    border-radius: 10px;
}
.media-frame::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255, 253, 248, .25);
    border-radius: calc(var(--radius-lg) - 10px);
    pointer-events: none;
}
.split-copy h2 { font-family: var(--font-display); font-size: clamp(30px, 3.6vw, 42px); margin-bottom: 18px; }
.split-copy p { color: var(--ink-soft); }
.check-list { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; font-size: 15.5px; color: var(--ink-soft); }
.check-list li::before {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 4px;
    border-radius: 50%;
    background: rgba(201, 162, 39, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23b08a26' stroke-width='2'%3E%3Cpath d='m5 10 3.5 3.5L15 6.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* Tribe cards */
.tribe-card { padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.tribe-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tribe-card h3 { font-size: 21px; margin: 0; }
.tribe-branch { font-size: 13px; color: var(--gold-700); font-weight: 700; letter-spacing: .02em; }
.tribe-card p { font-size: 14.5px; color: var(--muted); margin: 0; line-height: 1.9; }
.tribe-rel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--emerald-700);
    border-top: 1px solid var(--line);
    padding-top: 14px;
    margin-top: auto;
}
.tribe-rel::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); }

/* Document cards */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}
.doc-card { position: relative; cursor: pointer; }
.doc-card .card-media { aspect-ratio: 3 / 3.4; background: #e8e0cf; }
.doc-card .card-media img { object-fit: cover; filter: saturate(.85) contrast(1.02); }
.doc-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 18px;
    background: linear-gradient(180deg, transparent 35%, rgba(5, 29, 22, .85));
    opacity: 0;
    transition: opacity .3s;
    color: var(--sand-50);
}
.doc-card:hover .doc-overlay { opacity: 1; }
.doc-overlay span { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.doc-card-body { padding: 18px 20px 22px; }
.doc-card-body h3 { font-size: 17px; margin-bottom: 6px; line-height: 1.6; }
.doc-card-body h3 a { color: inherit; text-decoration: none; }
.doc-card-body h3 a:hover { color: var(--emerald-600); }
.doc-card-body .doc-dates { font-size: 12.5px; color: var(--gold-700); font-weight: 700; }
.doc-linked { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.8; }
.doc-linked span { color: var(--emerald-700); font-weight: 700; }
.doc-linked a { color: var(--emerald-800); text-decoration: none; border-bottom: 1px dotted var(--gold-500); }
.doc-linked a:hover { color: var(--gold-700); }
.doc-pages {
    display: flex;
    gap: 8px;
    padding: 0 20px 20px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.doc-pages a {
    width: 62px;
    height: 78px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    background: #e8e0cf;
    transition: border-color .2s, transform .2s;
}
.doc-pages a:hover { border-color: var(--gold-500); transform: translateY(-2px); }
.doc-pages img { width: 100%; height: 100%; object-fit: cover; }
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 34px;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--paper);
    transition: .2s;
}
.filter-chip:hover { border-color: var(--gold-500); color: var(--emerald-800); }
.filter-chip.is-active { background: var(--emerald-800); border-color: var(--emerald-800); color: var(--sand-50); }
.filter-chip span { font-size: 11.5px; opacity: .6; }

/* News */
.news-list { display: grid; gap: 26px; }
.news-card { display: grid; grid-template-columns: 320px 1fr; }
.news-card .card-media { aspect-ratio: auto; height: 100%; min-height: 230px; }
.news-card .card-body { padding: 32px; display: flex; flex-direction: column; justify-content: center; }
.news-card h3 { font-family: var(--font-display); font-size: 27px; }
.news-card .card-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gold-700);
    font-weight: 700;
    margin-bottom: 12px;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}
.gallery-item { position: relative; overflow: hidden; border-radius: var(--radius); cursor: pointer; background: var(--sand-200); }
.gallery-item:nth-child(6n+1) { grid-column: span 7; aspect-ratio: 16 / 10; }
.gallery-item:nth-child(6n+2) { grid-column: span 5; aspect-ratio: 4 / 3.4; }
.gallery-item:nth-child(6n+3) { grid-column: span 4; aspect-ratio: 1; }
.gallery-item:nth-child(6n+4) { grid-column: span 4; aspect-ratio: 1; }
.gallery-item:nth-child(6n+5) { grid-column: span 4; aspect-ratio: 1; }
.gallery-item:nth-child(6n+6) { grid-column: span 12; aspect-ratio: 21 / 9; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .4s; }
.gallery-item:hover img { transform: scale(1.05); filter: brightness(.85); }
.gallery-item figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 30px 20px 16px;
    background: linear-gradient(180deg, transparent, rgba(5, 29, 22, .8));
    color: var(--sand-50);
    font-size: 14px;
    transform: translateY(6px);
    opacity: .9;
    transition: .3s var(--ease);
}
.gallery-item:hover figcaption { transform: translateY(0); opacity: 1; }

/* Person cards */
.person-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    font-size: 14.5px;
    color: var(--ink);
    transition: .25s var(--ease);
}
.person-chip:hover { border-color: var(--gold-500); color: var(--emerald-800); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.person-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--emerald-700), var(--emerald-900));
    color: var(--gold-300);
    font-family: var(--font-display);
    font-size: 16px;
    flex: none;
}
.person-avatar.female { background: linear-gradient(135deg, #7b5d24, #a7832c); color: #fffdf8; }

/* Linked documents on a person page */
.person-docs { display: grid; gap: 12px; margin: 20px 0 30px; }
.person-doc {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
    transition: .25s var(--ease);
    break-inside: avoid;
}
.person-doc:hover { border-color: var(--gold-500); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.person-doc-mark {
    flex: none;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(201, 162, 39, .12);
    color: var(--gold-700);
}
.person-doc-mark svg { width: 20px; height: 20px; }
.person-doc-body { display: grid; gap: 3px; min-width: 0; }
.person-doc-body strong { font-size: 15px; color: var(--emerald-900); }
.person-doc-body small { font-size: 12px; color: var(--gold-700); font-weight: 700; }
.person-doc-body span { font-size: 13px; color: var(--muted); line-height: 1.7; }


/* --------------------------------------------------------------------------
   Prose (CMS content)
   -------------------------------------------------------------------------- */
.prose { max-width: 780px; font-size: 17.5px; line-height: 2; color: var(--ink-soft); }
.prose > p:first-of-type { font-size: 20px; color: var(--ink); }
.prose h2 {
    font-family: var(--font-display);
    font-size: 32px;
    margin: 2em 0 .65em;
    padding-bottom: .4em;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.prose h2::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 70px;
    height: 2px;
    background: var(--gold-500);
}
.prose h3 { font-size: 23px; margin: 1.6em 0 .5em; }
.prose p { margin-bottom: 1.25em; }
.prose a { text-decoration: underline; text-decoration-color: rgba(201, 162, 39, .5); text-underline-offset: 4px; }
.prose strong { color: var(--ink); }
.prose blockquote {
    position: relative;
    margin: 2.4em 0;
    padding: 30px 34px;
    background: var(--sand-100);
    border-radius: var(--radius);
    border-inline-start: 3px solid var(--gold-500);
    font-family: var(--font-display);
    font-size: 21px;
    line-height: 1.95;
    color: var(--emerald-800);
}
.prose blockquote span { display: block; margin-top: 12px; font-family: var(--font-body); font-size: 13.5px; color: var(--muted); }
.prose ul li, .prose ol li { margin-bottom: .5em; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius); box-shadow: var(--shadow); }
.prose figcaption { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 10px; }
.lineage-chain {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 1.8em 0 2.2em;
    padding: 24px;
    background: var(--sand-100);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.lineage-chain span {
    padding: 8px 15px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--emerald-800);
}
.lineage-chain i { font-style: normal; color: var(--gold-600); font-size: 15px; }
.prose .timeline-list { list-style: none; padding: 0; margin: 1.6em 0; position: relative; }
.prose .timeline-list::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    right: 7px;
    width: 1px;
    background: var(--line-strong);
}
.prose .timeline-list li {
    position: relative;
    padding: 0 32px 16px 0;
    font-size: 15.5px;
    color: var(--ink-soft);
    margin: 0;
}
.prose .timeline-list li::before {
    content: "";
    position: absolute;
    right: 1px;
    top: 8px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--gold-500);
}
.prose .timeline-list li strong { color: var(--gold-700); display: inline-block; min-width: 62px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15.5px; }
.prose th, .prose td { padding: 12px 16px; border: 1px solid var(--line); text-align: right; }
.prose th { background: var(--sand-100); color: var(--ink); }
.prose h2 { scroll-margin-top: calc(var(--header-h) + 28px); }

.reading-progress {
    position: fixed;
    inset-inline: 0;
    top: 0;
    height: 3px;
    z-index: 140;
    pointer-events: none;
}
.reading-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(270deg, var(--gold-300), var(--gold-600));
    transition: width .12s linear;
}
.reading-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.reading-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border: 1px solid rgba(232, 212, 154, .26);
    border-radius: 999px;
    background: rgba(255, 253, 248, .05);
    font-size: 12.5px;
    color: var(--gold-300);
}
.reading-meta svg { width: 15px; height: 15px; flex: none; }

.prose .history-toc {
    margin: 0 0 2.2em;
    padding: 24px 28px;
    background: var(--sand-100);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.history-toc-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-strong);
}
.history-toc-head strong { font-family: var(--font-display); font-size: 22px; color: var(--emerald-900); }
.history-toc-head small { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.prose .history-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 26px;
    counter-reset: toc;
}
.history-toc li { counter-increment: toc; margin: 0; }
.prose .history-toc a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14.5px;
    color: var(--ink-soft);
    text-decoration: none;
}
.prose .history-toc a::before {
    content: counter(toc, decimal-leading-zero);
    min-width: 22px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--gold-600);
}
.prose .history-toc a:hover { color: var(--emerald-800); }

.prose .history-glance {
    margin: 0 0 2.4em;
    padding: 22px 26px;
    background: linear-gradient(135deg, rgba(201, 162, 39, .1), rgba(201, 162, 39, .02));
    border: 1px solid rgba(201, 162, 39, .32);
    border-radius: var(--radius);
}
.prose .history-glance > strong {
    display: block;
    margin-bottom: 10px;
    font-family: var(--font-display);
    font-size: 19px;
    color: var(--emerald-900);
}
.prose .history-glance ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prose .history-glance li {
    position: relative;
    margin: 0;
    padding-inline-start: 22px;
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--ink-soft);
}
.prose .history-glance li::before {
    content: "";
    position: absolute;
    inset-inline-start: 4px;
    top: 11px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold-500);
}

.poem-figure { margin: 2.4em 0; }
.prose > .poem { margin: 2.2em 0; }
.poem {
    padding: 32px 26px;
    text-align: center;
    background: linear-gradient(180deg, rgba(201, 162, 39, .09), rgba(201, 162, 39, .03));
    border: 1px solid rgba(201, 162, 39, .35);
    border-radius: var(--radius);
}
.poem-bayt {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 30px;
    font-family: var(--font-display);
    font-size: clamp(20px, 2.4vw, 26px);
    line-height: 1.85;
    color: var(--emerald-800);
}
.poem-bayt + .poem-bayt {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(201, 162, 39, .38);
}
.poem-bayt span { display: block; }
.poem-figure figcaption { color: var(--muted); }

.prose .name-cards {
    list-style: none;
    margin: 1.3em 0 1.8em;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}
.prose .name-cards li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    padding: 14px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--gold-500);
    border-radius: 10px;
}
.prose .name-cards strong { font-size: 16.5px; color: var(--emerald-900); }
.prose .name-cards span { font-size: 12.5px; color: var(--muted); }

.history-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 2.6em 0 0;
    padding: 26px 28px;
    background: linear-gradient(135deg, rgba(201, 162, 39, .13), rgba(201, 162, 39, .04));
    border: 1px solid rgba(201, 162, 39, .38);
    border-radius: var(--radius);
}
.history-callout-kicker {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--gold-700);
}
.history-callout strong {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-display);
    font-size: 23px;
    color: var(--emerald-900);
}
.history-callout p { margin: 0; font-size: 14.5px; line-height: 1.8; color: var(--muted); }
.history-callout .btn { flex: none; }

.history-band {
    position: relative;
    overflow: hidden;
    padding: 58px 0;
    background: linear-gradient(135deg, var(--emerald-950), var(--emerald-800));
    border-block: 1px solid rgba(201, 162, 39, .3);
}
.history-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 88% 15%, rgba(201, 162, 39, .22), transparent 46%),
        radial-gradient(circle at 8% 92%, rgba(201, 162, 39, .1), transparent 42%);
    pointer-events: none;
}
.history-band-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 44px; }
.history-band h2 {
    margin: 6px 0 10px;
    font-family: var(--font-display);
    font-size: clamp(27px, 3.4vw, 38px);
    color: var(--sand-50);
}
.history-band p {
    margin: 0;
    max-width: 640px;
    font-size: 15.5px;
    line-height: 1.9;
    color: rgba(255, 253, 248, .62);
}
.history-band-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.history-band-facts span {
    padding: 6px 14px;
    border: 1px solid rgba(232, 212, 154, .28);
    border-radius: 999px;
    font-size: 12px;
    color: var(--gold-300);
}
.history-band-btn { flex: none; }

.news-history-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 34px;
    padding: 18px 24px;
    background: var(--sand-100);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.news-history-note strong { display: block; margin-bottom: 3px; font-size: 15.5px; color: var(--emerald-900); }
.news-history-note span { font-size: 13.5px; color: var(--muted); }
.news-history-note .link-arrow { flex: none; }

.aside-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.aside-timeline li {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--line);
}
.aside-timeline li:last-child { padding-bottom: 0; border-bottom: 0; }
.aside-timeline strong { font-size: 12.5px; color: var(--gold-700); }
.aside-timeline span { font-size: 13px; line-height: 1.7; color: var(--muted); }

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 64px;
    align-items: start;
}
.article-aside { position: sticky; top: calc(var(--header-h) + 28px); display: grid; gap: 22px; }
.aside-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
}
.aside-card h3 { font-size: 17px; margin-bottom: 14px; }
.aside-card p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.aside-nav { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.aside-nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 8px; font-size: 14.5px; color: var(--ink-soft); }
.aside-nav a:hover, .aside-nav a.is-active { background: var(--sand-100); color: var(--emerald-800); font-weight: 700; }
.aside-nav a span { opacity: .5; font-size: 12px; }

/* --------------------------------------------------------------------------
   Family tree
   -------------------------------------------------------------------------- */
.tree-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 34px;
    position: sticky;
    top: calc(var(--header-h) + 12px);
    z-index: 20;
    box-shadow: var(--shadow-sm);
}
.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 220px;
    background: var(--sand-50);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 18px;
}
.search-field svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-field input {
    border: 0;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    width: 100%;
    color: var(--ink);
}
.tree-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 700;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink-soft);
    border-radius: 999px;
    cursor: pointer;
    transition: .2s;
}
.tool-btn:hover, .tool-btn.is-active { background: var(--emerald-800); border-color: var(--emerald-800); color: var(--sand-50); }

.tree-canvas {
    position: relative;
    background:
        radial-gradient(circle at 50% 0%, rgba(201, 162, 39, .07), transparent 40%),
        var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 48px 30px 40px;
    overflow-x: auto;
    cursor: grab;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 162, 39, .5) transparent;
    -webkit-overflow-scrolling: touch;
}
.tree-canvas.is-panning { cursor: grabbing; user-select: none; }
.tree-root, .tree-branch, .tree-children { list-style: none; margin: 0; padding: 0; }
.tree-root { display: flex; flex-direction: column; align-items: center; min-width: max-content; }
.tree-node { display: flex; flex-direction: column; align-items: center; position: relative; }
.tree-children {
    display: flex;
    justify-content: center;
    gap: 26px;
    padding-top: 34px;
    position: relative;
}
.tree-children > li { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 18px; }
.tree-children > li::before {
    content: "";
    position: absolute;
    top: 0;
    right: 50%;
    height: 18px;
    border-right: 1px solid var(--line-strong);
}
.tree-children::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--line-strong);
}
.tree-children > li:first-child::after,
.tree-children > li:last-child::after {
    content: "";
    position: absolute;
    top: 0;
    width: 50%;
    height: 1px;
    background: var(--sand-50);
}
.tree-children > li:first-child::after { right: 0; }
.tree-children > li:last-child::after { left: 0; }
.tree-children > li:only-child::after { display: none; }
.tree-node > .tree-children { padding-top: 30px; }
.tree-node > .tree-children::before { display: none; }
.tree-card {
    position: relative;
    width: 210px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: border-color .25s, box-shadow .25s, transform .25s;
}
.tree-card:hover { border-color: var(--gold-500); box-shadow: var(--shadow); transform: translateY(-2px); }
.tree-card .gen-tag {
    display: inline-block;
    font-size: 10.5px;
    letter-spacing: .08em;
    color: var(--gold-700);
    background: rgba(201, 162, 39, .1);
    border-radius: 999px;
    padding: 2px 8px;
    margin-bottom: 6px;
}
.tree-card a { display: block; font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.55; }
.tree-card a:hover { color: var(--emerald-700); }
.tree-card .tree-years { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.tree-card .tree-title { font-size: 11.5px; color: var(--gold-700); margin-top: 3px; }
.tree-card.is-female { border-color: rgba(176, 138, 38, .3); }
.tree-card.is-match { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(201, 162, 39, .18), var(--shadow); }
.tree-card.is-descendant { background: rgba(201, 162, 39, .06); }
.tree-card.is-dim { opacity: .35; }
.tree-toggle {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--emerald-800);
    color: var(--sand-50);
    border: 2px solid var(--paper);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .2s, transform .2s;
}
.tree-toggle:hover { background: var(--gold-600); }
.tree-card.collapsed .tree-toggle { transform: translateX(-50%) rotate(-90deg); }
.tree-node > .tree-children[hidden] { display: none; }
.tree-legend { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; color: var(--muted); margin-top: 26px; justify-content: center; }
.tree-legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--emerald-700); }
.legend-dot.gold { background: var(--gold-500); }

.tree-empty { text-align: center; padding: 40px; color: var(--muted); }

/* سجل أفراد العائلة (members.php) — عرض وطباعة فقط */
.gen-badge { display: inline-block; min-width: 62px; text-align: center; padding: 3px 12px; border-radius: 999px; color: #fff; font-size: 12.5px; font-weight: 700; }
.members-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.members-table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.members-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 720px; }
.members-table th, .members-table td { padding: 13px 16px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
.members-table thead th { background: var(--sand-100); font-weight: 700; font-size: 13.5px; color: var(--emerald-900); }
.members-table tbody tr:last-child td { border-bottom: 0; }
.members-table tbody tr:hover td { background: var(--sand-50); }
.members-table .num { width: 46px; text-align: center; color: var(--muted); }
.members-table .nowrap { white-space: nowrap; }
.members-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.members-alive { display: inline-block; padding: 2px 12px; border-radius: 999px; background: #e5f3ea; color: #14663d; font-size: 12.5px; font-weight: 700; }
.members-deceased { display: inline-block; padding: 2px 12px; border-radius: 999px; background: #f3ecda; color: #7a6210; font-size: 12.5px; font-weight: 700; }
.members-pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 22px; font-size: 14px; color: var(--muted); }
.root-note { background: #faf3df; border: 1px solid var(--gold-300); color: #6b5510; border-radius: var(--radius); padding: 14px 18px; font-size: 14.5px; margin-bottom: 20px; }
.root-note a { color: var(--emerald-700); font-weight: 700; text-decoration: underline dotted; margin-inline-start: 8px; }
@media (max-width: 720px) {
    .members-toolbar { flex-direction: column; align-items: stretch; }
}

/* Person profile */
.person-hero { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: start; }
.person-seal {
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--emerald-700), var(--emerald-950));
    display: grid;
    place-items: center;
    color: var(--gold-300);
    font-family: var(--font-display);
    font-size: 72px;
    border: 1px solid rgba(232, 212, 154, .35);
    box-shadow: var(--shadow);
    position: relative;
}
.person-seal::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px solid rgba(232, 212, 154, .3);
}
.person-seal.has-photo { overflow: hidden; background: var(--sand-100); }
.person-seal.has-photo::before { z-index: 3; pointer-events: none; }
.person-seal.has-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.hero-print { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn-wa { --btn-bg: #1fa855; --btn-fg: #fff; --btn-border: #1fa855; }
.btn-wa:hover { --btn-bg: #178a45; box-shadow: 0 14px 30px -14px rgba(23, 138, 69, .6); }
.btn[data-busy], .doc-tab[data-busy] { opacity: .65; cursor: progress; }
.print-brand, .print-foot, .print-dates { display: none; }
.person-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 26px; }
.person-fact { background: var(--paper); padding: 16px 18px; }
.person-fact span { display: block; font-size: 11.5px; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
.person-fact strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.relation-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* --------------------------------------------------------------------------
   Timeline (origins)
   -------------------------------------------------------------------------- */
.timeline { position: relative; margin-top: 40px; }
.timeline::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    right: 19px;
    width: 1px;
    background: linear-gradient(180deg, var(--gold-500), var(--line) 85%);
}
.timeline-item { position: relative; padding: 0 64px 44px 0; }
.timeline-item::before {
    content: "";
    position: absolute;
    right: 12px;
    top: 6px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--gold-500);
    box-shadow: 0 0 0 4px var(--sand-50);
}
.timeline-year {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--gold-700);
    margin-bottom: 4px;
}
.timeline-item h3 { font-size: 21px; margin-bottom: 6px; }
.timeline-item p { font-size: 15.5px; color: var(--muted); margin: 0; max-width: 640px; }

/* --------------------------------------------------------------------------
   Locations
   -------------------------------------------------------------------------- */
.map-card { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 420px; box-shadow: var(--shadow); }
.map-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.map-card-overlay {
    position: relative;
    z-index: 2;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 34px;
    color: var(--sand-50);
    background: linear-gradient(180deg, rgba(5, 29, 22, .1), rgba(5, 29, 22, .88));
}
.map-card-overlay h3 { font-family: var(--font-display); font-size: 30px; color: var(--sand-50); }
.map-card-overlay p { color: rgba(255, 253, 248, .8); font-size: 15px; margin: 0; }
.location-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.location-row {
    display: grid;
    grid-template-columns: 170px 1fr auto;
    gap: 24px;
    align-items: baseline;
    padding: 22px 4px;
    border-bottom: 1px solid var(--line);
    transition: background .25s, padding .25s;
}
.location-row:hover { background: var(--paper); padding-inline: 18px; }
.location-row h3 { font-size: 19px; margin: 0; }
.location-row h3 small { display: block; font-size: 12px; font-weight: 400; color: var(--gold-700); letter-spacing: .04em; margin-top: 2px; }
.location-row p { margin: 0; font-size: 15px; color: var(--muted); }
.location-tag { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Memorial / deceased
   -------------------------------------------------------------------------- */
.memorial-hero {
    background:
        linear-gradient(180deg, rgba(5, 29, 22, .93), rgba(5, 29, 22, .72)),
        url('../img/memorial.jpg') center 35% / cover no-repeat;
}
.memorial-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.memorial-card {
    position: relative;
    background: rgba(255, 253, 248, .04);
    border: 1px solid rgba(232, 212, 154, .16);
    border-radius: var(--radius);
    padding: 30px 28px;
    color: rgba(255, 253, 248, .72);
    transition: .35s var(--ease);
    overflow: hidden;
}
.memorial-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(201, 162, 39, .14), transparent 55%);
    opacity: 0;
    transition: opacity .4s;
    pointer-events: none;
}
.memorial-card:hover { border-color: rgba(232, 212, 154, .45); transform: translateY(-4px); }
.memorial-card:hover::before { opacity: 1; }
.memorial-card .mem-year {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--gold-300);
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.memorial-card .mem-year::after { content: ""; flex: 1; height: 1px; background: rgba(232, 212, 154, .22); }
.memorial-card h3 { font-family: var(--font-display); font-size: 25px; color: var(--sand-50); margin-bottom: 6px; }
.memorial-card .mem-title { font-size: 13px; color: var(--gold-300); margin-bottom: 14px; }
.memorial-card p { font-size: 14.5px; line-height: 1.9; color: rgba(255, 253, 248, .62); margin-bottom: 20px; }
.memorial-card .mem-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fatiha-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(232, 212, 154, .35);
    color: var(--gold-300);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: .25s;
}
.fatiha-btn:hover { background: rgba(232, 212, 154, .12); border-color: var(--gold-300); }

.fatiha-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(5, 29, 22, .88);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.fatiha-modal.is-open { opacity: 1; visibility: visible; }
.fatiha-box {
    width: min(620px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: linear-gradient(180deg, #0c3528, #08281f);
    border: 1px solid rgba(232, 212, 154, .3);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    text-align: center;
    color: rgba(255, 253, 248, .8);
    transform: translateY(16px) scale(.98);
    transition: transform .35s var(--ease);
    position: relative;
}
.fatiha-modal.is-open .fatiha-box { transform: translateY(0) scale(1); }
.fatiha-box .fatiha-name { font-size: 13px; color: var(--gold-300); letter-spacing: .06em; margin-bottom: 20px; }
.fatiha-box h2 { font-family: var(--font-display); font-size: 30px; color: var(--sand-50); margin-bottom: 22px; }
.fatiha-box p { font-family: var(--font-display); font-size: 21px; line-height: 2.2; color: rgba(255, 253, 248, .88); }
.fatiha-box .fatiha-dua { font-family: var(--font-body); font-size: 14px; color: rgba(255, 253, 248, .55); margin-top: 24px; }
.fatiha-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(232, 212, 154, .3);
    background: transparent;
    color: var(--gold-300);
    font-size: 20px;
    cursor: pointer;
}
.fatiha-close:hover { background: rgba(232, 212, 154, .12); }

/* --------------------------------------------------------------------------
   Donations
   -------------------------------------------------------------------------- */
.donate-hero {
    background:
        linear-gradient(180deg, rgba(5, 29, 22, .9), rgba(5, 29, 22, .62)),
        url('../img/oasis.jpg') center 40% / cover no-repeat;
}
.campaign-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    box-shadow: var(--shadow);
}
.campaign-media { position: relative; min-height: 360px; background: var(--sand-200); }
.campaign-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.campaign-body { padding: 42px; display: flex; flex-direction: column; justify-content: center; }
.campaign-body h2 { font-family: var(--font-display); font-size: 32px; margin-bottom: 12px; }
.campaign-body p { font-size: 15.5px; color: var(--muted); }
.progress-wrap { margin: 20px 0 8px; }
.progress-bar {
    height: 10px;
    border-radius: 999px;
    background: var(--sand-200);
    overflow: hidden;
    position: relative;
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold-600), var(--gold-400));
    width: 0;
    transition: width 1.4s var(--ease);
    position: relative;
}
.progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    animation: progressShine 2.6s infinite;
}
@keyframes progressShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress-meta { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.progress-meta strong { color: var(--emerald-800); }

.trust-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; }
.trust-item { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.trust-item svg { width: 18px; height: 18px; color: var(--gold-600); }

.donate-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 46px; align-items: start; }
.donate-form-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}
.form-section-title {
    font-family: var(--font-display);
    font-size: 24px;
    margin: 0 0 6px;
}
.form-section-sub { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.amount-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.amount-preset {
    padding: 14px 8px;
    text-align: center;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--sand-50);
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    cursor: pointer;
    transition: .2s;
}
.amount-preset:hover { border-color: var(--gold-500); }
.amount-preset.is-active { background: var(--emerald-800); border-color: var(--emerald-800); color: var(--sand-50); }
.amount-preset small { display: block; font-size: 11px; font-weight: 400; opacity: .65; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.field label .req { color: var(--gold-600); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
    width: 100%;
    padding: 13px 16px;
    font-family: inherit;
    font-size: 15.5px;
    color: var(--ink);
    background: var(--sand-50);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--emerald-600);
    box-shadow: 0 0 0 3px rgba(20, 86, 63, .12);
    background: var(--paper);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.checkbox-line { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.checkbox-line input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--emerald-700); }
.form-note {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--sand-100);
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 22px;
}
.form-note svg { flex: none; width: 18px; height: 18px; color: var(--gold-600); margin-top: 2px; }
.alert {
    display: flex;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 22px;
    border: 1px solid;
    line-height: 1.7;
}
.alert svg { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.alert-error { background: #fdf1f1; border-color: #efcfcf; color: #8c2f2f; }
.alert-success { background: #f0f7f1; border-color: #cfe6d4; color: #1f6138; }
.alert-info { background: #f4f2e9; border-color: #e5ddc3; color: #6f5a20; }
.alert-warning { background: #fcf6ea; border-color: #eeddb6; color: #7c5c14; }

.donate-summary {
    background: var(--emerald-950);
    color: rgba(255, 253, 248, .78);
    border-radius: var(--radius-lg);
    padding: 34px;
    position: sticky;
    top: calc(var(--header-h) + 24px);
    overflow: hidden;
}
.donate-summary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, rgba(201, 162, 39, .18), transparent 55%);
    pointer-events: none;
}
.donate-summary h3 { color: var(--sand-50); font-family: var(--font-display); font-size: 24px; position: relative; }
.donate-summary .summary-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(255, 253, 248, .1); font-size: 14px; position: relative; }
.donate-summary .summary-row.total { border-bottom: 0; padding-top: 18px; }
.donate-summary .summary-row.total strong { font-size: 26px; color: var(--gold-300); font-family: var(--font-display); }
.donate-summary .summary-note { font-size: 12px; color: rgba(255, 253, 248, .45); margin-top: 18px; position: relative; }
.tadawul-mark {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 253, 248, .07);
    border: 1px solid rgba(255, 253, 248, .14);
    font-weight: 700;
    color: var(--sand-50);
    font-size: 14px;
    margin-bottom: 18px;
    position: relative;
}
.tadawul-mark span { color: var(--gold-300); font-size: 11px; font-weight: 400; }

.donation-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.donation-table th, .donation-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: right; }
.donation-table th { font-size: 12.5px; color: var(--muted); font-weight: 700; background: var(--sand-100); }
.donation-table td strong { color: var(--ink); }
.donation-table .amount { color: var(--emerald-800); font-weight: 700; white-space: nowrap; }

.return-box {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 54px 44px;
    box-shadow: var(--shadow);
}
.return-icon {
    width: 86px;
    height: 86px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(201, 162, 39, .12);
    color: var(--gold-600);
}
.return-icon svg { width: 40px; height: 40px; }
.return-icon.success { background: rgba(31, 97, 56, .1); color: #1f6138; }
.return-icon.pending { background: rgba(176, 138, 38, .12); color: var(--gold-700); }
.return-icon.fail { background: #fdf1f1; color: #8c2f2f; }
.return-box h1 { font-family: var(--font-display); font-size: 34px; }
.return-box p { color: var(--muted); }
.return-ref {
    display: inline-block;
    margin: 16px 0 24px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--sand-100);
    font-family: monospace;
    font-size: 13px;
    color: var(--ink);
    direction: ltr;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 380px 1fr; gap: 52px; align-items: start; }
.contact-info { display: grid; gap: 15px; }
.info-card {
    display: flex;
    gap: 16px;
    padding: 22px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.info-icon {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(11, 50, 39, .06);
    color: var(--emerald-700);
}
.info-icon svg { width: 21px; height: 21px; }
.info-card h3 { font-size: 15px; margin: 0 0 3px; }
.info-card p, .info-card a { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.7; }

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */
.search-hero { padding: 62px 0; background: var(--emerald-950); color: var(--sand-50); }
.search-form-lg {
    display: flex;
    gap: 10px;
    max-width: 760px;
    margin-top: 26px;
}
.search-form-lg .input { background: rgba(255, 253, 248, .08); border-color: rgba(255, 253, 248, .24); color: var(--sand-50); padding: 16px 20px; }
.search-form-lg .input::placeholder { color: rgba(255, 253, 248, .4); }
.search-form-lg .input:focus { background: rgba(255, 253, 248, .12); }
.search-result {
    display: block;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
    color: inherit;
}
.search-result:hover { color: inherit; }
.search-result:hover h3 { color: var(--emerald-700); }
.search-result .badge { margin-bottom: 10px; }
.search-result h3 { font-size: 21px; margin-bottom: 6px; transition: color .2s; }
.search-result p { font-size: 14.5px; color: var(--muted); margin: 0; }
mark { background: rgba(201, 162, 39, .25); color: inherit; padding: 0 2px; border-radius: 3px; }

/* --------------------------------------------------------------------------
   Pagination / empty
   -------------------------------------------------------------------------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 46px; align-items: center; }
.page-link {
    min-width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-soft);
    background: var(--paper);
}
.page-link:hover { border-color: var(--gold-500); color: var(--emerald-800); }
.page-link.is-active { background: var(--emerald-800); border-color: var(--emerald-800); color: var(--sand-50); }
.page-dots { color: var(--muted); padding: 0 6px; }
.empty-state {
    text-align: center;
    padding: 72px 24px;
    color: var(--muted);
    background: var(--paper);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}
.empty-state svg { width: 48px; height: 48px; color: var(--gold-500); opacity: .6; margin: 0 auto 16px; }
.empty-state h3 { font-family: var(--font-display); font-size: 25px; color: var(--ink); }
.empty-state p { margin-bottom: 20px; }

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band {
    position: relative;
    overflow: hidden;
    background: var(--emerald-900);
    color: rgba(255, 253, 248, .78);
    padding: 72px 0;
    isolation: isolate;
}
.cta-band::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 85% 20%, rgba(201, 162, 39, .2), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(201, 162, 39, .1), transparent 40%);
}
.cta-band-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.cta-band h2 { font-family: var(--font-display); font-size: clamp(28px, 3.6vw, 40px); color: var(--sand-50); margin-bottom: 8px; }
.cta-band p { margin: 0; color: rgba(255, 253, 248, .65); font-size: 16px; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--emerald-950); color: rgba(255, 253, 248, .6); position: relative; }
.site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 39, .5), transparent);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 48px;
    padding: 72px 0 56px;
}
.footer-brand .brand { margin-bottom: 18px; }
.footer-brand .brand-text strong { color: var(--sand-50); }
.footer-brand .brand-text small { color: rgba(255, 253, 248, .45); }
.footer-brand p { font-size: 14px; line-height: 1.9; color: rgba(255, 253, 248, .5); margin-bottom: 22px; }
.footer-seo { margin-top: -12px; }
.footer-seo a { color: rgba(255, 253, 248, .78); border-bottom: 1px dotted var(--gold-500); }
.footer-seo a:hover { color: var(--gold-500); }
.footer-col h3 {
    font-size: 14px;
    letter-spacing: .08em;
    color: var(--gold-300);
    margin-bottom: 18px;
    font-weight: 700;
}
.footer-col a { display: block; font-size: 14px; color: rgba(255, 253, 248, .58); padding: 5px 0; }
.footer-col a:hover { color: var(--gold-300); }
.footer-contact p { display: flex; gap: 10px; font-size: 13.5px; color: rgba(255, 253, 248, .58); margin-bottom: 12px; line-height: 1.7; }
.footer-contact p span { color: rgba(255, 253, 248, .3); min-width: 44px; font-size: 12px; padding-top: 2px; }
.footer-contact a { display: inline; padding: 0; color: rgba(255, 253, 248, .7); }
.footer-social { display: flex; gap: 9px; }
.footer-social a {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 253, 248, .16);
    border-radius: 50%;
    font-size: 12px;
    color: rgba(255, 253, 248, .65);
    transition: .25s;
}
.footer-social a:hover { background: var(--gold-500); border-color: var(--gold-500); color: var(--emerald-950); }
.footer-tadawul {
    margin-top: 20px;
    padding: 14px 18px;
    border: 1px solid rgba(232, 212, 154, .2);
    border-radius: 12px;
    background: rgba(232, 212, 154, .04);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.footer-tadawul small { font-size: 10.5px; color: rgba(255, 253, 248, .4); }
.footer-tadawul strong { font-size: 17px; color: var(--gold-300); letter-spacing: .02em; }
.footer-tadawul span { font-size: 10.5px; color: rgba(255, 253, 248, .4); }
.footer-bottom { border-top: 1px solid rgba(255, 253, 248, .08); }
.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 0;
    font-size: 12.5px;
    color: rgba(255, 253, 248, .38);
    flex-wrap: wrap;
}
.footer-bottom-inner p { margin: 0; }
.footer-motto { font-family: var(--font-display); font-size: 14.5px; color: rgba(232, 212, 154, .6); }
.footer-bottom-inner a { color: rgba(255, 253, 248, .5); }

/* --------------------------------------------------------------------------
   Floating UI
   -------------------------------------------------------------------------- */
.to-top {
    position: fixed;
    bottom: 26px;
    left: 26px;
    z-index: 90;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(232, 212, 154, .4);
    background: var(--emerald-900);
    color: var(--gold-300);
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: .3s var(--ease);
    box-shadow: var(--shadow);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--gold-500); color: var(--emerald-950); }

/* Toasts */
.toast-stack {
    position: fixed;
    top: 96px;
    left: 24px;
    z-index: 500;
    display: grid;
    gap: 10px;
    max-width: 380px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--emerald-600);
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-size: 14px;
    color: var(--ink);
    animation: toastIn .4s var(--ease);
}
.toast-success { border-inline-start-color: #2c7a4b; }
.toast-error { border-inline-start-color: var(--danger); }
.toast-warning { border-inline-start-color: var(--gold-600); }
.toast-close { margin-inline-start: auto; border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(4, 22, 17, .94);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity .3s;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 22px;
    color: rgba(255, 253, 248, .8);
    font-size: 14px;
}
.lightbox-tools { display: flex; gap: 8px; }
.lightbox-tools button, .lightbox-nav {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 253, 248, .22);
    background: rgba(255, 253, 248, .06);
    color: var(--sand-50);
    font-size: 18px;
    cursor: pointer;
    transition: .2s;
}
.lightbox-tools button:hover, .lightbox-nav:hover { background: rgba(255, 253, 248, .16); }
.lightbox-stage { flex: 1; overflow: auto; display: grid; place-items: center; padding: 10px 70px 30px; }
.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transition: transform .3s; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lightbox-stage img.zoomed { transform: scale(1.6); cursor: zoom-out; }
.lightbox-nav { position: fixed; top: 50%; transform: translateY(-50%); z-index: 2; }
.lightbox-nav.prev { right: 18px; }
.lightbox-nav.next { left: 18px; }

/* --------------------------------------------------------------------------
   Reveal animations
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */
.not-found {
    min-height: 70vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 80px 24px;
}
.not-found .code {
    font-family: var(--font-display);
    font-size: clamp(110px, 18vw, 200px);
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(201, 162, 39, .5);
    background: linear-gradient(180deg, rgba(201, 162, 39, .18), transparent);
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 12px;
}
.not-found h1 { font-family: var(--font-display); font-size: 34px; }
.not-found p { color: var(--muted); max-width: 460px; margin-inline: auto; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
    .nav-link { padding: 10px 9px; font-size: 14px; }
    .header-cta { display: none; }
    .explore-grid { gap: 34px; }
    .article-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 40px; }
}

@media (max-width: 1024px) {
    .topbar-note { display: none; }
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed;
        inset: calc(var(--header-h) + 42px) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        padding: 16px 20px 26px;
        gap: 2px;
        max-height: calc(100vh - var(--header-h) - 42px);
        overflow-y: auto;
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: .25s var(--ease);
        box-shadow: var(--shadow);
    }
    .main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
    .nav-link { padding: 13px 12px; font-size: 16px; justify-content: space-between; }
    .nav-link::after { display: none; }
    .nav-link.is-active { background: var(--sand-100); }
    .nav-item { width: 100%; }
    .nav-drop-toggle { width: 100%; }
    .nav-dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        border: 0;
        background: var(--sand-50);
        padding: 4px 10px;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        border-radius: 10px;
        margin-bottom: 6px;
    }
    .nav-dropdown::before { display: none; }
    .nav-item.open .nav-dropdown { display: block; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .split { gap: 40px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 38px; }
    .contact-grid { grid-template-columns: 1fr; }
    .donate-layout { grid-template-columns: 1fr; }
    .donate-summary { position: static; }
    .article-layout { grid-template-columns: 1fr; }
    .article-aside { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (max-width: 860px) {
    .section { padding: 70px 0; }
    .container { width: calc(100% - 36px); }
    .hero-inner { padding: 120px 0 70px; }
    .hero-frame { inset: 12px; }
    .hero-scroll { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(3)::before { display: none; }
    .stat:nth-child(odd)::before { display: none; }
    .stat + .stat:nth-child(even)::before { display: block; }
    .stat:nth-child(5) { grid-column: 1 / -1; }
    .stat:nth-child(5)::after { content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 1px; background: var(--line); }
    .explore-grid { grid-template-columns: 1fr; }
    .explore-panels { min-height: 420px; }
    .tab-nav { flex-direction: row; overflow-x: auto; border-top: 0; gap: 8px; padding-bottom: 6px; }
    .tab-btn { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; gap: 8px; }
    .tab-btn::before { display: none; }
    .tab-btn[aria-selected="true"] { padding-right: 18px; background: var(--emerald-800); }
    .tab-btn[aria-selected="true"] .tab-label strong { color: var(--sand-50); }
    .tab-btn[aria-selected="true"] .tab-label small { color: rgba(255, 253, 248, .55); }
    .tab-btn[aria-selected="true"] .tab-num { color: var(--gold-300); }
    .tab-btn svg.tab-arrow { display: none; }
    .tab-label small { display: none; }
    .split { grid-template-columns: 1fr; gap: 30px; }
    .split.reverse .split-media { order: 0; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .news-card { grid-template-columns: 1fr; }
    .news-card .card-media { min-height: 220px; }
    .news-card .card-body { padding: 26px; }
    .campaign-card { grid-template-columns: 1fr; }
    .campaign-media { min-height: 260px; }
    .campaign-body { padding: 30px; }
    .cta-band-inner { flex-direction: column; text-align: center; }
    .history-band { padding: 46px 0; }
    .history-band-inner { flex-direction: column; align-items: flex-start; gap: 22px; }
    .history-band .eyebrow { color: var(--gold-300); }
    .prose .history-toc ol { grid-template-columns: 1fr; }
    .history-toc { padding: 20px 22px; }
    .poem { padding: 24px 18px; }
    .poem-bayt { grid-template-columns: 1fr; gap: 2px; }
    .history-callout { flex-direction: column; align-items: flex-start; }
    .news-history-note { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-hero-inner { padding: 64px 0 54px; }
    .person-hero { grid-template-columns: 1fr; }
    .person-seal { width: 160px; }
    .location-row { grid-template-columns: 1fr; gap: 6px; }
    .location-tag { justify-self: start; }
    .footer-grid { padding: 52px 0 40px; }
    .gallery-grid { grid-template-columns: repeat(6, 1fr); }
    .gallery-item:nth-child(6n+1), .gallery-item:nth-child(6n+2), .gallery-item:nth-child(6n+6) { grid-column: span 6; aspect-ratio: 16 / 10; }
    .gallery-item:nth-child(6n+3), .gallery-item:nth-child(6n+4), .gallery-item:nth-child(6n+5) { grid-column: span 3; aspect-ratio: 1; }
    .tree-canvas { padding: 30px 16px; }
    .tree-card { width: 180px; }
    .tree-children { gap: 16px; }
    .toast-stack { left: 14px; right: 14px; max-width: none; top: 84px; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    .topbar-links a span, .topbar-links a:nth-child(3) { display: none; }
    .topbar-inner { min-height: 38px; }
    .header-inner { min-height: 68px; gap: 12px; }
    :root { --header-h: 68px; }
    .brand-mark { width: 40px; height: 40px; }
    .brand-text strong { font-size: 16.5px; }
    .brand-text small { display: none; }
    .hero { min-height: 88vh; }
    .hero-title { font-size: clamp(38px, 11vw, 54px); }
    .hero-actions .btn { width: 100%; }
    .stats-strip { margin-top: -40px; }
    .stat { padding: 22px 14px; }
    .stat-num { font-size: 32px; }
    .stat-label { font-size: 12.5px; }
    .section-head { margin-bottom: 36px; }
    .explore-panels { min-height: 400px; }
    .tab-panel { padding: 26px; }
    .tab-panel h3 { font-size: 25px; }
    .tab-panel p { font-size: 14px; }
    .amount-presets { grid-template-columns: repeat(2, 1fr); }
    .field-row { grid-template-columns: 1fr; }
    .donate-form-card, .return-box { padding: 26px 22px; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom-inner { flex-direction: column; text-align: center; gap: 8px; }
    .gallery-grid { gap: 10px; }
    .gallery-item:nth-child(6n+3), .gallery-item:nth-child(6n+4), .gallery-item:nth-child(6n+5) { grid-column: span 6; }
    .lightbox-stage { padding: 10px 14px 20px; }
    .lightbox-nav.prev { right: 8px; }
    .lightbox-nav.next { left: 8px; }
    .to-top { bottom: 16px; left: 16px; }
    .tree-toolbar { position: static; padding: 14px; }
    .prose { font-size: 16.5px; }
    .prose blockquote { padding: 22px; font-size: 19px; }
    .search-form-lg { flex-direction: column; }
    .fatiha-box { padding: 34px 22px; }
    .fatiha-box p { font-size: 18px; }
}

/* Print */
@media print {
    @page { size: A4; margin: 15mm 13mm; }
    .topbar, .site-header, .site-footer, .to-top, .hero-scroll, .cta-band, .toast-stack,
    .skip-link, .fatiha-modal, .lightbox, .no-print, .breadcrumb, .page-hero-bg,
    .reading-progress, .reading-meta, .history-toc, .history-callout, .history-band,
    .news-history-note, .article-aside { display: none !important; }
    body { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .page-hero { color: #000; background: #fff !important; overflow: visible; }
    .page-hero::before { display: none; }
    .page-hero h1 { color: #000; font-size: 32px; margin-bottom: 8px; }
    .page-hero p { color: #444; font-size: 13px; }
    .page-hero-inner { padding: 0 0 14px; border-bottom: 2px solid var(--gold-500); max-width: none; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    .container { max-width: none; padding: 0; }
    .section { padding: 20px 0 0 !important; }
    .prose { max-width: none; font-size: 12.5pt; line-height: 1.9; color: #222; }
    .prose > p:first-of-type { font-size: 13.5pt; color: #000; }
    .prose h2 { font-size: 18pt; margin: 1.2em 0 .45em; break-after: avoid; }
    .prose p { margin-bottom: 1em; }
    .prose a, a { color: #000; text-decoration: none; }
    .page-person .person-hero { display: flex; gap: 8mm; align-items: flex-start; margin-top: 6mm; }
    .page-person .person-seal { width: 30mm; flex: 0 0 30mm; font-size: 30px; box-shadow: none; break-inside: avoid; }
    .page-person .person-seal::before { inset: 2mm; }
    .page-person .person-facts { display: none !important; }
    .page-person .print-dates { display: block; font-size: 12pt; color: #333; margin-top: 4px; }
    .page-person .relation-line, .page-person .article-aside { display: none !important; }
    .page-person .article-layout { display: block; margin-top: 7mm !important; }
    .page-person .person-chip { padding: 3px 12px; font-size: 11.5pt; background: #fff; break-inside: avoid; }
    .page-person .person-docs { gap: 2.5mm; margin: 3mm 0 0; }
    .page-person .person-doc { padding: 2.5mm 3mm; background: #fff; border-color: #e3dcc8; box-shadow: none; }
    .page-person .person-doc-mark { display: none; }
    .page-person .person-doc-body strong { color: #000; font-size: 11.5pt; }
    .page-person .person-doc-body small, .page-person .person-doc-body span { color: #444; font-size: 9.5pt; }
    .page-person .person-avatar { display: none; }
    .page-person .print-brand { display: block; margin: 0 0 10px; font-size: 11px; letter-spacing: .08em; color: #666; }
    .page-person .print-foot { display: block; margin-top: 10mm; padding-top: 3mm; border-top: 1px solid #ccc; font-size: 9pt; color: #666; }
}
