/* =============================================================================
   Single Film Page Styles
   Loaded only on is_singular('film') via saab_scripts() in functions.php
   ============================================================================= */


/* =============================================================================
   1. FILM PAGE HEADER — white background, black title (left column)
   ============================================================================= */

/* Prevent page scroll when film lightbox is open */
body.lightbox-open {
    overflow: hidden;
}

/* Top padding compensates for the fixed site header */
.film-content-section {
    padding-top: 6rem;
}

.film-page-header {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #000000;
    margin-bottom: 1.5rem;
}

.film-page-header h1 {
    color: #000000;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.75rem;
}

/* Film tags — dark style for white background */
.film-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.film-tag {
    border: 1px solid rgba(0, 0, 0, 0.35);
    color: #444444;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
    display: inline-block;
}


/* =============================================================================
   2. FILM LAYOUT GRID
   ============================================================================= */

.film-layout-grid {
    align-items: flex-start;
    padding-top: 0;
}

.film-main-column {
    grid-column: span 8;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.film-sidebar-column {
    grid-column: span 4;
}

/* Tab navigation — box-fill style matching reference */
.film-tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 2rem;
}

.film-tab-nav .tab-button {
    background: transparent;
    border: 2px solid #000000;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #000000;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.film-tab-nav .tab-button.active,
.film-tab-nav .tab-button[aria-selected="true"] {
    background: #000000;
    color: #ffffff;
}

.film-tab-nav .tab-button:hover:not(.active) {
    background: #f0f0f0;
}

/* Cancel the ::after pseudo-element that main.css injects on .tab-button.active */
.film-tab-nav .tab-button::after {
    content: none !important;
}

/* Tab panel visibility — driven by initScreeningTabs() in main.js */
.screening-section {
    display: none;
}

.screening-section.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Content panels — flat white cards, no glass morphism */
.film-panel {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    padding: 2.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.film-panel h2,
.film-panel h3 {
    color: #000000 !important;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid #000000;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .film-main-column,
    .film-sidebar-column {
        grid-column: span 12;
    }

    .film-main-column {
        gap: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .film-panel {
        padding: var(--spacing-lg);
    }
}


/* =============================================================================
   3. FILM SYNOPSIS
   ============================================================================= */

.film-synopsis {
    text-align: left;
}

.film-synopsis h3 {
    text-align: left;
    margin-bottom: var(--spacing-md);
}

.film-synopsis-content {
    text-align: left;
    font-size: var(--font-size-large);
    line-height: 1.8;
    color: var(--gray-dark);
}

.film-synopsis-section .synopsis-content,
.film-restoration-section .restoration-content {
    font-size: var(--font-size-large);
    line-height: 1.8;
    color: var(--gray-dark);
}


/* =============================================================================
   4. FILM CREDITS
   ============================================================================= */

/* Standalone horizontal credits card */
.film-credits-horizontal {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg);
    background: var(--gray-light);
    border-radius: var(--border-radius-lg);
}

.film-credits-horizontal .section-title {
    font-size: var(--font-size-x-large);
    margin-bottom: var(--spacing-md);
    text-align: center;
    color: var(--brand-midnight);
}

.credits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-sm) var(--spacing-lg);
}

.credits-grid .credit-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.credits-grid .credit-item:last-child {
    border-bottom: none;
}

.credits-grid .credit-item strong {
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
}

.credits-grid .credit-item span {
    text-align: right;
    flex: 1;
}

/* Credits inside the film-panel */
.film-credits-section .credits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem 2rem;
}

.film-credits-section .credit-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.film-credits-section .credit-item:last-child {
    border-bottom: none;
}

.film-credits-section .credit-item strong {
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
}

.film-credits-section .credit-item span {
    text-align: right;
    flex: 1;
}

@media (max-width: 768px) {
    .credits-grid,
    .film-credits-section .credits-grid {
        grid-template-columns: 1fr;
    }
}


/* =============================================================================
   5. FILM SIDEBAR
   ============================================================================= */

