/*
Theme Name: Chroma-Shift
Theme URI: https://yourwebsite.com/
Author: Gemini
Author URI: https://google.com
Description: A dynamic theme with light/dark modes for The Feed and The Cinematheque plugins.
Version: 2.1.0 (App-like revision)
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chroma-shift
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
1.0  - Theme Variables (Light & Dark)
2.0  - Global & Reset Styles
3.0  - Layout & Structure
4.0  - Header & Navigation (v2 - Compact & App-like)
    4.1  - Compact Header Layout (54px)
    4.2  - Live Search Bar
    4.3  - User Actions (Bell & Profile Menu)
    4.4  - Desktop Navigation Menus
    4.5  - Mobile Hamburger Menu & Panel
5.0  - Plugin Component Styles
    5.1  - The Feed Components
    5.2  - The Cinematheque Components
6.0  - Responsive Design & Mobile
--------------------------------------------------------------*/


/*--------------------------------------------------------------
1.0 - Theme Variables (Light & Dark)
--------------------------------------------------------------*/
:root {
    /* Base Variables */
    --accent-color: #00aaff;
    --accent-hover-color: #0088cc;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --border-radius: 4px;
    --header-height: 54px;
}

/* Light Theme (for The Feed pages) */
body.theme-light {
    --bg-color: #f0f2f5;
    --surface-color: #ffffff;
    --primary-text-color: #1c1e21;
    --secondary-text-color: #65676b;
    --border-color: #ced0d4;
    --input-bg-color: #e4e6eb;
    --hover-bg-color: #e4e6eb;
}

/* Dark Theme (for The Cinematheque pages) */
body.theme-dark {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-text-color: #e0e0e0;
    --secondary-text-color: #a0a0a0;
    --border-color: #333333;
    --input-bg-color: #2a2a2a;
    --hover-bg-color: #2a2a2a;
}

/*--------------------------------------------------------------
2.0 - Global & Reset Styles
--------------------------------------------------------------*/
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    margin: 0;
    font-size: 15px; /* Slightly more compact base font size */
    padding-top: var(--header-height); /* Prevent content from hiding under fixed header */
    transition: background-color 0.3s ease;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}
a:hover {
    color: var(--accent-hover-color);
    text-decoration: underline;
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-text-color);
    margin-top: 0;
    margin-bottom: 0.5em;
}

/*--------------------------------------------------------------
3.0 - Layout & Structure
--------------------------------------------------------------*/
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 15px; /* More compact padding */
}

.site-content {
    padding-top: 20px;
}

.site-footer {
    margin-top: 30px;
    padding: 30px 15px;
    background-color: var(--surface-color);
    text-align: center;
    color: var(--secondary-text-color);
    border-top: 1px solid var(--border-color);
}

/*--------------------------------------------------------------
4.0 - Header & Navigation (v2 - Compact & App-like)
--------------------------------------------------------------*/
/* 4.1 - Compact Header Layout (54px) */
.site-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    padding: 0 15px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}
.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    height: 100%;
}
.header-left { justify-content: flex-start; }
.header-center { flex-grow: 1; justify-content: center; }
.header-right { justify-content: flex-end; }
.site-branding {
    display: flex;
    align-items: center;
}
.site-branding .site-title {
    font-size: 1.2em;
    margin: 0 0 0 10px;
    font-weight: 700;
}
.site-branding .site-title a {
    color: var(--primary-text-color);
    text-decoration: none;
}

/* 4.2 - Live Search Bar */
.header-search-container { position: relative; }
.search-toggle-icon { display: none; background: none; border: none; cursor: pointer; color: var(--primary-text-color); font-size: 1.5em; padding: 5px; }
#live-search-input { height: 36px; padding: 5px 15px 5px 40px; width: 220px; transition: width 0.3s; background-color: var(--input-bg-color); border: 1px solid var(--border-color); color: var(--primary-text-color); border-radius: 20px; }
#live-search-input:focus { width: 320px; }
#live-search-results { position: absolute; top: 110%; right: 0; width: 400px; max-height: 80vh; overflow-y: auto; background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: 0 5px 15px rgba(0,0,0,0.5); z-index: 1001; display: none; }
.live-search-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--border-color); color: var(--primary-text-color); }
.live-search-item:hover { background-color: var(--hover-bg-color); text-decoration: none; }
.result-title { font-weight: bold; }
.result-type, .result-context { font-size: 0.8em; color: var(--secondary-text-color); }

/* 4.3 - User Actions (Bell & Profile Menu) */
.header-right { gap: 8px; }
.user-avatar-toggle { background: none; border: none; padding: 0; cursor: pointer; border-radius: 50%; }
.user-avatar-toggle img { width: 36px; height: 36px; border-radius: 50%; display: block; }
.user-actions { background-color: transparent !important; padding: 0 !important; border-radius: 0 !important; margin-bottom: 30px !important; border: 0 !important; }
.user-actions-menu { position: relative; }
.user-dropdown-menu { display: none; position: absolute; top: 120%; right: 0; background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: 0 5px 15px rgba(0,0,0,0.2); z-index: 1001; min-width: 180px; padding: 5px 0; }
.user-dropdown-menu.is-active { display: block; }
.user-dropdown-menu a { display: block; padding: 8px 15px; color: var(--primary-text-color); }
.user-dropdown-menu a:hover { background-color: var(--hover-bg-color); text-decoration: none; }
.user-dropdown-menu .user-info { padding: 10px 15px; border-bottom: 1px solid var(--border-color); }
.user-dropdown-menu .logout-link { border-top: 1px solid var(--border-color); }
.the-feed-bell-container #the-feed-bell-trigger { padding: 5px; color: var(--primary-text-color); }
.the-feed-bell-container #the-feed-bell-trigger:hover { background-color: var(--hover-bg-color); }
.the-feed-bell-container #the-feed-bell-trigger .dashicons-bell { font-size: 24px; }
.button.button-small { padding: 6px 12px; font-size: 0.9em; }

/* 4.4 - Desktop Navigation Menus */
.desktop-menu { margin: 0; padding: 0; list-style: none; display: flex; height: 100%; }
.desktop-menu a { display: flex; align-items: center; height: 100%; padding: 0 15px; border-bottom: 3px solid transparent; color: var(--secondary-text-color); font-weight: 500; transition: color 0.2s, border-color 0.2s; }
.desktop-menu a:hover { text-decoration: none; color: var(--primary-text-color); }
.desktop-menu .current-menu-item > a { color: var(--accent-color); border-bottom-color: var(--accent-color); }
/* Icon Menu specific styles */
.theme-light .desktop-menu a { font-size: 0; /* Hide text */ }
.theme-light .desktop-menu a::before { font-family: 'dashicons'; font-size: 26px; }
.theme-light .menu-item.icon-feed a::before { content: '\f109'; }
.theme-light .menu-item.icon-profile a::before { content: '\f338'; }
.theme-light .menu-item.icon-submit a::before { content: '\f132'; }

/* 4.5 - Mobile Hamburger Menu & Panel */
.menu-toggle { display: none; background: none; border: none; padding: 10px; cursor: pointer; z-index: 1002; width: 40px; height: 40px; }
.hamburger-icon { display: block; position: relative; width: 22px; height: 2px; background-color: var(--primary-text-color); transition: background-color 0.1s ease; }
.hamburger-icon::before, .hamburger-icon::after { content: ''; position: absolute; left: 0; width: 100%; height: 2px; background-color: var(--primary-text-color); transition: transform 0.3s ease; }
.hamburger-icon::before { top: -7px; }
.hamburger-icon::after { bottom: -7px; }
.mobile-menu-active .hamburger-icon { background-color: transparent; }
.mobile-menu-active .hamburger-icon::before { transform: translateY(7px) rotate(45deg); }
.mobile-menu-active .hamburger-icon::after { transform: translateY(-7px) rotate(-45deg); }

.mobile-navigation { position: fixed; top: var(--header-height); left: 0; width: 280px; height: calc(100vh - var(--header-height)); background-color: var(--surface-color); border-right: 1px solid var(--border-color); padding: 20px; transform: translateX(-100%); transition: transform 0.3s ease; z-index: 999; overflow-y: auto; }
.mobile-menu-active .mobile-navigation { transform: translateX(0); }
.mobile-menu-overlay { display: none; position: fixed; top: var(--header-height); left: 0; width: 100%; height: calc(100vh - var(--header-height)); background: rgba(0,0,0,0.5); z-index: 998; }
.mobile-menu-active .mobile-menu-overlay { display: block; }
.mobile-menu { list-style: none; margin: 0; padding: 0; }
.mobile-menu a { display: block; padding: 12px 0; font-size: 1.1em; color: var(--primary-text-color); text-decoration: none; }

