/* Burichang Salafiah Madrasha: the one stylesheet every public page shares.

   Change the look here, once, and every page follows:
     1. Colours, fonts, widths           (:root, below)
     2. Header, menu drawer, phone bar, footer
     3. Shared page parts                 (page banner, section titles, dividers)
     4. Language: Bengali / Arabic        (.lang-bn, .lang-ar)
     5. Motion                            (.reveal)

   A page's own layout (only what that page has) lives in Styles/pages/<page>.css,
   loaded after this file by partials/site_head.php. Nothing is repeated between files. */

/* ── 1. Colours, fonts, widths ── */
:root {
    --primary: #000e2c;          /* navy */
    --primary-light: #001a4e;
    --primary-lighter: #002266;
    --gold: #c9a84c;             /* fills and text on navy; on cream use --gold-ink */
    --gold-light: #e8cc7a;       /* text on navy 12.1:1 */
    --gold-pale: #f5e8c0;
    --gold-ink: #7d6018;         /* gold-coloured text on cream 5.5:1 */
    --cream: #faf6ed;
    --cream-deep: #f0ebe0;
    --white: #ffffff;
    --text-dark: #1a1a2e;
    --text-mid: #3d3d5c;         /* 9.6:1 on cream */
    --text-light: #63637f;       /* 4.9:1 on cream-deep, 5.4:1 on cream, 5.8:1 on white */
    --muted-on-navy: #c0c3cb;    /* small text on navy 10.8:1 */
    --green: #1a6b3a;
    --green-light: #e8f5ee;
    --border: rgba(201, 168, 76, .25);
    --border-solid: rgba(201, 168, 76, .4);
    --gold-line: rgba(201, 168, 76, .28);
    --line: rgba(201, 168, 76, .35);
    --shadow-gold: 0 4px 30px rgba(201, 168, 76, .15);
    --shadow-dark: 0 8px 40px rgba(0, 14, 44, .25);
    --error: #8b1a1a;
    --success: #1a7a4a;
    --input-bg: #fff;
    --input-border: #d4c9a8;
    --input-focus: #c9a84c;
    --radius: 4px;
    --radius-lg: 8px;
    --transition: all .3s cubic-bezier(.4, 0, .2, 1);
    --wrap: 1320px;
    --font-bn: 'Noto Serif Bengali', 'Noto Sans Bengali', 'Hind Siliguri', system-ui, sans-serif;
    --font-ar: 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

/* ── 2. Header, menu drawer, phone bar, footer (partials/site_header.php, site_footer.php) ──
   Logical properties, so Arabic (dir="rtl") mirrors without extra rules. */
.sh-wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 20px;
}

.skip-link {
    position: absolute;
    inset-inline-start: 12px;
    top: -60px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--gold);
    color: var(--primary);
    font: 700 15px var(--font-bn);
    text-decoration: none;
}

.skip-link:focus { top: 12px; }

.sh-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    fill: currentColor;
}

/* ── top bar: contact, portals, language ── */
.sh-top {
    background: #000a20;
    border-bottom: 1px solid var(--gold-line);
    font: 13px/1.4 var(--font-bn);
    color: var(--muted-on-navy);
}

.sh-top .sh-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 38px;
}

.sh-top a {
    color: var(--muted-on-navy);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sh-top a:hover { color: var(--gold-light); }

.sh-top-group {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.sh-lang {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
}

.sh-lang button, .sh-lang a, .sh-lang span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted-on-navy);
    font: 600 13px var(--font-bn);
    cursor: pointer;
}

.sh-lang [lang="ar"] { font-family: var(--font-ar); font-size: 15px; }
/* the current language is a lit label; the other one is a link to this page in that language */
.sh-lang .active { background: var(--gold); color: var(--primary); cursor: default; }
.sh-lang a:hover { color: var(--gold-light); }

/* ── main bar ── */
.sh {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--primary);
    border-bottom: 2px solid var(--gold);
    font-family: var(--font-bn);
    transition: box-shadow .3s;
}

.sh.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }

.sh-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 72px;
}

