:root {
    --green-900: #0b342f;
    --green-800: #0f4f44;
    --green-700: #136353;
    --gold-600: #b89442;
    --gold-500: #c3a25a;
    --ink: #172420;
    --muted: #5a6864;
    --paper: #f6f2e8;
    --paper-deep: #ebe3d2;
    --white: #fffdf8;
    --border: rgba(184, 148, 66, .32);
    --shadow: 0 18px 46px rgba(11, 52, 47, .13);
    --radius: 8px;
    --container: min(1180px, calc(100% - 32px));
}

* { box-sizing: border-box; }

html {
    direction: rtl;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding-top: 132px;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(15, 79, 68, .045) 25%, transparent 25%) 0 0 / 28px 28px,
        linear-gradient(225deg, rgba(184, 148, 66, .05) 25%, transparent 25%) 0 0 / 28px 28px,
        var(--paper);
    font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.85;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }
button { border: 1px solid #f0730f; border-radius: var(--radius); background: #f0730f; color: white; padding: 10px 18px; font-weight: 800; cursor: pointer; transition: background .2s, color .2s; }
button:hover, button:focus { background: white; color: #f0730f; outline: none; }

.container { width: var(--container); margin-inline: auto; min-width: 0; }
.ltr-value, .contact-value[dir="ltr"] { direction: ltr; unicode-bidi: isolate; display: inline-block; text-align: left; }
.sr-only, .honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; inset-block-start: 12px; inset-inline-start: 12px; z-index: 20; transform: translateY(-140%); background: var(--green-900); color: white; padding: 8px 14px; border-radius: var(--radius); }
.skip-link:focus { transform: none; }

.site-header {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 10;
    background: rgba(255, 253, 248, .94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 79, 68, .12);
}

.topbar { background: var(--green-900); color: #f6edd8; font-size: .92rem; }
.topbar__inner, .header-main, .language-switcher, .brand, .primary-nav { display: flex; align-items: center; }
.topbar__inner { justify-content: space-between; min-height: 38px; gap: 16px; }
.language-switcher { gap: 12px; }
.language-switcher a[aria-current="true"] { color: #f0730f; }

.header-main { min-height: 94px; justify-content: space-between; gap: 22px; }
.brand { gap: 14px; min-width: 260px; }
.brand img { width: 76px; height: 76px; object-fit: contain; border: 1px solid var(--border); background: white; padding: 4px; border-radius: var(--radius); }
.brand strong { display: block; color: var(--green-800); font-size: 1.22rem; line-height: 1.35; }
.brand small { display: block; color: var(--muted); font-size: .9rem; line-height: 1.5; }

.primary-nav { gap: 2px; justify-content: flex-end; flex-wrap: wrap; }
.nav-link { padding: 8px 10px; border-radius: var(--radius); color: var(--green-900); font-weight: 700; font-size: .96rem; }
.nav-link:hover, .nav-link:focus, .nav-link.is-active { background: rgba(195, 162, 90, .16); color: var(--green-800); outline: none; }

.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--border); background: var(--white); border-radius: var(--radius); }
.menu-toggle span:not(.sr-only) { display: block; width: 22px; height: 2px; margin: 5px auto; background: var(--green-900); }

.hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(11, 52, 47, .94), rgba(15, 79, 68, .88)),
        var(--green-900);
    color: white;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .12;
    background-image:
        linear-gradient(30deg, transparent 44%, #fff 45%, transparent 46%),
        linear-gradient(150deg, transparent 44%, #fff 45%, transparent 46%);
    background-size: 42px 42px;
}

.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) 320px; gap: 46px; align-items: center; min-height: 430px; padding-block: 64px; }
.eyebrow { margin: 0 0 8px; color: #f0730f; font-weight: 800; letter-spacing: 0; }
.hero h1, .section h2, .site-footer h2 { font-family: "Amiri", "Times New Roman", serif; line-height: 1.45; margin: 0; }
.hero h1 { font-size: clamp(2rem, 5vw, 4rem); max-width: 820px; }
.hero p:not(.eyebrow) { max-width: 760px; margin: 14px 0 0; color: #f7eedc; font-size: 1.18rem; }
.hero__mark { justify-self: center; width: 270px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid rgba(195, 162, 90, .5); border-radius: 50%; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 16px rgba(255,255,255,.035); }
.hero__seal { color: #f4dd9b; text-align: center; font-family: "Amiri", serif; font-size: 2rem; line-height: 1.6; }

.search-panel { margin-top: 28px; max-width: 720px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.24); padding: 14px; border-radius: var(--radius); }
.search-panel label { display: block; color: #fff8e9; margin-bottom: 8px; font-weight: 700; }
.search-panel__control { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.search-panel input, .contact-form input, .contact-form textarea { width: 100%; border: 1px solid rgba(15, 79, 68, .2); border-radius: var(--radius); padding: 11px 13px; background: var(--white); color: var(--ink); }
.search-panel button, .contact-form button { border: 1px solid #f0730f; border-radius: var(--radius); background: #f0730f; color: white; padding: 11px 18px; font-weight: 800; cursor: pointer; }
.search-panel button:hover, .search-panel button:focus, .contact-form button:hover, .contact-form button:focus { background: white; color: #f0730f; outline: none; }
.institution-card a { border: 0; border-radius: var(--radius); background: var(--gold-600); color: white; padding: 11px 18px; font-weight: 800; cursor: pointer; }
.search-results { color: #fff8e9; margin-top: 8px; }

.section { padding-block: 70px; }
.section--tinted { background: rgba(255, 253, 248, .72); border-block: 1px solid rgba(15, 79, 68, .08); }
.section__heading { margin-bottom: 24px; }
.section h2 { color: var(--green-900); font-size: clamp(1.7rem, 3vw, 2.45rem); }

.card-grid, .content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.institution-card, .publication-card, .fatwa-card, .contact-box, .contact-form {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.institution-card { padding: 24px; min-height: 250px; display: flex; flex-direction: column; align-items: flex-start; }
.institution-card span, .fatwa-card span { color: var(--gold-600); font-weight: 800; }
.institution-card h3, .fatwa-card h3, .publication-card h2 { margin: 8px 0; color: var(--green-800); line-height: 1.55; }
.institution-card p { color: var(--muted); margin: 0 0 20px; }
.institution-card a { margin-top: auto; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 30px; align-items: start; }
.split p { color: var(--muted); font-size: 1.06rem; }
.fatwa-list { display: grid; gap: 12px; }
.fatwa-card { padding: 18px; box-shadow: none; }
.fatwa-card p { margin: 0; color: var(--muted); }

.page-content { max-width: 1040px; }
.page-stack { display: grid; gap: 24px; }
.content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.publication-card { padding: 22px; box-shadow: none; }
.publication-card span { display: block; width: 42px; height: 4px; background: #f0730f; border-radius: 99px; margin-bottom: 12px; }
.publication-card p { margin: 0; color: var(--muted); }

.intro-panel, .people-group, .prose-card, .notice-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.intro-panel, .people-group, .prose-card { box-shadow: var(--shadow); }
.intro-panel, .prose-card { padding: clamp(22px, 4vw, 34px); }
.intro-panel p, .prose-card p { margin: 12px 0 0; color: var(--muted); font-size: 1.08rem; }

.section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.people-group { padding: 22px; }
.group-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.group-heading h3 { margin: 0; color: var(--green-800); font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.5; }
.meta-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: rgba(195, 162, 90, .16); color: var(--gold-600); font-weight: 800; white-space: nowrap; }

.member-grid { display: grid; gap: 12px; }
.member-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid rgba(15, 79, 68, .12); border-radius: var(--radius); background: rgba(246, 242, 232, .42); }
.member-card__marker { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #f0730f; color: #fff8e9; font-weight: 800; }
.member-card h4 { margin: 0; color: var(--green-900); font-size: 1.05rem; line-height: 1.65; }
.member-card p { margin: 2px 0 0; color: var(--muted); line-height: 1.7; }

.people-profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.person-card { overflow: hidden; border: 1px solid rgba(15, 79, 68, .14); border-radius: var(--radius); background: linear-gradient(180deg, #fffdf8 0%, rgba(246, 242, 232, .78) 100%); }
.person-card__media { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; min-height: 150px; background: radial-gradient(circle at 50% 38%, rgba(195, 162, 90, .2), transparent 34%), linear-gradient(135deg, rgba(15, 79, 68, .94), rgba(19, 99, 83, .86)); }
.person-card__media::before { content: ""; position: absolute; width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 253, 248, .92); box-shadow: 0 46px 0 24px rgba(255, 253, 248, .22); }
.person-card__media.has-image::before { display: none; }
.person-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person-card__media span { position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--gold-600); color: white; font-weight: 800; }
.person-card__body { padding: 16px; min-height: 142px; }
.person-card h4 { margin: 0; color: var(--green-900); font-size: 1.05rem; line-height: 1.65; }
.person-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.75; }

/* --- Team Component (fidèle à assets/doc/olama/page CV.html, couleurs adaptées) --- */
.authors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; margin-top: 20px; }
.author-card { background: var(--white); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: space-between; }
.author-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(11,52,47,.16); }
.card-top { display: flex; justify-content: flex-start; align-items: center; margin-bottom: 15px; }
.country-badge { font-size: 11px; font-weight: bold; background-color: rgba(184,148,66,.12); color: var(--muted); padding: 4px 10px; border-radius: 12px; }
.author-img-container { width: 130px; height: 130px; margin: 0 auto 16px; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold-600); background-color: rgba(184,148,66,.1); }
.author-img-container img { width: 100%; height: 100%; object-fit: cover; display: block; }
.author-img-placeholder { display: flex; align-items: center; justify-content: center; font-family: "Amiri", serif; font-size: 2rem; font-weight: 700; color: var(--green-800); }
.author-name { font-size: 18px; font-weight: 700; color: var(--green-900); margin: 0 0 8px; }
.author-title { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0 0 16px; min-height: 50px; }
.read-bio-btn { display: inline-block; font-size: 13px; font-weight: 600; color: #f0730f; text-decoration: none; border: 1px solid #f0730f; padding: 8px 20px; border-radius: 20px; cursor: pointer; transition: all .2s; margin-top: auto; }
.read-bio-btn:hover { background-color: #f0730f; color: white; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,.6); backdrop-filter: blur(3px); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-box { background: white; width: 90%; max-width: 900px; height: 85vh; border-radius: 8px; box-shadow: 0 20px 25px rgba(0,0,0,.2); display: flex; flex-direction: column; overflow: hidden; animation: modalFadeIn .3s ease; }
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { background-color: var(--green-900); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; flex-direction: row-reverse; }
.modal-title { margin: 0; font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; color: white; font-size: 26px; cursor: pointer; font-weight: bold; line-height: 1; padding: 0; }
.modal-close:hover { color: var(--gold-600); }
.modal-body { flex-grow: 1; padding: 0; background: #cbd5e0; }
.pdf-frame { width: 100%; height: 100%; border: none; display: block; }

.notice-card { margin-top: 18px; padding: 18px; background: rgba(246, 242, 232, .65); }
.notice-card p { margin: 10px 0 0; color: var(--green-900); font-weight: 700; }

.guide-hero { position: relative; overflow: hidden; color: white; background: linear-gradient(90deg, rgba(11, 52, 47, .96), rgba(19, 99, 83, .88)), var(--green-900); }
.guide-hero::after { content: ""; position: absolute; inset: 0; opacity: .11; background-image: linear-gradient(30deg, transparent 44%, #fff 45%, transparent 46%), linear-gradient(150deg, transparent 44%, #fff 45%, transparent 46%); background-size: 42px 42px; }
.guide-hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: center; min-height: 430px; padding-block: 64px; }
.guide-hero--cover .guide-hero__grid { grid-template-columns: minmax(0, 1fr) 540px; align-items: center; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; color: #f7eedc; font-size: .96rem; }
.breadcrumb { display: none; }
.breadcrumb a { color: #f4dd9b; font-weight: 800; }
.guide-hero h1 { max-width: 880px; margin: 0; font-family: "Amiri", "Times New Roman", serif; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.45; }
.guide-hero p:not(.eyebrow) { max-width: 760px; margin: 14px 0 0; color: #f7eedc; font-size: 1.18rem; }
.guide-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-actions-with-search { align-items: stretch; }
.hero-inline-search { display: grid; grid-template-columns: minmax(190px, 280px) auto; gap: 8px; }
.hero-inline-search input { min-height: 46px; border: 1px solid rgba(255,255,255,.34); border-radius: var(--radius); background: rgba(255,255,255,.12); color: white; padding: 10px 13px; }
.hero-inline-search input::placeholder { color: rgba(255,255,255,.78); }
.hero-inline-search input:focus { outline: 3px solid rgba(195, 162, 90, .28); border-color: var(--gold-500); }
.hero-inline-search button { border: 1px solid #f0730f; border-radius: var(--radius); background: #f0730f; color: white; padding: 10px 16px; font-weight: 800; cursor: pointer; }
.hero-inline-search button:hover, .hero-inline-search button:focus { background: white; color: #f0730f; outline: none; }
.hero-search-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid #f0730f; border-radius: var(--radius); background: #f0730f; color: white; padding: 10px 18px; font-weight: 800; }
.hero-search-button:hover, .hero-search-button:focus { background: white; color: #f0730f; outline: none; }
.guide-button, .guide-link { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border-radius: var(--radius); padding: 10px 18px; font-weight: 800; }
.guide-button { background: #f0730f; color: white; border: 1px solid #f0730f; }
.guide-button:hover, .guide-button:focus { background: white; color: #f0730f; outline: none; }
.guide-button--muted { background: #f0730f; }
.guide-link { background: #f0730f; color: white; border: 1px solid #f0730f; }
.guide-link:hover, .guide-link:focus { background: white; color: #f0730f; outline: none; }
.guide-document-card { border: 1px solid rgba(195, 162, 90, .5); border-radius: var(--radius); background: rgba(255,255,255,.08); padding: 24px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.guide-document-card span { color: #f0730f; font-weight: 800; }
.guide-document-card strong { display: block; margin-top: 10px; font-family: "Amiri", serif; font-size: 3rem; line-height: 1.2; }
.guide-document-card p { margin: 8px 0 0; color: #f7eedc; }
.guide-document-card--cover { display: flex; height: auto; padding: 0; overflow: hidden; }
.guide-document-card--cover > a { display: block; width: 100%; cursor: pointer; }
.guide-document-card__cover { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 1083; object-fit: cover; border-radius: var(--radius); transition: transform .35s ease; }
.guide-document-card__cover:hover, .guide-document-card__cover:focus { transform: scale(1.08); }

.guide-nav-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.guide-nav-card { display: grid; gap: 10px; min-height: 245px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.guide-nav-card__number { color: var(--gold-600); font-weight: 900; }
.guide-nav-card__icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: rgba(15, 79, 68, .1); color: var(--green-800); font-weight: 800; }
.guide-nav-card strong { color: var(--green-900); line-height: 1.55; }
.guide-nav-card small { color: var(--muted); line-height: 1.7; }

.section, .guide-chapter { scroll-margin-top: 150px; }
.guide-chapter__head { margin-bottom: 24px; }
.guide-timeline { display: grid; gap: 12px; position: relative; }
.timeline-item { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); }
.timeline-item span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #f0730f; color: #fff8e9; font-weight: 900; }
.timeline-item h3 { margin: 0; color: var(--green-900); line-height: 1.6; }

.academic-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.academic-card { min-height: 190px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg, var(--white), rgba(246, 242, 232, .68)); }
.academic-card span { display: block; width: 44px; height: 5px; border-radius: 99px; background: #f0730f; margin-bottom: 18px; }
.academic-card h3 { margin: 0; color: var(--green-900); line-height: 1.65; font-size: 1.05rem; }

.methodology-layout { display: grid; gap: 18px; }
.principle-quote { margin: 0; padding: 24px; border-inline-start: 5px solid var(--gold-600); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.principle-quote p { margin: 0; color: var(--green-900); font-family: "Amiri", serif; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.7; }
.principle-list, .method-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.principle-card, .method-split section { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); }
.principle-card h3, .method-split h3 { margin: 0; color: var(--green-800); line-height: 1.6; }
.method-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.method-split p { margin: 10px 0 0; color: var(--muted); }

.african-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.strategy-block { min-height: 100%; padding: 24px; border-radius: var(--radius); background: linear-gradient(160deg, var(--green-900), var(--green-700)); color: white; }
.strategy-block span { color: #f0730f; font-weight: 800; }
.strategy-block h3 { margin: 12px 0; line-height: 1.6; }
.strategy-block p { margin: 0; color: #f7eedc; }
.theme-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.theme-card { min-height: 150px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); }
.theme-card span { display: block; width: 40px; height: 40px; border-radius: 50%; background: rgba(195, 162, 90, .16); margin-bottom: 14px; }
.theme-card h3 { margin: 0; color: var(--green-900); line-height: 1.65; font-size: 1.02rem; }

.archive-section { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.archive-section p { margin: 12px 0 0; color: var(--muted); }

.fatwa-hero { background: linear-gradient(90deg, rgba(11, 52, 47, .97), rgba(15, 79, 68, .88)), var(--green-900); }
.pillar-grid, .context-grid, .impact-grid, .fatwa-preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pillar-card, .context-card, .impact-card, .fatwa-preview-card, .source-card, .manuscript-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.pillar-card { min-height: 250px; padding: 22px; transition: transform .2s ease, border-color .2s ease; }
.pillar-card:hover { transform: translateY(-3px); border-color: rgba(184, 148, 66, .62); }
.pillar-card span { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: rgba(15, 79, 68, .1); color: var(--green-800); font-weight: 900; }
.pillar-card h3, .context-card h3, .impact-card h3, .fatwa-preview-card h3, .source-card h3, .manuscript-card h3 { margin: 14px 0 8px; color: var(--green-900); line-height: 1.6; }
.pillar-card p, .context-card p, .impact-card p, .fatwa-preview-card p, .source-card p, .manuscript-card p { margin: 0; color: var(--muted); }

.heritage-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.heritage-quote { margin: 0; padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg, var(--white), rgba(246, 242, 232, .75)); box-shadow: var(--shadow); }
.heritage-quote p { margin: 0; color: var(--green-900); font-family: "Amiri", serif; font-size: 1.55rem; line-height: 1.8; }
.manuscript-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.manuscript-card { padding: 20px; background: linear-gradient(180deg, #fffdf8, rgba(235, 227, 210, .5)); }

.context-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.context-card, .impact-card { padding: 20px; box-shadow: none; }
.context-card span, .impact-card span, .source-card span { display: block; width: 42px; height: 5px; border-radius: 99px; background: #f0730f; margin-bottom: 12px; }

.source-shelf { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.source-card { min-height: 220px; padding: 18px; background: linear-gradient(180deg, var(--white), rgba(246, 242, 232, .82)); }

.impact-card { min-height: 220px; }
.impact-card span { width: 46px; height: 46px; border-radius: 50%; background: rgba(15, 79, 68, .12); }

.fatwa-preview-card { padding: 20px; display: flex; flex-direction: column; align-items: flex-start; min-height: 260px; }
.fatwa-preview-card span { color: var(--gold-600); font-weight: 900; }
.fatwa-preview-card a { margin-top: auto; padding: 9px 14px; border-radius: var(--radius); background: #f0730f; color: white; font-weight: 800; }

.fatwa-closing { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 22px; align-items: center; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.closing-search label { display: block; margin-bottom: 8px; color: var(--green-900); font-weight: 800; }
.closing-search div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.closing-search input { width: 100%; border: 1px solid rgba(15, 79, 68, .2); border-radius: var(--radius); padding: 11px 13px; background: var(--white); }
.closing-search button { border: 1px solid #f0730f; border-radius: var(--radius); background: #f0730f; color: white; padding: 11px 18px; font-weight: 800; cursor: pointer; }
.closing-search button:hover, .closing-search button:focus { background: white; color: #f0730f; outline: none; }

.services-hero { background: linear-gradient(90deg, rgba(11, 52, 47, .96), rgba(19, 99, 83, .86)), var(--green-900); }
.service-block-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.service-block { min-height: 280px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; transition: transform .2s ease, border-color .2s ease; }
.service-block:hover { transform: translateY(-3px); border-color: rgba(184, 148, 66, .62); }
.service-block span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(15, 79, 68, .1); color: var(--green-800); font-weight: 900; }
.service-block h3, .dashboard-tool h3, .axis-card h3, .taxonomy-card h3, .modern-card h3, .library-card h3, .media-service-card h3, .training-path-card h3 { margin: 14px 0 8px; color: var(--green-900); line-height: 1.6; }
.service-block p, .dashboard-panel p, .dashboard-tool p, .axis-card p, .library-layout p, .media-service-card p, .training-path-card p { margin: 0; color: var(--muted); }
.service-block a { margin-top: auto; color: var(--green-800); font-weight: 900; }

.fatwa-dashboard { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.dashboard-panel, .dashboard-tool, .axis-card, .taxonomy-card, .modern-card, .library-layout, .media-service-card, .training-path-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.dashboard-panel { padding: 26px; }
.workflow-list { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: workflow; }
.workflow-list li { counter-increment: workflow; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; color: var(--green-900); font-weight: 800; }
.workflow-list li::before { content: counter(workflow); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold-600); color: white; }
.dashboard-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-tool { padding: 20px; box-shadow: none; }
.dashboard-tool span, .modern-card span, .media-service-card span, .library-card span { display: block; width: 42px; height: 5px; border-radius: 99px; background: #f0730f; margin-bottom: 12px; }

.axis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.axis-card { padding: 22px; box-shadow: none; border-top: 5px solid #f0730f; }
.axis-card > span { display: block; width: 54px; height: 54px; border-radius: 50%; background: rgba(15, 79, 68, .1); }
.axis-card--modern { border-top-color: #3f7f74; }
.axis-card--creed { border-top-color: #8a7040; }
.axis-card--suluk { border-top-color: #6f8f7a; }

.taxonomy-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.taxonomy-card { padding: 18px; min-height: 145px; box-shadow: none; }
.taxonomy-card span { color: var(--gold-600); font-weight: 900; }

.modern-grid, .media-service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.modern-card, .media-service-card { padding: 18px; min-height: 150px; box-shadow: none; }
.modern-card { background: linear-gradient(180deg, var(--white), rgba(246, 242, 232, .72)); }

.library-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; padding: 26px; }
.library-index { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.library-card { padding: 16px; border: 1px solid rgba(15, 79, 68, .12); border-radius: var(--radius); background: rgba(246, 242, 232, .62); }

.training-path-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.training-path-card { padding: 22px; min-height: 190px; background: linear-gradient(180deg, var(--white), rgba(246, 242, 232, .7)); }

.request-shell { max-width: 1040px; }
.secure-fatwa-form { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.request-form-header { padding: 26px; background: var(--green-900); color: #fff8e9; border-bottom: 4px solid var(--gold-600); }
.request-form-header h2 { margin: 0; font-family: "Amiri", serif; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.5; color: #fff8e9; }
.form-download-row, .form-or-line, .form-alt-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 12px 16px; background: rgba(255, 248, 233, .07); border: 1px solid rgba(255, 248, 233, .15); border-radius: var(--radius); }
.form-download-row p { margin: 0; color: #fff8e9; font-size: .96rem; line-height: 1.65; }
.form-or-line { justify-content: center; color: #fff8e9; font-size: .88rem; }
.form-alt-note { color: #fff8e9; font-size: .92rem; }
.download-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 18px; border-radius: 99px; border: 1px solid #f0730f; background: #f0730f; color: #fff; font-weight: 800; font-size: .88rem; text-decoration: none; white-space: nowrap; flex-shrink: 0; transition: background .2s, color .2s; }
.download-btn:hover, .download-btn:focus { background: white; color: #f0730f; outline: none; }
.request-form-header span { display: inline-flex; margin-top: 10px; padding: 5px 14px; border-radius: 99px; background: var(--gold-600); color: white; font-size: .82rem; font-weight: 800; }
.request-section, .consent-panel, .institution-commitment { margin: 22px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(246, 242, 232, .38); }
.request-section h3, .consent-panel h3 { margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid rgba(15, 79, 68, .12); color: var(--green-900); line-height: 1.6; }
.request-section label, .consent-panel label { display: grid; gap: 7px; color: var(--green-900); font-weight: 800; }
.request-section label + label { margin-top: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.request-section input, .request-section select, .request-section textarea { width: 100%; border: 1px solid rgba(15, 79, 68, .2); border-radius: var(--radius); padding: 11px 13px; background: var(--white); color: var(--ink); }
.request-section textarea { resize: vertical; min-height: 170px; }
.request-section input:focus, .request-section select:focus, .request-section textarea:focus { outline: 3px solid rgba(195, 162, 90, .28); border-color: var(--gold-600); }
.conditional-field.hidden { display: none; }
.inline-hint { margin: 8px 0 0; color: var(--muted); font-size: .92rem; }
.notice-box { padding: 16px; border-inline-start: 4px solid var(--green-700); border-radius: var(--radius); background: rgba(15, 79, 68, .07); color: var(--green-900); }
.legal-list { display: grid; gap: 8px; margin: 0; padding-inline-start: 22px; color: var(--muted); }
.checkbox-line { grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 12px; font-weight: 400; }
.checkbox-line input { width: 22px; height: 22px; margin-top: 4px; accent-color: var(--gold-600); }
.institution-commitment { background: rgba(15, 79, 68, .07); }
.institution-commitment p { margin: 0; color: var(--green-900); }
.request-submit { display: block; width: calc(100% - 44px); margin: 0 22px 12px; border: 0; border-radius: var(--radius); padding: 14px 20px; background: #f0730f; color: white; font-weight: 900; cursor: pointer; }
.request-submit:hover, .request-submit:focus { background: white; color: #f0730f; outline: none; }
.request-footnote { margin: 0 22px 24px; text-align: center; color: var(--muted); font-size: .9rem; }
.file-upload-wrapper { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid rgba(15, 79, 68, .2); border-radius: var(--radius); background: var(--white); }
.file-upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.file-upload-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid #f0730f; border-radius: 99px; background: #f0730f; color: white; font-weight: 800; font-size: .85rem; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: background .2s, color .2s; }
.file-upload-btn:hover { background: white; color: #f0730f; }
.file-upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .88rem; }
.file-upload-name.has-file { color: var(--green-900); font-weight: 700; }
.form-alert { margin-bottom: 18px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--white); }
.form-alert--success { color: var(--green-900); border-color: rgba(15, 99, 83, .35); background: rgba(15, 99, 83, .08); }
.form-alert--error { color: #7f1d1d; border-color: rgba(127, 29, 29, .28); background: rgba(127, 29, 29, .07); }
.form-alert ul { margin: 8px 0 0; }
.closing-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.guide-link--dark { border-color: rgba(15, 79, 68, .24); color: var(--green-900); }

.publications-hero { background: linear-gradient(90deg, rgba(11, 52, 47, .96), rgba(19, 99, 83, .88)), var(--green-900); }
.publication-category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.publication-category-card, .book-card, .archive-matrix, .research-access, .collaboration-band { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.publication-category-card { min-height: 190px; padding: 20px; background: linear-gradient(180deg, var(--white), rgba(246, 242, 232, .72)); }
.publication-category-card span, .metadata-card span { display: block; width: 42px; height: 5px; border-radius: 99px; background: #f0730f; margin-bottom: 14px; }
.publication-category-card h3, .book-card h3, .metadata-card h3 { margin: 0 0 8px; color: var(--green-900); line-height: 1.6; }
.publication-category-card p, .book-card p, .archive-matrix p, .collaboration-band p { margin: 0; color: var(--muted); }

.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.book-card { overflow: hidden; display: grid; grid-template-rows: 220px 1fr; }
.book-cover { display: grid; place-items: end start; padding: 18px; background: linear-gradient(145deg, var(--green-900), var(--green-700)); color: #f4dd9b; position: relative; }
.book-cover::after { content: ""; position: absolute; inset: 18px; border: 1px solid rgba(195, 162, 90, .45); }
.book-cover span { position: relative; z-index: 1; font-weight: 900; }
.book-card__body { padding: 20px; display: flex; flex-direction: column; align-items: flex-start; }
.book-card__body > span { color: var(--gold-600); font-weight: 900; }
.book-card a { margin-top: auto; padding: 9px 14px; border-radius: var(--radius); background: #f0730f; color: white; font-weight: 800; }

.archive-matrix, .research-access, .collaboration-band { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: center; padding: 28px; }
.metadata-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metadata-card { padding: 16px; border: 1px solid rgba(15, 79, 68, .12); border-radius: var(--radius); background: rgba(246, 242, 232, .62); }
.research-chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.research-chip-grid span { padding: 10px 14px; border-radius: 999px; background: rgba(15, 79, 68, .1); color: var(--green-900); font-weight: 800; }
.collaboration-band { grid-template-columns: minmax(0, 1fr) auto; }

.media-hero { background: linear-gradient(90deg, rgba(11, 52, 47, .96), rgba(32, 74, 86, .82)), var(--green-900); }
.media-hub-grid, .media-gateway-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.media-hub-card, .featured-news, .news-item, .calendar-card, .event-card, .media-gateway-card, .video-card, .audio-layout, .gallery-tile { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.media-hub-card { min-height: 240px; padding: 22px; transition: transform .2s ease; }
.media-hub-card:hover { transform: translateY(-3px); }
.media-hub-card span { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: rgba(15, 79, 68, .1); color: var(--green-800); font-weight: 900; }
.media-hub-card h3, .news-item h3, .event-card h3, .media-gateway-card h3, .video-card h3, .audio-card h3 { margin: 14px 0 8px; color: var(--green-900); line-height: 1.6; }
.media-hub-card p, .featured-news p, .news-item p, .event-card p, .media-gateway-card p, .video-card p, .audio-layout p, .audio-card p { margin: 0; color: var(--muted); }

.news-layout, .agenda-layout, .audio-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.featured-news, .calendar-card, .audio-layout { padding: 26px; }
.featured-news span, .news-item span { color: var(--gold-600); font-weight: 900; }
.news-feed, .event-timeline { display: grid; gap: 12px; }
.news-item, .event-card, .media-gateway-card, .audio-card { padding: 18px; box-shadow: none; }
.calendar-card { background: linear-gradient(160deg, var(--green-900), var(--green-700)); color: white; }
.calendar-card span { color: #f0730f; font-weight: 900; }
.calendar-card strong { display: block; font-family: "Amiri", serif; font-size: 4rem; line-height: 1.1; }
.calendar-card p { color: #f7eedc; }
.event-card { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; align-items: center; }
.event-card span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gold-600); color: white; font-weight: 900; }

.media-gateway-card span { display: block; width: 100%; height: 110px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(15, 79, 68, .92), rgba(195, 162, 90, .48)); margin-bottom: 14px; }
.video-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.video-card { overflow: hidden; box-shadow: none; }
.video-card h3, .video-card p { padding-inline: 16px; }
.video-card p { padding-bottom: 16px; }
.video-thumb { position: relative; min-height: 150px; display: grid; place-items: center; background: linear-gradient(135deg, var(--green-900), var(--green-700)); }
.video-thumb::before { content: ""; width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.88); }
.video-thumb span { position: absolute; color: var(--green-900); font-weight: 900; font-size: .82rem; }

.audio-layout { grid-template-columns: 320px minmax(0, 1fr); }
.audio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.audio-card span { display: block; height: 28px; border-radius: 99px; background: repeating-linear-gradient(90deg, #f0730f 0 4px, transparent 4px 10px), rgba(15, 79, 68, .08); margin-bottom: 14px; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gallery-tile { overflow: hidden; margin: 0; box-shadow: none; position: relative; }
.gallery-tile div { min-height: 210px; background: linear-gradient(135deg, rgba(15, 79, 68, .86), rgba(195, 162, 90, .3)); }
.gallery-tile div::after { content: "FM6OA"; position: absolute; inset-block-start: 18px; inset-inline-start: 18px; color: rgba(255,255,255,.55); font-weight: 900; letter-spacing: 0; }
.gallery-tile figcaption { padding: 14px; color: var(--green-900); font-weight: 800; }

.training-hero { background: linear-gradient(90deg, rgba(11, 52, 47, .97), rgba(55, 87, 72, .82)), var(--green-900); }
.training-roadmap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: roadmap; }
.roadmap-step, .curriculum-card, .admission-layout { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.roadmap-step { position: relative; min-height: 210px; padding: 22px; }
.roadmap-step::after { content: ""; position: absolute; inset-block-start: 48px; inset-inline-end: calc(100% - 8px); width: 34px; height: 2px; background: #f0730f; }
.roadmap-step:last-child::after { display: none; }
.roadmap-step span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #f0730f; color: #fff8e9; font-weight: 900; }
.roadmap-step h3, .curriculum-card h3 { margin: 14px 0 8px; color: var(--green-900); line-height: 1.6; }
.roadmap-step p, .curriculum-card p, .admission-layout p { margin: 0; color: var(--muted); }

.curriculum-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.curriculum-card { min-height: 190px; padding: 20px; background: linear-gradient(180deg, var(--white), rgba(246, 242, 232, .68)); }
.curriculum-card span { display: block; width: 44px; height: 5px; border-radius: 99px; background: #f0730f; margin-bottom: 16px; }
.skill-card { border-top: 5px solid #f0730f; }
.admission-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: center; padding: 28px; }
.admission-layout .guide-button { margin-top: 18px; }
.admission-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: admission; }
.admission-steps li { counter-increment: admission; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: rgba(246, 242, 232, .7); color: var(--green-900); font-weight: 800; }
.admission-steps li::before { content: counter(admission); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold-600); color: white; }

.contact-hero { background: linear-gradient(90deg, rgba(11, 52, 47, .97), rgba(19, 99, 83, .82)), var(--green-900); }
.contact-card-grid, .social-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.official-contact-card, .social-card, .contact-assurance { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.official-contact-card { min-height: 230px; padding: 22px; display: flex; flex-direction: column; align-items: flex-start; }
.official-contact-card span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: rgba(15, 79, 68, .1); color: var(--green-800); font-weight: 900; }
.official-contact-card h3, .social-card h3 { margin: 14px 0 8px; color: var(--green-900); line-height: 1.6; }
.official-contact-card p, .social-card p, .contact-assurance p { margin: 0; color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.official-contact-card a { margin-top: auto; padding: 9px 14px; border-radius: var(--radius); background: #f0730f; color: white; font-weight: 800; }
.social-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.social-card { display: block; min-height: 190px; padding: 20px; border-top: 5px solid #f0730f; transition: transform .2s ease; text-decoration: none; color: inherit; }
.social-card:hover { transform: translateY(-3px); }
.social-card > span { color: var(--gold-600); font-weight: 900; }
.social-card--youtube { border-top-color: #9f2d2d; }
.social-card--facebook { border-top-color: #2f5f9f; }
.social-card--x { border-top-color: #172420; }
.social-card--instagram { border-top-color: #9f6a2f; }
.contact-hub-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.guide-hero__grid > *, .contact-card-grid > *, .social-grid > *, .contact-hub-layout > *, .footer__grid > * { min-width: 0; }
.contact-assurance { padding: 24px; }
.contact-assurance ul { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.contact-assurance li { padding: 10px 12px; border-radius: var(--radius); background: rgba(15, 79, 68, .08); color: var(--green-900); font-weight: 800; }
.premium-contact-form { padding: 24px; }
.premium-contact-form input:focus, .premium-contact-form textarea:focus { outline: 3px solid rgba(195, 162, 90, .28); border-color: var(--gold-600); }

.home-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 500px; background: url('../images/hero-bg.jpg') center / cover no-repeat; }
.home-hero__caption { position: relative; z-index: 1; padding-block: 36px 48px; color: white; }
.home-hero h1 { margin: 0 0 20px; font-family: "Amiri", serif; font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1.35; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.home-hero p:not(.eyebrow) { max-width: 760px; color: #f7eedc; font-size: 1.2rem; text-shadow: 0 1px 6px rgba(0,0,0,.5); }

.royal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 4fr); gap: 28px; align-items: start; }
.royal-editorial, .manuscript-flipbook, .mission-card, .platform-ecosystem, .home-preview-card, .window-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.royal-editorial { padding: 20px; }
.royal-editorial p { color: var(--muted); }
.royal-editorial blockquote { margin: 16px 0; padding: 14px; border-inline-start: 5px solid var(--gold-600); background: rgba(246, 242, 232, .72); border-radius: var(--radius); }
.royal-editorial blockquote p { margin: 0; color: var(--green-900); font-family: "Amiri", serif; font-size: 1.1rem; line-height: 1.85; }

.manuscript-flipbook { padding: 18px; background: linear-gradient(180deg, #fffdf8, rgba(235, 227, 210, .62)); }
.flipbook-pages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 620px; padding: 14px; border: 1px solid rgba(184, 148, 66, .45); background: rgba(246, 242, 232, .8); }
.flipbook-page { display: none; margin: 0; border: 1px solid rgba(15, 79, 68, .14); background: var(--white); box-shadow: 0 10px 22px rgba(11,52,47,.12); }
.flipbook-page.is-visible { display: block; }
.flipbook-page img { width: 100%; height: 100%; min-height: 590px; object-fit: cover; }
.flipbook-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.flipbook-controls button { border: 0; border-radius: var(--radius); padding: 9px 14px; background: #f0730f; color: white; font-weight: 800; cursor: pointer; }
.flipbook-controls span { color: var(--green-900); font-weight: 900; }

/* ── Publications image gallery (hero carousel) ─────────────────────────── */
.publications-hero .guide-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.pub-gallery { border-radius: var(--radius); padding: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(195,162,90,.4); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.pub-gallery__track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pub-gallery__slide { display: none; margin: 0; border-radius: calc(var(--radius) - 2px); overflow: hidden; border: 1px solid rgba(195,162,90,.25); box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.pub-gallery__slide.is-visible { display: block; }
.pub-gallery__slide img { width: 100%; display: block; min-height: 280px; object-fit: cover; transition: transform .4s ease; }
.pub-gallery__slide:hover img { transform: scale(1.04); }
.pub-gallery__controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.pub-gallery__controls button { border: 0; border-radius: var(--radius); padding: 8px 20px; background: #f0730f; color: white; font-weight: 800; font-size: 1.15rem; line-height: 1; cursor: pointer; transition: background .2s, transform .15s; }
.pub-gallery__controls button:hover { background: rgba(240,115,15,.82); transform: scale(1.07); }
.pub-gallery__controls span { color: rgba(255,248,233,.75); font-weight: 700; font-size: .92rem; }

/* ── Issdarat overlay — books gallery modal ──────────────────────────────── */
.issdarat-modal { max-width: 1120px; }
.issdarat-modal__body { overflow-y: auto; padding: 28px; background: #f7fafc; }
.issdarat-books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.issdarat-book-card { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.06); transition: transform .3s ease, box-shadow .3s ease; border: 1px solid var(--border); display: flex; flex-direction: column; }
.issdarat-book-card:hover { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(11,52,47,.12); }
.issdarat-book-img { position: relative; height: 300px; overflow: hidden; background: rgba(184,148,66,.1); }
.issdarat-book-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.issdarat-book-card:hover .issdarat-book-img img { transform: scale(1.03); }
.issdarat-book-info { padding: 16px; flex-grow: 1; background: white; border-top: 3px solid var(--gold-600); }
.issdarat-book-title { margin: 0; font-family: "Amiri", serif; font-size: 1rem; font-weight: 700; color: var(--green-900); line-height: 1.65; text-align: center; }

.window-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.window-card { min-height: 210px; padding: 18px; transition: transform .2s ease; }
.window-card:hover { transform: translateY(-3px); }
.window-card span { color: var(--gold-600); font-weight: 900; }
.window-card h3, .mission-split h2, .platform-ecosystem h2, .home-preview-card h3 { color: var(--green-900); line-height: 1.6; }
.window-card p, .mission-split p, .platform-ecosystem p, .home-preview-card p { color: var(--muted); }

.mission-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: center; }
.mission-card { padding: 26px; background: linear-gradient(160deg, var(--green-900), var(--green-700)); color: white; }
.mission-card span { color: #f0730f; font-weight: 900; }
.mission-card p { color: #f7eedc; font-size: 1.1rem; }
.platform-ecosystem { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; padding: 28px; align-items: center; }
.ecosystem-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ecosystem-blocks article { padding: 18px; border-radius: var(--radius); background: rgba(246, 242, 232, .72); }
.ecosystem-blocks span { display: block; width: 42px; height: 5px; border-radius: 99px; background: #f0730f; margin-bottom: 12px; }
.ecosystem-blocks h3 { margin: 0; color: var(--green-900); }

.quick-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.quick-grid a { padding: 14px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); color: var(--green-900); font-weight: 900; box-shadow: var(--shadow); }
.home-preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.home-preview-card { min-height: 220px; padding: 22px; display: flex; flex-direction: column; align-items: flex-start; }
.home-preview-card a { margin-top: auto; color: var(--green-800); font-weight: 900; }

.contact-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; }
.contact-box, .contact-form { padding: 24px; }
.contact-form { display: grid; gap: 14px; }
.contact-form label { display: grid; gap: 6px; color: var(--green-900); font-weight: 800; }
.form-status { margin: 0; color: var(--green-800); font-weight: 700; }

.site-footer { background: var(--green-900); color: #f7eedc; padding-block: 44px 18px; }
.footer__grid { display: grid; grid-template-columns: 1.2fr .7fr .7fr; gap: 28px; }
.site-footer h2 { color: #f0730f; font-size: 1.7rem; }
.site-footer p { margin: 10px 0 0; color: #e9dec8; }
.site-footer nav, .site-footer address { display: grid; gap: 8px; font-style: normal; }
.site-footer a:hover { color: #f0730f; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: 26px; padding-top: 14px; display: flex; justify-content: space-between; gap: 12px; color: #d7c8a9; font-size: .92rem; }

/* ============================================================
   INSTITUTIONAL HEADER DESIGN
   ============================================================ */

.header-topbar {
    background: linear-gradient(90deg, var(--green-900), #0d3c36);
    color: #f6edd8;
    font-size: .92rem;
    border-bottom: 1px solid rgba(195, 162, 90, .24);
}

.header-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding-block: 8px;
    gap: 16px;
}

.institution-info {
    display: flex;
    align-items: center;
}

.institution-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #f6edd8;
    transition: color .2s ease;
}

.institution-name:hover {
    color: #f0730f;
}

.institution-abbr {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: rgba(195, 162, 90, .28);
    border-radius: 4px;
    font-weight: 900;
    font-size: .8rem;
    color: #f0730f;
}

.institution-full {
    font-size: .88rem;
    letter-spacing: 0.3px;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lang-link {
    padding: 4px 10px;
    border-radius: 3px;
    color: #f6edd8;
    font-weight: 600;
    font-size: .87rem;
    transition: all .2s ease;
    position: relative;
}

.lang-link:hover {
    background: rgba(195, 162, 90, .18);
    color: #f0730f;
}

.lang-link[aria-current="true"] {
    background: rgba(195, 162, 90, .32);
    color: #f0730f;
}

.lang-link span {
    display: block;
}

/* Main Header Container */
.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 102px;
    padding-block: 10px;
    gap: 24px;
}

.header-main__inner {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Brand / Logo Section */
.brand {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    transition: opacity .2s ease;
}

.brand:hover {
    opacity: 0.9;
}

.brand__logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border: 2px solid var(--border);
    background: white;
    padding: 6px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(11, 52, 47, .08);
    transform: scale(1.8);
    transform-origin: center;
    grid-column: 1;
    justify-self: center;
}

.brand__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    grid-column: 2;
    justify-items: center;
    text-align: center;
    padding-bottom: 32px;
}

.brand__name {
    display: block;
    color: var(--green-800);
    font-size: 1.24rem;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.brand__tagline {
    display: block;
    color: var(--muted);
    font-size: .87rem;
    line-height: 1.4;
    font-weight: 500;
}

/* Primary Navigation */
.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
    list-style: none;
}

.nav-container {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
}

.nav-section {
    display: flex;
    gap: 2px;
    align-items: center;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
    border-radius: 5px;
    color: var(--green-900);
    font-weight: 700;
    font-size: .95rem;
    transition: all .2s ease;
    white-space: nowrap;
    position: relative;
}

.nav-link:hover,
.nav-link:focus {
    background: rgba(195, 162, 90, .16);
    color: var(--green-800);
    outline: none;
}

.nav-link[aria-current="page"],
.nav-link.is-active {
    background: rgba(195, 162, 90, .28);
    color: var(--green-800);
}

.nav-link[aria-current="page"]::after,
.nav-link.is-active::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 13px;
    right: 13px;
    height: 3px;
    background: #f0730f;
    border-radius: 2px;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--border);
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    transition: all .2s ease;
    flex-shrink: 0;
}

.menu-toggle:hover {
    border-color: rgba(184, 148, 66, .48);
    background: rgba(195, 162, 90, .06);
}

.menu-toggle__line {
    display: block;
    width: 20px;
    height: 2px;
    margin: 5px auto;
    background: var(--green-900);
    border-radius: 1px;
    transition: all .3s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Header separator */
.header-sep { display: block; width: 40px; height: 28px; background: transparent; flex-shrink: 0; }

/* Header CTA group */
.header-cta-group { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Header CTA Button */
.header-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid #f0730f;
    border-radius: 6px;
    background: #f0730f;
    color: #fff;
    font-weight: 800;
    font-size: .92rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}

.header-cta:hover,
.header-cta:focus {
    background: #fff;
    color: #f0730f;
    outline: none;
}

.header-cta__icon {
    display: inline-block;
    font-size: 1.1rem;
}

.header-cta__text {
    display: inline;
}

/* Skip Link */
.sr-only--focusable {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.sr-only--focusable:focus {
    position: fixed;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    z-index: 20;
    width: auto;
    height: auto;
    clip-path: none;
    background: var(--green-900);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 700;
}

/* ============================================================
   INSTITUTIONAL FOOTER DESIGN
   ============================================================ */

.site-footer {
    background: linear-gradient(180deg, #1a2621, #0f1b17);
    color: #d9cdb7;
    border-top: 2px solid rgba(195, 162, 90, .24);
}

/* Footer Intro Section */
.footer-intro {
    padding-block: 48px;
    border-bottom: 1px solid rgba(195, 162, 90, .16);
}

.footer-intro__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 40px;
    align-items: start;
}

.footer-intro__content {
    display: grid;
    gap: 12px;
}

.footer-intro__title {
    margin: 0;
    color: white;
    font-size: 1.8rem;
    line-height: 1.4;
    font-weight: 800;
    font-family: "Amiri", "Times New Roman", serif;
}

.footer-intro__description {
    margin: 0;
    color: #c9bca5;
    font-size: 1.02rem;
    line-height: 1.8;
    max-width: 580px;
}

.footer-intro__cta {
    display: grid;
    place-items: center;
}

.footer-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--gold-600), #b8943a);
    color: white;
    font-weight: 800;
    font-size: .93rem;
    transition: all .2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(184, 148, 66, .24);
}

.footer-cta-button:hover {
    background: linear-gradient(135deg, #c3a25a, #b89442);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(184, 148, 66, .32);
}

.footer-cta-button__icon {
    font-size: 1.15rem;
}

/* Footer Navigation Grid */
.footer-nav-section {
    padding-block: 40px;
    border-bottom: 1px solid rgba(195, 162, 90, .16);
}

.footer-nav__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px;
}

.footer-nav-column {
    display: grid;
    gap: 16px;
}

.footer-nav-column__title {
    margin: 0;
    color: white;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

.footer-nav-list {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-nav-list li {
    display: list-item;
}

.footer-nav-list a {
    color: #c9bca5;
    font-size: .95rem;
    font-weight: 500;
    transition: all .2s ease;
    position: relative;
    padding-inline-start: 8px;
}

.footer-nav-list a::before {
    content: "–";
    position: absolute;
    inset-inline-start: 0;
    color: #f0730f;
    font-weight: 700;
}

.footer-nav-list a:hover {
    color: #f0730f;
    padding-inline-start: 12px;
}

/* Footer Contact & Social */
.footer-contact-section {
    padding-block: 32px;
    border-bottom: 1px solid rgba(195, 162, 90, .16);
}

.footer-contact__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 40px;
    align-items: start;
}

.footer-contact-info {
    display: grid;
    gap: 16px;
    font-style: normal;
}

.footer-contact-info__title {
    margin: 0;
    color: white;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.contact-list {
    display: grid;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* flex so both label and value size to their own content and pack at
   inline-start (= right in RTL) — no stretching column that would push
   the value to the far side of the container */
.contact-list__item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    gap: 10px;
}

.contact-list__label {
    color: #f0730f;
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
}

/* LTR scoped to the value element only — phone/email render correctly
   while the row and label inherit RTL from the page */
.contact-list__value {
    color: #c9bca5;
    font-size: .95rem;
    direction: ltr;
    unicode-bidi: embed;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Arabic values (e.g. address) keep RTL rendering */
.contact-list__value[dir="rtl"] {
    direction: rtl;
    unicode-bidi: embed;
}

.contact-list__value a {
    color: #c9bca5;
    text-decoration: none;
    -webkit-transition: color .2s ease;
            transition: color .2s ease;
}

.contact-list__value a:hover {
    color: #f0730f;
}

/* Social Media */
.footer-social {
    display: grid;
    gap: 14px;
}

.footer-social__title {
    margin: 0;
    color: white;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.social-list {
    display: flex;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.social-list__item {
    display: list-item;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: rgba(195, 162, 90, .12);
    color: #f0730f;
    transition: all .2s ease;
    font-size: 1.2rem;
}

.social-link:hover {
    background: rgba(195, 162, 90, .24);
    transform: translateY(-3px);
}

/* Footer Bottom Bar */
.footer-bottom {
    padding-block: 20px;
    background: rgba(11, 52, 47, .24);
}

.footer-bottom__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-copyright {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a89f8a;
    font-size: .9rem;
    flex-wrap: wrap;
}

.footer-copyright span {
    display: inline;
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-legal__link {
    color: #a89f8a;
    font-size: .9rem;
    transition: color .2s ease;
    text-decoration: none;
}

.footer-legal__link:hover {
    color: #f0730f;
}

/* ============================================================
   MOBILE & RESPONSIVE NAVIGATION
   ============================================================ */

@media (max-width: 960px) {
    .menu-toggle { display: flex; align-items: center; justify-content: center; }
    
    .primary-nav { 
        position: fixed;
        inset-block: 0;
        inset-inline-end: -100%;
        width: 100%;
        max-width: 340px;
        height: 100vh;
        background: var(--white);
        border-inline-start: 1px solid var(--border);
        padding-block-start: 56px;
        overflow-y: auto;
        z-index: 9;
        flex-direction: column;
        gap: 0;
        justify-content: flex-start;
        flex-wrap: nowrap;
        transition: inset-inline-end .3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 20px rgba(11, 52, 47, .12);
    }
    
    .primary-nav.is-open {
        inset-inline-end: 0;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }
    
    .nav-section {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
        border-bottom: 1px solid rgba(15, 79, 68, .08);
    }
    
    .nav-link {
        width: 100%;
        padding: 14px 18px;
        border-radius: 0;
        justify-content: flex-end;
        text-align: right;
        font-size: .98rem;
        background: transparent;
        transition: background .2s ease;
    }
    
    .nav-link:hover,
    .nav-link:focus {
        background: rgba(195, 162, 90, .12);
        outline: none;
    }
    
    .nav-link[aria-current="page"],
    .nav-link.is-active {
        background: rgba(195, 162, 90, .16);
        border-inline-end: 4px solid #f0730f;
        padding-inline-end: 14px;
    }
    
    .nav-link[aria-current="page"]::after,
    .nav-link.is-active::after {
        display: none;
    }
    
    .header-cta-group,
    .header-sep {
        display: none;
    }
    
    .header-topbar__inner,
    .footer-bottom__inner { 
        align-items: flex-start;
        flex-direction: column;
    }
    
    .header-main {
        min-height: 82px;
    }
    
    .header-main__inner {
        width: 100%;
        max-width: 100%;
        margin-inline: 0;
    }
    
    .brand {
        min-width: 0;
    }

    .brand__logo {
        width: 58px;
        height: 58px;
        transform: scale(1.5);
    }

    .brand__text {
        padding-bottom: 20px;
    }
    
    .brand__name {
        font-size: 1.05rem;
    }
    
    .brand__tagline {
        font-size: .78rem;
    }
    
    .footer-intro__inner,
    .footer-contact__inner,
    .footer-nav__grid {
        grid-template-columns: 1fr;
    }
    
    .footer-intro__cta {
        justify-self: start;
    }
    
    .footer-cta-button {
        width: 100%;
        justify-content: center;
    }
    
    .footer-nav__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
    
    .footer-social {
        justify-self: start;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Content Grid Breakpoints */
    .hero__grid, .home-hero__grid, .guide-hero__grid, .royal-layout, .mission-split, .platform-ecosystem, .split, .section-grid, .african-layout, .heritage-layout, .fatwa-dashboard, .library-layout, .archive-matrix, .research-access, .collaboration-band, .news-layout, .agenda-layout, .audio-layout, .admission-layout, .contact-hub-layout, .fatwa-closing, .contact-layout, .footer__grid { grid-template-columns: 1fr; }
    .guide-nav-grid, .academic-grid, .pillar-grid, .source-shelf, .impact-grid, .fatwa-preview-grid, .service-block-grid, .axis-grid, .taxonomy-grid, .modern-grid, .media-service-grid, .training-path-grid, .publication-category-grid, .book-grid, .metadata-grid, .media-hub-grid, .media-gateway-grid, .video-grid, .gallery-grid, .training-roadmap, .curriculum-grid, .contact-card-grid, .social-grid, .window-grid, .quick-grid, .home-preview-grid, .people-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .authors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .roadmap-step::after { display: none; }
    .principle-list, .method-split { grid-template-columns: 1fr; }
    .hero__mark { display: none; }
    .card-grid { grid-template-columns: 1fr; }
    .home-hero { background-position: top center; min-height: 420px; }
}

@media (max-width: 640px) {
    :root { --container: min(100% - 22px, 1180px); }
    body { padding-top: 210px; }
    .section, .guide-chapter { scroll-margin-top: 210px; }
    
    .header-topbar {
        position: relative;
    }
    
    .header-topbar__inner {
        min-height: 36px;
        padding-block: 6px;
    }
    
    .institution-name {
        gap: 6px;
    }
    
    .institution-abbr {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: .7rem;
    }
    
    .institution-full {
        font-size: .8rem;
    }
    
    .language-switcher {
        gap: 8px;
    }
    
    .lang-link {
        padding: 3px 8px;
        font-size: .8rem;
    }
    
    .header-main {
        min-height: 80px;
    }
    
    .brand {
        gap: 0;
    }

    .brand__logo {
        width: 52px;
        height: 52px;
        transform: scale(1.3);
    }

    .brand__text {
        padding-bottom: 14px;
    }
    
    .brand__name {
        font-size: .95rem;
    }
    
    .brand__tagline {
        font-size: .75rem;
    }
    
    .primary-nav {
        max-width: 100%;
    }
    
    .nav-link {
        padding: 12px 14px;
        font-size: .92rem;
    }
    
    .footer-nav__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    
    .footer-nav-column__title {
        font-size: .98rem;
    }
    
    .footer-nav-list a {
        font-size: .9rem;
    }
    
    .footer-contact__inner {
        gap: 24px;
    }
    
    .contact-list__label {
        font-size: .9rem;
    }

    .contact-list__value {
        font-size: .9rem;
    }
    
    .footer-social__title {
        font-size: .98rem;
    }
    
    .social-link {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .footer-copyright {
        font-size: .85rem;
    }
    
    .footer-legal__link {
        font-size: .85rem;
    }
    
    .topbar__inner,
    .footer__bottom { 
        align-items: flex-start;
        flex-direction: column;
    }
    
    /* Content Grid Breakpoints */
    .content-grid, .people-profile-grid, .guide-nav-grid, .academic-grid, .theme-card-grid, .archive-section, .pillar-grid, .context-grid, .manuscript-grid, .source-shelf, .impact-grid, .fatwa-preview-grid, .service-block-grid, .dashboard-tools, .axis-grid, .taxonomy-grid, .modern-grid, .library-index, .media-service-grid, .training-path-grid, .publication-category-grid, .book-grid, .metadata-grid, .media-hub-grid, .media-gateway-grid, .video-grid, .audio-grid, .gallery-grid, .training-roadmap, .curriculum-grid, .contact-card-grid, .social-grid, .window-grid, .quick-grid, .home-preview-grid, .ecosystem-blocks, .authors-grid { grid-template-columns: 1fr; }
.flipbook-pages { grid-template-columns: 1fr; min-height: auto; }
    .flipbook-page img { min-height: 320px; }
    .hero-inline-search { grid-template-columns: 1fr; width: 100%; }
    .event-card { grid-template-columns: 1fr; }
    .timeline-item { grid-template-columns: 1fr; }
    .hero__grid, .guide-hero__grid { min-height: auto; padding-block: 44px; }
    .home-hero { background-size: cover; background-position: top center; min-height: 69vw; }
    .home-hero h1 { font-size: clamp(1.85rem, 5.5vw, 2.4rem); }
    .home-hero__caption { padding-block: 26px 36px; }
    .search-panel__control { grid-template-columns: 1fr; }
    .section { padding-block: 46px; }
}


@media (max-width: 640px) {
    .pub-gallery__track { grid-template-columns: 1fr; }
    .pub-gallery__slide img { min-height: 220px; }
}

/* Landscape phones — prevent hero from exceeding viewport height */
@media (max-width: 900px) and (orientation: landscape) {
    .home-hero { min-height: 55vh; background-position: center; }
    .home-hero h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
    .home-hero__caption { padding-block: 18px 24px; }
}

/* Very small phones ≤360px (Samsung Galaxy A, older iPhones) */
@media (max-width: 360px) {
    .home-hero h1 { font-size: 1.75rem; }
    .home-hero__caption { padding-block: 20px 28px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ── Fatwa form: toast & field validation ────────────────────── */
.fatwa-toast {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(calc(-100% - 2rem));
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .875rem 1.25rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-family: "Amiri", serif;
    direction: rtl;
    max-width: 560px;
    width: calc(100% - 2rem);
    box-shadow: 0 6px 28px rgba(0,0,0,.22);
    background: #1a4731;
    color: #fff;
    border-right: 4px solid #48bb78;
    opacity: 0;
    transition: transform .4s cubic-bezier(.175,.885,.32,1.275), opacity .35s ease;
}
.fatwa-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.fatwa-toast__close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .25rem;
    opacity: .7;
    flex-shrink: 0;
}
.fatwa-toast__close:hover { opacity: 1; }
input.field-error,
select.field-error,
textarea.field-error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229,62,62,.14) !important;
    background-color: #fff5f5 !important;
}
input.field-valid,
select.field-valid,
textarea.field-valid {
    border-color: #38a169 !important;
    box-shadow: none !important;
}
input[type="checkbox"].field-error { outline: 2px solid #e53e3e; outline-offset: 2px; }
input[type="checkbox"].field-valid { outline: 2px solid #38a169; outline-offset: 2px; }