/*--------------------------------------------------------------
5.0 - Plugin Component Styles
--------------------------------------------------------------*/
/* 5.1 - The Feed Components */
.the-feed-post-box, .the-feed-activity, #the-feed-profile-app, #the-feed-notifications-app, .the-feed-profile-header-new, .the-feed-profile-tab-panel, .the-feed-profile-edit-content {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 15px;
}
.the-feed-activity-footer, .the-feed-post-box-actions, .the-feed-comment-box { border-top-color: var(--border-color); }
.the-feed-post-box-input-placeholder { background-color: var(--input-bg-color); color: var(--secondary-text-color); }
.the-feed-add-media-btn:hover { background-color: var(--hover-bg-color); }
.the-feed-activity-user-name, .the-feed-comment-user-name { color: var(--primary-text-color); font-weight: 600; }
.the-feed-activity-timestamp, .the-feed-comment-timestamp { color: var(--secondary-text-color); }
.the-feed-comment { background-color: var(--bg-color); }
.the-feed-activity-actions-row button { color: var(--secondary-text-color); font-weight: 600; }
.the-feed-activity-actions-row button:hover { background-color: var(--hover-bg-color); }
.the-feed-react-btn.reacted-like, .the-feed-react-btn.liked { color: var(--accent-color); }
.the-feed-mention { color: var(--accent-color); font-weight: 600; }
.the-feed-profile-nav { background-color: var(--surface-color); border-bottom-color: var(--border-color); }
.the-feed-profile-nav ul li a { color: var(--secondary-text-color); }
.the-feed-profile-nav ul li.active a { color: var(--accent-color); border-bottom-color: var(--accent-color); }
.the-feed-lightbox-comments-area { background-color: var(--surface-color); }

/* 5.2 - The Cinematheque Components */
.cinematheque-form-container, #cinematheque-edit-suggestion-form { background-color: var(--surface-color); border: 1px solid var(--border-color); padding: 20px 30px; border-radius: var(--border-radius); max-width: 700px; margin: 20px auto; }
.cinematheque-form-container h2 { border-bottom-color: var(--border-color); }
.single-cinematheque .entry-header { border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 15px; }


/*--------------------------------------------------------------
6.0 - Responsive Design & Mobile
--------------------------------------------------------------*/
@media (max-width: 900px) {
    .header-center { display: none; }
}

@media (max-width: 782px) {
    /* --- Mobile Header --- */
    .menu-toggle { display: block; }
    .site-branding { flex-grow: 1; text-align: center; }
    #live-search-input { display: none; }
    .search-toggle-icon { display: block; }
    .header-search-container.is-active #live-search-input {
        display: block;
        position: absolute;
        top: calc(var(--header-height) - 1px);
        left: 50%;
        transform: translateX(-50%);
        width: 95vw;
        max-width: 400px;
        border-radius: 0 0 4px 4px;
        z-index: 1001;
        border-top: none;
    }

    /* --- App-like Fixed Nav for Feed pages --- */
    .feed-page .main-navigation { display: none; } /* Hide the (now empty) desktop nav container */
    .mobile-feed-nav { display: none; }
    body.feed-page .mobile-feed-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
        z-index: 999;
    }
    .mobile-feed-nav ul { width: 100%; display: flex; justify-content: space-around; list-style: none; margin: 0; padding: 5px 0; }
    .mobile-feed-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 10px; font-size: 10px; color: var(--secondary-text-color); }
    .mobile-feed-nav .current-menu-item a { color: var(--accent-color); }
    .mobile-feed-nav a::before { font-size: 24px; }
    body.feed-page { padding-bottom: 60px; /* Space for the fixed nav */ }
}

/*--------------------------------------------------------------
5.3 - Single CPT: Movie (App-like Layout)
--------------------------------------------------------------*/

.theme-dark .movie-single-page {
    background-color: var(--bg-color);
}

/* --- 1. Cinematic Header --- */
.movie-header {
    position: relative;
    padding: 40px 0;
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    color: #fff;
    display: flex;
    align-items: flex-end;
    min-height: 450px;
}
.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(18,18,18,1) 10%, rgba(18,18,18,0.7) 50%, rgba(18,18,18,0.4) 100%);
    z-index: 1;
}
.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 30px;
    margin: 0;
    padding: 15px;
}
.header-poster {
    flex-shrink: 0;
    width: 200px;
}
.header-poster img {
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}
.header-details .entry-title {
    font-size: 2.8em;
    font-weight: 200;
    margin: 0;
    line-height: 1.1;
    color: #fff;
}
.header-details .release-year {
    font-size: 1.5em;
    font-weight: 300;
    color: var(--secondary-text-color);
}
.header-details .tagline {
    font-size: 1.1em;
    font-style: italic;
    color: var(--secondary-text-color);
    margin: 10px 0;
}
.header-details .quick-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: var(--secondary-text-color);
    margin-top: 15px;
}
.header-details .quick-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- 2. Main Content Layout --- */
.movie-single-page .entry-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px; /* Main column | Sidebar */
    gap: 30px;
    padding-top: 20px;
}

.main-content-area {
    /* This element is now a grid-area, no flex properties needed */
}

.sidebar-area {
    /* This element is now a grid-area, no flex properties needed */
}

.content-section {
    background-color: var(--surface-color);
    padding: 10px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.content-section h2 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.4em;
}

/* --- 3. Credits & Horizontal Scroll --- */
.credits-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.credits-grid::-webkit-scrollbar { display: none; }
.credit-person, .view-all-card {
    flex-shrink: 0;
    width: 150px;
    scroll-snap-align: start;
}
.credit-person a, .view-all-card a {
    display: block;
    text-decoration: none;
    color: var(--primary-text-color);
    transition: transform 0.2s ease;
}
.credit-person a:hover, .view-all-card a:hover {
    transform: scale(1.05);
    text-decoration: none;
}
.credit-person img {
    width: 100%;
    height: 225px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    background-color: var(--input-bg-color);
}
.credit-person strong, .credit-person span {
    font-size: 0.9em;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.credit-person span {
    font-size: 0.8em;
    color: var(--secondary-text-color);
}
/* NEW: "View All" card styling */
.view-all-card a {
    background-color: var(--input-bg-color);
    border-radius: var(--border-radius);
    height: 225px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
}
.view-all-card a:hover {
    background-color: #3a3a3a;
}
.view-all-card a .dashicons {
    font-size: 2em;
    height: auto;
    width: auto;
    margin-top: 10px;
}

/* --- 4. Sidebar & Details List --- */
.user-actions .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}
.action-btn {
    background-color: var(--input-bg-color);
    color: var(--primary-text-color);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 15px 5px;
    border-radius: var(--border-radius);
}
/* NEW: Details List Styling */
.details-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9em;
}
.details-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.details-list li:last-child {
    border-bottom: none;
}
.details-list strong {
    color: var(--secondary-text-color);
    margin-right: 8px;
}

/* --- 5. Comments & Responsive Stacking --- */
#feed-comments-section {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}
#feed-comments-section .the-feed-comments-section { border-top: none; margin-top: 0; padding-top: 0; }
#feed-comments-section .the-feed-comment { background-color: var(--input-bg-color); }

@media (max-width: 900px) {
    .movie-single-page .entry-content {
        grid-template-columns: 1fr; /* Stack to a single column */
    }
    .sidebar-area {
        order: -1; /* Move sidebar to the top on mobile */
    }
}
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .header-poster {
        width: 150px;
    }
    .header-details .entry-title {
        font-size: 1.5em;
    }
    .header-details .quick-meta {
        justify-content: center;
    }
    .header-details .release-year {
        font-size: 1.2em;
    }
}

.content-section--carousel {
    display: grid;
}

/* --- Media Section: Tabs & Carousels --- */
.media-tabs-nav {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
.media-tabs-nav .tab-link {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.media-tabs-nav .tab-link.active {
    color: var(--primary-text-color);
    border-bottom-color: var(--accent-color);
}

.media-tabs-content {

}

.media-tabs-content .tab-content {
    display: none;
}
.media-tabs-content .tab-content.active {
    display: block;
}

.media-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.media-carousel::-webkit-scrollbar { display: none; }

.media-item {
    scroll-snap-align: start;
    flex-shrink: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    background-color: var(--input-bg-color);
}
.media-item a {
    display: block;
    width: 100%;
    height: 100%;
}
.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}
.media-item a:hover img {
    transform: scale(1.05);
}

.media-item--video {
    width: 280px;
    aspect-ratio: 16 / 9;
}
.play-icon-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: opacity 0.2s ease;
}
.play-icon-overlay .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.media-item--poster {
    width: 180px;
    aspect-ratio: 2 / 3;
}

