/* =========================================================
   HOME.CSS
   Homepage-specific styles
   ========================================================= */


/* =========================================================
   HERO SECTION
   ========================================================= */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    padding: 0 60px 120px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #000;
}

    /* background video */
    .hero video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: -2;
    }

    /* dark overlay with radial colour glows */
    .hero::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(900px 380px at 18% 18%, rgba(47,125,255,0.18), transparent 62%), radial-gradient(760px 360px at 82% 22%, rgba(214,0,0,0.16), transparent 62%), linear-gradient(to bottom, rgba(0,0,0,0.75), rgba(0,0,0,0.45) 45%, rgba(0,0,0,0.2) 70%, var(--bg) 100%);
        z-index: -1;
    }

/* hero text block */
.hero-content {
    max-width: 880px;
    padding-top: 120px;
    position: relative;
    z-index: 1;
}

    .hero-content h1 {
        font-size: 12px;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: #aaa;
        font-weight: 900;
        margin-bottom: 14px;
        text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    }

.hero .hero-tagline {
    font-size: 64px;
    font-weight: 950;
    letter-spacing: -1px;
    line-height: 1.05;
    margin-bottom: 18px;
    background: linear-gradient(to bottom, #fff 0%, #f0f0f0 45%, #cfcfcf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fff; /* fallback for browsers that don't support background-clip: text */
}

.hero p {
    font-size: 19px;
    line-height: 1.75;
    color: var(--muted2);
    max-width: 780px;
    margin-bottom: 22px;
}

/* hero buttons */
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}


/* =========================================================
   STATS BLOCK
   ========================================================= */

.home-stats {
    max-width: var(--max);
    margin: -40px auto 0;
    padding: 0 60px;
    position: relative;
    z-index: 5;
}

.stats-card {
    border-radius: 22px;
    background: radial-gradient(600px 200px at 10% 20%, rgba(47,125,255,0.15), transparent 60%), radial-gradient(600px 200px at 90% 80%, rgba(214,0,0,0.15), transparent 60%), rgba(15,15,15,0.95);
    border: 1px solid rgba(255,255,255,0.08);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
}

.stat-item {
    padding: 48px 28px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.06);
}

    .stat-item:last-child {
        border-right: none;
    }

.stat-number {
    font-size: 64px;
    display: inline-flex;
    align-items: flex-end;
    font-weight: 950;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #8a8a8a;
    font-weight: 800;
    margin-top: 8px;
}

.digit-column {
    position: relative;
    height: 1em;
    overflow: hidden;
    width: 0.7em;
}

.digit-strip {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    transition: transform 1.2s cubic-bezier(.22,.61,.36,1);
}

.digit {
    height: 1em;
    line-height: 1em;
    text-align: center;
}


/* =========================================================
   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;
    }


/* =========================================================
   DONATION CTA
   ========================================================= */

.donation-cta {
    max-width: var(--max);
    margin: 30px auto 0;
    padding: 0 60px;
}

.donation-cta-card {
    border-radius: 26px;
    padding: 50px;
    background: linear-gradient(135deg, rgba(214,0,0,0.15), rgba(47,125,255,0.15)), rgba(20,20,20,0.95);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .donation-cta-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

.donation-cta h3 {
    font-size: 30px;
    font-weight: 950;
    margin-bottom: 14px;
}

.donation-cta p {
    max-width: 620px;
    color: #bdbdbd;
    line-height: 1.8;
}

.donation-cta-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}


/* =========================================================
   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);
    }


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

/* #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 {
    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) {
    .hero {
        padding: 0 20px 70px;
        min-height: 78vh;
    }

        .hero h1 {
            font-size: 42px;
        }

    .section {
        padding: 60px 20px 40px;
    }

    .donation-cta {
        padding: 0 20px;
    }

    .donation-cta-card {
        padding: 40px 30px;
    }

    .home-stats {
        padding: 0 20px;
    }

    .stats-card {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

        .stat-item:nth-child(2n) {
            border-right: none;
        }

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

@media (max-width: 640px) {
    nav a {
        display: none;
    }

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

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

    .hero h1 {
        font-size: 34px;
    }

    .stats-card {
        grid-template-columns: 1fr;
    }

    .stat-item {
        border-right: none;
    }

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