/* ==========================================================================
   Janazah.com — Design System v2
   Editorial · Restrained · Confident
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

:root {
    /* Color */
    --cream:           #F4EBDD;
    --cream-soft:      #FAF6EE;
    --paper:           #FFFFFF;
    --ink:             #161613;
    --ink-soft:        #1F1F1B;
    --text:            #1A1A17;
    --text-mid:        #57564E;
    --text-dim:        #93908A;
    --gold:            #B8956A;
    --gold-soft:       #C9AD89;
    --border:          #E5DFD5;
    --border-strong:   #D5CDBE;
    --line:            rgba(22,22,19,0.08);

    /* Radius */
    --r-pill:  999px;
    --r-card:  20px;
    --r-input: 12px;
    --r-tile:  6px;

    /* Type */
    --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --sans:  'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Type scale */
    --fs-xs:    0.75rem;
    --fs-sm:    0.875rem;
    --fs-base:  1rem;
    --fs-lg:    1.125rem;
    --fs-xl:    1.25rem;
    --fs-2xl:   1.5rem;
    --fs-3xl:   clamp(1.75rem, 3.5vw, 2.25rem);
    --fs-4xl:   clamp(2.25rem, 5vw, 3.25rem);
    --fs-5xl:   clamp(3rem, 7vw, 4.75rem);
    --fs-disp:  clamp(3.75rem, 11vw, 7.5rem);

    /* Layout */
    --max-w:        1240px;
    --max-w-text:   720px;
    --pad-x:        clamp(1rem, 4vw, 2rem);
    --section-y:    clamp(4rem, 9vw, 7rem);

    /* Motion */
    --ease:         cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);

    /* Legacy aliases — keep so other pages don't break */
    --bg-warm:        var(--cream);
    --bg-white:       var(--paper);
    --text-primary:   var(--text);
    --text-secondary: var(--text-mid);
    --text-tertiary:  var(--text-dim);
    --accent-grey:    #9E9E9E;
    --border-light:   var(--border);
    --radius-card:    var(--r-card);
    --radius-button:  var(--r-pill);
    --radius-input:   var(--r-input);
    --font-serif:     var(--serif);
    --font-sans:      var(--sans);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--cream);
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--fs-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;     /* defend against any decorative element spilling */
}
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Typography */
h1, h2, h3, h4, h5 {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.1;
}
h1 { font-size: var(--fs-5xl); letter-spacing: -0.025em; }
h2 { font-size: var(--fs-4xl); letter-spacing: -0.02em; }
h3 { font-size: var(--fs-2xl); letter-spacing: -0.01em; }
h4 { font-size: var(--fs-xl); }
p  { color: var(--text-mid); }

a { color: inherit; text-decoration: none; transition: color 0.25s var(--ease); }

/* ============ Container ============ */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad-x);
}

/* Editorial label / kicker */
.label, .eyebrow {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text-dim);
    margin-bottom: 0.85rem;
    position: relative;
    padding-left: 28px;
}
.label::before, .eyebrow::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 18px; height: 1px;
    background: var(--text-dim);
}
.eyebrow.is-light { color: rgba(255,255,255,0.7); }
.eyebrow.is-light::before { background: rgba(255,255,255,0.5); }
.eyebrow.is-center {
    padding-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.eyebrow.is-center::before { position: static; }
.eyebrow.is-center::after {
    content: '';
    width: 18px; height: 1px;
    background: currentColor;
    opacity: 0.4;
}

/* ============ Header (sticky, scroll-aware) ============ */
.site-header,
header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(244, 235, 221, 0.85);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
header.is-scrolled,
body.is-scrolled header {
    border-bottom-color: var(--line);
    background: rgba(244, 235, 221, 0.95);
}
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem var(--pad-x);
    max-width: var(--max-w);
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}
.brand::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(184,149,106,0.18);
}

