:root {
    --gold: #D4AF37;
    --gold-light: #E8C96A;
    --gold-dark: #A88B24;
    --navy: #0B2C5F;
    --navy-deep: #071C3D;
    --navy-mid: #143A73;
    --cream: #F8F1E3;
    --ivory: #FFF9F0;
    --maroon: #7B1113;
    --mural-red: #7B1113;
    --text: #1a1a1a;
    --muted: #5c5c5c;
    --font-display: "Cinzel", "Noto Sans Malayalam", serif;
    --font-ml: "Noto Sans Malayalam", "Gayathri", sans-serif;
    --font-body: "Poppins", "Noto Sans Malayalam", sans-serif;
    --font-ui: "Poppins", "Noto Sans Malayalam", sans-serif;
    --shadow: 0 12px 40px rgba(11, 44, 95, 0.18);
    --radius: 4px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
    background-color: #F4EBDA;
    background-image:
        url("../images/mural-texture.svg"),
        radial-gradient(circle at 12% 0%, rgba(212, 175, 55, 0.14), transparent 42%),
        radial-gradient(circle at 88% 18%, rgba(123, 17, 19, 0.08), transparent 40%),
        linear-gradient(180deg, #FBF6EC 0%, #F1E4CF 100%);
    background-size: 420px 420px, auto, auto, auto;
    background-attachment: fixed, scroll, scroll, scroll;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--navy);
}

.ml {
    font-family: var(--font-ml);
}

html[lang="ml"] .form-temple .form-label,
html[lang="ml"] .form-temple .btn,
html[lang="ml"] .locale-ml,
.locale-ml .form-label {
    font-family: var(--font-ml);
}

.form-temple .form-label {
    line-height: 1.35;
}

.form-temple .form-label .label-ml {
    display: block;
    font-family: var(--font-ml);
    font-weight: 600;
}

.form-temple .form-label .label-en {
    display: block;
    font-size: 0.78rem;
    font-weight: 400;
    color: #6c6a62;
    font-family: var(--font-body);
}

.form-section-title {
    font-family: var(--font-display);
    color: var(--navy);
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

html[lang="ml"] .form-section-title,
.locale-ml .form-section-title {
    font-family: var(--font-ml);
    text-transform: none;
    letter-spacing: 0;
}

/* Mural border motif */
.mural-border {
    position: relative;
    border: 2px solid var(--gold);
    box-shadow:
        inset 0 0 0 4px var(--navy),
        inset 0 0 0 7px var(--gold-light);
}

.mural-border::before,
.mural-border::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--gold);
    background: var(--navy);
}

.mural-border::before {
    top: -6px;
    left: -6px;
}

.mural-border::after {
    bottom: -6px;
    right: -6px;
}

.section-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0.5rem 0 1.5rem;
    color: var(--gold-dark);
}

.section-ornament::before,
.section-ornament::after {
    content: "";
    width: 64px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.section-ornament i {
    font-size: 1rem;
}

.section-title {
    font-family: var(--font-display);
    color: var(--navy);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    text-align: center;
    margin-bottom: 0.35rem;
    letter-spacing: 0.03em;
}

.section-subtitle {
    text-align: center;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.98rem;
    max-width: 640px;
    margin: 0 auto 2rem;
}

.btn-temple {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--navy-deep) !important;
    border: none;
    font-family: var(--font-ui);
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(138, 109, 26, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-temple:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(138, 109, 26, 0.45);
    color: var(--navy-deep) !important;
}

.btn-outline-temple {
    border: 2px solid var(--gold);
    color: var(--gold-light) !important;
    background: transparent;
    font-family: var(--font-ui);
    font-weight: 600;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius);
}

.btn-outline-temple:hover {
    background: rgba(201, 162, 39, 0.15);
    color: #fff !important;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 8px 28px rgba(11, 44, 95, 0.35);
}

.header-lamp-rail {
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    padding: 0.55rem 0 0.25rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    background:
        linear-gradient(180deg, rgba(123, 17, 19, 0.42), transparent),
        url("../images/mural-texture.svg");
    background-size: auto, 280px 280px;
}

