/* Shared styles for the redesigned foundation pages (index.html, about.html).
   Loaded after navbar.css, so the nav overrides below win at equal specificity. */

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

:root {
    --brand: #173518;
    --band: #173518;
    --sun: #FFC526;
    --on-sun: #173518;
    --surface: #FFFFFF;
    --leaf: #EDF4E8;
    --ink: #16241A;
    --muted: #4C5C50;
    --link: #1E6B3A;
    --line: #D5E0D1;
    --focus: #1E6B3A;
    --seg-masjid: #1F8A4C;
    --seg-water: #2A86C9;
    --seg-orphan: #D18A00;
    --display: 'League Spartan', 'Century Gothic', 'Futura', sans-serif;
    --body: 'Source Sans 3', 'Segoe UI', sans-serif;
    --gutter: clamp(20px, 4vw, 48px);
    --space: clamp(64px, 9vw, 120px);
}

[data-theme="dark"] {
    --band: #1B4022;
    --surface: #101C14;
    --leaf: #18281D;
    --ink: #EAF1E6;
    --muted: #A9B8AC;
    --link: #7FD19B;
    --line: #2C3F31;
    --focus: #7FD19B;
    --seg-masjid: #2E9A5C;
    --seg-water: #3688C6;
    --seg-orphan: #BC840C;
}

html { scroll-padding-top: 104px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    font-family: var(--body);
    font-size: 18px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: clamp(34px, 4.4vw, 58px); }
h3 { font-size: clamp(22px, 2vw, 27px); line-height: 1.15; }

