/* ============================================================
   വാക്കയിൽ ശ്രീ ധർമ ശാസ്താ ക്ഷേത്രം — Saffron-Gold theme
   ============================================================
   Design tokens at the top; everything below derives from them.
   To switch palette later, edit the :root variables only.
   ============================================================ */

:root {
    /* Palette */
    --bg:           #fef9ed;   /* page background — warm ivory */
    --surface:      #fffdf6;   /* card / main panel */
    --surface-soft: #fbf5e2;   /* subtle alt panel */
    --ink:          #3a2a1a;   /* primary text */
    --ink-soft:     #6b5641;   /* secondary text */
    --muted:        #8a7558;   /* tertiary / hint */

    --maroon:       #5a1a1a;   /* deep red — h1, anchors */
    --maroon-dark:  #3d1010;
    --saffron:      #e07a1f;   /* primary accent / CTA */
    --saffron-dark: #b85f10;
    --saffron-soft: #fde2c5;
    --gold:         #c79e3c;
    --gold-light:   #e8d28a;
    --gold-soft:    #f5e9bf;

    --border:       #e8d28a;
    --border-soft:  #f0e3b6;

    --success:      #1f5934;
    --danger:       #8a1f1f;
    --warn:         #a06b00;

    --shadow-sm:    0 2px 6px rgba(90, 26, 26, 0.06);
    --shadow:       0 4px 16px rgba(90, 26, 26, 0.10);
    --shadow-lg:    0 8px 30px rgba(90, 26, 26, 0.14);

    --radius-sm:    6px;
    --radius:       10px;
    --radius-lg:    16px;

    --font-display: 'Noto Serif Malayalam', 'Manjari', Georgia, 'Times New Roman', serif;
    --font-body:    'Noto Sans Malayalam', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    padding: 0;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Subtle "rangoli" radial accent in the corners — barely there */
    background-image:
        radial-gradient(circle at 0% 0%, rgba(199, 158, 60, 0.08) 0%, transparent 35%),
        radial-gradient(circle at 100% 100%, rgba(224, 122, 31, 0.06) 0%, transparent 40%);
    background-attachment: fixed;
}

a {
    color: var(--maroon);
    text-decoration: none;
    border-bottom: 1px dotted var(--gold);
    transition: color 0.2s ease, border-color 0.2s ease;
}
a:hover { color: var(--saffron-dark); border-bottom-color: var(--saffron); }

p { margin: 0.6em 0; }

/* ---------- Construction banner ---------- */
.construction-banner {
    background: linear-gradient(90deg, #fff3cd, #fde2c5, #fff3cd);
    color: var(--maroon);
    border-bottom: 2px solid var(--saffron);
    padding: 10px 16px;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
    position: sticky;
    top: 0;
    z-index: 50;
}
.construction-banner strong { color: var(--maroon-dark); }
.construction-banner-en {
    display: block;
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-top: 2px;
    font-family: var(--font-body);
}

/* ---------- Header ---------- */
header {
    background:
        linear-gradient(180deg, rgba(255,253,246,0) 0%, rgba(245,233,191,0.5) 100%),
        linear-gradient(135deg, #fff7e3 0%, #f9e4b8 50%, #f3d693 100%);
    padding: 2.2em 1em 1.6em;
    text-align: center;
    border-bottom: 4px solid var(--gold);
    position: relative;
}
/* Decorative gold ribbon under the header */
header::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0; right: 0;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--saffron) 0 12px,
        var(--gold) 12px 24px
    );
    opacity: 0.45;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2em;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 0 auto;
}

.ayyappa-img {
    height: 90px;
    width: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    background: var(--surface);
    padding: 4px;
    border: 2px solid var(--gold);
}

h1 {
    font-family: var(--font-display);
    font-size: 2.4em;
    font-weight: 700;
    color: var(--maroon);
    text-shadow: 0 2px 6px rgba(199, 158, 60, 0.35);
    margin: 0;
    letter-spacing: 1px;
    line-height: 1.2;
}

