/* =====================================================================
   NTMI — MAIN.CSS
   Shared design system: loaded by every page. Page-specific layout
   (hero, prayer times, teasers, etc.) lives in each page's own style.css.
   ===================================================================== */

:root {
    --font-display: 'Fraunces', serif;
    --font-arabic: 'Amiri', serif;
    --font-body: 'Work Sans', sans-serif;
    --maxw: 1160px;
    --shadow: 0 24px 54px -26px rgba(15, 59, 38, .28);

    --bg: #FBF8F0;
    --paper: #FFFFFF;
    --line: rgba(15, 59, 38, .13);
    --ink: #142A1E;
    --ink-dim: #4B5F52;
    --ink-faint: #7C8C80;

    --gold: #A9812C;
    --gold-bright: #C7973B;
    --gold-deep: #7C5C1B;
    --gold-tint: #F4EAD2;

    --deep: #0E3324;
    --deep-2: #134330;
    --deep-line: rgba(199, 151, 59, .25);
    --deep-ink: #F4EEDD;
    --deep-ink-dim: #C3D3C8;
    --star-op: .07;
}

/* ---------- reset ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 28px;
}

/* ---------- twinkling glitter particles (hero effect) ---------- */
.glitter {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.glitter span {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #F4EAD2 0%, rgba(244, 234, 210, 0) 70%);
    opacity: 0;
    animation-name: ntmi-twinkle;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

@keyframes ntmi-twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

@media (prefers-reduced-motion: reduce) {
    .glitter span {
        animation: none;
        opacity: .4;
    }
}

/* ---------- section shells: light (default) vs dark-green block ---------- */
section {
    position: relative;
    padding: 84px 0;
}

@media (max-width: 900px) {
    section {
        padding: 60px 0;
    }
}

@media (max-width: 560px) {
    section {
        padding: 46px 0;
    }
}

section.dark {
    background: var(--deep);
    color: var(--deep-ink);
}

section.dark .ink-dim {
    color: var(--deep-ink-dim);
}

.section-head {
    max-width: 640px;
    margin: 0 0 44px;
}

@media (max-width: 560px) {
    .section-head {
        margin: 0 0 32px;
    }
}

.section-head .kicker {
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.section-head .kicker::before {
    content: '';
    width: 18px;
    height: 1px;
    background: var(--gold);
}

section.dark .section-head .kicker {
    color: var(--gold-bright);
}

section.dark .section-head .kicker::before {
    background: var(--gold-bright);
}

.section-head h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(28px, 3.4vw, 42px);
    margin: 0 0 14px;
    line-height: 1.15;
}

.section-head p {
    color: var(--ink-dim);
    font-size: 15.5px;
    line-height: 1.7;
    margin: 0;
}

section.dark .section-head p {
    color: var(--deep-ink-dim);
}

.center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.center .kicker {
    justify-content: center;
}

.center .kicker::before {
    display: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-arabic);
    font-size: 15px;
    color: var(--gold-bright);
    letter-spacing: .04em;
    margin-bottom: 20px;
}

.eyebrow::before, .eyebrow::after {
    content: '';
    width: 26px;
    height: 1px;
    background: var(--gold-bright);
    opacity: .6;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--deep-ink-dim);
    margin-bottom: 26px;
}

.breadcrumb a {
    text-decoration: none;
    color: var(--deep-ink-dim);
}

.breadcrumb a:hover {
    color: var(--gold-bright);
}

/* ---------- header / nav (shared across all pages) ---------- */
/* =====================================================================
   HEADER & NAVIGATION SYSTEM
   Supports two theme variants on load:
   - <header class="header header-dark">  (for dark hero/bg pages)
   - <header class="header header-light"> (for light bg pages)
   Both transition smoothly to their scrolled state when user scrolls.
   ===================================================================== */

header.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    box-shadow: none;
    /*border-bottom: 1px solid transparent;*/
    transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    max-width: var(--maxw);
    margin: 0 auto;
    position: relative;
}

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

