/* =========================================================
   COMPONENTS.CSS
   Shared components loaded on every page (layout_top).
   Split out of home.css: film cards + carousel + preview are
   used by default.asp, search.asp and film.asp's related
   carousel; section scaffolding, post-thumb, sponsors strip
   and cta-band are reusable page furniture.
   ========================================================= */


/* =========================================================
   PAGE SECTIONS
   ========================================================= */

.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 30px 60px 0px;
    position: relative;
}

.section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

    .section-title h2 {
        font-size: 30px;
        letter-spacing: -0.4px;
    }

    .section-title p {
        max-width: 620px;
        color: #888;
        font-size: 14.5px;
        line-height: 1.7;
    }


/* =========================================================
   FILM CAROUSEL
   ========================================================= */

.carousel-wrap {
    position: relative;
    border-radius: 18px;
    background: rgba(255,255,255,0.02);
    overflow: hidden;
}

    .carousel-wrap::before,
    .carousel-wrap::after {
        content: "";
        position: absolute;
        top: 0;
        width: 140px;
        height: 100%;
        z-index: 4;
        pointer-events: none;
    }

    .carousel-wrap::before {
        left: 0;
        background: linear-gradient(to right, var(--bg) 0%, rgba(11,11,11,0) 100%);
    }

    .carousel-wrap::after {
        right: 0;
        background: linear-gradient(to left, var(--bg) 0%, rgba(11,11,11,0) 100%);
    }

.carousel {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    scrollbar-width: none;
    scroll-behavior: smooth;
    scroll-padding-left: 20px;
}

    .carousel::-webkit-scrollbar {
        display: none;
    }

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .carousel-arrow:hover {
        background: var(--accent);
        color: #fff;
    }

    .carousel-arrow.left {
        left: 10px;
    }

    .carousel-arrow.right {
        right: 10px;
    }


/* =========================================================
   FILM CARD
   ========================================================= */

.film-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

    .film-card:hover {
        background: var(--card-hover);
        border-color: rgba(255,255,255,0.08);
        transform: translateY(-4px) scale(1.04);
        box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    }

    /* thumbnail container */
    .film-card .thumb {
        position: relative;
        width: 100%;
        aspect-ratio: 16 / 9;
        overflow: visible !important;
        background: #111;
    }

        .film-card .thumb img.poster-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease, opacity 0.3s ease;
            display: block;
        }

    .film-card:hover .thumb img.poster-img {
        transform: scale(1.06);
    }

    /* video preview container */
    .film-card .preview-host {
        position: absolute;
        inset: 0;
        display: none;
        background: #000;
    }

        .film-card .preview-host iframe {
            width: 100%;
            height: 100%;
            border: 0;
        }

    /* play icon overlay */
    .film-card .play-overlay {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.2s ease;
        background: rgba(0,0,0,0.25);
        pointer-events: none;
    }

    .film-card:hover .play-overlay {
        opacity: 1;
    }

    .film-card.previewing .play-overlay {
        opacity: 0 !important;
    }

.preview-host,
.play-overlay,
.preview-loader {
    pointer-events: none;
}

.play-overlay .play-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: transform 0.2s ease;
}

.film-card:hover .play-icon {
    transform: scale(1.08);
}

.play-overlay svg {
    width: 18px;
    height: 18px;
    fill: #000;
    margin-left: 2px;
}

/* year badge */
.film-card .year-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #ccc;
    z-index: 2;
}

.film-card.previewing .year-badge {
    display: none;
}

/* loading spinner shown while iframe loads */
.film-card .preview-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 1;
}

.film-card.loading .preview-loader {
    display: flex;
}

.preview-loader .spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* card body */
.film-card .card-body {
    padding: 16px 18px 8px;
}

    .film-card .card-body h3 {
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 7px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

.film-card .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

    .film-card .card-meta span {
        font-size: 13px;
        color: #666;
        line-height: 1.4;
    }

    .film-card .card-meta .filmmaker-name {
        color: #888;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .film-card .card-meta .country-line {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .film-card .card-meta .country-flag {
        width: 18px;
        height: 13px;
        border-radius: 2px;
        object-fit: cover;
        flex-shrink: 0;
        box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
    }


/* =========================================================
   BLOG THUMB FALLBACK
   ========================================================= */

/* #4 - graceful fallback for missing blog post images */
.post-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    opacity: 0.15;
    pointer-events: none;
}

.post-thumb {
    position: relative;
}


/* =========================================================
   SPONSORS STRIP
   ========================================================= */

.sponsors {
    padding: 14px 0 120px;
}

.sponsors-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #555;
    margin-top: 18px;
    margin-bottom: 18px;
    text-align: center;
}

.sponsors-carousel {
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    position: relative;
}

    .sponsors-carousel::before,
    .sponsors-carousel::after {
        content: "";
        position: absolute;
        top: 0;
        width: 110px;
        height: 100%;
        z-index: 3;
        pointer-events: none;
    }

    .sponsors-carousel::before {
        left: 0;
        background: linear-gradient(to right, var(--bg) 0%, rgba(11,11,11,0) 100%);
    }

    .sponsors-carousel::after {
        right: 0;
        background: linear-gradient(to left, var(--bg) 0%, rgba(11,11,11,0) 100%);
    }

.sponsors-track {
    display: flex;
    gap: 44px;
    align-items: center;
    width: max-content;
    padding: 22px 26px;
    animation: scrollSponsors 36s linear infinite;
}

.sponsors-carousel:hover .sponsors-track {
    animation-play-state: paused;
}

@keyframes scrollSponsors {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.sponsor-item {
    flex: 0 0 auto;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .sponsor-item img {
        height: 56px;
        max-width: 190px;
        object-fit: contain;
        opacity: .85;
        filter: grayscale(100%);
        transition: transform .25s ease, opacity .25s ease, filter .25s ease;
    }

    .sponsor-item:hover img {
        transform: scale(1.06);
        opacity: 1;
        filter: grayscale(0%);
    }


/* =========================================================
   CTA BAND
   ========================================================= */

.cta-band {
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.06);
    background: radial-gradient(700px 260px at 10% 30%, rgba(47,125,255,0.14), transparent 62%), radial-gradient(700px 260px at 90% 70%, rgba(214,0,0,0.14), transparent 62%), linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    padding: 34px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

    .cta-band h3 {
        font-size: 22px;
        letter-spacing: -0.3px;
        margin-bottom: 8px;
    }

    .cta-band p {
        color: #aaa;
        font-size: 14.5px;
        line-height: 1.7;
        max-width: 680px;
    }


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 980px) {
    .section {
        padding: 60px 20px 40px;
    }

    .film-card {
        flex: 0 0 220px;
    }
}

@media (max-width: 640px) {
    /* Header rules - belong in base.css; parked here so they
       stay global now that home.css is homepage-only. */
    nav a {
        display: none;
    }

    .nav-search {
        margin-left: 0;
    }

    .nav-search-input:focus {
        width: 180px;
    }

    .film-card {
        flex-basis: 280px;
    }
}