.media-item--backdrop {
    width: 300px;
    aspect-ratio: 16 / 9;
}

.media-tabs-content .tab-content.active {
    display: grid;
}

/*--------------------------------------------------------------
5.4 - Carousel Item Sizing & Uniform Height (v2.3)
--------------------------------------------------------------*/

/* --- 1. Define a responsive height variable for all carousels --- */
.theme-dark {
    /* Base height for desktop */
    --carousel-item-height: 180px;
}
@media (max-width: 900px) {
    .theme-dark { --carousel-item-height: 160px; }
}
@media (max-width: 600px) {
    .theme-dark { --carousel-item-height: 140px; }
}


/* --- 2. Apply the height and aspect ratios to carousel items --- */
/* This makes all items have the same height, while width is calculated automatically */

.media-item {
    height: var(--carousel-item-height); /* Use the variable for height */
    width: auto; /* Allow width to be determined by aspect ratio */
}

/* Redefine cast/crew card to match the new height logic */
.credit-person, .view-all-card {
    width: calc( (var(--carousel-item-height) - 42px) * (2/3) ); /* Keep width calculation simple */
    min-width: 110px;
}

.credit-person a, .view-all-card a {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.credit-person img {
    /* Let the image fill the remaining space in the flex container */
    width: 100%;
    height: 100%;
    flex-grow: 1;
    object-fit: cover;
    min-height: 0; /* Critical for flexbox item shrinking */
}

/* Ensure the text below the image has a fixed height */
.credit-person a div {
    padding-top: 8px;
    height: 42px; /* Fixed height for two lines of text */
    flex-shrink: 0;
}

/* --- Single Movie Template v2.4 Additions --- */

/* Header Content Rating */
.quick-meta .rating {
    border: 1px solid var(--secondary-text-color);
    padding: 2px 6px;
    border-radius: var(--border-radius);
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1;
}

/* Official Links Sidebar Section */
.links-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}


.social-links {
    display: flex;
    justify-content: left;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--input-bg-color);
    color: var(--secondary-text-color);
    border-radius: 50%;
    font-size: 22px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.social-links a:hover {
    background-color: #3a3a3a;
    color: #fff;
}

/* Custom Icons for IMDb and Instagram */
.icon-imdb {
    font-weight: bold;
    font-size: 0.8em;
    font-family: sans-serif;
    border: 2px solid;
    padding: 0 4px;
    border-radius: 3px;
}
.icon-instagram::before {
    /* Basic representation of Instagram icon */
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    border: 2px solid;
    border-radius: 5px;
    position: relative;
}
.icon-instagram::after {
    content: '';
    display: block;
    position: absolute;
    width: 8px;
    height: 8px;
    border: 2px solid;
    border-radius: 50%;
}


/* Expanded Details List Styling */
.details-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
}

.details-list strong {
    flex-shrink: 0;
}

/* Keyword Styling */
.keywords-list .term-list a {
    display: inline-block;
    background-color: var(--input-bg-color);
    color: var(--secondary-text-color);
    padding: 3px 8px;
    border-radius: 12px; /* Pill shape */
    font-size: 0.9em;
    margin-bottom: 5px;
    text-decoration: none;
    border: 1px solid var(--border-color);
}
.keywords-list .term-list a:hover {
    background-color: #3a3a3a;
    color: var(--primary-text-color);
}

/* --- Where to Watch Section --- */
.where-to-watch-section {
    padding: 0; /* Remove default padding to allow button to fill space */
}
.watch-now-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--input-bg-color);
    padding: 10px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color .2s ease;
}
.where-to-watch-section.is-expanded .watch-now-btn {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.watch-now-btn:hover {
    background-color: #3a3a3a;
}
.watch-now-btn__label {
    display: flex;
    align-items: center;
    gap: 12px;
}
.watch-now-btn__label img {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    background-color: #fff; /* In case of transparent PNGs */
}
.watch-now-btn__text span {
    display: block;
    font-size: 0.8em;
    color: var(--secondary-text-color);
}
.watch-now-btn__text strong {
    display: block;
    font-size: 1.1em;
    color: var(--primary-text-color);
}
.watch-now-btn .expand-arrow {
    transition: transform .3s ease;
}
.where-to-watch-section.is-expanded .expand-arrow {
    transform: rotate(180deg);
}
.watch-providers-panel {
    display: none; /* Hidden by default */
    padding: 15px;
    background-color: var(--input-bg-color);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}
.watch-providers-panel label {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--secondary-text-color);
    margin-bottom: 5px;
    display: block;
}
.watch-providers-panel select {
    width: 100%;
    margin-bottom: 15px;
    background-color: var(--bg-color);
    border-color: #444;
}
.provider-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.provider-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-text-color);
    text-decoration: none;
}
.provider-list-item img {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
}
.provider-list-item span {
    font-weight: 500;
}

/* NEW: Default Widget Styling for Movie Sidebar */
.sidebar-area .widget-area {
    /* The dynamic_sidebar function will wrap widgets in a section with the .widget class */
}

