/* ============================================================================
   Maa Koteshwari Seva Samiti Trust — Mandir Theme Layer
   ----------------------------------------------------------------------------
   A "Sattvic–Heritage" decorative skin that layers on top of the existing
   design. Loaded LAST on every page so it wins ties by source order.
   Pure CSS only (gradients + inline-SVG data-URIs), zero markup changes,
   bilingual-safe (only the Om glyph ॐ is added, never as a "|"/"/" text node),
   WCAG-AA preserved, responsive, and reduced-motion aware.
   ============================================================================ */

:root {
    /* Antique / aged gold — used for hairlines, rings, ornaments only (never body text) */
    --mt-gold-antique: #b8893b;
    --mt-gold-deep: #8c6322;
    --mt-gold-leaf: #d9b25f;
    --mt-gold-hair: rgba(184, 137, 59, 0.5);
    --mt-gold-ghost: rgba(184, 137, 59, 0.16);
    --mt-gold-wash: rgba(184, 137, 59, 0.10);

    /* Warm parchment surfaces (replace busy two-stop card gradients) */
    --mt-parchment: #fdf8ee;
    --mt-parchment-2: #fbf3e2;

    --mt-ink-deep: #2a1f16;
    --mt-maroon-veil: rgba(127, 38, 38, 0.06);

    /* Reusable diya / lamp aura behind circular badges */
    --mt-halo: radial-gradient(circle, rgba(228, 176, 43, 0.20) 0%, rgba(184, 137, 59, 0.10) 40%, transparent 70%);

    --mt-shadow-quiet: 0 16px 40px -28px rgba(58, 38, 18, 0.34);
    --mt-shadow-lift: 0 22px 48px -30px rgba(58, 38, 18, 0.42);
}

/* ── Reduced-motion kill-switch (belt-and-suspenders for the new pseudo glows) ── */
@media (prefers-reduced-motion: reduce) {

    .hero-temple::after,
    .section-icon::after,
    .card-icon::after {
        animation: none !important;
    }
}

/* ── Site-wide backdrop: trade the busy fixed dot-fleck for a calm warm vignette ── */
.mandir-pattern {
    background-image: radial-gradient(ellipse 90% 60% at 50% 0%, var(--mt-gold-ghost), transparent 60%) !important;
    background-size: auto !important;
    opacity: 0.85;
}

/* ── Navbar: one consistent antique-gold rule + a brass "lintel" highlight ── */
.navbar-mandir {
    border-bottom: 1px solid var(--mt-gold-hair);
    box-shadow: inset 0 1px 0 rgba(255, 251, 240, 0.6), 0 10px 24px -18px rgba(44, 22, 9, 0.55);
}

.nav-links {
    border-color: var(--mt-gold-ghost);
}

.logo-icon {
    border-color: var(--mt-gold-antique);
}

/* Navbar "Join" call-to-action button (shared across all pages) */
.nav-link.nav-cta {
    background: linear-gradient(135deg, #f3e3ba 0%, #e6cd94 100%);
    color: var(--primary-dark);
    border-color: var(--mt-gold-antique);
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 251, 235, 0.6);
}

.nav-link.nav-cta:hover,
.nav-link.nav-cta.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: rgba(255, 236, 177, 0.5);
}

/* ── Hero: a barely-there concentric mandala halo behind the content ── */
.hero-temple,
.page-hero {
    position: relative;
}

