/* Phulwariya Mandir — design tokens, translated 1:1 from the Figma file
   (Indiquest -> Mandir project). Keep in sync with Figma "Brand Colors" variable
   collection and the Hindi/Latin text styles — see PRD §4.4 / PROJECT_BRIEF.md. */

:root {
    --color-saffron: #E8792B;
    --color-maroon: #8A1C2B;
    --color-gold: #D4A017;
    --color-cream: #FAF6EF;
    --color-charcoal: #2B2B2B;
    --color-green: #2E7D53;
    --color-white: #FFFFFF;
    --color-grey-light: #EBEBEB;
    --color-grey-mid: #D9D9D9;

    --font-hindi-display: 'Noto Sans Devanagari', sans-serif;
    --font-hindi-body: 'Mukta', sans-serif;
    --font-latin-display: 'Lora', serif;
    --font-latin-heading: 'Poppins', sans-serif;
    --font-latin-body: 'Inter', sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --max-width: 480px; /* mobile-first reference width, per PRD §16.1 */
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
    margin: 0;
    width: 100%;
    overflow-x: hidden;
    background: var(--color-cream);
    color: var(--color-charcoal);
    font-family: var(--font-hindi-body);
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-break: normal;
}

/* Permanent, sitewide guarantee against horizontal overflow (2026-07-04):
   confirmed on a real device, not just a screenshot artifact — any text
   anywhere on the site must wrap within its container's padding rather than
   push past the screen edge. overflow-wrap:break-word (inherited from body,
   above) already covers most cases; this reinforces it explicitly on every
   text-bearing element so a future addition can't silently regress it, and
   clips .wrap itself as a second line of defense (html/body already clip,
   but a child escaping .wrap's own box should never be visible either). */
h1, h2, h3, h4, h5, h6, p, span, a, li, blockquote {
    overflow-wrap: break-word;
    word-break: normal;
}
.wrap { width: 100%; overflow-x: hidden; }

.img-slot.placeholder { overflow-wrap: break-word; word-break: break-all; box-sizing: border-box; }

/* Mixed-script rule (learned building the Figma mockups): never mix Devanagari
   and Latin symbols/arrows in one element relying on a single font to cover
   both — use separate spans with explicit font-family per script. */
.lang-hi { font-family: var(--font-hindi-body); }
.lang-en { font-family: var(--font-latin-body); }

h1, h2, h3 { font-family: var(--font-hindi-display); color: var(--color-maroon); margin: 0 0 0.4em; }
h1.lang-en, h2.lang-en, h3.lang-en { font-family: var(--font-latin-display); }

.wrap { max-width: var(--max-width); margin: 0 auto; background: var(--color-white); min-height: 100vh; }

/* Header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-grey-light);
    position: sticky;
    top: 0;
    z-index: 40;
}
.site-header .logo { font-family: var(--font-hindi-display); font-weight: 700; font-size: 18px; color: var(--color-maroon); text-decoration: none; }

.hamburger-btn {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--color-charcoal);
    cursor: pointer;
    padding: 4px 6px;
}

/* Top nav — persistent primary navigation (moved up from the old bottom-nav) */
.top-nav {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-grey-light);
}
.top-nav a {
    font-size: 12px;
    color: var(--color-charcoal);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
}
.top-nav a.active { color: var(--color-saffron); font-weight: 700; border-bottom-color: var(--color-saffron); }

/* Side menu (hamburger drawer) */
.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 49;
}
.side-menu-overlay.open { opacity: 1; }
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 78%;
    max-width: 300px;
    background: var(--color-white);
    box-shadow: -2px 0 12px rgba(0,0,0,0.15);
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    z-index: 50;
}
.side-menu.open { transform: translateX(0); }
.side-menu a {
    display: block;
    padding: 12px 0;
    color: var(--color-charcoal);
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid var(--color-grey-light);
}
.side-menu-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-charcoal);
}

/* Footer (secondary links only — primary nav lives at the top now) */
.site-footer {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: #888;
    border-top: 1px solid var(--color-grey-light);
}
.site-footer a { color: var(--color-charcoal); text-decoration: none; }

/* WhatsApp floating button */
.whatsapp-fab {
    position: fixed;
    right: 16px;
    bottom: 78px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--color-green);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 50;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-hindi-body);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    width: 100%;
}
.btn-primary { background: var(--color-saffron); color: var(--color-white); }
.btn-secondary { background: var(--color-green); color: var(--color-white); }
.btn-outline { background: transparent; color: var(--color-maroon); border: 1.5px solid var(--color-maroon); }

/* Image placeholder — mirrors the Figma component so the fallback is visible
   in-browser exactly like it was in the mockups. */
.img-slot { display: block; width: 100%; border-radius: var(--radius-sm); object-fit: cover; background: var(--color-grey-mid); }
.img-slot.placeholder {
    display: flex; align-items: center; justify-content: center;
    border: 1px dashed var(--color-charcoal);
    color: var(--color-charcoal);
    font-family: var(--font-latin-body);
    font-size: 11px;
    text-align: center;
    padding: 8px;
    min-height: 120px;
}