.header-lamp {
    position: relative;
    width: 16px;
    height: 32px;
}

.header-lamp::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 9px;
    background: linear-gradient(180deg, var(--gold), var(--maroon));
    border-radius: 2px 2px 1px 1px;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35);
}

.header-lamp::after {
    content: "";
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 8px;
    height: 16px;
    border-radius: 50% 50% 20% 20%;
    background: radial-gradient(circle at 50% 20%, #fff8d6, #ffb347 42%, #d97706 78%, transparent 100%);
    transform: translateX(-50%);
    animation: flame 1.35s ease-in-out infinite alternate;
    box-shadow: 0 0 12px rgba(232, 201, 106, 0.75), 0 0 22px rgba(255, 179, 71, 0.35);
}

.header-lamp:nth-child(2)::after { animation-delay: 0.2s; }
.header-lamp:nth-child(3)::after { animation-delay: 0.4s; }
.header-lamp:nth-child(4)::after { animation-delay: 0.15s; }
.header-lamp:nth-child(5)::after { animation-delay: 0.35s; }

.bell-toggle {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.55);
    color: var(--gold-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.bell-toggle:hover,
.bell-toggle.is-ringing {
    background: rgba(212, 175, 55, 0.18);
    color: #fff;
}

.bell-toggle.is-ringing i {
    animation: bellSwing 0.9s ease-in-out;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold-dark));
    display: grid;
    place-items: center;
    color: var(--navy-deep);
    font-size: 1.35rem;
    flex-shrink: 0;
    animation: lampGlow 2.8s ease-in-out infinite;
}

@keyframes lampGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 197, 71, 0.45); }
    50% { box-shadow: 0 0 18px 4px rgba(232, 197, 71, 0.55); }
}

.brand-text .name-ml {
    display: block;
    font-family: var(--font-ml);
    color: var(--gold-light);
    font-size: 1.05rem;
    line-height: 1.2;
}

.brand-text .name-en {
    display: block;
    font-family: var(--font-display);
    color: #d9e2f2;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}

.navbar-temple .nav-link {
    color: #d7e0f0 !important;
    font-family: var(--font-ui);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.55rem 0.75rem !important;
    position: relative;
}

.navbar-temple .nav-link::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.2rem;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.navbar-temple .nav-link:hover::after,
.navbar-temple .nav-link.active::after {
    transform: scaleX(1);
}

.navbar-temple .nav-link.active,
.navbar-temple .nav-link:hover {
    color: var(--gold-light) !important;
}

.navbar-toggler {
    border-color: var(--gold) !important;
}

.navbar-toggler-icon {
    filter: invert(78%) sepia(54%) saturate(500%) hue-rotate(7deg);
}

/* Hero */
.hero {
    position: relative;
    min-height: min(88vh, 760px);
    display: flex;
    align-items: flex-end;
    color: #fff;
    overflow: hidden;
    background: var(--navy-deep);
}

.hero-media {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6, 18, 40, 0.18) 0%, rgba(6, 18, 40, 0.42) 52%, rgba(6, 18, 40, 0.88) 100%),
        url("../images/hero-devi.png") center 22%/cover no-repeat;
    transform: scale(1.04);
    animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
    from { transform: scale(1.04) translateY(0); }
    to { transform: scale(1.08) translateY(-1.5%); }
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 4.5rem 0 3.5rem;
    width: 100%;
}

.hero-kicker {
    font-family: var(--font-ml);
    color: var(--gold-light);
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 0.2s;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4.5vw, 3.2rem);
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 0.4s;
}

.hero p {
    max-width: 560px;
    font-size: 1.15rem;
    color: #e8eef8;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 0.6s;
}

.hero-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    opacity: 0;
    animation: fadeUp 0.9s ease forwards 0.8s;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.lamp-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    opacity: 0;
    animation: fadeUp 1s ease forwards 1s;
}

.lamp {
    width: 18px;
    height: 42px;
    position: relative;
}

.lamp::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 10px;
    background: var(--gold-dark);
    border-radius: 2px 2px 0 0;
}