.temple-subtitle {
    font-family: var(--font-display);
    font-size: 1.15em;
    color: var(--saffron-dark);
    margin: 0.4em 0 0;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* ---------- Navigation ----------
   Defensive: target every plausible parent — bare <nav>, <header><nav>,
   and <div id="header"><nav>. One of them will match no matter what
   wrapper the loaded header.html happens to use. */
nav, #header nav, header nav {
    background-color: #5a1a1a !important;   /* deep maroon */
    padding: 0.6em 1em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    margin-top: 1em;
    border-radius: 6px;
}
nav ul, #header nav ul, header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4em 1.4em;
    max-width: 1100px;
    margin-inline: auto;
}
nav ul li, #header nav ul li, header nav ul li { margin: 0; display: inline-flex; background: transparent; border: 0; padding: 0; }
nav ul li a,
nav ul li a:link,
nav ul li a:visited,
nav ul li a:active,
#header nav ul li a,
#header nav ul li a:link,
#header nav ul li a:visited,
#header nav ul li a:active,
header nav ul li a,
header nav ul li a:link,
header nav ul li a:visited,
header nav ul li a:active {
    color: #ffffff !important;        /* pure white — guaranteed contrast */
    background-color: transparent !important;
    border: none !important;
    padding: 0.45em 0.9em;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1em;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}
nav ul li a:hover,
nav ul li a:focus,
#header nav ul li a:hover,
#header nav ul li a:focus,
header nav ul li a:hover,
header nav ul li a:focus {
    background-color: rgba(255, 255, 255, 0.18) !important;
    color: #ffe8a3 !important;
    border: none !important;
    outline: none;
}

/* ---------- Main panel ---------- */
main {
    padding: 2em 2.2em;
    max-width: 880px;
    margin: 1.6em auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-soft);
    position: relative;
}
/* Decorative gold corner accents on the main panel */
main::before, main::after {
    content: "";
    position: absolute;
    width: 32px; height: 32px;
    border: 2px solid var(--gold);
    opacity: 0.5;
    pointer-events: none;
}
main::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
main::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }

main h2 {
    font-family: var(--font-display);
    color: var(--maroon);
    margin-top: 0;
    font-size: 1.7em;
    border-bottom: 2px solid var(--gold-light);
    padding-bottom: 0.35em;
}
main h3 {
    font-family: var(--font-display);
    color: var(--saffron-dark);
    margin-top: 1.4em;
    margin-bottom: 0.4em;
    font-size: 1.25em;
}

/* ---------- Forms ---------- */
label {
    display: block;
    margin-top: 1em;
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 0.95em;
}
input, select, textarea {
    margin-top: 0.4em;
    padding: 0.6em 0.8em;
    width: 100%;
    max-width: 360px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--ink);
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--saffron);
    box-shadow: 0 0 0 3px rgba(224, 122, 31, 0.15);
}

button {
    margin-top: 0.6em;
    padding: 0.7em 1.4em;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, var(--saffron) 0%, var(--saffron-dark) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(184, 95, 16, 0.3);
    transition: transform 0.1s ease, box-shadow 0.2s ease, filter 0.2s ease;
    letter-spacing: 0.3px;
}
button:hover { filter: brightness(1.06); box-shadow: 0 4px 14px rgba(184, 95, 16, 0.4); }
button:active { transform: translateY(1px); }
button:disabled {
    background: linear-gradient(180deg, #d3bf94 0%, #b8a373 100%);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.85;
}

/* Disabled Pay Now (under-construction state) */
button#payBtn:disabled { background: linear-gradient(180deg, #d3bf94 0%, #b8a373 100%); }
.pay-disabled-note {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--saffron-soft);
    border: 1px solid var(--saffron);
    border-radius: var(--radius-sm);
    color: var(--maroon);
    font-size: 0.95rem;
    line-height: 1.5;
}
.pay-disabled-en {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-top: 2px;
    font-family: var(--font-body);
}