nav {
    display: flex;
    gap: 1.85rem;
    align-items: center;
}
nav a {
    position: relative;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-mid);
    padding: 0.4rem 0;
}
nav a:hover { color: var(--text); }
nav a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--text);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.35s var(--ease-out);
}
nav a:hover::after, nav a.active::after { transform: scaleX(1); }
nav a.active { color: var(--text); font-weight: 600; }

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px; height: 18px;
    cursor: pointer;
    z-index: 110;
}
.menu-toggle span {
    display: block; width: 100%; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s var(--ease);
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 54px;
    padding: 0 2rem;
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
    text-decoration: none;
    width: 100%;
}
.btn:hover {
    background: var(--ink-soft);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.btn-ghost {
    background: transparent;
    color: var(--paper);
    border-color: rgba(255,255,255,0.25);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.5);
}

.btn-auto { width: auto; }

.btn-sm { height: 44px; padding: 0 1.4rem; font-size: 0.7rem; }
.btn-lg { height: 60px; padding: 0 2.5rem; font-size: 0.82rem; }

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--text);
    padding: 2px 0;
    transition: gap 0.25s var(--ease);
    background: none;
}
.btn-link:hover { gap: 0.85rem; }
.btn-link::after { content: '→'; font-weight: 400; transition: transform 0.25s var(--ease); }

.btn-hero-outlined { /* legacy alias */
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--text);
}
.btn-hero-outlined:hover { background: var(--text); color: var(--paper); }

/* ============ Inputs ============ */
.input-group { margin-bottom: 1.25rem; text-align: left; }
.input-field {
    width: 100%;
    height: 54px;
    padding: 0 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    background: var(--paper);
    font: inherit;
    color: var(--text);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.input-field::placeholder { color: var(--text-dim); }
.input-field:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(22,22,19,0.08);
}
textarea.input-field { padding-top: 1rem; padding-bottom: 1rem; min-height: 130px; }

/* ============ Cards ============ */
.card {
    background: var(--paper);
    border-radius: var(--r-card);
    padding: clamp(2rem, 5vw, 3.5rem);
    box-shadow: 0 1px 0 rgba(22,22,19,0.04), 0 16px 50px rgba(22,22,19,0.04);
}