.lamp::after {
    content: "";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 14px;
    background: radial-gradient(circle at 50% 20%, #fff6c8, #ffb347 45%, #d97706 80%);
    border-radius: 50% 50% 20% 20%;
    animation: flame 1.4s ease-in-out infinite alternate;
}

@keyframes flame {
    from { transform: translateX(-50%) scale(1); opacity: 0.85; }
    to { transform: translateX(-50%) scale(1.15) translateY(-2px); opacity: 1; }
}

/* Sections */
.section {
    padding: 4.5rem 0;
}

.section-alt {
    background:
        linear-gradient(180deg, rgba(11, 28, 61, 0.04), rgba(11, 28, 61, 0.08));
}

.temple-card {
    background: var(--ivory);
    border: 1px solid rgba(201, 162, 39, 0.35);
    border-top: 4px solid var(--gold);
    padding: 1.5rem;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

.temple-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.temple-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--navy);
    color: var(--gold);
    margin-bottom: 1rem;
}

.temple-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.temple-card p,
.temple-card .meta {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: var(--muted);
}

.meta {
    color: var(--gold-dark) !important;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.page-banner {
    background:
        linear-gradient(120deg, rgba(6, 18, 40, 0.92), rgba(20, 48, 95, 0.88)),
        url("../images/hero-temple.svg") center/cover;
    color: #fff;
    padding: 4rem 0 3rem;
    border-bottom: 3px solid var(--gold);
    text-align: center;
}

.page-banner h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin-bottom: 0.4rem;
}

.page-banner .ml {
    color: var(--gold-light);
    font-size: 1.15rem;
}

.content-panel {
    background: var(--ivory);
    border: 1px solid rgba(201, 162, 39, 0.3);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.content-panel p {
    margin-bottom: 1rem;
}

.gallery-grid .gallery-item {
    position: relative;
    overflow: hidden;
    border: 2px solid var(--gold);
    aspect-ratio: 4/3;
    background: var(--navy);
    cursor: pointer;
}

.gallery-grid .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-grid .gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-grid .gallery-item .caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(transparent, rgba(6, 18, 40, 0.9));
    color: var(--gold-light);
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

.family-node {
    background: var(--ivory);
    border: 2px solid var(--gold);
    padding: 1rem;
    text-align: center;
    min-width: 160px;
}

.family-node .gen {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--gold-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.family-node h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--navy);
    margin: 0.25rem 0;
}

.tree-level {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.donation-cta {
    background: linear-gradient(135deg, var(--navy-deep), var(--navy-mid));
    color: #fff;
    padding: 3.5rem 0;
    border-block: 3px solid var(--gold);
    text-align: center;
}

.donation-cta h2 {
    font-family: var(--font-display);
    color: var(--gold-light);
}

.contact-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: var(--font-ui);
}

.contact-info-list li {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.contact-info-list i {
    color: var(--gold-dark);
    margin-top: 0.25rem;
}

.form-temple .form-control,
.form-temple .form-select {
    border-radius: var(--radius);
    border-color: rgba(11, 28, 61, 0.2);
    font-family: var(--font-ui);
    padding: 0.7rem 0.9rem;
}

.form-temple .form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(201, 162, 39, 0.2);
}

.form-temple label {
    font-family: var(--font-ui);
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.35rem;
}

/* Footer */
.site-footer {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
    color: #c9d4e8;
    border-top: 3px solid var(--gold);
    padding-top: 3rem;
    font-family: var(--font-ui);
}

.site-footer h5 {
    font-family: var(--font-display);
    color: var(--gold-light);
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.site-footer a {
    color: #c9d4e8;
}

.site-footer a:hover {
    color: var(--gold-light);
}

.footer-social a {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    margin-right: 0.4rem;
    color: var(--gold-light);
}

.footer-bottom {
    border-top: 1px solid rgba(201, 162, 39, 0.25);
    margin-top: 2rem;
    padding: 1rem 0;
    font-size: 0.9rem;
    text-align: center;
}

.bell-motif {
    color: var(--gold);
    animation: bellSwing 3.5s ease-in-out infinite;
    transform-origin: top center;
    display: inline-block;
}

@keyframes bellSwing {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(8deg); }
    40% { transform: rotate(-7deg); }
    60% { transform: rotate(4deg); }
    80% { transform: rotate(-2deg); }
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 991.98px) {
    .navbar-temple .navbar-collapse {
        background: var(--navy-deep);
        padding: 1rem;
        margin-top: 0.75rem;
        border: 1px solid rgba(201, 162, 39, 0.35);
    }

    .hero {
        min-height: 72vh;
    }
}