/* In-page warning block (book.html) */
.book-warning {
    background: #ffe5e5;
    color: var(--danger);
    border: 2px solid #d33;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 1em 0;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 2px 10px rgba(138, 31, 31, 0.1);
}
.book-warning strong { color: var(--danger); }
.book-warning-en {
    display: block;
    font-size: 0.9rem;
    margin-top: 4px;
    color: var(--danger);
    font-family: var(--font-body);
}

/* ---------- Hero (home page) ---------- */
.hero {
    position: relative;
    margin: 1em 0 1.4em;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 280px;
    background:
        linear-gradient(135deg, rgba(58, 16, 16, 0.55) 0%, rgba(184, 95, 16, 0.4) 100%),
        url("/frontend/images/temple.jpg") center / cover no-repeat;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5em 1.4em;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--gold);
}
.hero-content { max-width: 640px; }
.hero h2 {
    font-family: var(--font-display);
    font-size: 1.9em;
    color: #fff;
    margin: 0 0 0.4em;
    border-bottom: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.hero p {
    font-size: 1.05em;
    margin: 0 0 1.2em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.hero-cta { display: inline-flex; gap: 0.6em; flex-wrap: wrap; justify-content: center; }
.hero-cta a {
    display: inline-block;
    padding: 0.7em 1.4em;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 700;
    font-size: 1em;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.hero-cta .btn-primary {
    background: linear-gradient(180deg, var(--saffron) 0%, var(--saffron-dark) 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.hero-cta .btn-primary:hover { filter: brightness(1.08); }
.hero-cta .btn-secondary {
    background: rgba(255, 255, 255, 0.92);
    color: var(--maroon);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.hero-cta .btn-secondary:hover { background: #fff; }

/* ---------- Section divider (gold ornamental flourish) ---------- */
.section-divider {
    text-align: center;
    margin: 1.6em 0 1em;
    color: var(--gold);
    font-size: 1.4em;
    letter-spacing: 0.3em;
    user-select: none;
    line-height: 1;
}
.section-divider::before,
.section-divider::after {
    content: "";
    display: inline-block;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    vertical-align: middle;
    margin: 0 0.6em;
}

/* ---------- Home page layout ---------- */
.main-flex {
    display: flex;
    gap: 1.6em;
    flex-wrap: wrap;
    margin-top: 1em;
}
.main-left { flex: 1 1 320px; }
.main-left img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--gold-light);
}
.main-right { flex: 1 1 320px; display: flex; flex-direction: column; gap: 1em; }

.how-to-reach,
.darshan-times {
    background: var(--surface-soft);
    border-left: 4px solid var(--saffron);
    border-radius: var(--radius);
    padding: 1em 1.2em;
}
.darshan-times {
    margin-top: 1em;
    background: linear-gradient(135deg, var(--gold-soft) 0%, var(--surface-soft) 100%);
    border-left-color: var(--gold);
}
.darshan-times h2 {
    font-size: 1.25em;
    margin: 0 0 0.6em;
    border-bottom: none;
    color: var(--maroon);
    padding-bottom: 0;
}
.darshan-times ul {
    list-style: none;
    padding-left: 0;
    margin: 0 0 0.6em;
}
.darshan-times ul li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6em;
    padding: 0.55em 0;
    border-bottom: 1px dashed var(--border);
    font-size: 1em;
    margin: 0;
    background: transparent;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}
.darshan-times ul li:last-child { border-bottom: 0; }
.darshan-times .period {
    flex: 1 1 auto;
    color: var(--ink);
    font-weight: 700;
    font-family: var(--font-display);
}
.darshan-times .times {
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--saffron-dark);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 1.05em;
    letter-spacing: 0.5px;
}
.darshan-note {
    margin: 0.4em 0 0;
    font-size: 0.85em;
    color: var(--ink-soft);
    line-height: 1.5;
    font-style: italic;
}
.how-to-reach h2 {
    font-size: 1.25em;
    margin: 0 0 0.5em;
    border-bottom: none;
    color: var(--maroon);
    padding-bottom: 0;
}
.how-to-reach ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.how-to-reach ul li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6em;
    padding: 0.4em 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.95em;
    margin: 0;
    background: transparent;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}
.how-to-reach ul li:last-child { border-bottom: 0; }
.how-to-reach ul li b { color: var(--saffron-dark); }
.how-to-reach .place { flex: 1 1 auto; min-width: 0; }
.how-to-reach .distance {
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--saffron-dark);
    font-size: 0.88em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.map-link iframe {
    width: 100%;
    height: 280px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--gold-light);
}

/* ---------- Next-event banner (home) ---------- */
.next-event {
    display: none;
    background:
        linear-gradient(135deg, var(--gold-soft) 0%, var(--saffron-soft) 100%);
    border: 2px solid var(--gold);
    border-left: 6px solid var(--saffron);
    border-radius: var(--radius);
    padding: 1em 1.4em;
    margin-bottom: 1.5em;
    box-shadow: var(--shadow);
}
.next-event.visible { display: block; }
.next-event-label {
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--saffron-dark);
    font-weight: 700;
}
.next-event-title {
    font-family: var(--font-display);
    font-size: 1.55em;
    font-weight: 700;
    color: var(--maroon);
    margin: 0.25em 0 0.2em;
}
.next-event-date { font-size: 1.05em; color: var(--ink-soft); margin-bottom: 0.4em; font-weight: 600; }
.next-event-desc { font-size: 0.95em; color: var(--ink); line-height: 1.55; }