.sidebar-area .widget {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.sidebar-area .widget-title {
    margin: -20px -20px 15px -20px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.2em;
    background-color: var(--input-bg-color); /* A slightly different header for widgets */
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.sidebar-area .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-area .widget ul li {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-area .widget ul li:last-child {
    border-bottom: none;
}


/* --- Single TV Show: Seasons Section --- */
.seasons-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.seasons-grid::-webkit-scrollbar { display: none; }

.season-card {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 200px; /* A bit wider than cast cards */
    transition: transform 0.2s ease;
}
.season-card:hover {
    transform: translateY(-5px);
}
.season-card a {
    text-decoration: none;
    color: var(--primary-text-color);
    display: block;
}
.season-card img {
    width: 100%;
    aspect-ratio: 2 / 3; /* Standard poster aspect ratio */
    object-fit: cover;
    border-radius: var(--border-radius);
    background-color: var(--input-bg-color);
    margin-bottom: 10px;
}
.season-card-info {
    padding: 0 5px;
}
.season-card-info strong {
    font-size: 1em;
    display: block;
}
.season-card-info span {
    font-size: 0.85em;
    color: var(--secondary-text-color);
}

@media (max-width: 600px) {
    .season-card {
        width: 160px;
    }
}

.tv-show-single-page .entry-content, .movie-single-page .entry-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 30px;
    padding: 0;
}

@media (max-width: 900px) {
    .tv-show-single-page .entry-content, .movie-single-page .entry-content {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
}

/* ADD THESE NEW RULES TO THE BOTTOM OF YOUR style.css FILE */

/* --- Single TV Show: Season Slider Section --- */
.season-slider-section {
    padding: 0;
    background-color: transparent;
    border: none;
}
.season-slider-section h2 {
    margin: 0 0 5px 0;
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 1.4em;
}
.season-slider-container {
    position: relative;
}
.season-slider-viewport {
    overflow: hidden;
    border-radius: var(--border-radius);
    display: grid;
}
.season-slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.season-slider-card {
    flex-basis: 100%;
    flex-shrink: 0;
    position: relative;
    background-size: cover;
    background-position: center center;
    color: #fff;
}
.season-slider-card .card-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(30,30,30,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.season-slider-card .card-content {
    position: relative;
    z-index: 2;
    padding: 25px;
    display: flex;
    gap: 25px;
    align-items: center;
}
.season-slider-card .card-poster {
    width: 150px;
    flex-shrink: 0;
}
.season-slider-card .card-poster img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.season-slider-card .card-details h3 {
    margin: 0 0 5px 0;
    font-size: 1.5em;
}
.season-slider-card .card-details h3 a {
    color: #fff;
    text-decoration: none;
}
.season-slider-card .card-meta {
    font-size: 0.9em;
    color: var(--secondary-text-color);
    margin-bottom: 15px;
}
.season-slider-card .card-description {
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-airing-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: var(--border-radius);
}
.card-airing-info .dashicons {
    font-size: 24px;
    color: var(--accent-color);
}
.card-airing-info strong {
    display: block;
    font-size: 0.8em;
    text-transform: uppercase;
    color: var(--secondary-text-color);
}
.card-airing-info span {
    font-weight: 500;
}

/* Slider Navigation */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30,30,30,0.5);
    color: #fff;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all .2s ease;
}
.slider-nav:hover {
    background-color: rgba(0,0,0,0.8);
}
.slider-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.slider-nav.prev { left: -20px; }
.slider-nav.next { right: -20px; }

/* Update the responsive rule to handle the new grid layout */
@media (max-width: 600px) {
    .season-slider-card .card-content {
        grid-template-columns: 1fr; /* Stack into a single column */
        text-align: center;
    }
    .season-slider-card .card-poster {
        width: 150px; /* Set a max-width for the poster on mobile */
        margin: 0 auto; /* Center the poster */
    }
    .slider-nav.prev { left: 5px; }
    .slider-nav.next { right: 5px; }
}

/* --- Next Episode Countdown Timer --- */
.next-episode-countdown {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: var(--input-bg-color); /* Use a slightly different bg */
    padding: 15px 20px;
}
.countdown-icon .dashicons {
    font-size: 36px;
    color: var(--accent-color);
}
.countdown-text-info {
    flex-grow: 1;
    color: var(--secondary-text-color);
    font-size: 0.9em;
}
.countdown-text-info strong {
    display: block;
    color: var(--primary-text-color);
    font-size: 1.1em;
}
.countdown-timer {
    display: flex;
    gap: 10px;
    text-align: center;
}
.countdown-timer .time-part {
    display: flex;
    flex-direction: column;
}
.countdown-timer .time-value {
    font-family: "SF Mono", "Consolas", "Menlo", monospace;
    font-size: 2.2em;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.countdown-timer .time-label {
    font-size: 0.7em;
    text-transform: uppercase;
    color: var(--secondary-text-color);
}

@media (max-width: 600px) {
    .next-episode-countdown {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .countdown-timer {
        justify-content: center;
    }
}

/* --- Single TV Show: Responsive Fix for Season Slider on Small Mobile --- */
@media (max-width: 480px) {
    .season-slider-card .card-content {
        /* Reduce padding on very small screens */
        padding: 20px 15px;
        gap: 15px;
    }

    .season-slider-card .card-poster {
        /* Change fixed width to a more flexible value */
        width: 100px;
    }

    .season-slider-card .card-details h3 {
        font-size: 1.3em;
    }

    .slider-nav {
        /* Make nav buttons smaller and position them further inside */
        width: 36px;
        height: 36px;
    }
    .slider-nav.prev { left: 10px; }
    .slider-nav.next { right: 10px; }
}

/* --- Single Video Page Template --- */
.single-video-page .entry-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    padding: 0;
}
@media (max-width: 900px) {
    .single-video-page .entry-content {
        grid-template-columns: 1fr;
    }
    
    .single-video-page .sidebar-area {
        order: 2;
    }
}

.video-player-section {
    padding: 0;
    overflow: hidden; /* Ensures border-radius is applied to iframe */
}

.video-player-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
}
.video-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.parent-post-info {
    display: flex;
    align-items: center;
    gap: 20px;
}
.parent-post-info .parent-poster {
    flex-shrink: 0;
    width: 80px;
}
.parent-post-info .parent-poster img {
    border-radius: var(--border-radius);
}
.parent-post-info .parent-details h2 {
    font-size: 1.5em;
    margin-bottom: 5px;
}
.parent-post-info .parent-details p {
    margin: 0;
    color: var(--secondary-text-color);
}
.parent-post-info .parent-details p a {
    color: var(--primary-text-color);
}

.related-videos-section h2 {
    margin: 0 -20px 15px -20px;
    padding: 0 20px 15px 20px;
    border-bottom: 1px solid var(--border-color);
}
.related-videos-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.related-video-item {
    display: flex;
    gap: 10px;
    text-decoration: none;
    color: var(--primary-text-color);
}
.related-video-item:hover .related-video-details strong {
    color: var(--accent-color);
}
.related-video-thumb {
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
}
.related-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-video-details strong {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.3;
    transition: color 0.2s;
}
.related-video-details span {
    font-size: 0.8em;
    color: var(--secondary-text-color);
}

/* Main video title styling */
.video-main-title {
    font-size: clamp(1.1rem, 4vw, 1.8rem); /* Responsive font size */
    margin: 15px 0;
    line-height: 1.2;
}

/* Remove heading from parent info box */
.parent-post-info .parent-details h2 {
    display: none;
}

/* Limit related video titles to two lines */
.related-video-details strong {
    line-height: 1.3;
    max-height: 2.6em; /* 2 lines * 1.3 line-height */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* --- Single Person Page Template --- */
.single-person-page .entry-content {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr); /* Sidebar | Main Content */
    gap: 30px;
    padding-top: 20px;
}
.single-person-page .sidebar-area {
    order: -1; /* Show sidebar on the left */
}
@media (max-width: 900px) {
    .single-person-page .entry-content {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
    .single-person-page .sidebar-area {
        order: 0; /* Let sidebar appear in natural order on mobile (first) */
    }
}

.person-info-card {
    padding: 0;
    overflow: hidden;
}
.person-profile-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}
.person-info-card h2 {
    font-size: 1.4em;
    padding: 15px 20px 0 20px;
    margin: 0;
}
.person-details-list {
    list-style: none;
    padding: 10px 20px 20px 20px;
    margin: 0;
}
.person-details-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.person-details-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.person-details-list li strong {
    display: block;
    font-weight: 600;
    color: var(--primary-text-color);
    margin-bottom: 3px;
}
.person-details-list li span {
    color: var(--secondary-text-color);
    font-size: 0.9em;
}

.person-header {
    margin-bottom: 20px;
}
.person-header .entry-title {
    font-size: 2.8em;
}

.filmography-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.filmography-year-group h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}
.filmography-year-group .credit-items {
    list-style: none;
    padding: 0;
    margin: 0;
}
.filmography-year-group .credit-items li {
    padding: 8px 0;
}
.filmography-year-group .credit-items a {
    font-weight: 600;
}
.filmography-year-group .credit-role {
    color: var(--secondary-text-color);
    font-size: 0.9em;
}

/* --- Single Person Page v2.1 Additions --- */

.person-social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}
.person-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--input-bg-color);
    color: var(--secondary-text-color);
    border-radius: 50%;
    font-size: 22px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.person-social-links a:hover {
    background-color: #3a3a3a;
    color: #fff;
}
.person-social-links .icon-imdb {
    font-weight: bold;
    font-size: 0.8em;
    font-family: sans-serif;
    border: 2px solid;
    padding: 0 4px;
    border-radius: 3px;
}
.person-social-links .icon-instagram::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    border: 2px solid;
    border-radius: 5px;
    position: relative;
}
.person-social-links .icon-instagram::after {
    content: '';
    display: block;
    position: absolute;
    width: 8px;
    height: 8px;
    border: 2px solid;
    border-radius: 50%;
}

.person-details-list li span {
    display: block; /* Make the value appear on a new line */
}

/* "Also Known As" bulleted list styling */
.person-details-list .aka-list {
    list-style: disc;
    padding-left: 20px;
    margin: 5px 0 0 0;
    color: var(--secondary-text-color);
}
.person-details-list .aka-list li {
    padding: 2px 0;
    border-bottom: none;
    font-size: 0.9em;
}

/* Tagged Images Carousel Item */
.media-item--tagged {
    /* Uses the same height variable as other carousels for consistency */
    height: var(--carousel-item-height);
    width: auto; /* Width will be determined by its natural aspect ratio */
}

/* --- Single Person Page v2.3 Additions --- */
.person-header {
    margin: 0 0 20px 0; /* Adjust spacing for top-level title */
}

/* NEW Filmography Accordion Styles */
.filmography-accordion {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.filmography-department-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 15px;
    background-color: var(--input-bg-color);
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--primary-text-color);
}
.filmography-department-header:hover {
    background-color: #3a3a3a;
}
.filmography-department-header .department-name {
    font-size: 1.1em;
    font-weight: 600;
    flex-grow: 1;
}
.filmography-department-header .department-meta {
    font-size: 0.9em;
    color: var(--secondary-text-color);
}
.filmography-department-header .department-caret {
    margin-left: 15px;
    transition: transform 0.3s ease;
}
.filmography-department-header.is-open .department-caret {
    transform: rotate(180deg);
}

.filmography-department-panel {
    display: none; /* Hidden by default */
    padding: 15px;
    background-color: var(--input-bg-color);
}

.filmography-year-group {
    margin-bottom: 20px;
}
.filmography-year-group:last-child {
    margin-bottom: 0;
}
.filmography-year-group h3 {
    font-size: 1.2em;
    padding-bottom: 5px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.filmography-year-group .credit-items {
    list-style: none;
    padding: 0;
    margin: 0;
}
.filmography-item {
    margin-bottom: 10px;
}
.filmography-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}
.filmography-item a:hover .filmography-item-title {
    color: var(--accent-color);
}
.filmography-item-poster {
    width: 45px;
    height: 68px;
    object-fit: cover;
    border-radius: var(--border-radius);
    flex-shrink: 0;
}
.filmography-item-title {
    font-weight: 600;
    color: var(--primary-text-color);
    transition: color 0.2s;
}
.filmography-item-role {
    font-size: 0.9em;
    color: var(--secondary-text-color);
    display: block;
}