.wrap { max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--space); }
.section-leaf { background: var(--leaf); }
.lede { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.45; max-width: 58ch; }
.prose p { max-width: 66ch; }
.prose p + p { margin-top: 1em; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 6px;
    border: 2px solid transparent;
    font-family: var(--body);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s, color .15s, border-color .15s;
}
.btn-give { background: var(--sun); color: var(--on-sun); }
.btn-give:hover { background: #FFD65E; }
.btn-line { border-color: currentColor; color: #fff; }
.btn-line:hover { background: #fff; border-color: #fff; color: var(--brand); }

/* ===== NAV (overrides navbar.css) ===== */
.navbar.navbar-light {
    position: sticky;
    padding: 10px var(--gutter);
    background: var(--surface) !important;
    border-bottom: 1px solid var(--line);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}
.navbar-light .nav-logo img { height: 68px; }
.navbar-light .nav-center { gap: 36px; }
[data-theme] .navbar-light .nav-center a {
    color: var(--ink) !important;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    padding-block: 8px;
}
[data-theme] .navbar-light .nav-center a:hover,
[data-theme] .navbar-light .nav-center a[aria-current="page"] { color: var(--link) !important; }
.navbar-light .nav-center a::after { background: var(--link); bottom: 0; height: 2px; }
.navbar-light .nav-center a[aria-current="page"]::after { width: 100%; }
.navbar-light .has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: none; }
.navbar-light .dropdown-arrow { width: 13px; height: 13px; }
[data-theme] .navbar-light .dropdown-inner {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(23, 53, 24, .14);
}
[data-theme] .navbar-light .dropdown a {
    color: var(--ink) !important;
    font-size: 16px !important;
    letter-spacing: 0 !important;
    padding: 10px 22px;
}
[data-theme] .navbar-light .dropdown a:hover { background: var(--leaf) !important; color: var(--link) !important; padding-left: 22px; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
[data-theme] .navbar-light .nav-cta {
    padding: 12px 26px;
    border: 0;
    border-radius: 6px;
    background: var(--sun);
    color: var(--on-sun);
    font-family: var(--body);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}
[data-theme] .navbar-light .nav-cta:hover { background: #FFD65E; color: var(--on-sun); }
[data-theme] .navbar-light .theme-toggle { border-color: var(--line); color: var(--ink); }
[data-theme] .navbar-light .theme-toggle:hover { background: var(--leaf); border-color: var(--line); color: var(--ink); }
[data-theme] .navbar-light .hamburger span { background: var(--ink) !important; height: 2px; }

/* ===== MOBILE DRAWER ===== */
.drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 86vw);
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 72px 28px 32px;
    border: 0;
    background: var(--surface);
    color: var(--ink);
}
.drawer::backdrop { background: rgba(10, 25, 14, .55); }
.drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: none;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.drawer a, .drawer summary {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 19px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.drawer details a { padding-left: 16px; font-size: 17px; font-weight: 400; }
.drawer .btn { margin-top: 24px; border-bottom: 0; color: var(--on-sun); padding: 15px 30px; font-weight: 700; }

/* ===== HOME HERO ===== */
.hero-band { background: var(--band); color: #fff; --focus: var(--sun); }
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
    gap: clamp(32px, 4vw, 64px);
    align-items: end;
    padding-block: clamp(40px, 3.6vw, 56px);
}
.hero-grid h1 { font-size: clamp(44px, 5.2vw, 84px); line-height: 1; letter-spacing: -0.02em; text-wrap: initial; }
.hero-aside p { font-size: 20px; line-height: 1.4; margin-bottom: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* The four ways to give, set edge to edge straight under the headline. */
.doors { display: flex; gap: 3px; height: clamp(320px, 48vh, 540px); background: var(--band); }
.door {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
    transition: flex-grow .3s ease;
}
.door img { width: 100%; height: 100%; object-fit: cover; }
.door:focus-visible { outline-offset: -5px; outline-color: var(--sun); z-index: 1; }
.door-tag {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: calc(100% - 20px);
    padding: 14px 22px 12px;
    background: var(--surface);
    border-top-right-radius: 6px;
    transition: background-color .15s, color .15s;
}
.door-type { display: block; font-size: 16px; font-weight: 600; color: var(--muted); }
.door-name { display: block; font-family: var(--display); font-size: clamp(20px, 1.9vw, 27px); font-weight: 700; line-height: 1.1; }
.door:hover, .door:focus-visible { flex-grow: 1.35; }
.door:hover .door-tag, .door:focus-visible .door-tag { background: var(--sun); color: var(--on-sun); }
.door:hover .door-type, .door:focus-visible .door-type { color: var(--on-sun); }

/* ===== FUNDS RAISED ===== */
.funds-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; margin-bottom: 40px; }
.funds-asof { color: var(--muted); }
.funds-bar { display: grid; grid-template-columns: 11137.10fr 10678.70fr 3335.45fr; gap: 2px; list-style: none; }
.funds-bar .seg { display: block; height: 30px; margin-bottom: 18px; background: var(--c); }
.funds-bar li:first-child .seg { border-radius: 4px 0 0 4px; }
.funds-bar li:last-child .seg { border-radius: 0 4px 4px 0; }
.funds-bar .amount { display: block; font-family: var(--display); font-size: clamp(24px, 2.6vw, 36px); font-weight: 700; line-height: 1.1; }
.funds-bar .label { display: block; color: var(--muted); padding-right: 12px; line-height: 1.3; }

/* ===== PROJECT LIST ===== */
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head p { margin-top: 14px; }
.project-list { list-style: none; border-top: 2px solid var(--ink); }
.project {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) 260px;
    gap: 12px 32px;
    align-items: start;
    padding-block: 30px;
    border-bottom: 1px solid var(--line);
}
.project-type { font-weight: 700; padding-top: 3px; }
.project h3 a { color: inherit; text-decoration: none; }
.project h3 a:hover { text-decoration: underline; }
.project p { margin-top: 8px; max-width: 62ch; color: var(--muted); }
.project-side { text-align: right; }
.project-status { display: block; color: var(--muted); margin-bottom: 6px; }
.project-donate { font-weight: 700; }

/* ===== HOW DONATIONS WORK ===== */
.how-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 88px); align-items: center; }
.how-grid figure img { width: 100%; border-radius: 6px; }
.how-grid figcaption { margin-top: 10px; color: var(--muted); font-size: 16px; }
.steps { list-style: none; counter-reset: step; margin-top: 32px; }
.steps li { counter-increment: step; position: relative; padding-left: 58px; }
.steps li + li { margin-top: 26px; }
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: -2px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--band);
    color: #fff;
    font-family: var(--display);
    font-weight: 700;
    font-size: 21px;
    line-height: 44px;
    text-align: center;
}
.steps p { margin-top: 4px; color: var(--muted); }

