/* Ranger of the Realms - Stylesheet */

/* CSS Reset and Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --slate-dark: #1a2332;
    --slate-medium: #2d3e50;
    --slate-light: #4a5f7f;
    --mist: #8b9bb4;
    --gold: #c9a875;
    --warm-gold: #e8c89a;
    --text-light: #e8e4dd;
    --text-muted: #a0a8b5;
    --shadow: rgba(0, 0, 0, 0.5);
    --card-bg: rgba(45, 62, 80, 0.4);
    --border-subtle: rgba(201, 168, 117, 0.2);

    --font-serif: 'Georgia', 'Palatino', 'Book Antiqua', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --max-width: 1200px;
    --content-width: 800px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background: linear-gradient(180deg, var(--slate-dark) 0%, var(--slate-medium) 100%);
    background-attachment: fixed;
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.7;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 50% 20%, rgba(201, 168, 117, 0.04) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(139, 155, 180, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--warm-gold);
    line-height: 1.3;
    letter-spacing: 0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); }

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

a:hover {
    color: var(--warm-gold);
}

p {
    margin-bottom: 1rem;
}

/* Layout */
.site-header,
.site-main,
.site-footer {
    position: relative;
    z-index: 1;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
    background: rgba(26, 35, 50, 0.9);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--warm-gold);
    letter-spacing: 0.05em;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-light);
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    opacity: 0.8;
    transition: opacity 0.3s ease, color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    opacity: 1;
    color: var(--warm-gold);
}

.main-nav a.active::after,
.main-nav a:hover::after {
    transform: scaleX(1);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-light);
    transition: all 0.3s ease;
}

.mobile-menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Main Content */
.site-main {
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1.5rem 3rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: var(--warm-gold);
    text-shadow: 2px 2px 8px var(--shadow);
    margin-bottom: 0.75rem;
    letter-spacing: 0.06em;
}

.hero-tagline {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-style: italic;
    color: var(--mist);
    opacity: 0.85;
    letter-spacing: 0.04em;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.15rem);
    max-width: 650px;
    margin: 0 auto;
    color: var(--text-light);
    opacity: 0.9;
}

/* Divider */
.divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 2rem auto;
    opacity: 0.7;
}

/* Page Headers */
.page-header {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.page-description {
    color: var(--mist);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Episodes Grid */
.recent-episodes,
.episodes-library {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    color: var(--text-light);
}

.view-all {
    font-size: 0.9rem;
    color: var(--gold);
    letter-spacing: 0.03em;
}

.view-all:hover {
    text-decoration: underline;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.episodes-grid.full-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Episode Card */
.episode-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
}

.episode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--gold);
}

.episode-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--slate-dark);
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.episode-card:hover .episode-thumbnail img {
    transform: scale(1.05);
}

.episode-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--text-light);
    font-size: 0.75rem;
    font-family: var(--font-sans);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.episode-title {
    padding: 1rem;
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.4;
    font-weight: 400;
}

/* Episode Detail Page */
.episode-detail {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    margin-bottom: 2rem;
    border: 2px solid var(--gold);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 30px var(--shadow);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.episode-info .episode-title {
    padding: 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--warm-gold);
    margin-bottom: 0.5rem;
}

.episode-meta {
    display: inline-block;
    color: var(--mist);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.episode-description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-light);
    opacity: 0.95;
}

/* Episode Infographic - Preview Card */
.episode-infographic {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.episode-infographic h2 {
    color: var(--text-light);
    margin-bottom: 1.25rem;
    font-size: 1.3rem;
}

.infographic-card {
    position: relative;
    cursor: pointer;
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    background: var(--slate-dark);
}

.infographic-card:hover {
    border-color: var(--gold);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.infographic-preview {
    position: relative;
    max-height: 200px;
    overflow: hidden;
}

.infographic-preview img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s ease;
}

.infographic-card:hover .infographic-preview img {
    transform: scale(1.02);
}

/* Gradient fade at bottom */
.infographic-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--slate-dark));
    pointer-events: none;
}

.view-infographic-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--gold);
    font-family: var(--font-serif);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

.infographic-card:hover .view-infographic-btn {
    background: rgba(201, 168, 117, 0.1);
    color: var(--warm-gold);
}

.view-infographic-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Lightbox Modal */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-light);
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease;
    line-height: 1;
    padding-bottom: 3px;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--gold);
    color: var(--gold);
}

.lightbox-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--mist);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    opacity: 0.7;
}

.more-episodes {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    text-align: center;
}