/* --- Movie Archive Page --- */
.archive-header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
}
.archive-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    background-color: var(--surface-color);
    padding: 15px;
    border-radius: var(--border-radius);
}
.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 180px; /* Responsive flexbox sizing */
}
.control-group label {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--secondary-text-color);
}
.control-group select {
    background-color: var(--input-bg-color);
    border-color: var(--border-color);
    color: var(--primary-text-color);
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    min-height: 400px;
    position: relative;
}
.movie-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.movie-card a {
    text-decoration: none;
}
.movie-card-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background-color: var(--input-bg-color);
}
.movie-card-info {
    padding: 10px;
}
.movie-card-title {
    font-size: 1em;
    color: var(--primary-text-color);
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.movie-card-year {
    font-size: 0.9em;
    color: var(--secondary-text-color);
}

.grid-loading-spinner {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: translateX(-50%) rotate(360deg); }
}
.grid-no-results {
    grid-column: 1 / -1; /* Span all columns */
    text-align: center;
    color: var(--secondary-text-color);
    font-style: italic;
}

@media (max-width: 600px) {
    .movie-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap; /* This new line allows the buttons to wrap to the next line */
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}
.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--primary-text-color);
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}
.page-numbers:hover {
    background-color: var(--input-bg-color);
    border-color: var(--accent-color);
}
.page-numbers.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    cursor: default;
}

/* --- Person Archive Page --- */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    min-height: 400px;
    position: relative;
}
.person-card {
    text-align: center;
}
.person-card a {
    text-decoration: none;
}
.person-card-photo {
    margin-bottom: 10px;
}
.person-card-photo img {
    width: 100%;
    border-radius: 50%; /* Circular profile images */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: var(--input-bg-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.person-card a:hover img {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.person-card-name {
    font-size: 1em;
    font-weight: 600;
    color: var(--primary-text-color);
    margin: 0;
}
.person-card a:hover .person-card-name {
    color: var(--accent-color);
}

/* Force a 2-column layout for the person grid on small screens */
@media (max-width: 600px) {
    .person-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

/* Make pagination buttons smaller on very narrow screens to prevent overflow */
@media (max-width: 480px) {
    .pagination {
        gap: 5px;
    }
    .page-numbers {
        width: 32px;
        height: 32px;
        font-size: 0.9em;
    }
}

/* ADD THIS REVISED SECTION TO YOUR style.css FILE, REPLACING THE OLD HERO SLIDER STYLES */

/* --- Front Page Hero Slider (v1.2 - Grid Layout Fix) --- */
.hero-slider-section {
    width: 100%;
    margin-bottom: 30px;
}
.hero-slider-container {
    position: relative;
}
.hero-slider-viewport {
    overflow: hidden;
    background-color: #000;
    border-radius: var(--border-radius); /* Applied here on the clipping container */
}

/* --- THIS IS THE KEY FIX --- */
/* We change the track from Flexbox to Grid */
.hero-slider-track {
    display: grid;
    grid-auto-flow: column; /* Lay out items in a single row */
    grid-auto-columns: 100%; /* Make each column (slide) exactly 100% of the viewport width */
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.hero-slide {
    /* No flex-basis or width needed, the grid cell defines the size */
    position: relative;
    background-size: cover;
    background-position: center;
    color: #fff;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hero-slide-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(18,18,18,0.5) 0%, rgba(18,18,18,0.4) 50%, rgba(18,18,18,0.3) 100%);
}
.hero-slide-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
}
.hero-slide-link-area {
    text-decoration: none;
    color: #fff;
}
.hero-slide-link-area:hover {
    text-decoration: none;
    color: #fff;
}
.hero-slide-details {
    max-width: 600px;
}
.hero-badge {
    display: inline-block;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 15px;
}
.hero-logo-title .hero-logo {
    max-width: 400px;
    max-height: 150px;
    width: auto;
    height: auto;
    margin: 0 auto 15px auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.hero-logo-title .hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 15px;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
.hero-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 25px;
    color: rgba(255,255,255,0.85);
}
.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.hero-airing-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(0,0,0,0.3);
    padding: 8px 12px;
    border-radius: var(--border-radius);
}
.hero-airing-info .dashicons { font-size: 24px; }
.airing-text span { display: block; font-size: 0.8em; color: var(--secondary-text-color); }
.airing-text strong { font-weight: 600; }

/* Hero Slider Navigation */
.hero-slider-section .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30,30,30,0.5);
    color: #fff;
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    z-index: 10;
}
.hero-slider-section .slider-nav:hover {
    background-color: rgba(0,0,0,0.8);
    text-decoration:none;
}
.hero-slider-section .slider-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.hero-slider-section .slider-nav.prev { left: 20px; }
.hero-slider-section .slider-nav.next { right: 20px; }

/* Responsive Layout for Hero Slider */
@media (max-width: 782px) {
    .hero-slide { min-height: 550px; padding: 20px 0; }
    .hero-slide-details { max-width: 90%; margin: 0 auto;}
    .hero-logo-title .hero-logo { max-width: 80%; }
    .hero-logo-title .hero-title { font-size: 2.5rem; }
    .hero-description { font-size: 1em; }
    .hero-actions { flex-direction: column; }
    .hero-slider-section .slider-nav.prev { left: 10px; }
    .hero-slider-section .slider-nav.next { right: 10px; }
}

/* --- Front Page: Content Carousels (v1.3 - Final Layout Fix) --- */
.content-section-wrapper {
    margin-bottom: 40px;
    padding: 0;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.section-header h2 { font-size: 1.8rem; margin: 0; }
.explore-more-btn { font-size: 0.9em; font-weight: 600; color: var(--secondary-text-color); }

/* Main Carousel Container */
.paginated-carousel-container {
    position: relative; /* This is the positioning context for the nav buttons */
}
.carousel-viewport {
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    /* This negative margin pulls the track wider to hide the outer padding of the first/last items */
    margin: 0 -10px; 
}

.carousel-track > * { /* Target any carousel item */
    flex-shrink: 0;
    box-sizing: border-box;
    /* Give ALL items the same padding for a 20px gap */
    padding: 0 10px; 
    width: 50%; /* Default: 2 columns */
}

/* Responsive Column Sizing - This remains the same */
@media (min-width: 768px) { .carousel-track > * { width: 33.333%; } }
@media (min-width: 900px) { .carousel-track > * { width: 25%; } }
@media (min-width: 1200px){ .carousel-track > * { width: 20%; } }

/* Responsive Column Sizing controlled entirely by CSS */
@media (min-width: 768px) { .carousel-track > * { width: 33.333%; } }
@media (min-width: 900px) { .carousel-track > * { width: 25%; } }
@media (min-width: 1200px){ .carousel-track > * { width: 20%; } }

/* Navigation Button Positioning */
.paginated-carousel-container .slider-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30,30,30,0.8);
    color: #fff;
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    z-index: 10;
    cursor: pointer;
    transition: all .2s ease;
}
.paginated-carousel-container .slider-nav:hover { background-color: #000; }
.paginated-carousel-container .slider-nav.disabled {
    opacity: 0;
    pointer-events: none;
}
.paginated-carousel-container .slider-nav.prev { left: -22px; }
.paginated-carousel-container .slider-nav.next { right: -22px; }

@media (max-width: 767px) {
    .paginated-carousel-container .slider-nav {
        /* On mobile, bring buttons inside and make smaller */
        width: 36px;
        height: 36px;
    }
    .paginated-carousel-container .slider-nav.prev { left: 10px; }
    .paginated-carousel-container .slider-nav.next { right: 10px; }
}

/* --- Person Card Birthday Indicator --- */
.person-card-photo {
    position: relative; /* Needed for the indicator overlay */
}
.birthday-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    border: 2px solid #fff;
}
.birthday-indicator .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}
.person-card-birthdate {
    display: block;
    font-size: 0.9em;
    color: var(--secondary-text-color);
    margin-top: 2px;
}

/* --- Front Page: Latest News Grid --- */
.latest-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.post-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-card-image {
    position: relative;
}
.post-card-image a {
    display: block;
}
.post-card-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.post-card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--accent-color);
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    text-decoration: none;
}
.post-card-category:hover {
    background-color: var(--accent-hover-color);
    color: #fff;
}