.hero-temple::after,
.page-hero::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 48%;
    width: min(82vw, 680px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
    background:
        repeating-conic-gradient(from 0deg, var(--mt-gold-wash) 0deg 6deg, transparent 6deg 12deg),
        radial-gradient(circle, transparent 38%, var(--mt-gold-wash) 39% 40%, transparent 41% 54%, var(--mt-gold-wash) 55% 56%, transparent 57%);
    -webkit-mask: radial-gradient(circle, #000 52%, transparent 72%);
    mask: radial-gradient(circle, #000 52%, transparent 72%);
}

/* Home hero gently "breathes"; secondary heroes stay static and fainter */
.hero-temple::after {
    animation: mt-mandala-breathe 16s ease-in-out infinite;
}

.page-hero::after {
    opacity: 0.34;
}

/* Keep hero content above the halo; deepen the secondary overlay for white-title contrast */
.hero-content,
.page-hero-content {
    position: relative;
    z-index: 2;
}

.page-hero::before {
    background: linear-gradient(180deg, rgba(64, 16, 24, 0.56) 0%, rgba(52, 13, 19, 0.46) 52%, rgba(40, 10, 14, 0.6) 100%);
}

/* ── Section panels: calm parchment + manuscript inner rule + torana arch crown ── */
.section-mandir,
.section-shell {
    background: linear-gradient(180deg, var(--mt-parchment) 0%, var(--mt-parchment-2) 100%);
    border: 1px solid var(--mt-gold-ghost);
    box-shadow: inset 0 0 0 1px var(--mt-gold-ghost), var(--mt-shadow-quiet);
}

.section-mandir::after,
.section-shell::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: min(78%, 460px);
    height: 26px;
    pointer-events: none;
    opacity: 0.6;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 30'%3E%3Cpath d='M4 28 C4 10 44 4 100 4 C156 4 196 10 196 28' fill='none' stroke='%23b8893b' stroke-width='1.4'/%3E%3Ccircle cx='100' cy='5' r='2' fill='%23b8893b'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}

/* Re-tone the existing home corner blob to the antique gold */
.section-mandir::before {
    background: radial-gradient(circle, var(--mt-gold-wash), transparent 70%);
}

/* ── Title divider: the signature Om mark, flanked by tapering gold hairlines ── */
.title-divider {
    width: min(300px, 78%);
    height: 22px;
    border-radius: 0;
    margin: 1rem auto 0;
    display: flex;
    align-items: center;
    gap: 1.7rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ctext x='14' y='21' font-size='20' text-anchor='middle' fill='%23b8893b' font-family='serif'%3E%E0%A5%90%3C/text%3E%3C/svg%3E") center/auto 20px no-repeat;
}

.title-divider::before,
.title-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
}

.title-divider::before {
    background: linear-gradient(90deg, transparent, var(--mt-gold-antique));
}

.title-divider::after {
    background: linear-gradient(90deg, var(--mt-gold-antique), transparent);
}

/* ── Icon badges: quiet brass medallions with a warm diya halo ── */
.section-icon {
    position: relative;
    background: var(--mt-parchment);
    border: 1px solid var(--mt-gold-antique);
    color: var(--primary-dark);
    box-shadow: 0 0 0 4px var(--mt-maroon-veil), 0 0 0 5px var(--mt-gold-ghost);
}

.card-icon {
    position: relative;
    background: var(--mt-parchment);
    border: 1px solid var(--mt-gold-antique);
    color: var(--primary);
    box-shadow: 0 0 0 4px var(--mt-maroon-veil);
}

.section-icon::after,
.card-icon::after {
    content: "";
    position: absolute;
    inset: -13px;
    border-radius: 50%;
    background: var(--mt-halo);
    z-index: -1;
    pointer-events: none;
    animation: mt-halo-flicker 5.5s ease-in-out infinite;
}

/* Secondary-page badge icons become quiet brass medallions like the home page.
   Scoped to DIRECT children so the large .member-avatar glyph is never bordered. */
.notice-card > i,
.member-card > i {
    background: var(--mt-parchment);
    border: 1px solid var(--mt-gold-antique);
    box-shadow: 0 0 0 4px var(--mt-maroon-veil);
}

/* ── Cards: unified flat parchment, hairline frame, soft rest + calm 3px hover ── */
.card-mandir,
.qr-card,
.seva-item,
.notice-card,
.member-card,
.social-card,
.summary-panel,
.gallery-card,
.contact-info {
    background: #fffdf8;
    border: 1px solid rgba(184, 137, 59, 0.26);
    box-shadow: inset 0 0 0 1px rgba(255, 252, 246, 0.6), var(--mt-shadow-quiet);
}

@media (hover: hover) {

    .card-mandir:hover,
    .qr-card:hover,
    .seva-item:hover,
    .notice-card:hover,
    .member-card:hover,
    .social-card:hover,
    .summary-panel:hover,
    .gallery-card:hover,
    .contact-info:hover {
        transform: translateY(-3px);
        box-shadow: var(--mt-shadow-lift);
        border-color: var(--mt-gold-antique);
    }
}

/* ── History timeline (home): faint gold mala rail + diya-lit milestone dots ── */
.timeline-wrap::before {
    width: 1px;
    background: linear-gradient(180deg, var(--mt-gold-ghost), rgba(184, 137, 59, 0.4) 50%, var(--mt-gold-ghost));
}

.timeline-dot {
    position: relative;
    box-shadow: 0 0 0 3px rgba(253, 248, 238, 0.9), 0 0 0 4px var(--mt-gold-ghost);
}

.timeline-dot::after {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    background: var(--mt-halo);
    z-index: -1;
    pointer-events: none;
}

.timeline-content {
    background: var(--mt-parchment);
    border: 1px solid var(--mt-gold-ghost);
    box-shadow: var(--mt-shadow-quiet);
}

/* ── Buttons: polished-brass primary, quiet cream/antique-gold secondary ── */
.btn-primary {
    border: 1px solid var(--mt-gold-antique);
    box-shadow: 0 12px 28px -16px rgba(127, 38, 38, 0.6), inset 0 1px 0 rgba(255, 236, 177, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 16px 30px -16px rgba(127, 38, 38, 0.7), inset 0 1px 0 rgba(255, 236, 177, 0.45);
}

.btn-secondary {
    background: linear-gradient(135deg, #f3e3ba 0%, #e6cd94 100%);
    color: var(--primary-dark);
    border: 1px solid var(--mt-gold-antique);
    box-shadow: var(--mt-shadow-quiet);
}

.copy-btn {
    border: 1px solid var(--mt-gold-hair);
}

/* ── Forms: paper-like inputs, warm AA-visible focus (background-color keeps the select caret) ── */
.field-control {
    background-color: var(--mt-parchment);
    border: 1px solid var(--mt-gold-hair);
}

.field-control:focus {
    border-color: var(--mt-gold-deep);
    box-shadow: 0 0 0 3px rgba(140, 99, 34, 0.22), 0 0 0 2px var(--mt-gold-deep);
    background-color: #fffdf8;
}

.field-label {
    color: var(--primary-dark);
    letter-spacing: 0.2px;
}

input[type="file"].field-control {
    border: 2px dashed var(--mt-gold-hair);
}

input[type="file"].field-control:hover {
    border-color: var(--mt-gold-antique);
}

.captcha-question {
    border-color: var(--mt-gold-antique);
}

/* ── Headings: keep the devotional maroon, just give Cormorant a little air ── */
.section-title {
    letter-spacing: 0.3px;
}

.page-title {
    letter-spacing: 0.3px;
}

/* ── Footer: an Om bookend echoing the divider, antique-gold top rule ── */
.footer-mandir {
    border-top: 2px solid var(--mt-gold-antique);
}

.footer-mandir::after {
    content: "\0950";
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: var(--mt-gold-leaf);
    font-family: 'Noto Sans Devanagari', serif;
    font-size: 1.5rem;
    text-shadow: 0 0 16px rgba(184, 137, 59, 0.4);
    pointer-events: none;
}

.footer-inner {
    padding-top: 3.2rem;
}

/* ── Keyframes (disabled under prefers-reduced-motion above) ── */
@keyframes mt-mandala-breathe {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.03);
    }
}

@keyframes mt-halo-flicker {

    0%,
    100% {
        opacity: 0.85;
    }

    50% {
        opacity: 1;
    }
}

/* ============================================================================
   Review-pass refinements — cohesion for in-card controls, modals, and polish
   ============================================================================ */

/* In-card chips / controls retoned to the antique-gold family */
.detail-row {
    background: var(--mt-gold-wash);
    border-color: var(--mt-gold-ghost);
}

.seva-tags span {
    background: var(--mt-gold-wash);
    border-color: var(--mt-gold-ghost);
    color: var(--primary-dark);
}

.captcha-question {
    background: var(--mt-gold-wash);
    border-color: var(--mt-gold-antique);
}

.gallery-action-download {
    border-color: var(--mt-gold-hair);
}

.gallery-action-preview {
    border-color: var(--mt-gold-antique);
}

.member-avatar {
    background: radial-gradient(circle at top, #fffaf0 0%, #f1e2bb 60%, #c9a86a 100%);
    border-color: var(--mt-gold-antique);
}

/* Success modal + gallery lightbox join the parchment / antique-gold system */
.seva-modal,
.gallery-lightbox-dialog {
    background: linear-gradient(180deg, var(--mt-parchment), var(--mt-parchment-2));
    border: 1px solid var(--mt-gold-ghost);
}

.seva-modal-ref {
    border-color: var(--mt-gold-hair);
}

.gallery-lightbox-toolbar {
    border-bottom-color: var(--mt-gold-ghost);
}

/* Slimmer milestone-dot ring on small screens (respect the mobile sizing) */
@media (max-width: 640px) {
    .timeline-dot {
        box-shadow: 0 0 0 2px rgba(253, 248, 238, 0.9), 0 0 0 3px var(--mt-gold-ghost);
    }
}

/* The hero mandala only crops to a band on very short landscape screens — hide it */
@media (max-height: 520px) and (orientation: landscape) {

    .hero-temple::after,
    .page-hero::after {
        display: none;
    }
}