.tile {
    background: var(--paper);
    border-radius: var(--r-card);
    padding: 2rem;
    border: 1px solid transparent;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.tile:hover {
    transform: translateY(-4px);
    border-color: var(--border);
    box-shadow: 0 14px 40px rgba(22,22,19,0.06);
}

/* ============ Sections ============ */
.section { padding: var(--section-y) 0; }
.section-pad-sm { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section-paper  { background: var(--paper); }
.section-cream  { background: var(--cream); }
.section-soft   { background: var(--cream-soft); }
.section-ink {
    background: var(--ink);
    color: var(--paper);
}
.section-ink h1, .section-ink h2, .section-ink h3, .section-ink h4 { color: var(--paper); }
.section-ink p { color: rgba(255,255,255,0.72); }

.section-head {
    max-width: 720px;
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
    text-align: center;
}
.section-head h2 { margin-bottom: 1rem; }
.section-head p { font-size: var(--fs-lg); }

/* Spacer (legacy) */
.spacer-y { height: clamp(2.5rem, 5vw, 4rem); }
.spacer-sm { height: 1.5rem; }

/* ============ Hero (homepage anchor) ============ */
.hero-stack {
    position: relative;
    padding: clamp(3rem, 7vw, 6rem) 0 clamp(4rem, 8vw, 6rem);
    overflow: hidden;
}
.hero-stack .hero-eyebrow { margin-bottom: 1.5rem; }
.hero-stack h1 {
    font-size: var(--fs-disp);
    line-height: 0.95;
    letter-spacing: -0.035em;
    margin-bottom: 1.5rem;
    max-width: 12ch;
}
.hero-stack h1 em {
    font-style: italic;
    color: var(--text-mid);
    font-weight: 400;
}
.hero-stack .hero-lead {
    font-size: var(--fs-lg);
    max-width: 540px;
    margin-bottom: 2.5rem;
    line-height: 1.55;
}
.hero-stack .hero-cta {
    display: inline-flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.hero-deco {
    position: absolute;
    top: 12%;
    right: -4%;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(184,149,106,0.18), transparent 65%);
    filter: blur(8px);
    pointer-events: none;
}

/* Legacy hero (kept for non-anchor pages) */
.hero {
    text-align: center;
    padding: clamp(3rem, 6vw, 5rem) 0 clamp(3rem, 5vw, 4rem);
}
.hero h1 {
    font-size: var(--fs-4xl);
    max-width: 880px;
    margin: 0 auto 1.25rem;
}
.hero p {
    font-size: var(--fs-lg);
    color: var(--text-mid);
    max-width: 580px;
    margin: 0 auto 2rem;
}

/* ============ Stat strip ============ */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(1.5rem, 3vw, 3rem);
    padding: clamp(2rem, 4vw, 3rem) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stat .v {
    font-family: var(--serif);
    font-size: clamp(2.25rem, 4vw, 3rem);
    font-weight: 500;
    line-height: 1;
    color: var(--text);
    letter-spacing: -0.02em;
}
.stat .l {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ============ Process numbered grid ============ */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
    counter-reset: step;
}
.process-step { counter-increment: step; }
.process-step .num {
    font-family: var(--serif);
    font-size: 3rem;
    font-weight: 400;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
    line-height: 1;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}
.process-step .num::before { content: '0' counter(step); }
.process-step h3 { margin-bottom: 0.6rem; }
.process-step p { font-size: 0.95rem; line-height: 1.65; }

/* Legacy services grid (used by older pages) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}
.service-item { text-align: left; padding: 0; }
.service-item h3 { font-size: 1.4rem; margin: 0.75rem 0 0.5rem; }
.service-item p { font-size: 0.95rem; }
.circle-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--cream);
    display: grid; place-items: center;
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text);
    border: 1px solid var(--border);
}

/* ============ Feature grid (icon tiles) ============ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.feature {
    background: var(--paper);
    border-radius: var(--r-card);
    padding: 2rem;
    border: 1px solid var(--border);
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
}
.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 50px rgba(22,22,19,0.05);
}
.feature .glyph {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--cream);
    display: grid; place-items: center;
    color: var(--text);
}
.feature h3 { font-size: 1.35rem; }
.feature p { font-size: 0.95rem; line-height: 1.6; }
.feature .more {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap 0.25s var(--ease);
}
.feature:hover .more { gap: 0.7rem; }
.feature .more::after { content: '→'; }

/* ============ Quote block ============ */
.quote {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
    padding: clamp(2rem, 4vw, 3rem) 0;
}
.quote blockquote {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text);
}
.quote cite {
    display: block;
    margin-top: 1.5rem;
    font-style: normal;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ============ CTA Strip (matches page bg, no border) ============ */
.cta-strip {
    background: transparent;
    color: var(--text);
    padding: clamp(3rem, 6vw, 5rem) 0;
    text-align: center;
}
.cta-strip h2 {
    color: var(--text);
    font-size: clamp(2rem, 5vw, 3.25rem);
    max-width: 20ch;
    margin: 0 auto 1.25rem;
    letter-spacing: -0.02em;
}
.cta-strip p {
    color: var(--text-mid);
    font-size: var(--fs-lg);
    max-width: 540px;
    margin: 0 auto 2rem;
}
.cta-strip .btn-row {
    display: inline-flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ============ Masjid Finder ============ */
.finder-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: start;
}
.search-panel {
    background: var(--paper);
    border-radius: var(--r-card);
    padding: 2rem;
    position: sticky;
    top: 100px;
    box-shadow: 0 1px 0 rgba(22,22,19,0.04), 0 8px 30px rgba(22,22,19,0.04);
}
.results-list { display: flex; flex-direction: column; gap: 0.85rem; }
.masjid-card {
    background: var(--paper);
    border-radius: var(--r-card);
    padding: 1.5rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid transparent;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.masjid-card:hover {
    transform: translateY(-2px);
    border-color: var(--border);
    box-shadow: 0 10px 30px rgba(22,22,19,0.05);
}
.masjid-info h4 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.masjid-info p { font-size: 0.88rem; }
.tag {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-mid);
    background: var(--cream);
    padding: 4px 10px;
    border-radius: var(--r-tile);
    margin-top: 0.5rem;
    margin-right: 4px;
}

/* ============ Request CTA card (legacy) ============ */
.request-section { max-width: 720px; margin: 0 auto; }
.request-card {
    background: var(--paper);
    border-radius: var(--r-card);
    padding: clamp(2.5rem, 5vw, 3.5rem);
    text-align: center;
    box-shadow: 0 1px 0 rgba(22,22,19,0.04), 0 16px 50px rgba(22,22,19,0.04);
}
.request-card h2 { font-size: var(--fs-3xl); margin-bottom: 0.5rem; }
.request-card p { font-size: var(--fs-lg); margin-bottom: 2rem; }

/* ============ Shop ============ */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: clamp(1.25rem, 2.5vw, 1.75rem);
}
.shop-card {
    background: var(--paper);
    border-radius: var(--r-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.shop-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(22,22,19,0.06);
}
.shop-card-media {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--cream-soft);
    overflow: hidden;
    display: block;
    padding: 1.25rem;
}
.shop-card-media img {
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform 0.7s var(--ease-out);
    mix-blend-mode: multiply;
}
.shop-card:hover .shop-card-media img { transform: scale(1.04); }

/* Hover overlay — explains the item */
.shop-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(22, 22, 19, 0.82);
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.75rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
}
.shop-card:hover .shop-card-overlay,
.shop-card:focus-within .shop-card-overlay { opacity: 1; }
.shop-card-overlay p {
    color: var(--paper);
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.55;
    font-style: italic;
    max-width: 30ch;
}

