/* Calendar Overlay */
.calendar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 20%; 
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    z-index: 25;  
    transition: opacity 0.4s ease;
    pointer-events: none;
    display: none;
}

/* Hide cursor only in collapsed state */
.split-container:not(.calendar-active):not(.film-detail-active) .calendar-overlay {
    cursor: none;
}

/* When expanded, overlay is gone */
.split-container.calendar-active .calendar-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
    width: 50%;
}

/* When film detail active, overlay blocks calendar */
.split-container.film-detail-active .calendar-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Header (Month Navigation) */
.program-main-header {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}

.program-month-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
}

.program-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: #1a1a1a;
}

.month-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #1a1a1a;
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.month-nav-btn:hover {
    background: #f5f5f5;
    border-color: #d8d8d8;
    color: #1a1a1a;
    transform: translateY(-1px);
}

.month-nav-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.month-nav-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

/* Nudge Effect (hover on collapsed calendar) */
.split-container.calendar-hover .right-section {
    transform: translateX(2%);
}

.right-section {
    transition: transform 0.6s ease;
}

/* Filters - Vertical Stack (as designed) */
.program-filters {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px 20px;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    gap: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 12px 16px;
}

/* Each filter as inline dropdown */
.program-filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    border-right: 1px solid #e5e5e5;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a1a1a;
    cursor: pointer;
    padding: 8px 28px 8px 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='none' stroke='%23666' stroke-width='1.5' d='M1 1l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    font-family: inherit;
    white-space: nowrap;
    min-width: auto;
    -webkit-tap-highlight-color: transparent;
}

.program-filter-select:last-of-type {
    border-right: none;
}

.program-filter-select:hover {
    color: #000;
}

.program-filter-select:focus {
    outline: none;
}

.program-filter-select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

/* Sort toggle - pushed to right */
.program-sort-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    padding-left: 12px;
    border-left: 1px solid #e5e5e5;
}