.brand-mark {
    width: 44px;
    height: 44px;
    flex: none;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-text b {
    font-size: 17px;
    letter-spacing: .02em;
    font-weight: 600;
    transition: color 0.3s ease;
}

.brand-text span {
    font-size: 10.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
}

nav.links {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-left: auto;
    margin-right: 24px;
}

nav.links a {
    text-decoration: none;
    font-size: 14.5px;
    letter-spacing: .02em;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s ease;
}

nav.links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform .3s ease;
}

nav.links a:hover::after {
    transform: scaleX(1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.3s ease;
}

/* ---------------------------------------------------------------------
   VARIANT 1: .header-dark (For Dark Hero / Dark Background Pages)
   --------------------------------------------------------------------- */

/* Initial Transparent State */
header.header-dark {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

header.header-dark .brand-mark {
    filter: brightness(0) invert(1);
}

header.header-dark .brand-text b {
    color: var(--paper, #ffffff);
}

header.header-dark nav.links a {
    color: var(--deep-ink-dim, #C3D3C8);
}

header.header-dark nav.links a:hover {
    color: var(--paper, #ffffff);
}

header.header-dark .menu-btn {
    color: var(--paper, #ffffff);
}

/* Scrolled State */
header.header-dark.scrolled {
    background-color: rgba(14, 51, 36, 0.92); /* Deep Green Glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: rgba(212, 175, 55, 0.25);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

header.header-dark.scrolled nav.links a {
    color: var(--deep-ink, #F4EEDD);
}


/* ---------------------------------------------------------------------
   VARIANT 2: .header-light (For Light / White Background Pages)
   --------------------------------------------------------------------- */

header.header-light {
    border-bottom-color: var(--line, rgba(15, 59, 38, .18));
}

/* Keeps original logo colors */
header.header-light .brand-mark {
    filter: none;
}

/* Darker brand title */
header.header-light .brand-text b {
    color: var(--ink, #0D1C14); /* Darker green/black tone */
    font-weight: 700;
}

/* Darker navigation links */
header.header-light nav.links a {
    color: var(--ink, #142A1E); /* Changed from --ink-dim to primary --ink */
    font-weight: 500; /* Increased weight for better contrast */
}

/* Active / Hover state for links */
header.header-light nav.links a:hover {
    color: var(--gold-deep, #7C5C1B); /* High-contrast gold hover state */
}

/* Darker mobile menu toggle button */
header.header-light .menu-btn {
    color: var(--ink, #0D1C14);
}

/* Scrolled State */
header.header-light.scrolled {
    background-color: rgba(251, 248, 240, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--line, rgba(15, 59, 38, .22));
    box-shadow: 0 10px 25px -10px rgba(15, 59, 38, 0.15);
}

header.header-light.scrolled nav.links a {
    color: var(--ink, #0D1C14);
}

/* ---------------------------------------------------------------------
   MOBILE NAVIGATION DRAWER & MEDIA QUERIES
   --------------------------------------------------------------------- */

@media (max-width: 900px) {
    nav.links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 12px 28px 20px;
        box-shadow: 0 16px 30px -20px rgba(15, 59, 38, .3);
    }

    nav.links.open {
        display: flex;
    }

    /* Mobile menu drawer backgrounds matching the theme */
    header.header-dark nav.links.open {
        background: var(--deep, #0E3324);
        border-bottom: 1px solid var(--deep-line);
    }

    header.header-light nav.links.open {
        background: var(--paper, #FFFFFF);
        border-bottom: 1px solid var(--line);
    }

    nav.links a {
        padding: 12px 0;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    header.header-light nav.links a {
        border-bottom-color: var(--line);
    }

    .menu-btn {
        display: block;
    }
}


/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 13.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 600;
    border: 1px solid var(--gold);
    transition: all .25s ease;
    cursor: pointer;
}

.btn-solid {
    background: var(--gold);
    color: #FFF9EC;
    border-color: var(--gold);
}

.btn-solid:hover {
    background: var(--gold-deep);
    border-color: var(--gold-deep);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    display: inline-block;
    color: var(--ink);
    border-color: var(--line);
}

.btn-ghost:hover {
    border-color: var(--gold);
    color: var(--gold);
}

section.dark .btn-ghost {
    color: var(--deep-ink);
    border-color: var(--deep-line);
}

section.dark .btn-ghost:hover {
    border-color: var(--gold-bright);
    color: var(--gold-bright);
}

/* ---------- animated stat numbers (hero stats, teaser stats, etc.) ---------- */
.stat-num {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---------- generic page hero banner (dark) — used by sub-pages ---------- */
.page-hero {
    position: relative;
    overflow: hidden;
    padding: 106px 0 72px;
}

@media (max-width: 560px) {
    .page-hero {
        padding: 90px 0 52px;
    }
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 700px 460px at 82% -10%, rgba(199, 151, 59, .14), transparent 70%),
    radial-gradient(ellipse 520px 420px at 6% 110%, rgba(199, 151, 59, .10), transparent 70%);
    z-index: 0;
}

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

.page-hero h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(34px, 4.4vw, 54px);
    line-height: 1.08;
    margin: 0 0 20px;
    letter-spacing: -.01em;
    max-width: 20ch;
}

.page-hero p.lede {
    font-size: 16.5px;
    line-height: 1.7;
    color: var(--deep-ink-dim);
    max-width: 56ch;
    margin: 0 0 32px;
}

.page-hero-ctas {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.page-hero-stats {
    display: flex;
    gap: 34px;
    margin-top: 44px;
    padding-top: 26px;
    border-top: 1px solid var(--deep-line);
    flex-wrap: wrap;
}

@media (max-width: 560px) {
    .page-hero-stats > div {
        flex: 0 0 calc(50% - 17px); /* 17px = half the 34px gap */
    }
}

.page-hero-stats div .stat-num {
    font-size: 26px;
    color: var(--gold-bright);
}

.page-hero-stats div span {
    font-size: 11px;
    letter-spacing: .04em;
    color: var(--deep-ink-dim);
    text-transform: uppercase;
}

/* ---------- donation bank-card (used by home + al zahra centre page) ---------- */
.donate-intro {
    max-width: 680px;
    margin: 0 auto 46px;
}

.donate-intro p {
    color: var(--deep-ink-dim);
    line-height: 1.8;
    font-size: 15.5px;
    margin: 0;
}

.donate-tiles {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 28px;
}

@media (max-width: 700px) {
    .donate-tiles {
        grid-template-columns:1fr;
    }
}

.donate-wrap {
    max-width: 520px;
    margin: 0 auto;
}

.bank-card {
    border: 1px solid var(--deep-line);
    border-radius: 14px;
    padding: 32px 30px;
    background: var(--deep-2);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5);
}

.bank-card .tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold-bright);
    border: 1px solid var(--deep-line);
    border-radius: 999px;
    padding: 5px 12px;
    margin-bottom: 16px;
}

.bank-card h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 500;
    margin: 0 0 10px;
    color: var(--deep-ink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.bank-card h3 svg {
    width: 20px;
    height: 20px;
    color: var(--gold-bright);
    flex: none;
}

.bank-card .sub {
    font-size: 13.5px;
    color: var(--deep-ink-dim);
    line-height: 1.6;
    margin: 0 0 22px;
}

.bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--deep-line);
    font-size: 14px;
}

.bank-row:last-of-type {
    border-bottom: none;
}

.bank-row span:first-child {
    color: var(--deep-ink-dim);
    letter-spacing: .03em;
    text-transform: uppercase;
    font-size: 11px;
}

.bank-row span:last-child {
    color: var(--deep-ink);
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: .02em;
}

.bank-note {
    margin-top: 24px;
    font-size: 12.5px;
    color: var(--deep-ink-dim);
    line-height: 1.6;
    text-align: center;
}

.donate-alt {
    text-align: center;
    margin-top: 26px;
    font-size: 13.5px;
    color: var(--deep-ink-dim);
}

.donate-alt a {
    color: var(--gold-bright);
    text-decoration: none;
    border-bottom: 1px solid var(--deep-line);
}

.donate-alt a:hover {
    border-color: var(--gold-bright);
}

/* ---------- event card (used by home + events page) ---------- */
.event-card {
    display: grid;
    grid-template-columns:150px 1fr auto;
    gap: 30px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 28px 30px;
    background: var(--paper);
    transition: border-color .25s ease, transform .25s ease;
    margin: 10px;
}

.event-card:hover {
    border-color: var(--gold);
    transform: translateX(4px);
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--line);
    padding-right: 26px;
}

.event-date .day {
    font-family: var(--font-display);
    font-size: 34px;
    color: var(--gold-deep);
    line-height: 1;
}

.event-date .rest {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 6px;
}

.event-body h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 500;
    margin: 0 0 10px;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 13.5px;
    color: var(--ink-dim);
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.event-meta svg {
    width: 14px;
    height: 14px;
    color: var(--gold);
}

@media (max-width: 900px) {
    .event-card {
        grid-template-columns:1fr;
        text-align: center;
    }

    .event-date {
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding-right: 0;
        padding-bottom: 16px;
        flex-direction: row;
        gap: 10px;
        justify-content: center;
    }
}

/* ---------- Al Zahra project detail blocks (used by centre page) ---------- */
.cc-intro {
    display: grid;
    grid-template-columns:1.3fr .6fr;
    gap: 56px;
    align-items: start;
    margin-bottom: 56px;
}

.cc-intro p {
    color: var(--ink-dim);
    line-height: 1.85;
    font-size: 15.5px;
    margin: 0 0 16px;
}

.cc-intro p.cc-disclaimer {
    font-size: 11px;
    font-style: italic;
    color: var(--ink-faint);
    line-height: 1;
}

.cc-facts {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px 26px;
    background: var(--paper);
}

.cc-facts h4 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 18px;
    color: var(--gold-deep);
}

.cc-facts ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cc-facts li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    color: var(--ink-dim);
    border-bottom: 1px dashed var(--line);
    padding-bottom: 12px;
}

.cc-facts li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cc-facts li b {
    color: var(--ink);
    font-weight: 600;
}

.cc-media {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.cc-media img {
    width: 100%;
    display: block;
}

.cc-caption {
    font-size: 12.5px;
    color: var(--ink-faint);
    text-align: center;
    margin: 0 0 48px;
    font-style: italic;
}

.cc-features {
    display: grid;
    grid-template-columns:repeat(6, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.cc-feature {
    background: var(--paper);
    padding: 26px 16px;
    text-align: center;
}

.cc-feature svg {
    width: 24px;
    height: 24px;
    color: var(--gold);
    margin: 0 auto 12px;
}

.cc-feature span {
    display: block;
    font-size: 12.5px;
    color: var(--ink-dim);
    line-height: 1.5;
}

@media (max-width: 560px) {
    .cc-intro {
        grid-template-columns:1fr;
    }

    .cc-features {
        grid-template-columns:1fr 1fr;
    }
}

/* ---------- footer (shared) ---------- */
footer {
    padding: 52px 0 26px;
    background: var(--deep);
    color: var(--deep-ink);
}

.footer-top {
    display: grid;
    grid-template-columns:1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.footer-brand-text p {
    color: var(--deep-ink-dim);
    font-size: 13.5px;
    line-height: 1.7;
    margin-top: 14px;
}

.footer-col h4 {
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold-bright);
    margin: 0 0 18px;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col a {
    text-decoration: none;
    color: var(--deep-ink-dim);
    font-size: 14px;
}

.footer-col a:hover {
    color: var(--gold-bright);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 26px;
    border-top: 1px solid var(--deep-line);
    font-size: 12.5px;
    color: var(--deep-ink-dim);
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 900px) {
    .footer-top {
        grid-template-columns:1fr 1fr;
        row-gap: 36px;
    }

    /* brand block and the "Follow" column each span the full row,
       so "Explore" and "Projects" sit side-by-side as a clean 2-col pair */
    .footer-top > div:first-child,
    .footer-col:last-child {
        grid-column: 1 / -1;
    }
}

/* ---------- scroll reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
}

.reveal.in {
    opacity: 1;
    transform: none;
}
