/* --- Brand Variables Extracted from Old Site --- */
:root {
    --primary: #0e7c7b;       /* Manor Teal */
    --primary-hover: #0d706f; 
    --secondary: #c3512f;     /* Rust */
    --accent: #ffd042;        /* Gold/Yellow */
    --text: #2b2b2b;          /* Dark Grey */
    --text-muted: #6b6b6b;
    --bg: #ffffff;
    --border: #ececec;
    
    --font-main: 'Open Sans', sans-serif;
    --container-width: 1200px;
}

/* --- Base Resets --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-main);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a { text-decoration: none; color: var(--primary); transition: color 0.2s ease; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }

/* --- Layout --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}
.main-content {
    flex: 1; /* Pushes footer to bottom */
    padding: 40px 20px;
}

/* --- Header & Navigation --- */
.site-header {
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}
.logo {
    height: 60px; /* Adjust based on preference */
}
.primary-nav {
    display: flex;
    gap: 25px;
}
.nav-item {
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    padding: 10px 0;
}
.nav-item:hover {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
}

.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--text);
    color: var(--bg);
    padding: 30px 0;
    text-align: center;
}
.social-icons {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.social-icons a {
    color: var(--bg);
    font-size: 1.5rem;
}
.social-icons a:hover {
    color: var(--accent);
}
.copyright {
    color: #999;
    font-size: 0.85rem;
}

/* --- Responsive Adjustments (Tablet & Mobile Global) --- */
@media (max-width: 992px) {
    .primary-nav { gap: 15px; }
    .nav-item { font-size: 0.85rem; }
}

@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    
    /* Hide nav by default on mobile (JS will toggle this later) */
    .primary-nav {
        display: none; 
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--bg);
        flex-direction: column;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }
    .primary-nav.is-active {
        display: flex;
    }
    .nav-item {
        font-size: 1.25rem; /* Increased for mobile readability */
        padding: 15px 20px; /* Increased touch target */
        border-top: 1px solid var(--border);
        display: block; /* Ensures the link spans nicely in a mobile dropdown */
    }
}

/* --- Page Fragment Styles --- */
.page-content {
    max-width: 1000px;
    margin: 0 auto;
}

.page-title {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-header, .welcome-text {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

.welcome-text p, .page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Modern Hero Image */
.hero-banner {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.hero-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive 16:9 Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* Mathematical ratio for 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    background-color: #000;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Smooth Routing Animation */
.fade-in {
    animation: fadeIn 0.4s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Video Gallery Grid --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns by default */
    gap: 20px;
    margin-bottom: 20px;
}

.video-card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.video-card:hover {
    transform: scale(1.03); /* Subtle zoom effect on hover */
}

.video-thumb-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.video-thumb-title {
    font-size: 0.85rem;
    text-align: center;
    margin-top: 10px;
    color: var(--text);
    font-weight: 600;
}

/* --- Gallery Controls --- */
.gallery-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 30px 0 20px;
}

.bottom-controls {
    margin: 20px 0 40px;
}

.page-indicator {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.nav-button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.nav-button:hover {
    color: var(--secondary);
}

/* --- Grid Responsiveness --- */
@media (max-width: 992px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
    }
}

@media (max-width: 600px) {
    .video-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
    }
}

/* --- Schedule Grid Styles --- */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.schedule-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.schedule-thumb-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9; /* Creates a perfect widescreen box */
    height: auto; /* Removes the restrictive 180px height */
    background-color: #f4f5f7; /* Matches the soft background of your other images */
    overflow: hidden;
}

.schedule-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Forces the entire uncropped image to be visible */
    object-position: center;
}

.schedule-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.schedule-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.schedule-topic {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.schedule-artist {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 15px;
    flex: 1;
}

.schedule-link {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    margin-top: auto;
}

.schedule-link:hover {
    text-decoration: underline;
}

/* --- Darshan Page Styles --- */
.darshan-hero-container {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    text-align: center;
}

.darshan-hero-img {
    width: 100%;
    max-height: 550px;
    object-fit: cover;
    display: block;
}

.darshan-hero-caption {
    padding: 20px;
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
}

.darshan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.darshan-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.darshan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.darshan-thumb-box {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
}

.darshan-thumb-title {
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.darshan-external-link {
    text-align: center;
    margin: 40px 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Shared Hero Image Styles (Darshan, Japa, Radio) */
.darshan-image,
.japa-hero-img,
.radio-hero-img {
    width: 100%;
    height: 400px; /* Enforces a consistent vertical size across all pages */
    object-fit: contain; /* Shrinks the image to fit entirely inside the box without cropping */
    background-color: #f4f5f7; /* Adds a soft background color to fill any leftover space neatly */
    border-radius: 8px;
    margin-bottom: 20px;
    display: block;
}

/* Darshan Grid Responsiveness */
@media (max-width: 992px) {
    .darshan-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .darshan-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Japa Page Styles --- */
.japa-media-container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    padding: 30px;
    text-align: center;
}

.japa-audio-wrapper {
    margin: 30px 0;
    width: 100%;
}

.japa-audio-wrapper audio {
    width: 100%;
    outline: none;
}

.japa-link-wrapper {
    margin-top: 20px;
}

.japa-external-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.japa-external-link:hover {
    text-decoration: underline;
    color: var(--secondary);
}

/* --- Radio Page Styles --- */
.radio-media-container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    padding: 30px;
    text-align: center;
}

.radio-audio-wrapper {
    margin: 20px 0;
    width: 100%;
}

.radio-audio-wrapper audio {
    width: 100%;
    outline: none;
}

/* --- Audio Page Styles (Featured & Gallery) --- */
.audio-featured-card {
    max-width: 1000px;
    margin: 0 auto 40px auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    padding: 30px;
    position: relative;
}

.audio-featured-badge {
    position: absolute;
    top: 20px;
    right: 25px;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.audio-featured-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.audio-featured-thumb {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    flex-shrink: 0;
}

.audio-featured-info {
    flex-grow: 1;
}

.audio-featured-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    color: var(--primary);
}

.audio-gallery-title {
    max-width: 1000px;
    margin: 0 auto 20px auto;
    font-size: 1.3rem;
    color: var(--text-main, #333);
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.audio-grid-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 20px;
}

.audio-item-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.audio-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.audio-speaker-thumb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.audio-meta-info h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    color: var(--primary);
}

.audio-date {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.audio-description {
    font-size: 0.95rem;
    color: var(--text-main, #333);
    margin-bottom: 15px;
}

.audio-player-wrapper {
    width: 100%;
}

.audio-player-wrapper audio {
    width: 100%;
    outline: none;
}

/* --- Mobile Specific Adjustments for Audio & Images --- */
@media (max-width: 768px) {
    .audio-featured-content {
        flex-direction: column;
        text-align: center;
    }
    .audio-featured-badge {
        position: static;
        display: inline-block;
        margin-bottom: 15px;
    }
    .audio-grid-container {
        grid-template-columns: 1fr;
    }
    .darshan-image,
    .japa-hero-img,
    .radio-hero-img {
        height: 250px; 
    }
}