/* ===== WHY WE STARTED ===== */
.origin-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.origin-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 28%; border-radius: 6px; }
.origin-copy h2 { margin-bottom: 20px; }
.origin-quote { margin-top: 28px; padding-left: 20px; border-left: 4px solid var(--sun); }
.origin-quote p { font-size: 21px; line-height: 1.4; }
.origin-quote footer { margin-top: 8px; color: var(--muted); }
.text-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 28px; font-weight: 700; }

/* ===== DONATE ===== */
.donate { background: var(--band); color: #fff; --focus: var(--sun); --link: #fff; }
.donate-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: clamp(36px, 6vw, 88px); align-items: start; }
.donate-copy h2 { margin-bottom: 20px; }
.donate-list { list-style: none; margin-top: 32px; }
.donate-list li { padding-block: 13px; border-top: 1px solid rgba(255, 255, 255, .25); }
.donate-list strong { display: block; }
.donate-panel { padding: 24px; border-radius: 8px; background: #fff; color: #16241A; --link: #1E6B3A; --focus: #1E6B3A; }
.partner { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; color: #4C5C50; font-size: 16px; }
.partner img { width: 72px; height: 72px; object-fit: contain; }
.donate-form-wrap { display: flex; justify-content: center; min-height: 400px; }

/* ===== FOOTER ===== */
.site-footer { background: var(--brand); color: rgba(255, 255, 255, .85); --focus: var(--sun); font-size: 17px; }
[data-theme="dark"] .site-footer { background: #0B150E; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; padding-block: 64px 48px; }
.footer-logo { width: auto; height: 96px; margin-bottom: 16px; }
.footer-brand p { max-width: 34ch; margin-bottom: 20px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px; color: #fff; }
.footer-social a:hover { background: rgba(255, 255, 255, .12); }
.footer-social svg { width: 18px; height: 18px; }
.footer-col h3 { font-size: 20px; color: #fff; margin-bottom: 14px; letter-spacing: 0; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: inherit; overflow-wrap: anywhere; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px; border-top: 1px solid rgba(255, 255, 255, .18); font-size: 16px; }
.footer-bottom a { color: #fff; }

/* ===== ABOUT HERO ===== */
.page-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--band); color: #fff; --focus: var(--sun); }
.page-hero-copy { padding: clamp(48px, 7vw, 104px) clamp(32px, 5vw, 72px) clamp(48px, 7vw, 104px) max(var(--gutter), calc((100vw - 1280px) / 2 + var(--gutter))); }
.page-hero h1 { font-size: clamp(44px, 5.6vw, 80px); margin-bottom: 24px; }
.page-hero-copy p + p { margin-top: 16px; }
.page-hero-copy .hero-actions { margin-top: 32px; }
.page-hero-img { min-height: 320px; }
.page-hero-img img { width: 100%; height: 100%; object-fit: cover; }

/* ===== ABOUT: MISSION, VALUES ===== */
.mission-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 88px); }
.mission-grid h2 { margin-bottom: 20px; }
.aims { list-style: none; border-top: 2px solid var(--ink); }
.aims li { padding-block: 18px; border-bottom: 1px solid var(--line); font-size: 20px; line-height: 1.35; }
.mission-after { margin-top: 24px; color: var(--muted); max-width: 62ch; }
.columns { display: grid; gap: 32px clamp(24px, 3vw, 44px); margin-top: 48px; }
.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.columns > div { border-top: 4px solid var(--band); padding-top: 16px; }
.columns p { margin-top: 10px; color: var(--muted); }

/* ===== ABOUT: STORY ===== */
.story-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(36px, 6vw, 88px); align-items: start; }
.story-side { position: sticky; top: 112px; }
.story-side img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; }
.timeline { list-style: none; margin-top: 24px; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--band); }
.timeline strong { display: block; line-height: 1.25; }
.timeline span { display: block; color: var(--muted); font-size: 16px; line-height: 1.35; }
.story-body h2 { margin-bottom: 28px; }
.story-body h3 { margin: 44px 0 14px; }
.story-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 66ch; margin-block: 32px; }
.story-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.story-photos figcaption { margin-top: 6px; color: var(--muted); font-size: 16px; }
.lion { max-width: 66ch; margin-block: 32px; padding: 26px 30px; border-radius: 6px; background: var(--surface); }
.lion dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin-block: 14px; font-size: 21px; }
.lion dt { font-weight: 700; }
.lion p { max-width: none; }