.program-sort-btn {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.program-sort-btn:hover,
button.program-sort-btn:hover,
.program-sort-btn:active,
.button-hover:hover {
    background-color: #fff !important;
    color: #1a1a1a !important;
}


.program-sort-btn.is-active {
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

.program-sort-btn:focus-visible {
    outline: none;
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

/* Calendar List */
.program-calendar {
    padding: 0;
}

.program-date-group {
    border-bottom: 1px solid #e5e5e5;
}

.date-header {
    padding: 18px 20px 12px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.date-day-name {
    font-weight: 700;
    color: #1a1a1a;
}

.date-separator {
    color: #999;
    margin: 0 6px;
}

.date-full {
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

.date-screenings {
    display: flex;
    flex-direction: column;
}

/* Film Card */
.film-card {
    display: block;
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.film-card:first-child {
    border-top: none;
}

.film-card:hover,
.film-card.is-active {
    background: #f5f5f5;
}

.film-card.is-active {
    background: #f0f0f0;
}

.film-time {
    font-size: 0.9rem;
    font-weight: 400;
    color: #666;
    margin-bottom: 4px;
}

.film-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.film-time-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 15px;
    border-radius: 999px;
    border: 1px solid #e2e2e2;
    background: #000000;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.film-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #1a1a1a;
    line-height: 1.3;
}

.film-meta {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.film-description {
    font-size: 0.85rem;
    color: #777;
    margin: 6px 0 0;
    line-height: 1.5;
}

.film-notes {
    font-weight: 500;
    color: #1a1a1a;
}

.film-poster-thumb {
    display: none !important;
}

.film-card.is-hidden {
    display: none;
}

.program-date-group.is-empty {
    display: none;
}

/* Film Preview Panel (Hover) */
.film-preview-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 50;
    display: none;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
}

.film-preview-image {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    overflow: hidden;
}

.film-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.film-preview-image iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.film-preview-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.film-preview-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
}

.film-preview-info {
    display: none;
}

.film-preview-panel.is-text-only {
    justify-content: center;
}

.film-preview-panel.is-text-only .film-preview-image {
    display: none;
}

.film-preview-panel.is-text-only .film-preview-info {
    display: block;
    padding: 30px;
}

.film-preview-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

.film-preview-meta {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

.film-preview-description {
    font-size: 0.95rem;
    color: #666;
    margin: 12px 0 0;
    line-height: 1.6;
}

/* Film Detail Panel */
.film-detail-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 200;
    display: none;
    opacity: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

@media (min-width: 769px) {
    .split-container.film-detail-active .right-section {
        overflow: hidden !important;
    }
}

.split-container.film-detail-active .right-section {
    transform: none !important;
}

/* Back button - positioned inside the panel */
.film-detail-back {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 16px;
    background: #000;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    align-self: flex-end;
}

.film-detail-back:hover {
    background: #fff;
    color: #000;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
    border-color: #000;
}

.film-detail-back--mobile {
    display: none;
}

.film-detail-back-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

/* Hero */
.film-detail-hero {
    position: relative;
    width: 100%;
    height: 50vh;
    min-height: 300px;
    max-height: 500px;
    background: #1a1a1a;
    overflow: hidden;
}

.film-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.film-detail-hero iframe,
.film-detail-hero video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
}

.film-detail-hero-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.film-detail-audio-toggle {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 5;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

.film-detail-audio-toggle:hover {
    background: #fff !important;
    color: #000 !important;
    border-color: #fff !important;
}

.film-detail-audio-toggle.is-on {
    background: #fff !important;
    color: #000 !important;
    border-color: #fff !important;
}

.film-detail-audio-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.film-detail-audio-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.film-detail-audio-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.film-detail-trailer-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #1a1a1a;
    text-decoration: none;
    padding: 12px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.film-detail-trailer-btn:hover {
    background: #f0f0f0;
}

.film-detail-trailer-btn svg {
    width: 14px;
    height: 14px;
}

/* Content */
.film-detail-content {
    padding: 30px;
    padding-bottom: 60px;
}

.film-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
    gap: 32px;
    align-items: start;
}

.film-detail-layout.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.film-detail-main {
    min-width: 0;
}

.film-detail-side {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.film-detail-side .film-detail-details {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.film-detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: #1a1a1a;
    line-height: 1.2;
}

.film-detail-title-original {
    font-size: 1rem;
    color: #666;
    margin: 0 0 20px 0;
    font-style: italic;
}

.film-detail-meta {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.film-detail-synopsis {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 30px;
}

.film-detail-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

/* Screenings */
.film-detail-screenings {
    margin-bottom: 30px;
    max-width: 100%;
}

.film-detail-screening-item {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    grid-template-areas:
        "datetime price"
        "info price";
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 6px 16px;
}

.film-detail-screening-item.is-hidden {
    display: none;
}

.film-detail-screening-item:last-child {
    border-bottom: none;
}

.film-detail-screening-datetime {
    grid-area: datetime;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.film-detail-screening-date {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a1a;
}

.film-detail-screening-time {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #e2e2e2;
    background: #f7f7f7;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a1a;
}

.film-detail-screening-info {
    grid-area: info;
    font-size: 0.85rem;
    color: #666;
}

.film-detail-screening-price {
    grid-area: price;
    align-self: start;
    justify-self: start;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    padding: 4px 10px;
    border-radius: 999px;
}

.film-detail-screenings-toggle {
    margin-top: 16px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #000 !important;
    background: #000 !important;
    color: #fff !important;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.film-detail-screenings-toggle:hover {
    background: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
    transform: translateY(-1px);
}

.film-detail-screenings-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

/* Details grid */
.film-detail-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.film-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.film-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
}

.film-detail-value {
    font-size: 0.95rem;
    color: #1a1a1a;
}

/* Cast */
.film-detail-cast {
    margin-bottom: 30px;
}

.film-detail-cast-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
}

/* Notice */
.program-notice {
    padding: 20px;
    background: #fff8e6;
    border-bottom: 1px solid #e5e5e5;
}

.program-notice p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

.program-no-events {
    padding: 40px 20px;
    text-align: center;
}

.program-no-events p {
    color: #666;
    margin: 0;
}

/* Make month navigation arrows more prominent */
.program-month-nav .month-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.program-month-nav .month-nav-btn:hover {
    background: #fff;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
}

.program-month-nav .month-nav-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .program-month-nav .month-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}

/* End-of-month prompt */
.program-next-prompt {
    display: flex;
    justify-content: center;
    padding: 24px 16px 8px;
}

.program-next-link {
    background: transparent;
    color: #000;
    border: 1px solid #000;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.program-next-link:hover {
    background: #000;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

/* Hide nav links when film detail active */
.split-container.film-detail-active .view-calendar-link,
.split-container.film-detail-active .view-content-link,
.split-container.film-detail-active .right-section-calendar-link {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-overlay {
        display: none !important;
    }

    .program-month-nav {
        padding: 14px 15px;
    }
    
    .program-title {
        font-size: 0.8rem;
    }
    
    .program-filters {
        padding: 10px 15px;
        margin: 10px 12px;
    }
    
    .film-card {
        padding: 12px 15px;
    }
    
    .film-detail-content {
        padding: 20px;
    }

    .film-detail-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .film-detail-title {
        font-size: 1.5rem;
    }
    
    .film-detail-details {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .film-detail-screening-item {
        grid-template-columns: 1fr;
        grid-template-areas:
            "datetime"
            "info"
            "price";
        gap: 6px;
    }
    
    .film-detail-back-wrap {
        justify-content: flex-start;
    }

    .film-detail-side {
        align-items: flex-start;
    }

    .film-detail-back {
        align-self: flex-start;
    }

    .film-detail-back--mobile {
        display: inline-flex;
    }

    .film-detail-back--desktop {
        display: none;
    }

    .film-detail-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .film-detail-audio-toggle {
        bottom: 12px;
        left: 12px;
        width: 36px;
        height: 36px;
    }

    .split-container.film-detail-active .calendar-section {
        display: none !important;
    }

    .split-container.film-detail-active .right-section {
        display: block !important;
        height: 100vh;
    }
    
    .view-calendar-link,
    .view-content-link,
    .right-section-calendar-link {
        display: none !important;
    }
}