/* ---------- Booking-page hint ---------- */
.hint {
    color: var(--ink-soft);
    font-size: 0.92em;
    margin-bottom: 1em;
    background: var(--gold-soft);
    padding: 0.6em 0.9em;
    border-left: 3px solid var(--saffron);
    border-radius: var(--radius-sm);
}

/* ---------- Privacy block (booking) ---------- */
.privacy-note {
    margin-top: 0.8em;
    background: #effaf0;
    border-left: 3px solid #2e8b57;
    color: var(--success);
    border-radius: var(--radius-sm);
    padding: 0.6em 0.9em;
    font-size: 0.9em;
    line-height: 1.5;
}

/* ---------- Donation amount inputs (booking) ---------- */
#donationInputs:empty { display: none; }
#donationInputs {
    background: var(--gold-soft);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    padding: 0.6em 0.9em;
    margin: 0.6em 0 1em;
}
#donationInputs .donation-row { display: flex; align-items: center; gap: 0.6em; margin: 0.3em 0; }
#donationInputs .donation-row input[type="number"] {
    width: 8em;
    max-width: 8em;
    padding: 0.35em 0.55em;
}

/* ---------- Cart line items ---------- */
ul.cart-list, #cartItems ul { list-style: none; padding-left: 0; }
#cartItems li, ul.cart-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    padding: 0.4em 0.6em;
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    list-style: none;
}
.cart-item-name { flex: 1 1 auto; }
.cart-item-price {
    font-variant-numeric: tabular-nums;
    color: var(--maroon);
    font-weight: 700;
    margin-left: auto;
}
.cart-item-price + .icon-btn { margin-left: 4px; }

.icon-btn {
    margin-left: 8px;
    padding: 4px;
    border: none;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    box-shadow: none;
}
.icon-btn:hover { color: #d00; background: rgba(218, 0, 0, 0.06); box-shadow: none; filter: none; }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Offerings list (offerings page) — card style ---------- */
#offeringsList {
    list-style: none;
    padding: 0;
    margin: 1em 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.9em;
}
#offeringsList li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--saffron);
    border-radius: var(--radius);
    padding: 0.8em 1em;
    box-shadow: var(--shadow-sm);
    margin: 0;
    display: block;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