.post-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows footer to stick to bottom */
}
.post-card .entry-title {
    font-size: 1.3em;
    margin: 0 0 10px 0;
}
.post-card .entry-title a {
    color: var(--primary-text-color);
    text-decoration: none;
}
.post-card .entry-title a:hover {
    color: var(--accent-color);
}
.post-card .entry-summary {
    color: var(--secondary-text-color);
    font-size: 0.95em;
    flex-grow: 1; /* Pushes meta to the bottom */
    margin-bottom: 15px;
}
.post-card .entry-meta {
    font-size: 0.8em;
    color: var(--secondary-text-color);
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}
.post-card .entry-meta a {
    color: var(--secondary-text-color);
    font-weight: 600;
}
.post-card .entry-meta .post-date::before {
    content: '•';
    margin: 0 8px;
}

/* --- Single Episode Page Template --- */
.single-episode-page .entry-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    padding-top: 20px;
}
@media (max-width: 900px) {
    .single-episode-page .entry-content {
        grid-template-columns: 1fr;
    }
}

.episode-breadcrumbs {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: var(--secondary-text-color);
}
.episode-breadcrumbs a {
    color: var(--secondary-text-color);
}
.episode-breadcrumbs a:hover {
    color: var(--accent-color);
}
.episode-breadcrumbs .sep {
    margin: 0 8px;
}

.episode-main-content {
    padding: 0;
    overflow: hidden;
}
.episode-still-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background-color: #000;
}
.episode-header {
    padding: 20px;
}
.episode-header .entry-title {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 10px 0;
}
.episode-meta {
    font-size: 0.9em;
    color: var(--secondary-text-color);
}
.episode-meta span:not(:last-child)::after {
    content: '•';
    margin: 0 10px;
}
.episode-synopsis {
    padding: 0 20px 20px 20px;
    line-height: 1.7;
}

/* --- New Single Episode Template (v2.0) --- */
.new-single-episode-page .container {
    max-width: 1400px; /* Wider container for this layout */
}

.episode-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
}
.episode-hero-backdrop {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    border-radius: var(--border-radius);
}
.episode-hero-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}
.episode-hero-description {
    font-size: 0.95em;
    color: var(--secondary-text-color);
    line-height: 1.7;
    margin-bottom: 30px;
}
.episode-airing-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background-color: var(--surface-color);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}
.airing-date-info { display: flex; align-items: center; gap: 15px; }
.airing-date-info .dashicons { font-size: 32px; color: var(--accent-color); }
.airing-date-info span { display: block; font-size: 0.8em; color: var(--secondary-text-color); }
.airing-date-info strong { font-size: 1em; }

.episode-countdown-timer { display: flex; gap: 10px; text-align: center; }
.episode-countdown-timer .time-part { display: flex; flex-direction: column; }
.episode-countdown-timer .time-value { font-family: "SF Mono", "Consolas", "Menlo", monospace; font-size: 1.8em; font-weight: 700; color: #fff; line-height: 1; }
.episode-countdown-timer .time-label { font-size: 0.7em; text-transform: uppercase; color: var(--secondary-text-color); }

.parent-show-info-row {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
}
.parent-show-link {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    text-decoration: none;
    color: var(--primary-text-color);
}
.parent-show-link:hover .parent-show-title { color: var(--accent-color); }
.parent-show-poster { height: 80px; width: auto; aspect-ratio: 2 / 3; border-radius: var(--border-radius); }
.parent-show-title { font-size: 1.3em; font-weight: 600; display: block; transition: color 0.2s; }
.parent-show-meta { font-size: 0.9em; color: var(--secondary-text-color); }

.season-episodes-carousel-section { margin-bottom: 40px; }
.season-episodes-carousel-section h2 { font-size: 1.5em; margin-bottom: 20px; }
.episodes-carousel-container { position: relative; }
.episodes-carousel-viewport { overflow: hidden; }
.episodes-carousel-track { display: flex; transition: transform 0.4s ease-in-out; }
.episode-carousel-card { flex-shrink: 0; width: 20%; box-sizing: border-box; padding: 0 10px; }
.episode-carousel-card a { text-decoration: none; display: block; }
.episode-carousel-card .card-still { aspect-ratio: 16/9; border-radius: var(--border-radius); overflow: hidden; margin-bottom: 10px; border: 3px solid transparent; transition: border-color 0.2s; }
.episode-carousel-card .card-still img { width: 100%; height: 100%; object-fit: cover; }
.episode-carousel-card.is-current .card-still { border-color: var(--accent-color); }
.episode-carousel-card .card-info { text-align: center; }
.episode-carousel-card .card-info strong { color: var(--primary-text-color); font-size: 0.9em; }
.episode-carousel-card .card-info span { color: var(--secondary-text-color); font-size: 0.8em; display: block; }
.episodes-carousel-container .slider-nav { position: absolute; top: 35%; transform: translateY(-50%); background-color: rgba(30,30,30,0.8); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; z-index: 10; }
.episodes-carousel-container .slider-nav.prev { left: -20px; }
.episodes-carousel-container .slider-nav.next { right: -20px; }
.episodes-carousel-container .slider-nav:disabled { opacity: 0.3; cursor: not-allowed; }

/* Responsive Adjustments */
@media (max-width: 1200px) { .episode-carousel-card { width: 25%; } }
@media (max-width: 900px) {
    .episode-hero-grid { grid-template-columns: 1fr; }
    .episode-carousel-card { width: 33.333%; }
}
@media (max-width: 600px) {
    .episode-airing-info { flex-direction: column; align-items: stretch; text-align: center; }
    .episode-carousel-card { width: 50%; }
    .episodes-carousel-container .slider-nav.prev { left: 5px; }
    .episodes-carousel-container .slider-nav.next { right: 5px; }
}

/* --- New Single Episode Template - Responsive Fixes --- */

/* Tablet & Small Desktop (<= 1024px) */
@media (max-width: 1024px) {
    .new-single-episode-page .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .episode-hero-grid {
        /* Stack the hero section into a single column */
        grid-template-columns: 1fr;
    }

    .episode-carousel-card {
        /* Show 3 cards instead of 5 */
        width: 33.333%;
    }
}

/* Mobile Devices (<= 767px) */
@media (max-width: 767px) {
    .episode-hero-details {
        text-align: center;
    }
    .episode-airing-info {
        /* Stack the countdown below the date info */
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .airing-date-info {
        justify-content: center;
        text-align: center;
    }
    
    .episode-countdown-timer {
        justify-content: center;
    }

    .parent-show-link {
        /* Center the parent show info on mobile */
        flex-direction: column;
        text-align: center;
    }

    .episode-carousel-card {
        /* Show 2 cards */
        width: 50%;
    }
    
    .episodes-carousel-container .slider-nav {
        /* Bring navigation arrows inside the carousel on mobile */
        top: 30%;
    }
    .episodes-carousel-container .slider-nav.prev {
        left: 10px;
    }
    .episodes-carousel-container .slider-nav.next {
        right: 10px;
    }
}

/* Sidebar Parent Show Card */
.parent-show-card a {
    display: block;
    text-decoration: none;
    color: var(--primary-text-color);
}
.parent-show-card img {
    width: 100%;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}
.parent-show-card .parent-show-info {
    text-align: center;
}
.parent-show-card .parent-show-info span {
    font-size: 0.85em;
    color: var(--secondary-text-color);
}
.parent-show-card .parent-show-info strong {
    display: block;
    font-size: 1.2em;
}
.parent-show-card:hover strong {
    color: var(--accent-color);
}

/* --- Single Episode: Aired Date Styling --- */
.aired-date-info {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%; /* Take full width of the container */
    padding: 10px 0; /* Add some vertical padding for balance */
}
.aired-date-info .dashicons {
    font-size: 32px;
    color: var(--success-color); /* Use the theme's success color for the checkmark */
}
.aired-date-info span {
    display: block;
    font-size: 0.9em;
    color: var(--secondary-text-color);
}
.aired-date-info strong {
    font-size: 1.2em;
    font-weight: 600;
}

/* --- Single Season Page Template --- */
.season-page-header {
    background-color: var(--surface-color);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}
.season-header-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.season-header-poster {
    flex-shrink: 0;
    width: 180px;
}
.season-header-poster img {
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.season-header-details .entry-title {
    font-size: 2.2rem;
    margin: 0 0 10px 0;
}
.season-meta {
    font-size: 0.9em;
    color: var(--secondary-text-color);
    margin-bottom: 15px;
}
.season-meta span:not(:last-child)::after {
    content: '•';
    margin: 0 10px;
}
.season-overview {
    font-size: 0.95em;
    line-height: 1.6;
}
.single-season-page .entry-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    padding-top: 20px;
}
@media (max-width: 900px) {
    .single-season-page .entry-content { grid-template-columns: 1fr; }
    .season-header-content { flex-direction: column; align-items: center; text-align: center; }
}

/* Episode List */
.episode-list-section h2 { margin-top: 0; }
.episode-list { display: flex; flex-direction: column; gap: 20px; }
.episode-list-item {
    display: flex;
    gap: 20px;
    background-color: var(--surface-color);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}
.episode-item-still {
    width: 200px;
    flex-shrink: 0;
    aspect-ratio: 16/9;
}
.episode-item-still img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: var(--border-radius);
}
.episode-item-details {
    display: flex;
    flex-direction: column;
}
.episode-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.episode-item-number {
    font-size: 0.9em;
    color: var(--secondary-text-color);
    border-right: 1px solid var(--border-color);
    padding-right: 10px;
}
.episode-item-title {
    font-size: 1.2em;
    margin: 0;
    flex-grow: 1;
}
.episode-item-title a {
    color: var(--primary-text-color);
    text-decoration: none;
    font-weight: 600;
}
.episode-item-title a:hover { color: var(--accent-color); }
.episode-item-airdate {
    font-size: 0.8em;
    color: var(--secondary-text-color);
}
.episode-item-excerpt {
    font-size: 0.9em;
    color: var(--secondary-text-color);
}
@media (max-width: 600px) {
    .episode-list-item { flex-direction: column; }
    .episode-item-still { width: 100%; }
}

/* Season Navigation Sidebar */
.season-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.season-nav-list li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--primary-text-color);
    font-weight: 500;
    border-radius: var(--border-radius);
}
.season-nav-list li a:hover {
    background-color: var(--input-bg-color);
}
.season-nav-list li.current-season a {
    background-color: var(--accent-color);
    color: #fff;
    font-weight: 600;
}