.sh-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.sh-brand img { width: 52px; height: 52px; }

.sh-brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.sh-brand-name strong {
    color: var(--gold-light);
    font-size: 19px;
    font-weight: 600;
}

.sh-brand-name strong.lang-ar { font-size: 22px; line-height: 1.6; } /* room for Amiri's descenders above the English line */
.sh-brand-name small { color: var(--muted-on-navy); font-size: 12.5px; letter-spacing: .02em; }

.sh-nav { margin-inline-start: auto; }

.sh-nav > ul {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sh-nav li { position: relative; }

.sh-nav a {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
}

.sh-nav a:hover, .sh-nav li:focus-within > a { color: var(--gold-light); background: rgba(255, 255, 255, .06); }
.sh-nav a[aria-current="page"] { color: var(--gold-light); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 8px 8px 0 0; }
.sh-nav .sh-caret { width: 10px; height: 10px; opacity: .7; }

/* sub-menus open on hover and on keyboard focus */
.sh-sub {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    min-width: 230px;
    list-style: none;
    margin: 0;
    padding: 8px;
    background: var(--primary-light);
    border: 1px solid var(--gold-line);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    /* hidden only after the fade out; shown at once, so keyboard focus can land in it */
    transition: opacity .18s, transform .18s, visibility 0s .18s;
}

.sh-nav li:hover > .sh-sub, .sh-nav li:focus-within > .sh-sub { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .18s, visibility 0s; }
.sh-sub a { font-size: 14.5px; }

.sh-actions { display: flex; gap: 8px; flex-shrink: 0; }

.sh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    font: 700 14.5px var(--font-bn);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s, color .2s, border-color .2s;
}

.sh-btn.gold { background: var(--gold); color: var(--primary); }
.sh-btn.gold:hover { background: var(--gold-light); }
.sh-btn.ghost { border: 1.5px solid var(--gold); color: var(--gold-light); }
.sh-btn.ghost:hover { background: rgba(201, 168, 76, .12); }

.sh-burger {
    display: none;
    width: 44px;
    height: 44px;
    margin-inline-start: auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gold-line);
    border-radius: 10px;
    background: transparent;
    color: var(--gold-light);
    cursor: pointer;
}

.sh-burger .sh-icon { width: 22px; height: 22px; }

.sh a:focus-visible, .sh button:focus-visible, .sh-top a:focus-visible, .sh-top button:focus-visible,
.sh-drawer a:focus-visible, .sh-drawer button:focus-visible, .sf a:focus-visible, .sh-dock a:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 2px;
}

/* ── phone drawer ── */
.sh-drawer {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 6, 20, .55);
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s, visibility 0s .25s;
}

.sh-drawer-panel {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(340px, 88vw);
    overflow-y: auto;
    padding: 18px 18px 28px;
    background: var(--primary);
    border-inline-start: 2px solid var(--gold);
    font-family: var(--font-bn);
    transform: translateX(100%);
    transition: transform .25s ease-out;
}

[dir="rtl"] .sh-drawer-panel { transform: translateX(-100%); }
.sh-drawer.open { visibility: visible; opacity: 1; transition: opacity .25s, visibility 0s; }
.sh-drawer.open .sh-drawer-panel { transform: none; }

.sh-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sh-drawer h2 {
    margin: 18px 0 6px;
    color: var(--gold);
    font-size: 12.5px;
    letter-spacing: .08em;
}

.sh-drawer ul { list-style: none; margin: 0; padding: 0; }

.sh-drawer a:not(.sh-btn) {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 10px;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    text-decoration: none;
}

.sh-drawer a:not(.sh-btn):hover, .sh-drawer a[aria-current="page"] { background: rgba(255, 255, 255, .07); color: var(--gold-light); }
.sh-drawer .sh-actions { margin-top: 18px; flex-wrap: wrap; }
.sh-drawer .sh-btn { flex: 1; }
body.sh-locked { overflow: hidden; }

/* ── phone bar: call, WhatsApp, admission ── */
.sh-dock { display: none; }