/* Featured image — top of the left 8/12 column, natural aspect ratio */
.film-main-poster {
    width: 100%;
    line-height: 0; /* collapse inline spacing below img */
}

.film-main-poster img {
    width: 100%;
    height: auto;
    display: block;
}

.film-sidebar {
    padding-left: 1rem;
}

.film-sidebar .sidebar-section {
    padding: 1.25rem 0;
}

/* First card starts at grid top — no extra top gap above Details heading */
.film-sidebar .sidebar-section:first-child {
    padding-top: 0;
}

.film-sidebar .sidebar-section h4 {
    font-family: var(--font-heading);
    color: #000000;
    font-size: var(--font-size-medium);
    margin-bottom: var(--spacing-sm);
}

.film-sidebar .meta-item {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0.4rem 0;
    margin-bottom: 0;
    white-space: normal;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.film-sidebar .meta-item:last-child {
    border-bottom: none;
}

.film-sidebar .meta-item strong {
    flex-shrink: 0;
    margin-right: 0.5rem;
    font-size: var(--font-size-small);
    font-weight: 600;
    text-align: left;
}

.film-sidebar .meta-item span {
    font-size: var(--font-size-small);
    text-align: left;
}

@media (max-width: 768px) {
    .film-sidebar {
        padding-left: 0;
    }

    .film-sidebar .sidebar-section {
        margin-left: 0;
    }
}


/* =============================================================================
   5b. DOCS TAB
   ============================================================================= */

.film-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.film-doc-item {
    border: 1px solid #e8e8e8;
    padding: 1rem;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    border-radius: 4px;
}

.film-doc-item:hover {
    border-color: #000000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.film-doc-item img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0.5rem;
    border-radius: 2px;
}

.film-doc-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.film-doc-item a {
    color: #000000;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    word-break: break-word;
    display: block;
    margin-top: 0.5rem;
}

.film-doc-item a:hover {
    text-decoration: underline;
}

.film-docs-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: #999999;
    font-style: italic;
    border: 1px dashed #dddddd;
    border-radius: 4px;
}

.film-docs-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .film-docs-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}


/* =============================================================================
   5c. STANDALONE DOCUMENTS SECTION
   ============================================================================= */

.film-documents-section {
    background: #ffffff;
    padding: var(--spacing-2xl) 0;
    border-top: 1px solid #e8e8e8;
}

.film-documents-section h2 {
    color: #000000;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid #000000;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}


/* =============================================================================
   6. FILM STILLS GALLERY
   ============================================================================= */

.film-stills-section {
    background: var(--brand-midnight);
    padding: var(--spacing-2xl) 0;
    color: var(--brand-white);
    position: relative;
    overflow: hidden;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 30px,
        rgba(255, 255, 255, 0.02) 30px,
        rgba(255, 255, 255, 0.02) 32px
    );
}

.film-strip-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.film-stills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.film-still {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 3px solid #2a2a2a;
    box-shadow:
        inset 0 0 0 1px #333,
        0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Film strip perforations — top */
.film-still::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    height: 20px;
    background: #2a2a2a;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 8px,
        #1a1a1a 8px,
        #1a1a1a 12px,
        transparent 12px,
        transparent 20px
    );
    z-index: 2;
}

/* Film strip perforations — bottom */
.film-still::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: -3px;
    right: -3px;
    height: 20px;
    background: #2a2a2a;
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 8px,
        #1a1a1a 8px,
        #1a1a1a 12px,
        transparent 12px,
        transparent 20px
    );
    z-index: 2;
}

.film-still:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.film-still:hover::before,
.film-still:hover::after {
    background-color: rgba(255, 255, 255, 0.05);
}

.film-frame {
    position: relative;
    width: 100%;
    background: #222;
}

.film-frame img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px 8px 0 0;
    position: relative;
    z-index: 1;
}

/* Film grain texture overlay */
.film-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 3px 3px, 2px 2px, 4px 4px;
    pointer-events: none;
    z-index: 2;
    border-radius: 8px 8px 0 0;
    opacity: 0.4;
    mix-blend-mode: overlay;
}