/* ===== ABOUT: TRIBUTES ===== */
.tribute-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px clamp(24px, 3vw, 44px); margin-top: 40px; }
.tribute-grid blockquote p { font-size: 20px; line-height: 1.45; }
.tribute-grid figcaption { margin-top: 12px; font-weight: 700; }
.tribute-grid figcaption span { display: block; font-weight: 400; color: var(--muted); }
.poem { margin-top: 56px; border-block: 2px solid var(--ink); }
.poem summary { padding-block: 20px; font-family: var(--display); font-size: clamp(21px, 2vw, 26px); font-weight: 700; cursor: pointer; }
.poem-body { padding-bottom: 32px; }
.poem-body p { max-width: 62ch; font-size: 19px; line-height: 1.6; }
.poem-body p + p { margin-top: 14px; }
.poem-credit { margin-top: 24px; }
.poem-credit strong, .poem-credit span { display: block; }
.poem-credit span { color: var(--muted); }

/* ===== CALL TO ACTION ===== */
.cta-band { background: var(--band); color: #fff; --focus: var(--sun); }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 48px; padding-block: clamp(48px, 6vw, 80px); }
.cta-inner h2 { margin-bottom: 10px; font-size: clamp(30px, 3.6vw, 48px); }
.cta-inner > div:first-child { flex: 1 1 480px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .navbar-light .nav-center { gap: 24px; }
    .project { grid-template-columns: 110px minmax(0, 1fr); }
    .project-side { grid-column: 2; text-align: left; }
    .project-status { display: inline; margin-right: 16px; }
    .how-grid, .donate-grid { grid-template-columns: minmax(0, 1fr); }
    .donate-panel { max-width: 520px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .columns-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .story-grid { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .navbar.navbar-light { padding-block: 8px; }
    .navbar-light .nav-logo img { height: 56px; }
    [data-theme] .navbar-light .nav-cta { padding: 10px 18px; font-size: 16px; }

    .hero-grid { grid-template-columns: 1fr; align-items: start; }
    .doors { display: grid; grid-template-columns: 1fr 1fr; height: auto; }
    .door { height: 230px; }
    .door-tag { padding: 10px 14px 8px; }
    .door-type { font-size: 15px; }

    .funds-bar { grid-template-columns: 1fr; gap: 22px; }
    .funds-bar .seg { width: calc(var(--share) * 1%); height: 22px; margin-bottom: 8px; border-radius: 0 4px 4px 0 !important; }

    .origin-grid, .mission-grid, .page-hero { grid-template-columns: 1fr; }
    .origin-grid img { max-width: 340px; }
    .page-hero-copy { padding-inline: var(--gutter); }
    .page-hero-img { height: 280px; min-height: 0; }
    .columns-3, .tribute-grid { grid-template-columns: 1fr; }
    .story-grid { grid-template-columns: 1fr; }
    .story-side { position: static; }
    .story-side img { max-width: 340px; }
}

@media (max-width: 600px) {
    body { font-size: 17px; }
    .project { grid-template-columns: 1fr; gap: 6px; padding-block: 24px; }
    .project-side { grid-column: 1; margin-top: 6px; }
    .hero-actions .btn { flex: 1 1 100%; }
    .columns-4 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; padding-block: 48px 32px; }
    .door { height: 190px; }
    .door-name { font-size: 18px; }
    .donate-panel { padding: 16px 8px; }
    .lion { padding: 20px; }
    [data-theme] .navbar-light .theme-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
