/* ==================================================
   PREVIOUS LIVE STREAMS (UNIFIED CHURCH THEME EDITION)
   THEME: ROYAL NAVY, METALLIC GOLD FOIL, & PURE WHITE
   FONTS: LINUX LIBERTINE (TITLES) & OPEN SANS (BODY)
================================================== */

@import url('https://fonts.cdnfonts.com/css/linux-libertine');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary-navy: #0b1f4d;
    --navy-dark: #030a1a;
    --navy-light: #133266;
    --accent-gold: #c3b091;
    --gold-bright: #dfb738;
    --gold-dark: #997a15;
    --gold-glow: rgba(223, 183, 56, 0.4);
    --gold-aura: rgba(195, 176, 145, 0.2);
    --khaki-light: #f9f6f0;
    --text-dark: #1e293b;
    --text-muted: #526075;
    --border-color: #e2e8f0;
    --bg-gradient: linear-gradient(180deg, #ffffff 0%, #f4f0e6 100%);

    /* Font Stacks */
    --font-heading: 'Linux Libertine', Georgia, 'Times New Roman', serif;
    --font-body: 'Open Sans', Arial, Helvetica, sans-serif;

    /* Shadows & Transitions */
    --shadow-sm: 0 4px 14px rgba(11, 31, 77, 0.05);
    --shadow-base: 0 10px 28px rgba(11, 31, 77, 0.08);
    --shadow-hover: 0 18px 40px rgba(11, 31, 77, 0.14), 0 0 20px rgba(195, 176, 145, 0.3);
    --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Setup */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 86px;
    text-rendering: optimizeLegibility;
}

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

body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-body);
    color: var(--text-dark);
    background: var(--bg-gradient);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   MAIN SECTION & HEADINGS
========================================== */

.previous-stream {
    width: 94%;
    max-width: 1580px;
    margin: 40px auto 90px;
    padding: 80px 20px;
    min-height: 900px;
}

.previous-stream h2 {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 52px;
    color: #000000;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
    margin-top: 10px;
    margin-bottom: 16px;
    position: relative;
}

.previous-stream p {
    text-align: center;
    font-family: var(--font-body);
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 720px;
    line-height: 1.65;
    margin: 0 auto 50px;
    font-weight: 400;
}

/* =========================================
   SEARCH BAR
========================================== */

.stream-search {
    display: flex;
    justify-content: center;
    margin-bottom: 55px;
}

.stream-search input {
    width: 100%;
    max-width: 680px;
    padding: 16px 30px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: 50px;
    border: 2px solid var(--accent-gold);
    outline: none;
    background: rgba(255, 255, 255, 0.96);
    color: var(--primary-navy);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.stream-search input::placeholder {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.85;
}

.stream-search input:focus {
    border-color: var(--primary-navy);
    box-shadow:
        0 10px 28px rgba(11, 31, 77, 0.12),
        0 0 16px var(--gold-glow);
    background: #ffffff;
    transform: translateY(-2px);
}

/* =========================================
   VIDEO GRID CONTAINER & CARDS
========================================== */

.stream-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.stream-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-dark);
    border: 1.5px solid rgba(195, 176, 145, 0.65);
    border-top: 4.5px solid var(--accent-gold);
    box-shadow: var(--shadow-base);
    transition: var(--transition-smooth);
}

.stream-card:hover {
    border-color: var(--accent-gold);
    border-top-color: var(--primary-navy);
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.stream-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 3.5px solid var(--accent-gold);
    transition:
        filter 0.3s ease,
        opacity 0.3s ease;
    transform: none !important;
}

.stream-card:hover img {
    filter: brightness(1.03);
    opacity: 0.98;
}

/* Light Shimmer Effect */
.stream-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -110%;
    width: 65%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    pointer-events: none;
}

.stream-card:hover::after {
    left: 140%;
    transition: left 0.85s ease-in-out;
}

/* =========================================
   STREAM CONTENT & TYPOGRAPHY
========================================== */

.stream-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stream-content h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--primary-navy);
    margin: 0 0 10px;
    line-height: 1.35;
    font-weight: 700;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stream-card:hover .stream-content h3 {
    color: var(--navy-light);
}

.stream-date {
    font-family: var(--font-body);
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* =========================================
   YOUTUBE WATCH BUTTON
========================================== */

.watch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
    color: #ffffff !important;
    padding: 10px 24px;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(229, 57, 53, 0.22);
    transition: var(--transition-smooth);
    margin-top: auto;
    align-self: flex-start;
}

.watch-btn:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    box-shadow: 0 6px 18px rgba(229, 57, 53, 0.38);
    transform: translateY(-1px);
}

.view-toggle {
    display: flex;
    flex-direction: row;
    gap: 6px;
    position: fixed;
    left: 30px;
    bottom: 55px;
    top: auto;
    width: fit-content;
    max-width: 100%;
    justify-content: flex-start;
    margin: 0;
    padding: 6px;
    transform: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(195, 176, 145, 0.65);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(11, 31, 77, 0.12);
    z-index: 1001;
}