.film-caption {
    padding: 1rem;
    background: #1a1a1a;
    border-top: 2px solid #333;
}

.film-frame-number {
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-small);
    color: var(--brand-midnight);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-xs);
    text-shadow: none;
    position: relative;
}

.film-frame-number::before {
    content: '•';
    margin-right: var(--spacing-xs);
    color: var(--brand-gray);
}

.film-frame-number::after {
    content: '•';
    margin-left: var(--spacing-xs);
    color: var(--brand-gray);
}

.film-caption-text {
    font-size: var(--font-size-small);
    color: var(--gray-medium);
    line-height: 1.4;
}

/* Responsive — tablet */
@media (max-width: 768px) {
    .film-stills-section {
        padding: var(--spacing-xl) 0;
    }

    .film-strip-container {
        padding: 0 1rem;
    }

    .film-stills-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }

    .film-caption {
        padding: 0.75rem;
    }
}

/* Responsive — mobile */
@media (max-width: 480px) {
    .film-stills-section {
        padding: var(--spacing-lg) 0;
    }

    .film-stills-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .film-still {
        max-width: 100%;
    }
}


/* =============================================================================
   7. FILM QUOTES
   ============================================================================= */

.film-quotes-section {
    background: var(--brand-white);
    padding: 6rem 0 3rem 0;
    position: relative;
}

.quotes-carousel-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.quotes-carousel {
    position: relative;
    overflow: hidden;
}

.quote-slide {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.quote-slide.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.film-quote {
    border: none;
    margin: 0;
    padding: 0;
}

.quote-text {
    font-size: clamp(var(--font-size-x-large), 4vw, calc(var(--font-size-xx-large) * 1.125));
    line-height: 1.4;
    font-style: italic;
    font-weight: 300;
    color: var(--brand-midnight);
    margin-bottom: calc(var(--spacing-lg) * 1.25);
    font-family: var(--font-body);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.quote-attribution {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-xs) * 0.25);
    font-style: normal;
}

.quote-source {
    font-size: var(--font-size-medium);
    font-weight: 600;
    color: var(--gray-dark);
    font-family: var(--font-heading, sans-serif);
}

.quote-publication {
    font-size: var(--font-size-small);
    color: var(--brand-gray);
    font-weight: 400;
    font-family: var(--font-heading, sans-serif);
}

/* Navigation arrows */
.quote-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--gray-light);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-x-large);
    color: var(--gray-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.quote-nav:hover {
    background: var(--gray-light);
    border-color: var(--gray-medium);
    transform: translateY(-50%) scale(1.1);
}

.quote-prev {
    left: -60px;
}

.quote-next {
    right: -60px;
}

/* Slide indicator dots */
.quotes-dots {
    display: flex;
    justify-content: center;
    gap: calc(var(--spacing-sm) * 0.75);
    margin-top: var(--spacing-xl);
}

.quote-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: var(--gray-medium);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quote-dot.active,
.quote-dot:hover {
    background: var(--gray-dark);
    transform: scale(1.2);
}

/* Responsive — tablet */
@media (max-width: 768px) {
    .film-quotes-section {
        padding: var(--spacing-2xl) 0;
    }

    .quotes-carousel-container {
        padding: 0 var(--spacing-md);
    }

    .quote-nav {
        display: none;
    }

    .quote-text {
        font-size: var(--font-size-large);
        margin-bottom: var(--spacing-lg);
    }

    .quote-slide {
        padding: var(--spacing-sm) 0;
    }
}

/* Responsive — mobile */
@media (max-width: 480px) {
    .quotes-carousel-container {
        padding: 0 var(--spacing-sm);
    }

    .quote-text {
        font-size: var(--font-size-medium);
        line-height: 1.5;
    }

    .quote-source {
        font-size: 1rem;
    }

    .quote-publication {
        font-size: var(--font-size-small);
    }
}