/* ── footer ── */
.sf {
    position: relative;
    background: var(--primary);
    border-top: 3px solid var(--gold);
    color: var(--muted-on-navy);
    font: 15px/1.7 var(--font-bn);
}

.sf-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.1fr 1.3fr;
    gap: 36px;
    padding-block: 56px 40px;
}

.sf h2 {
    margin: 0 0 14px;
    color: var(--gold-light);
    font-size: 17px;
    font-weight: 600;
}

.sf-brand img { width: 72px; height: 72px; margin-bottom: 12px; }
.sf-names { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.sf-names strong { color: #fff; font-size: 18px; font-weight: 600; }
.sf-names [lang="ar"] { color: var(--gold-light); font-size: 21px; }
.sf-names span:not([lang]) { font-size: 14px; }
.sf p { margin: 0 0 10px; }
.sf ul { list-style: none; margin: 0; padding: 0; }
.sf a { color: var(--muted-on-navy); text-decoration: none; }
.sf a:hover { color: var(--gold-light); }
.sf-links a { display: inline-flex; min-height: 34px; align-items: center; }

.sf-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.sf-contact .sh-icon { color: var(--gold); margin-top: 5px; }

.sf-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.sf-social a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    font-size: 14px;
}

.sf-map iframe {
    width: 100%;
    height: 210px;
    border: 0;
    border-radius: 12px;
    filter: grayscale(.25);
}

.sf-bottom {
    border-top: 1px solid var(--gold-line);
    padding-block: 18px;
    font-size: 13.5px;
}

.sf-bottom .sh-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
}

.sf-credit a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-on-navy); }
.sf-credit img { height: 22px; width: auto; }

@media (prefers-reduced-motion: reduce) {
    .sh, .sh-sub, .sh-drawer, .sh-drawer-panel, .sh-btn { transition: none; }
}

/* ── narrower screens: the menu moves into the drawer ── */
@media (max-width: 1180px) {
    .sh-nav, .sh-bar > .sh-actions { display: none; }
    .sh-burger { display: inline-flex; }
}

@media (max-width: 900px) {
    .sf-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 760px) {
    .sh-top .sh-contact { display: none; }
    .sh-top .sh-wrap { justify-content: flex-end; }
    .sh-top-portals { display: none; }
    .sh-bar { min-height: 64px; gap: 12px; }
    .sh-brand img { width: 44px; height: 44px; }
    .sh-brand-name strong { font-size: 16px; }
    .sh-brand-name strong.lang-ar { font-size: 19px; }
    .sh-brand-name small { font-size: 11.5px; }
    .sf-grid { grid-template-columns: 1fr; padding-block: 40px 28px; }

    .sh-dock {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 900;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        background: var(--primary);
        border-top: 2px solid var(--gold);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .sh-dock a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 56px;
        color: #fff;
        font: 600 12.5px var(--font-bn);
        text-decoration: none;
    }

    .sh-dock a .sh-icon { width: 20px; height: 20px; color: var(--gold-light); }
    .sh-dock a.gold { background: var(--gold); color: var(--primary); }
    .sh-dock a.gold .sh-icon { color: var(--primary); }
    body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
}

/* ── 3. Shared page parts ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* read by screen readers, not shown: headings that name a section the eye already understands */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-bn);
    background: var(--cream);
    color: var(--text-dark);
    overflow-x: hidden;
}

.page-hero {
    background: var(--primary);
    position: relative;
    overflow: hidden;
    padding: 80px 24px 60px;
    text-align: center;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(45deg, rgba(201, 168, 76, 0.025) 0, rgba(201, 168, 76, 0.025) 1px, transparent 1px, transparent 60px), repeating-linear-gradient(-45deg, rgba(201, 168, 76, 0.025) 0, rgba(201, 168, 76, 0.025) 1px, transparent 1px, transparent 60px);
}

.page-hero-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    border: 1px solid rgba(201, 168, 76, 0.07);
    border-radius: 50%;
    pointer-events: none;
}

.page-hero-ring::before {
    content: '';
    position: absolute;
    inset: 30px;
    border: 1px solid rgba(201, 168, 76, 0.05);
    border-radius: 50%;
}