/* Form fields */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input, .field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-grey-mid);
    border-radius: var(--radius-sm);
    font-family: var(--font-hindi-body);
    font-size: 14px;
    background: var(--color-white);
}

/* Cards / chips / grids */
.card { background: var(--color-white); border-radius: var(--radius-md); padding: 8px; }
.chip { display: inline-flex; padding: 6px 12px; border-radius: 16px; background: var(--color-grey-light); font-size: 12px; font-weight: 500; }
.chip.active { background: var(--color-saffron); color: var(--color-white); }
.grid-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; width: 100%; min-width: 0; }
.grid-row > * { flex: none; }
.gallery-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-grid .img-slot { width: 78px; height: 78px; }

/* Homepage temple carousel — auto-scrolling marquee (CSS animation, not JS-driven
   scroll polling, so it stays smooth on low-end Indian-market Android phones).
   The track is rendered twice in the markup (see index.php) and animates exactly
   -50%, so the second copy seamlessly continues where the first left off. */
.temple-carousel { overflow: hidden; width: 100%; padding: 4px 0; }
.temple-carousel-track {
    display: flex;
    gap: 12px;
    width: max-content;
    padding: 0 20px;
    animation: temple-carousel-scroll 26s linear infinite;
}
.temple-carousel.paused .temple-carousel-track { animation-play-state: paused; }
.temple-carousel-card {
    flex: none;
    width: 150px;
    text-decoration: none;
    color: inherit;
    text-align: center;
}
.temple-carousel-card .img-slot { height: 150px; }
/* Name is centered under the photo (not left-aligned) so it never sits flush
   against a card edge while the marquee is mid-scroll — the track's own
   left/right padding only ever applies to the very first/last card, not to
   whichever card happens to be passing the viewport edge at a given moment. */
.temple-carousel-card p { padding: 0 4px; }
@keyframes temple-carousel-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .temple-carousel-track { animation: none; }
}

/* Deity showcase — the primary identity of each temple; deliberately more
   prominent than the priest listing, per explicit direction (2026-07-03). */
.deity-showcase {
    background: linear-gradient(135deg, var(--color-maroon), #6e1522);
    padding: 20px;
    margin: 4px 0;
}
.deity-showcase h2 {
    color: var(--color-gold);
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px;
}
/* Deity cards — vertical stack, each clickable through to its own detail
   page (photo + description here, full gallery + YouTube videos there). */
.deity-list { display: flex; flex-direction: column; gap: 10px; }
.deity-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 12px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.deity-card .img-slot { width: 64px; height: 64px; min-height: 0; flex: none; }
.deity-card-body { flex: 1; min-width: 0; }
.deity-card-body h3 {
    color: var(--color-maroon);
    font-size: 15px;
    margin: 0 0 4px;
}
.deity-card-body p {
    color: var(--color-charcoal);
    font-size: 12.5px;
    line-height: 1.4;
    margin: 0;
}

/* Deity detail page */
.deity-detail-hero { padding: 0 20px; }
.deity-video-grid { display: flex; flex-direction: column; gap: 14px; }
.deity-video-grid iframe { width: 100%; aspect-ratio: 16 / 9; border: none; border-radius: var(--radius-md); }

/* Homepage legacy/history content — emotionally-toned brand story with
   Sanskrit references, placed between "हमारे मंदिर" and the footer. */
.legacy-section { padding: 26px 20px; }
.legacy-section:nth-of-type(even) { background: var(--color-cream); }
.legacy-section h2 { font-size: 19px; margin-bottom: 4px; }
.legacy-section .eyebrow {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-saffron);
    font-weight: 700;
    margin-bottom: 6px;
}
.legacy-section p { line-height: 1.75; font-size: 14.5px; color: var(--color-charcoal); margin: 0 0 12px; }
.shloka-block {
    background: var(--color-white);
    border-left: 3px solid var(--color-gold);
    padding: 14px 16px;
    margin: 14px 0;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.shloka-block .sanskrit {
    font-family: var(--font-hindi-display);
    font-weight: 700;
    color: var(--color-maroon);
    font-size: 15.5px;
    line-height: 1.7;
    margin: 0 0 8px;
}
.shloka-block .meaning { font-size: 13px; color: #555; margin: 0 0 4px; }
.shloka-block .source { font-size: 11.5px; color: #999; margin: 0; }
.saint-quote {
    background: linear-gradient(135deg, var(--color-maroon), #6e1522);
    color: var(--color-white);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    margin: 14px 0;
}
.saint-quote p { color: var(--color-white); margin: 0; }
.saint-quote .attribution { display: block; color: var(--color-gold); font-weight: 700; font-size: 13px; margin-top: 10px; }
.legacy-gallery-note { padding: 0 20px 26px; }

.admin-notice {
    font-family: var(--font-latin-body);
    font-size: 11px;
    color: #808080;
    padding: 8px 20px;
    overflow-wrap: break-word;
    word-break: break-word;
}