/* --- Single Blog Post Template --- */
.single-post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
}
@media (max-width: 900px) {
    .single-post-layout {
        grid-template-columns: 1fr;
    }
}

.single-blog-post .post-featured-image {
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
}
.single-blog-post .entry-header {
    margin-bottom: 20px;
}
.single-blog-post .entry-title {
    font-size: 2.5rem;
    line-height: 1.2;
}
.single-blog-post .entry-meta {
    font-size: 0.9em;
    color: var(--secondary-text-color);
}
.single-blog-post .entry-meta span:not(:last-child)::after {
    content: '•';
    margin: 0 10px;
}
.single-blog-post .entry-meta a {
    color: var(--secondary-text-color);
    font-weight: 600;
}
.single-blog-post .entry-content {
    line-height: 1.8;
}
.single-blog-post .entry-content p,
.single-blog-post .entry-content ul,
.single-blog-post .entry-content ol {
    margin-bottom: 1.5em;
}

.post-tags {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.post-tags a {
    display: inline-block;
    background-color: var(--input-bg-color);
    color: var(--secondary-text-color);
    padding: 5px 12px;
    margin: 0 5px 5px 0;
    border-radius: 4px;
    text-decoration: none;
}
.post-tags a:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* Author Box */
.author-box {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 30px;
}
.author-box .author-avatar img {
    border-radius: 50%;
}
.author-box .author-name {
    margin: 0 0 5px 0;
}
.author-box .author-description {
    margin: 0;
    font-size: 0.9em;
    color: var(--secondary-text-color);
}

/* Sidebar Widgets */
.sidebar-area .widget {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.sidebar-area .widget-title {
    font-size: 1.2em;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-area .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-area .widget ul li {
    margin-bottom: 10px;
}
.sidebar-area .widget ul li a {
    color: var(--primary-text-color);
    text-decoration: none;
    font-weight: 500;
}
.sidebar-area .widget ul li a:hover {
    color: var(--accent-color);
}

@media (max-width: 600px) {
    .section-header h2 {
    font-size: 1.2rem;
    }
    .video-player-section {
    margin-top: -20px;
    margin-left: -15px;
    margin-right: -15px;
    border: 0;
    border-radius: 0;
    }
    .movie-header {
    margin: -20px -15px 0;
    }
    .header-content {
    margin: 0 auto;
    padding: 0;
    }
    .card-airing-info {
        justify-content: center;
    }
}


}

/* --- Discover Slider Section --- */
.discover-slider-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.discover-slider-header h2 {
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1.5px;
    color: var(--secondary-text-color);
    margin-bottom: 15px;
}

.discover-genres-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.discover-genres-nav .genres-viewport {
    overflow: hidden; /* This is still needed to hide non-active genres */
    flex-grow: 1;
    text-align: center;
}

.discover-genres-nav .genres-track {
    display: inline-flex; /* Use inline-flex to center the active button */
    align-items: center;
    transition: transform 0.3s ease;
}

.discover-genre-btn {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 1.8em;
    font-weight: 600;
    padding: 5px 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
    display: none; /* Hide all by default */
}

.discover-genre-btn.active {
    display: block; /* Only show the active one */
    color: var(--primary-text-color);
    transform: scale(1.1);
}

.genre-nav-arrow {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 2em;
    cursor: pointer;
    padding: 0 10px;
}
.genre-nav-arrow:hover {
    color: var(--primary-text-color);
}

#discover-slider-content {
    min-height: 350px; /* Ensure space for the loading spinner */
}

#discover-slider-content .carousel-track-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 350px;
}

.genre-nav-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* 1. Main Card Structure
   This ensures all cards within a carousel item use a flex layout.
*/
.carousel-item .movie-card,
.carousel-item .episode-card,
.carousel-item .person-card,
.carousel-item .post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* 2. Enforce Specific Aspect Ratios on Image Containers
*/
.carousel-item .movie-card-poster,
.carousel-item .post-card-image {
    /*aspect-ratio: 2 / 3; Standard portrait/poster ratio */
}

.carousel-item .episode-card-still {
    aspect-ratio: 16 / 9; /* Standard widescreen/video ratio */
}

.carousel-item .person-card-photo {
    aspect-ratio: 1 / 1; /* Square ratio for the circular photo */
}

/* 3. The Images Themselves
   This forces every image to fill its container completely, cropping to fit
   the defined aspect ratio without stretching.
*/
.carousel-item .movie-card-poster img,
.carousel-item .episode-card-still img,
.carousel-item .person-card-photo img,
.carousel-item .post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* The magic property */
    background-color: var(--input-bg-color);
    transition: transform 0.3s ease;
}

/* 4. Shared Hover Effect
   Adds a consistent, subtle zoom effect to all carousel images on hover.
*/
.carousel-item a:hover img {
    transform: scale(1.05);
}

/* 5. Info Area
   Ensures the text area below the image does not shrink and has consistent padding.
*/
.movie-card-info,
.episode-card-info,
.person-card-info,
.post-card-content {
    flex-shrink: 0;
    padding: 10px; /* Ensure consistent padding for all cards */
}

/* --- Birthday Celebration Feature --- */
.birthday-banner {
    background: linear-gradient(45deg, #ffca28, #ff7043);
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    text-align: center;
    padding: 15px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* This is crucial so the canvas doesn't block mouse clicks on the page */
    pointer-events: none; 
    z-index: 9999;
}

/* --- Cast & Crew Page Template --- */
.cast-crew-page {
    padding-top: 20px;
    padding-bottom: 40px;
}

.cast-crew-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.parent-info-link {
    display: inline-flex;
    align-items: center;
    gap: 25px;
    text-decoration: none;
    color: var(--primary-text-color);
}

.parent-info-link:hover .parent-title {
    color: var(--accent-color);
}

.parent-poster {
    width: 100px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
    flex-shrink: 0;
}

.parent-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1.1;
    margin: 0 0 10px 0;
    transition: color 0.2s;
}

.parent-year {
    font-weight: 300;
    color: var(--secondary-text-color);
}

.back-to-main {
    font-weight: 500;
    color: var(--secondary-text-color);
}

.cast-crew-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 60px; /* 40px row-gap, 60px column-gap */
}

.cast-column h2,
.crew-column h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.count-badge {
    font-size: 0.6em;
    font-weight: 600;
    background-color: var(--input-bg-color);
    color: var(--secondary-text-color);
    padding: 3px 8px;
    border-radius: 10px;
}

.department-group {
    margin-bottom: 30px;
}

.department-group h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.credit-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.credit-list-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--primary-text-color);
}

.credit-list-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--input-bg-color);
    flex-shrink: 0;
}

.credit-list-item strong {
    font-weight: 600;
    display: block;
}

.credit-list-item span {
    font-size: 0.9em;
    color: var(--secondary-text-color);
}

.credit-list-item a:hover strong {
    color: var(--accent-color);
}

/* --- Responsive Styles --- */
@media (max-width: 767px) {
    .cast-crew-content {
        /* Stack columns on mobile */
        grid-template-columns: 1fr;
    }

    .parent-poster {
        width: 80px;
        height: 120px;
    }
}