.shop-card-body { padding: 1.75rem; display: flex; flex-direction: column; flex: 1; }
.shop-card-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    margin-bottom: 0.7rem;
}
.shop-card-title {
    font-family: var(--serif);
    font-size: 1.4rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.shop-card-footer {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    margin-top: auto;
}
.shop-card-price {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 600;
}
.shop-card-price sup {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-left: 1px;
    top: -0.55em;
}

/* ============ Footer (cream — matches site) ============ */
footer {
    background: var(--cream-soft);
    color: var(--text-mid);
    padding: clamp(3.5rem, 6vw, 5rem) 0 2rem;
    margin-top: var(--section-y);
    border-top: 1px solid var(--border);
}
footer .container { max-width: var(--max-w); }
footer .ft-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: clamp(2rem, 4vw, 3rem);
    margin-bottom: 3rem;
}
footer .ft-brand .brand { color: var(--text); font-size: 1.6rem; }
footer .ft-brand p {
    color: var(--text-mid);
    font-size: 0.92rem;
    line-height: 1.65;
    margin-top: 1rem;
    margin-bottom: 0;
    max-width: 320px;
}
footer .ft-col h5 {
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    margin-bottom: 1rem;
}
footer .ft-col a {
    display: block;
    color: var(--text-mid);
    font-size: 0.92rem;
    padding: 0.3rem 0;
    margin: 0;
    transition: color 0.2s var(--ease);
}
footer .ft-col a:hover { color: var(--text); }
footer .ft-fine {
    border-top: 1px solid var(--border);
    padding-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-dim);
}
footer .ft-fine em {
    font-style: italic;
    color: var(--text-mid);
    font-family: var(--serif);
    font-size: 1rem;
}
footer p { color: var(--text-mid); }
footer a { color: var(--text); margin: 0; }
footer a:hover { color: var(--text-mid); }