#offeringsList li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-left-color: var(--maroon);
}
#offeringsList li strong {
    color: var(--maroon);
    font-family: var(--font-display);
    font-size: 1.05em;
    display: block;
    margin-bottom: 0.2em;
}
#offeringsList li em {
    color: var(--ink-soft);
    font-style: normal;
    font-size: 0.88em;
    display: block;
    margin-top: 0.2em;
}

/* ---------- 'Contact the temple' notice (offerings) ---------- */
.contact-offerings {
    margin-top: 2em;
    background: var(--gold-soft);
    border: 1px solid var(--gold);
    border-left: 5px solid var(--saffron);
    border-radius: var(--radius);
    padding: 1em 1.2em 1.2em;
    box-shadow: var(--shadow-sm);
}
.contact-offerings h3 {
    color: var(--maroon);
    margin: 0 0 0.5em;
    font-size: 1.1em;
}
.contact-offerings ul {
    padding-left: 1.2em;
    margin: 0.4em 0 0.6em;
    list-style: disc;
}
.contact-offerings ul li {
    display: list-item;
    margin: 0.18em 0;
    background: transparent;
    border: 0;
    padding: 0;
}
.contact-offerings .contact-numbers { margin: 0.6em 0 0; font-weight: 700; }
.contact-offerings .contact-numbers a { color: var(--maroon); }

/* ---------- Checkout messages ---------- */
#checkoutSummary h3 {
    color: var(--maroon);
    margin-top: 1em;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.3em;
}
.checkout-breakdown {
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    padding: 0.6em 0.9em;
    margin-top: 0.8em;
    border: 1px solid var(--border-soft);
}
#checkoutMessage {
    margin-top: 1em;
    font-weight: 600;
    line-height: 1.55;
    white-space: pre-line;
    padding: 0.6em 0.9em;
    border-radius: var(--radius-sm);
}
#checkoutMessage[data-kind="success"] { color: var(--success); background: #effaf0; border-left: 4px solid var(--success); }
#checkoutMessage[data-kind="error"]   { color: var(--danger);  background: #fdecec; border-left: 4px solid var(--danger); }
#checkoutMessage[data-kind="warn"]    { color: var(--warn);    background: var(--gold-soft); border-left: 4px solid var(--warn); }

