:root {
    --ttd-bg: #fff9ee;
    --ttd-surface: #fffdf7;
    --ttd-text: #2f2318;
    --ttd-muted: #6c5846;
    --ttd-saffron: #c2410c;
    --ttd-maroon: #7f1d1d;
    --ttd-gold: #d7ab38;
    --ttd-border: #ecd7aa;
    --ttd-shadow: 0 4px 20px rgba(124, 45, 18, 0.06);
    --ttd-radius: 1rem;
    --ttd-radius-sm: 0.65rem;
}

.ttd-page {
    font-family: 'Poppins', sans-serif;
    background: var(--ttd-bg);
    min-height: 100vh;
}

/* ===== DEITY PAGE LAYOUT STRUCTURE ===== */

.sidebar-nav {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.nav-link {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: var(--ttd-muted);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.nav-link:hover {
    background: #fff7e7;
    border-left: 3px solid var(--ttd-gold);
    padding-left: calc(1rem - 3px);
}

.nav-link.active {
    background: var(--ttd-maroon);
    border-radius: var(--ttd-radius-sm);
    color: #fff;
    font-weight: 500;
    border-left: none;
    padding-left: 1rem;
}

.section-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--ttd-border);
}

.decorative-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ttd-saffron), transparent);
    margin: 1.5rem 0;
}

.ttd-hero {
    margin-top: 1rem;
    border-radius: var(--ttd-radius);
    padding: 1.5rem 1.25rem;
    background: linear-gradient(145deg, #9a1f19 0%, #6b1410 40%, #3d0a08 100%);
    border: 1px solid rgba(247, 196, 89, 0.2);
    color: #fff8ec;
    position: relative;
    overflow: hidden;
}

.ttd-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(255, 211, 120, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.ttd-kpi {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--ttd-radius-sm);
    padding: 0.85rem 0.6rem;
    text-align: center;
    backdrop-filter: blur(6px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.ttd-kpi:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.ttd-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    color: rgba(255, 248, 236, 0.95);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    transition: all 0.2s ease;
}

.ttd-pill:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.ttd-mobile-nav {
    margin-top: 1rem;
    border: 1px solid var(--ttd-border);
    border-radius: var(--ttd-radius-sm);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.6rem 0.75rem;
    position: sticky;
    top: 60px;
    z-index: 40;
    box-shadow: var(--ttd-shadow);
}

.ttd-mobile-nav-link {
    transition: all 0.2s ease;
    text-decoration: none;
}

.ttd-mobile-nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--ttd-saffron), var(--ttd-maroon));
    border-color: transparent !important;
}



.ttd-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ttd-maroon);
    font-family: 'Trio', 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ttd-sub {
    color: var(--ttd-muted);
    font-size: 0.92rem;
    margin-top: -0.2rem;
    margin-bottom: 0.9rem;
    line-height: 1.5;
}