/* ============ Donate / Pledge (legacy) ============ */
.pledge-shell { min-height: calc(100vh - 280px); display: grid; place-items: center; padding: 3rem 0 5rem; }
.pledge-card  { background: var(--paper); border-radius: var(--r-card); padding: clamp(2.25rem, 5vw, 3.5rem); max-width: 720px; width: 100%; text-align: center; box-shadow: 0 1px 0 rgba(22,22,19,0.04), 0 16px 50px rgba(22,22,19,0.04); }
.pledge-icon { width: 76px; height: 76px; margin: 0 auto 1.5rem; border-radius: 50%; background: var(--cream); display: grid; place-items: center; color: var(--text); }
.pledge-icon svg { width: 36px; height: 36px; }
.pledge-card h1 { font-size: clamp(2rem, 5vw, 2.6rem); line-height: 1.15; margin-bottom: 0.85rem; }
.pledge-card .lead { font-size: var(--fs-lg); max-width: 540px; margin: 0 auto 2rem; }
.pledge-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 2rem 0 2.5rem; text-align: left; }
.pledge-tile { background: var(--cream-soft); border-radius: var(--r-input); padding: 1.25rem 1.4rem; }
.pledge-tile .h { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin-bottom: 0.35rem; }
.pledge-tile .b { font-size: 0.88rem; color: var(--text-mid); line-height: 1.55; }
.pledge-quote { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--text-mid); border-left: 3px solid var(--cream); padding: 0.5rem 0 0.5rem 1.25rem; margin: 0 auto 2.25rem; max-width: 540px; text-align: left; }
.pledge-cta { display: inline-flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* ============ Legacy utility/grid ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* ============ Reveal animation ============ */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
    .finder-layout { grid-template-columns: 1fr; }
    .search-panel { position: static; }
    footer .ft-grid { grid-template-columns: 1fr 1fr; }
    footer .ft-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    header { padding: 1rem var(--pad-x); }
    .menu-toggle { display: flex; }
    .menu-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.is-open span:nth-child(2) { opacity: 0; }
    .menu-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    nav {
        position: fixed;
        top: 0; right: 0; bottom: 0; left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;                 /* iOS-friendly: respects browser chrome */
        background: var(--cream);
        z-index: 200;                   /* above the sticky header (z=100) */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.25rem;
        padding: 4rem 1.5rem 2rem;
        margin: 0;                      /* defeat any inherited margin */
        transform: translateY(-100%);
        transition: transform 0.4s var(--ease-out);
        pointer-events: none;
    }
    nav.is-open, nav.active {
        transform: translateY(0);
        pointer-events: auto;
    }
    nav a { font-size: 1.4rem; font-weight: 600; padding: 0.5rem 0; }
    nav a::after { display: none; }

    /* Keep the hamburger clickable above the open menu */
    .menu-toggle {
        position: relative;
        z-index: 220;
    }

    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .masjid-card { flex-direction: column; align-items: flex-start; }
    .masjid-card > div:last-child { width: 100%; display: flex; justify-content: space-between; align-items: center; }

    footer .ft-grid { grid-template-columns: 1fr; }
    footer .ft-fine { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* ============ Print niceties (avoid jank) ============ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============ Legacy .container wrapping fix ============ */
/* Some pages wrap header+sections+footer in <div class="container">.
   Break out header and footer so they span edge-to-edge while
   sections inside the container stay max-width-constrained. */
.container > header,
.container > footer {
    width: calc(100% + 2 * var(--pad-x));
    max-width: none;
    margin-left: calc(-1 * var(--pad-x));
    margin-right: calc(-1 * var(--pad-x));
}

/* ============ Hamburger animation — works whether class is .active or .is-open ============ */
@media (max-width: 768px) {
    .menu-toggle.is-open span:nth-child(1),
    .menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.is-open span:nth-child(2),
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.is-open span:nth-child(3),
    .menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    nav.is-open, nav.active { transform: none; }

    /* Mobile-specific tightening */
    .hero-deco { display: none; }                  /* kill the gold radial spill */
    .hero-stack h1 { letter-spacing: -0.02em; }
    .stat .v { font-size: 2rem; }
    .shop-card-body { padding: 1.25rem 1.25rem 1.5rem; }
    .shop-card-overlay p { font-size: 0.95rem; }

    /* Donate page tiles already collapse — re-confirm hero scaling */
    .pledge-hero h1 { font-size: clamp(2.25rem, 9vw, 3.25rem); }

    /* Cart-page artifacts (page is archived but the global classes might still surface) */
    .cta-strip h2 { font-size: clamp(1.6rem, 7vw, 2.25rem); }

    /* Container narrow padding so sections breathe edge-to-edge on phones */
    .container { padding: 0 1.25rem; }
}

@media (max-width: 480px) {
    .hero-cta .btn,
    .pledge-cta .btn,
    .cta-strip .btn-row .btn {
        width: 100%;
    }
    .hero-cta, .pledge-cta .btn-row, .cta-strip .btn-row {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        width: 100%;
    }
    .stat-row { grid-template-columns: 1fr 1fr; }   /* 2x2 instead of 4 cols cramped */
    .quote blockquote { font-size: 1.35rem; }
    .ft-fine { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