@media (max-width: 650px) {
    .view-toggle {
        left: 20px;
        bottom: 90px;
    }
}

.view-toggle button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--primary-navy);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
}

.view-toggle button:hover {
    background: var(--khaki-light);
}

.view-toggle button.active {
    background: var(--primary-navy);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(11, 31, 77, 0.25);
}

.view-toggle button:focus-visible {
    outline: 3px solid var(--gold-bright);
    outline-offset: 2px;
}

/* Mobile Menu Toggle Reset */
.menu-toggle {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: inherit;
    padding: 0 !important;
    margin: 0;
    border-radius: 0 !important;
}

/* =========================================
   DESKTOP LIST VIEW
========================================== */

.stream-container.list-view {
    grid-template-columns: 1fr;
    gap: 20px;
}

.stream-container.list-view .stream-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-height: 0;
    height: auto !important;
    overflow: hidden;
    border-top: 1.5px solid rgba(195, 176, 145, 0.65);
    border-left: 5px solid var(--accent-gold);
}

.stream-container.list-view .stream-card img {
    width: clamp(180px, 24vw, 300px);
    min-width: 0;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    flex: 0 0 clamp(180px, 24vw, 300px);
    align-self: flex-start;
    object-fit: cover;
    border-bottom: none;
    border-right: 3.5px solid var(--accent-gold);
}

.stream-container.list-view .stream-content {
    min-width: 0;
    min-height: 0;
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
}

.stream-container.list-view .stream-content h3 {
    margin: 0 0 8px;
    line-height: 1.35;
}

.stream-container.list-view .stream-date {
    margin-bottom: 15px;
}

.stream-container.list-view .watch-btn {
    margin-top: auto;
    align-self: flex-start;
}

@media (max-width: 600px) {
    .previous-stream {
        width: auto;
        min-height: 0;
        margin: 16px 15px 35px;
        padding: 8px 0 40px;
    }

    .previous-stream h2 {
        font-size: 2.1rem;
    }

    .previous-stream p {
        font-size: 0.95rem;
        margin-bottom: 35px;
    }

    .stream-container {
        grid-template-columns: 1fr;
    }

    .stream-card img {
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .stream-content {
        padding: 18px;
    }

    .stream-content h3 {
        font-size: 1.1rem;
    }

    .watch-btn {
        width: 100%;
        text-align: center;
    }

    /* Keep list cards readable without forcing a fixed card height. */
    #streamContainer.list-view .stream-card {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        height: auto !important;
        min-height: 140px !important;
        overflow: hidden;
        border-left: 4px solid var(--accent-gold) !important;
    }

    #streamContainer.list-view .stream-card img {
        width: clamp(96px, 35vw, 140px) !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 140px !important;
        flex: 0 0 clamp(96px, 35vw, 140px) !important;
        object-fit: cover;
        border-right: 3px solid var(--accent-gold) !important;
        border-bottom: none !important;
    }

    #streamContainer.list-view .stream-content {
        min-width: 0 !important;
        min-height: 140px !important;
        padding: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        flex: 1 !important;
    }
    #streamContainer.list-view .stream-content h3 {
        font-size: clamp(0.84rem, 3.4vw, 0.95rem);
        margin: 0 0 6px;
        line-height: 1.25;
        -webkit-line-clamp: 3;
        overflow-wrap: anywhere;
    }

    #streamContainer.list-view .stream-date {
        font-size: 0.8rem;
        margin: 0 0 8px;
    }

    #streamContainer.list-view .watch-btn {
        margin-top: auto !important;
        width: auto !important;
        padding: 7px 12px;
        font-size: 0.8rem;
        align-self: flex-start;
    }
}

/* Accessibility Focus States & Reduced Motion */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(223, 183, 56, 0.75);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   TYPOGRAPHY-ONLY ENHANCEMENT
   Linux Libertine for titles and Open Sans for body content.
   Layout, card sizing, grid behavior, and mobile rules are unchanged.
============================================================ */

:root {
    --font-heading: 'Linux Libertine', Georgia, 'Times New Roman', serif !important;
    --font-body: 'Open Sans', Arial, Helvetica, sans-serif !important;
}

body,
button,
input,
select,
textarea,
a,
table,
th,
td,
.previous-stream p,
.stream-search input,
.stream-date,
.watch-btn {
    font-family: var(--font-body) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.previous-stream h2,
.stream-content h3 {
    font-family: var(--font-heading) !important;
    text-rendering: optimizeLegibility;
}

/* Match the global parish background and type system. */
:root {
    --font-heading: 'Linux Libertine', Georgia, 'Times New Roman', serif !important;
    --font-body: 'Open Sans', Arial, Helvetica, sans-serif !important;
    --bg-gradient: #f8f6f0;
}

body,
.previous-stream {
    background: #f8f6f0 !important;
    font-family: var(--font-body) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading) !important;
}
.previous-stream h2::after,
.previous-stream h2::before {
    display: none !important;
    content: none !important;
}