/* --- Custom Authentication Pages --- */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 150px); /* Adjust 150px for your footer height */
    padding: 40px 15px;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 400px;
    background-color: var(--surface-color);
    padding: 30px 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

body.theme-dark .auth-form-wrapper {
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.auth-title {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 25px;
    font-weight: 600;
}

.auth-form-row {
    margin-bottom: 20px;
}

.auth-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
}

.auth-form-row .input {
    width: 100%;
    padding: 12px;
    background-color: var(--input-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--primary-text-color);
    font-size: 1em;
}

.auth-button {
    width: 100%;
    padding: 12px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.auth-button:hover {
    background-color: var(--accent-hover-color);
}

.auth-button:disabled {
    background-color: var(--secondary-text-color);
    cursor: wait;
}

.auth-message {
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
    min-height: 1.2em;
}

.auth-message.error {
    color: var(--error-color);
}

.auth-message.success {
    color: var(--success-color);
}

.auth-links {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9em;
}

.auth-links a {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary-text-color);
}

.auth-links a:hover {
    color: var(--accent-color);
}

/* --- Custom Authentication Pages --- */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - 150px); /* Adjust 150px for your footer height */
    padding: 40px 15px;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 400px;
    background-color: var(--surface-color);
    padding: 30px 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

body.theme-dark .auth-form-wrapper {
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.auth-title {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 25px;
    font-weight: 600;
}

.auth-form-row {
    margin-bottom: 20px;
}

.auth-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
}

.auth-form-row .input {
    width: 100%;
    padding: 12px;
    background-color: var(--input-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--primary-text-color);
    font-size: 1em;
}

.auth-button {
    width: 100%;
    padding: 12px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.auth-button:hover {
    background-color: var(--accent-hover-color);
}

.auth-button:disabled {
    background-color: var(--secondary-text-color);
    cursor: wait;
}

.auth-message {
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
    min-height: 1.2em;
}

.auth-message.error {
    color: var(--error-color);
}

.auth-message.success {
    color: var(--success-color);
}

.auth-links {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9em;
}

.auth-links a {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary-text-color);
}

.auth-links a:hover {
    color: var(--accent-color);
}

/* --- Social Login & Divider --- */
.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border-radius: var(--border-radius);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    color: var(--primary-text-color);
    transition: background-color 0.2s ease;
}

#google-signin-btn {
    margin: 0 auto;
}

.social-button:hover {
    background-color: var(--hover-bg-color);
}

.social-button svg {
    width: 18px;
    height: 18px;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--secondary-text-color);
    font-size: 0.8em;
    margin: 25px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 10px;
}

.recaptcha-notice {
    font-size: 0.75em;
    color: var(--secondary-text-color);
    text-align: center;
    margin-top: 20px;
}

/* --- Single Ship Page Template --- */
.single-ship-page .entry-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 30px;
    padding-top: 20px;
}

.ship-header {
    position: relative;
    padding: 40px 0;
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.ship-header .header-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(18,18,18,1) 5%, rgba(18,18,18,0.7) 50%, rgba(18,18,18,0.4) 100%);
    z-index: 1;
}

.ship-header .header-content {
    position: relative;
    z-index: 2;
}

.ship-pairing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.ship-pairing .person-card {
    text-decoration: none;
    color: #fff;
}

.ship-pairing .person-card img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
}

.ship-pairing .person-card:hover img {
    transform: scale(1.05);
}

.ship-pairing .person-name {
    display: block;
    font-weight: 600;
    margin-top: 10px;
}

.ship-icon {
    font-size: 48px;
    color: #ff4d6d; /* A pink/red color for the heart */
    text-shadow: 0 0 15px #ff4d6d;
}

.single-ship-page .entry-title {
    font-size: 2.8em;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.ship-description {
    line-height: 1.7;
}

/* --- Responsive Styles for Ship Page --- */
@media (max-width: 900px) {
    .single-ship-page .entry-content {
        grid-template-columns: 1fr;
    }
    .single-ship-page .sidebar-area {
        order: -1;
    }
}

@media (max-width: 600px) {
    .ship-pairing {
        gap: 10px;
    }
    .ship-pairing .person-card img {
        width: 100px;
        height: 100px;
    }
    .ship-icon {
        font-size: 32px;
    }
    .single-ship-page .entry-title {
        font-size: 2em;
    }
}

/* --- Latest News Carousel Section --- */
.news-carousel-section {
    padding: 20px 0;
}

.news-carousel-section .section-header {
    margin-bottom: 20px;
}

.news-carousel-section .section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-carousel-section .section-header h2 .dashicons {
    font-size: 1rem;
}

.news-carousel-container {
    position: relative;
}

.news-carousel-container .carousel-track > * {
    width: 33.333%; /* Show 3 items by default */
}

/* FIX: Add positioning for the navigation buttons */
.news-carousel-container .slider-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(30,30,30,0.8);
    color: #fff;
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    z-index: 10;
    cursor: pointer;
    transition: all .2s ease;
}

.news-carousel-container .slider-nav:hover {
    background-color: #000;
}

.news-carousel-container .slider-nav.disabled {
    opacity: 0;
    pointer-events: none;
}

.news-carousel-container .slider-nav.prev {
    left: 20px;
}

.news-carousel-container .slider-nav.next {
    right: 20px;
}


.post-card-horizontal {
    display: flex;
    gap: 15px;
    align-items: center;
}

.post-card-horizontal a.card-link {
    display: flex;
    gap: 15px;
    align-items: center;
    text-decoration: none;
    color: var(--primary-text-color);
}

.post-card-horizontal-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.post-card-horizontal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-horizontal-content .entry-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 8px 0;
}

.post-card-horizontal-content .entry-meta {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
}

.post-card-horizontal-content .entry-meta span:not(:last-child)::after {
    content: '•';
    margin: 0 8px;
}

.news-category-filters {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.category-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-decoration: none;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-filter-btn:hover {
    background-color: var(--hover-bg-color);
    color: var(--primary-text-color);
    border-color: var(--primary-text-color);
}

@media (max-width: 900px) {
    .news-carousel-container .carousel-track > * {
        width: 50%; /* Show 2 items on tablets */
    }
}

@media (max-width: 767px) {
    .news-carousel-container .slider-nav {
        width: 36px;
        height: 36px;
    }
    .news-carousel-container .slider-nav.prev {
        left: 10px;
    }
    .news-carousel-container .slider-nav.next {
        right: 10px;
    }
}

@media (max-width: 600px) {
    .news-carousel-container .carousel-track > * {
        width: 100%; /* Show 1 item on mobile */
    }
}

/* --- All Seasons Archive Page --- */
.seasons-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.seasons-archive-grid .season-card {
    width: 100%;
}

/* --- Latest Season Section on Single TV Show Page --- */
.latest-season-section h2 {
    margin-bottom: 15px;
}

.latest-season-card .season-slider-card {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.view-all-seasons-link {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background-color: var(--input-bg-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    color: var(--primary-text-color);
    transition: background-color 0.2s;
}

.view-all-seasons-link:hover {
    background-color: #3a3a3a;
    text-decoration: none;
}

/* --- Upcoming Episodes Page Layout --- */
.upcoming-episode-item {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    align-items: center;
}

.upcoming-episode-item .episode-still img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upcoming-episode-item .episode-details {
    padding: 20px;
}

.upcoming-episode-item .episode-title {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    font-weight: 600;
}
.upcoming-episode-item .episode-title a {
    color: var(--primary-text-color);
    text-decoration: none;
}
.upcoming-episode-item .episode-title a:hover {
    color: var(--accent-color);
}
.upcoming-episode-item .episode-title span {
    display: block;
    font-size: 0.8em;
    font-weight: 400;
    color: var(--secondary-text-color);
}

.upcoming-episode-item .episode-air-info {
    font-size: 0.9em;
    color: var(--secondary-text-color);
    margin-bottom: 15px;
    font-weight: 500;
}

.upcoming-episode-item .episode-countdown {
    display: flex;
    gap: 10px;
    text-align: center;
}
.upcoming-episode-item .episode-countdown .time-part {
    display: flex;
    flex-direction: column;
}
.upcoming-episode-item .episode-countdown .time-value {
    font-family: "SF Mono", "Consolas", "Menlo", monospace;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-text-color);
    line-height: 1;
}
.upcoming-episode-item .episode-countdown .time-label {
    font-size: 0.7em;
    text-transform: uppercase;
    color: var(--secondary-text-color);
}

@media (max-width: 767px) {
    .upcoming-episode-item {
        grid-template-columns: 1fr;
    }
    .upcoming-episode-item .episode-still {
        aspect-ratio: 16/9;
    }
}