@media (max-width: 575.98px) {
    .brand-text .name-en {
        display: none;
    }

    .section {
        padding: 3rem 0;
    }
}

/* Festival countdown */
.countdown-section {
    background:
        linear-gradient(120deg, rgba(11, 44, 95, 0.94), rgba(123, 17, 19, 0.82)),
        url("../images/mural-texture.svg"),
        url("../images/hero-temple.svg") center/cover;
    background-blend-mode: normal, soft-light, normal;
    color: #fff;
    border-block: 3px solid var(--gold);
    padding: 3.25rem 0;
}

.countdown-kicker {
    color: var(--gold-light);
    margin-bottom: 0.35rem;
    letter-spacing: 0.04em;
}

.countdown-section h2 {
    font-family: var(--font-display);
    color: var(--gold-light);
    margin-bottom: 0.35rem;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: 520px;
    margin: 1.25rem auto 0;
}

.countdown-box {
    background: rgba(255, 249, 240, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.45);
    padding: 0.85rem 0.5rem;
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(11, 44, 95, 0.2);
}

.countdown-box .num {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 4vw, 2rem);
    color: var(--gold-light);
    line-height: 1.1;
}

.countdown-box .lbl {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

/* Heritage timeline on homepage */
.section-heritage {
    background:
        linear-gradient(180deg, rgba(248, 241, 227, 0.72), rgba(241, 228, 207, 0.88)),
        url("../images/mural-texture.svg");
    background-size: auto, 420px 420px;
}

.heritage-timeline {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
}

.heritage-timeline::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--gold), var(--maroon), var(--navy));
}

.heritage-item {
    position: relative;
    padding: 1rem 1rem 1rem 56px;
    margin-bottom: 1.15rem;
    background: rgba(255, 249, 240, 0.78);
    border: 1px solid rgba(11, 44, 95, 0.08);
    border-left: 0;
}

.heritage-item::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 1.15rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gold);
    border: 3px solid var(--navy);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

.heritage-item .year {
    font-family: var(--font-display);
    color: var(--maroon);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.heritage-item h3 {
    font-family: var(--font-display);
    color: var(--navy);
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.archive-note {
    background: linear-gradient(135deg, rgba(11, 44, 95, 0.96), rgba(123, 17, 19, 0.9));
    color: #fff;
    border: 2px solid var(--gold);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.archive-note-lamps {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 0.85rem;
}

.archive-note h3 {
    font-family: var(--font-display);
    color: var(--gold-light);
    margin-bottom: 0.65rem;
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
}

.archive-note p {
    max-width: 46rem;
    margin-inline: auto;
    opacity: 0.95;
}

.live-strip {
    background: var(--maroon);
    color: #fff;
    padding: 0.85rem 0;
    border-bottom: 2px solid var(--gold);
}

.hero-mural-overlay {
    position: absolute;
    inset: 0;
    background: url("../images/mural-texture.svg");
    background-size: 360px 360px;
    opacity: 0.12;
    pointer-events: none;
    mix-blend-mode: soft-light;
}

.hero-lead {
    max-width: 36rem;
    font-family: var(--font-body);
    font-size: 1.05rem;
    opacity: 0.92;
}

.panel-heading {
    font-family: var(--font-display);
    color: var(--navy);
}

@media (max-width: 575.98px) {
    .countdown-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.btn-nav-cta {
    background: var(--maroon) !important;
    color: #fff !important;
    padding: 0.35rem 0.85rem !important;
    margin-left: 0.35rem;
    border-radius: 3px;
}

.btn-nav-cta:hover {
    background: #5e0d0f !important;
    color: #fff !important;
}