.page-hero-content {
    position: relative;
    z-index: 2;
}

.hero-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 420px;
    height: 420px;
    border: 1px solid rgba(201,168,76,0.07);
    border-radius: 50%;
    pointer-events: none;
}

.hero-ring::before {
    content: '';
    position: absolute;
    inset: 30px;
    border: 1px solid rgba(201,168,76,0.05);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    margin: 16px 0;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 0.4s;
}

.hero-divider-line {
    flex: 1;
    max-width: 100px;
    height: 1px;
}

.hero-divider-line:last-child {
    background: linear-gradient(90deg, var(--gold), transparent);
}

.hero-divider-icon {
    color: var(--gold);
    font-size: 14px;
}

@keyframes fadeUp {
            from {
                opacity: 0;
                transform: translateY(24px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

.social-icon:hover {
    background: var(--gold);
    color: var(--primary);
    border-color: var(--gold);
}

.hero-tag {
    display: inline-block;
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid var(--border);
    color: var(--gold);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.o-line {
    flex: 1;
    height: 1px;
}

.o-line-l {
    background: linear-gradient(90deg, transparent, var(--gold));
}

.o-line-r {
    background: linear-gradient(90deg, var(--gold), transparent);
}

.o-diamond {
    width: 7px;
    height: 7px;
    background: var(--gold);
    transform: rotate(45deg);
    flex-shrink: 0;
}

.hero-title.ar {
    font-family: var(--font-ar);
}

.hero-sub {
    font-size: 14px;
    color: var(--muted-on-navy);
}

.hero-sub.ar {
    font-family: var(--font-ar);
    font-size: 16px;
}

.page-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.section-header {
    margin-bottom: 36px;
}

.ornament-line:last-child {
    background: linear-gradient(90deg, var(--gold), transparent);
}

.ornament-diamond {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
}

.section-header h2.ar {
    font-family: var(--font-ar);
    direction: rtl;
}

.section-header p {
    font-size: 14px;
    color: var(--text-mid);
    margin-top: 6px;
    line-height: 1.8;
}

.section-header p.ar {
    font-family: var(--font-ar);
    font-size: 16px;
    direction: rtl;
}

.s-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 52px 0;
}

.s-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(0,14,44,0.1);
}

@media(max-width:600px) {
    .page-content {
        padding: 40px 16px 60px;
    }
}

/* ── 4. Language: Bengali / Arabic ──
   Write both: <span class="lang-bn">…</span><span class="lang-ar" lang="ar">…</span>.
   The other language is hidden and nothing else changes, so text stays inline or block as written.
   Arabic pages live under /ar/; the server marks them <html dir="rtl"> and <body class="ar-mode">
   (partials/site_lang.php), so no script is involved. */
body:not(.ar-mode) .lang-ar,
body.ar-mode .lang-bn { display: none !important; }
body.ar-mode { direction: rtl; }
/* spaced-out letters break the Bengali headline stroke and the joins between Arabic letters */
:lang(bn), :lang(ar) { letter-spacing: normal !important; }
.lang-ar:not(i), [lang="ar"]:not(i) { font-family: var(--font-ar); } /* icons (<i class="fas … lang-ar">) keep their icon font */

/* ── 5. Motion ──
   Give anything class="reveal" and it rises into view as you scroll (scripts/site.js, GSAP ScrollTrigger).
   html.motion is set only when the visitor has not asked for reduced motion, so without JavaScript
   or with reduced motion everything is simply shown. */
html.motion .reveal:not(.visible) { opacity: 0; transform: translateY(24px); }
:where(html.motion:not(.gsap)) .reveal { transition: opacity .6s ease-out, transform .6s ease-out; }
/* safety net: if scripts/site.js never starts (a failed download), show everything after 3 seconds */
html.motion:not(.js-ready) .reveal:not(.visible) { animation: reveal-failsafe .4s 3s ease-out forwards; }
@keyframes reveal-failsafe { to { opacity: 1; transform: none; } }
/* reduced motion: every page's own CSS animations (hero fade-ins, rings, ticker) jump straight to their end */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