.ttd-card {
    border: 1px solid #f0e0b8;
    border-radius: var(--ttd-radius-sm);
    background: #fffef9;
    padding: 0.95rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ttd-card p.font-semibold,
.ttd-card-soft p.font-semibold {
    font-family: 'Trio', 'Poppins', sans-serif;
}

.ttd-card:hover {
    box-shadow: 0 6px 20px rgba(124, 45, 18, 0.08);
    border-color: #e8d4a0;
}

.ttd-card-soft {
    border: 1px dashed #e5d4a8;
    border-radius: var(--ttd-radius-sm);
    background: linear-gradient(135deg, #fffcf5 0%, #fff9ed 100%);
    padding: 0.8rem 1rem;
}

.ttd-grid-3 {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ttd-grid-2 {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ttd-badge {
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    display: inline-block;
    letter-spacing: 0.02em;
}

.ttd-facts {
    columns: 3;
    column-gap: 0.9rem;
}

.ttd-fact {
    break-inside: avoid;
    margin-bottom: 0.85rem;
}


.ttd-accordion-content.hidden {
    display: none;
}

.ttd-room-tab {
    border: 1px solid #e5d4a8;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    color: var(--ttd-maroon);
    background: #fffcf5;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ttd-room-tab.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--ttd-saffron), var(--ttd-maroon));
    box-shadow: 0 6px 14px rgba(194, 65, 12, 0.25);
}

.ttd-room-tier-content {
    display: none;
}

.ttd-room-tier-content.active {
    display: block;
}

.crowd-bar {
    height: 0.5rem;
    border-radius: 999px;
    overflow: hidden;
    background: #fef3c7;
}

.crowd-bar-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.4s ease;
}

.crowd-bar-fill.low {
    background: #008000;
}

.crowd-bar-fill.moderate {
    background: #FFA500;
}

.crowd-bar-fill.high {
    background:#FF0000;
}

@media (max-width: 1024px) {
    .sidebar-nav {
        display: none;
    }
}

@media (max-width: 900px) {

    .ttd-grid-3,
    .ttd-grid-2 {
        grid-template-columns: 1fr;
    }

    .ttd-facts {
        columns: 1;
    }

    .ttd-heading {
        font-size: 1.2rem;
    }
}

@media (max-width: 640px) {

    .ttd-hero {
        padding: 1.25rem 1rem;
        margin-top: 0.75rem;
    }

    .ttd-hero h1 {
        font-size: 1.75rem !important;
    }

    .ttd-heading {
        font-size: 1.1rem;
        flex-wrap: wrap;
    }

    .ttd-kpi {
        padding: 0.6rem 0.4rem;
    }

    .ttd-kpi .text-xl {
        font-size: 1rem;
    }

    .ttd-pill {
        padding: 0.35rem 0.7rem;
        font-size: 0.72rem;
    }

    .ttd-card {
        padding: 0.8rem;
    }

    .ttd-room-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .ttd-accordion-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.88rem;
    }

    .ttd-timeline-wrapper {
        padding-left: 0;
    }

    table {
        font-size: 0.8rem;
    }

    table th,
    table td {
        padding: 0.5rem 0.4rem !important;
    }

    .ttd-mobile-nav {
        padding: 0.5rem 0.6rem;
    }
}

/* ─── TTD daily darshan dashboard (DB-backed) ─── */
.ttd-daily-dashboard {
    background: linear-gradient(180deg, #fffbf0 0%, #fffef9 100%);
    border: 1px solid rgba(236, 215, 170, 0.9);
    border-radius: var(--ttd-radius-sm);
    box-shadow: var(--ttd-shadow);
}

.ttd-daily-stats-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ttd-daily-stats-grid {
    display: grid;
    gap: 0.75rem;
}

.ttd-daily-stats-grid--top {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .ttd-daily-stats-grid--top {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ttd-daily-stats-grid--bottom {
    grid-template-columns: 1fr;
    max-width: 100%;
}

@media (min-width: 640px) {
    .ttd-daily-stats-grid--bottom {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 66.666%;
        margin-left: auto;
        margin-right: auto;
    }
}

.ttd-daily-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 0.9rem;
    background: #fffbeb;
    border: 1px solid #f5e0a8;
    border-radius: var(--ttd-radius-sm);
    min-height: 4.25rem;
}

.ttd-daily-stat-ico {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.ttd-daily-stat-text {
    min-width: 0;
}

.ttd-daily-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ttd-muted);
    margin: 0 0 0.15rem 0;
}

.ttd-daily-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #633215;
    margin: 0;
    line-height: 1.2;
}

.ttd-weekly-table tbody td {
    vertical-align: top;
}

.ttd-weekly-legacy td,
.ttd-weekly-legacy th {
    border: 1px solid #777;
}

.ttd-weekly-legacy tbody tr:nth-child(even) td {
    background: #e8dfda;
}

.ttd-weekly-legacy tbody tr:nth-child(odd) td {
    background: #f0ece8;
}

/* Scroll margin for anchor jumps */
#darshan, #rooms, #prasadam, #history,
#sevas, #timings, #festivals, #updates,
#facts, #travel {
    scroll-margin-top: 70px;
}
@media (min-width: 1024px) {
    #darshan, #rooms, #prasadam, #history,
    #sevas, #timings, #festivals, #updates,
    #facts, #travel {
        scroll-margin-top: 80px;
    }
}