.more-episodes h2 {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.view-all-link {
    display: inline-block;
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 0.75rem 2rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.view-all-link:hover {
    background: var(--gold);
    color: var(--slate-dark);
}

/* Notes */
.notes-library {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.note-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 1.5rem;
    text-decoration: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.note-card:hover {
    border-color: var(--gold);
    background: rgba(45, 62, 80, 0.6);
}

.note-title {
    color: var(--warm-gold);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.note-date {
    display: block;
    color: var(--mist);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.note-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.no-content {
    text-align: center;
    color: var(--mist);
    font-style: italic;
    padding: 2rem;
}

/* Note Detail */
.note-detail {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.note-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.note-header .note-title {
    margin-bottom: 0.5rem;
}

.note-header .note-date {
    color: var(--mist);
    font-size: 0.9rem;
}

.note-body {
    font-size: 1.1rem;
    line-height: 1.9;
}

.note-body h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.note-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.note-body p {
    margin-bottom: 1.25rem;
}

.note-body a {
    text-decoration: underline;
}

.note-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.back-link {
    color: var(--gold);
    font-size: 0.95rem;
}

/* About Page */
.about-page {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.about-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.about-hero h1 {
    margin-bottom: 0.5rem;
}

.about-tagline {
    color: var(--mist);
    font-style: italic;
    font-size: 1.1rem;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.9;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-links {
    text-align: center;
}

.about-links h2 {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.platform-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.platform-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    opacity: 0.8;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.platform-link:hover {
    opacity: 1;
    color: var(--warm-gold);
}

.platform-link svg {
    fill: currentColor;
}

.about-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--mist);
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 3rem 1.5rem 4rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.cta-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: rgba(74, 95, 127, 0.3);
    border: 2px solid var(--gold);
    border-radius: 4px;
    color: var(--text-light);
    font-family: var(--font-serif);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cta-button:hover {
    background: rgba(74, 95, 127, 0.5);
    border-color: var(--warm-gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    color: var(--text-light);
}

.cta-button svg {
    fill: currentColor;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    background: rgba(26, 35, 50, 0.5);
    padding: 3rem 1.5rem 2rem;
    margin-top: auto;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--warm-gold);
    letter-spacing: 0.05em;
}

.footer-tagline {
    color: var(--mist);
    font-size: 0.9rem;
    font-style: italic;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-light);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-links svg {
    fill: currentColor;
}

.footer-legal {
    font-size: 0.85rem;
    color: var(--mist);
}

.footer-legal a {
    color: var(--gold);
}

.copyright {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(26, 35, 50, 0.98);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        border-bottom: 1px solid var(--border-subtle);
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        padding: 1rem;
        text-align: center;
        border-bottom: 1px solid var(--border-subtle);
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .main-nav a::after {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero {
        padding: 3rem 1rem 2rem;
    }

    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .platform-links {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.75rem 1rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .episodes-grid {
        grid-template-columns: 1fr;
    }

    .episode-detail,
    .note-detail,
    .about-page {
        padding: 1.5rem 1rem 2rem;
    }
}

/* Episode search */
.episodes-search {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

#episode-search {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    font-size: 1rem;
    width: 100%;
    max-width: 400px;
    transition: border-color 0.2s;
}

#episode-search:focus {
    outline: none;
    border-color: var(--gold);
}

#episode-search::placeholder {
    color: var(--mist);
}

.search-count {
    color: var(--mist);
    font-size: 0.9rem;
}

.episode-card.hidden {
    display: none;
}

/* Episode links */
.episode-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.episode-links a {
    color: var(--gold);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.episode-links a:hover {
    background: var(--card-bg);
    border-color: var(--gold);
}

/* Transcript & Research pages */
.transcript-page,
.research-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--mist);
    text-decoration: none;
    font-size: 0.9rem;
}

.breadcrumb a:hover {
    color: var(--gold);
}

.transcript-header,
.research-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.transcript-header h1,
.research-header h1 {
    color: var(--warm-gold);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.transcript-subtitle,
.research-subtitle {
    color: var(--mist);
    font-size: 1rem;
}

.transcript-content,
.research-content {
    line-height: 1.8;
    color: var(--text-light);
}

.transcript-content h1,
.transcript-content h2,
.research-content h1,
.research-content h2 {
    color: var(--warm-gold);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.transcript-content h2,
.research-content h2 {
    font-size: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.5rem;
}

.transcript-content h3,
.research-content h3 {
    color: var(--gold);
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.transcript-content p,
.research-content p {
    margin-bottom: 1rem;
}

.research-content a {
    color: var(--gold);
}

.research-content a:hover {
    text-decoration: underline;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .site-header,
    .site-footer,
    .video-container,
    .cta-section {
        display: none;
    }
}