/* Receipt PDF download */
#receiptDownload { margin-top: 1em; }
.receipt-download-btn {
    display: inline-block;
    padding: 0.7em 1.3em;
    background: linear-gradient(180deg, var(--maroon) 0%, var(--maroon-dark) 100%);
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(90, 26, 26, 0.3);
    border-bottom: 0;
}
.receipt-download-btn:hover { filter: brightness(1.1); color: #fff; border-bottom: 0; }
.receipt-download-missing {
    background: var(--saffron-soft);
    border-left: 3px solid var(--saffron);
    color: var(--maroon);
    padding: 0.7em 1em;
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    line-height: 1.55;
}

/* ---------- Gallery page ---------- */
.gallery-main { max-width: 1100px; }
.gallery-hint { color: var(--ink-soft); margin-bottom: 1em; font-size: 0.95em; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 1em;
}
.gallery-item {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--surface-soft);
    aspect-ratio: 4 / 3;
    border: 2px solid var(--gold-light);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gallery-item:hover { border-color: var(--saffron); box-shadow: var(--shadow); }
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    display: block;
}
.gallery-item img:hover { transform: scale(1.05); }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 8, 0, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    flex-direction: column;
    gap: 12px;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 92vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    border: 2px solid var(--gold);
}
.lightbox-close {
    position: absolute;
    top: 16px; right: 20px;
    background: transparent;
    border: 0;
    color: var(--gold-light);
    font-size: 2.2em;
    cursor: pointer;
    width: auto;
    padding: 0 8px;
    box-shadow: none;
}
.lightbox-close:hover { color: #fff; background: transparent; box-shadow: none; }
.lightbox-caption { color: var(--gold-light); font-size: 1em; text-align: center; }

/* ---------- History article (details.html) ---------- */
.history-article p {
    line-height: 1.85;
    margin: 0.9em 0;
    text-align: justify;
    color: var(--ink);
}
.history-article h2 { color: var(--maroon); margin-top: 0; }
.history-article h3 {
    font-family: var(--font-display);
    color: var(--maroon);
    margin-top: 1.6em;
    margin-bottom: 0.5em;
    border-bottom: 2px solid var(--gold-light);
    padding-bottom: 0.25em;
    font-size: 1.3em;
}
.history-article h4 {
    font-family: var(--font-display);
    color: var(--saffron-dark);
    margin-top: 1.1em;
    margin-bottom: 0.3em;
    font-size: 1.1em;
}
.history-article a { font-weight: 600; }

/* ---------- Footer ---------- */
footer {
    background:
        linear-gradient(180deg, var(--maroon-dark) 0%, var(--maroon) 100%);
    color: var(--gold-soft);
    padding: 2em 1.4em 1.4em;
    margin-top: 2em;
    border-top: 4px solid var(--gold);
}
footer .footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.6em;
}
footer h4 {
    color: var(--gold-light);
    font-family: var(--font-display);
    font-size: 1.1em;
    margin: 0 0 0.5em;
    border-bottom: 1px solid rgba(199, 158, 60, 0.3);
    padding-bottom: 0.25em;
}
footer ul { list-style: none; padding-left: 0; margin: 0; }
footer ul li {
    background: transparent;
    border: 0;
    padding: 0.2em 0;
    color: var(--gold-soft);
    margin: 0;
    display: block;
}
footer a,
footer a:link,
footer a:visited {
    color: #fff7d6;
    border-bottom: 1px dotted rgba(232, 210, 138, 0.4);
}
footer a:hover,
footer a:focus { color: #fff; border-bottom-color: var(--gold); }
footer .footer-copy {
    text-align: center;
    margin-top: 1.6em;
    padding-top: 1em;
    border-top: 1px solid rgba(199, 158, 60, 0.25);
    font-size: 0.88em;
    color: var(--gold-light);
    opacity: 0.9;
}

/* ---------- Mobile (≤ 600px) ---------- */
@media (max-width: 600px) {
    main {
        padding: 1.2em 1em;
        margin: 0.6em;
        border-radius: var(--radius);
    }
    main::before, main::after { width: 22px; height: 22px; }

    header { padding: 1.4em 0.6em 1.2em; }
    .header-flex { flex-direction: column; gap: 0.5em; }
    .ayyappa-img { height: 70px; }

    h1 {
        font-size: 1.5em;
        letter-spacing: 0.5px;
    }
    .temple-subtitle { font-size: 0.95em; }

    nav { padding: 0.4em 0.6em; }
    nav ul { gap: 0.2em 0.5em; }
    nav ul li a { font-size: 0.92em; padding: 0.4em 0.6em; }

    .hero { min-height: 220px; padding: 1.8em 1em; }
    .hero h2 { font-size: 1.4em; }
    .hero p  { font-size: 0.95em; }

    .main-flex { gap: 1em; }
    .map-link iframe { height: 220px; }

    input, select, textarea, button { max-width: 100%; }

    .construction-banner { padding: 8px 12px; font-size: 0.88rem; }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    .next-event-title { font-size: 1.25em; }

    .history-article p { text-align: left; }

    #offeringsList { grid-template-columns: 1fr; }

    footer { padding: 1.4em 1em 1em; }
    footer .footer-grid { gap: 1em; }
}

/* ---------- Print (admin orders page) ---------- */
@media print {
    body { background: #fff; }
    main { box-shadow: none; border: 0; padding: 0; margin: 0; }
    main::before, main::after, header::after { display: none; }
    .construction-banner, .book-warning, nav { display: none !important; }
}
