
/* ===== MOVIES PAGE ===== */

.movies-page {
    width: min(100% - 48px, 1050px);
    margin: 0 auto;
}

/* HERO */

.movies-hero {
    padding: clamp(95px, 14vw, 155px) 0 55px;
}

.movies-hero h1 {
    margin-top: 28px;
    font-size: clamp(52px, 9vw, 100px);
    line-height: 0.99;
    letter-spacing: -0.075em;
    font-weight: 650;
}

.movies-intro {
    max-width: 520px;
    margin-top: 27px;
    color: var(--theme-muted);
    font-size: 16px;
    line-height: 1.9;
}

.movies-meta {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 55px;
    padding-bottom: 17px;
    border-bottom: 1px solid var(--theme-border);
    color: var(--theme-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.3px;
}

.movies-meta a {
    transition: color 0.2s ease;
}

.movies-meta a:hover {
    color: var(--theme-text);
}

/* FEATURED FILM */

.featured-film {
    margin-bottom: 110px;
}

.featured-poster {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    border-radius: 5px;
    color: #f5f5f7;
    background: #10131a;
}

.poster-placeholder-label,
.poster-placeholder-note {
    position: absolute;
    z-index: 3;
    color: rgba(255, 255, 255, 0.65);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
}

.poster-placeholder-label {
    top: 22px;
    left: 22px;
}

.poster-placeholder-note {
    right: 22px;
    bottom: 20px;
}

.featured-art {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 35%, rgba(80, 102, 142, 0.42), transparent 35%),
        linear-gradient(180deg, #111a2b 0%, #202b3a 45%, #080b12 100%);
}

.space-orb {
    position: absolute;
    top: 8%;
    left: 50%;
    width: clamp(140px, 24vw, 260px);
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translateX(-50%);
    background:
        radial-gradient(circle at 35% 30%, #d5d9df 0%, #727d8d 22%, #252d3c 57%, #090d17 72%);
    box-shadow: 0 0 85px rgba(137, 165, 206, 0.18);
}

.space-horizon {
    position: absolute;
    right: -10%;
    bottom: 5%;
    left: -10%;
    height: 32%;
    border-radius: 50% 50% 0 0;
    transform: rotate(-4deg);
    background: linear-gradient(180deg, #5b6677, #242d3c 35%, #0a0d13 90%);
    box-shadow: 0 -10px 50px rgba(180, 192, 210, 0.12);
}

.featured-film-title {
    position: absolute;
    z-index: 2;
    right: 20px;
    bottom: 18%;
    left: 20px;
    text-align: center;
}

.featured-film-title > span {
    font-size: 9px;
    letter-spacing: 3px;
}

.featured-film-title h2 {
    margin-top: 12px;
    font-size: clamp(28px, 6vw, 64px);
    font-weight: 500;
    letter-spacing: 0.14em;
}

.featured-film-title > p {
    margin-top: 12px;
    font-size: 9px;
    letter-spacing: 2px;
}

.featured-film-info {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 35px;
    padding-top: 25px;
}

.featured-film-info h2 {
    margin-top: 12px;
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -0.06em;
}

.film-description {
    max-width: 470px;
    margin-top: 12px;
    color: var(--theme-muted);
    font-size: 13px;
    line-height: 1.85;
}

.featured-film-bottom {
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 8px;
    flex-shrink: 0;
    color: var(--theme-muted);
    font-size: 9px;
    letter-spacing: 1px;
}

/* SECTION HEADINGS */

.favourites-section {
    padding-bottom: 100px;
}

.movies-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 35px;
}

.movies-section-heading h2,
.watchlist-section h2 {
    margin-top: 13px;
    font-size: clamp(32px, 5vw, 49px);
    line-height: 1.1;
    letter-spacing: -0.06em;
}

.movies-section-heading > p {
    max-width: 260px;
    color: var(--theme-muted);
    font-size: 13px;
    line-height: 1.8;
}

/* FILM GRID */

.movie-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px 22px;
    align-items: start;
}

.movie-card {
    min-width: 0;
}

.movie-poster {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border-radius: 3px;
    color: #f5f5f7;
    isolation: isolate;
    background: #202126;
}

.movie-poster::before,
.movie-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.movie-poster::before {
    transition: transform 0.5s ease;
}

.movie-card:hover .movie-poster::before {
    transform: scale(1.04);
}

.movie-poster::after {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.05) 0%,
        transparent 35%,
        rgba(0, 0, 0, 0.12) 55%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.movie-index,
.poster-edit-note {
    position: absolute;
    z-index: 2;
    color: rgba(255, 255, 255, 0.65);
    font-size: 8px;
    letter-spacing: 1.1px;
}

.movie-index {
    top: 13px;
    left: 13px;
}

.poster-edit-note {
    right: 12px;
    bottom: 12px;
    left: 12px;
    text-align: center;
    font-size: 7px;
}

.poster-art {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    text-align: center;
}

.poster-silhouette {
    position: absolute;
    top: 18%;
    left: 50%;
    width: 38%;
    height: 52%;
    transform: translateX(-50%);
    opacity: 0.38;
    background: linear-gradient(180deg, rgba(255,255,255,0.4), transparent 85%);
    clip-path: polygon(35% 0, 65% 0, 78% 18%, 100% 40%, 80% 52%, 72% 100%, 28% 100%, 20% 52%, 0 40%, 22% 18%);
}

.poster-title {
    position: relative;
    z-index: 1;
    margin-top: auto;
    font-size: clamp(15px, 2vw, 24px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.poster-year {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    font-size: 9px;
    letter-spacing: 2px;
}

/* INDIVIDUAL POSTER PALETTES */

.poster-dark-knight::before {
    background:
        radial-gradient(ellipse at 50% 28%, #737c83, transparent 35%),
        linear-gradient(180deg, #59616a, #202731 55%, #080a0f);
}

.poster-american-psycho::before {
    background:
        radial-gradient(ellipse at 50% 30%, #c7b9b1, transparent 35%),
        linear-gradient(150deg, #8e8782, #403d3d 60%, #161618);
}

.poster-wolf::before {
    background:
        radial-gradient(ellipse at 50% 35%, #b99b65, transparent 35%),
        linear-gradient(145deg, #4d4b43, #766346 55%, #211e19);
}

.poster-limitless::before {
    background:
        radial-gradient(ellipse at 50% 25%, #c3d8e2, transparent 38%),
        linear-gradient(160deg, #63869b, #304e63 58%, #121e2c);
}

.poster-inception::before {
    background:
        radial-gradient(ellipse at 50% 25%, #9b9589, transparent 30%),
        linear-gradient(180deg, #77736b, #34383b 55%, #101315);
}

.poster-tenet::before {
    background:
        radial-gradient(ellipse at 50% 25%, #aa7866, transparent 35%),
        linear-gradient(135deg, #544a49, #38363b 55%, #11151b);
}

.poster-interstellar-small::before {
    background:
        radial-gradient(ellipse at 50% 25%, #b0bdce, transparent 32%),
        linear-gradient(180deg, #34465d, #202c3e 55%, #080b12);
}

.movie-info {
    padding-top: 14px;
}

.movie-info h3 {
    font-size: 16px;
    font-weight: 550;
    letter-spacing: -0.035em;
    line-height: 1.4;
}

.movie-info > p {
    min-height: 43px;
    margin-top: 7px;
    color: var(--theme-muted);
    font-size: 12px;
    line-height: 1.75;
}

.movie-genre {
    display: inline-block;
    margin-top: 13px;
    color: var(--theme-muted);
    font-size: 8px;
    letter-spacing: 0.9px;
}

.collection-note {
    margin-top: 35px;
    color: var(--theme-muted);
    font-size: 12px;
}

/* FILM TASTE */

.film-taste {
    padding: 75px 0 85px;
    border-top: 1px solid var(--theme-border);
    border-bottom: 1px solid var(--theme-border);
}

.film-taste > h2 {
    margin-top: 18px;
    font-size: clamp(38px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.065em;
}

.taste-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 35px;
    margin-top: 55px;
}

.taste-item > span {
    color: var(--theme-muted);
    font-size: 10px;
    letter-spacing: 1px;
}

.taste-item h3 {
    margin-top: 18px;
    font-size: 17px;
    font-weight: 550;
    letter-spacing: -0.03em;
}

.taste-item p {
    margin-top: 10px;
    color: var(--theme-muted);
    font-size: 12px;
    line-height: 1.8;
}

/* WATCHLIST */

.watchlist-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 45px;
    padding: 95px 0;
}

.watchlist-section > div:first-child > p:last-child {
    max-width: 400px;
    margin-top: 17px;
    color: var(--theme-muted);
    font-size: 13px;
    line-height: 1.85;
}

.watchlist-placeholder {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    min-height: 210px;
    padding: 25px;
    border: 1px dashed var(--theme-border);
    border-radius: 5px;
    text-align: center;
}

.watchlist-placeholder > span {
    color: var(--theme-muted);
    font-size: 9px;
    letter-spacing: 1.5px;
}

.watchlist-placeholder p {
    margin-top: 17px;
    font-size: 15px;
}

.watchlist-placeholder small {
    margin-top: 10px;
    color: var(--theme-muted);
    font-size: 8px;
    letter-spacing: 1px;
}

/* BOTTOM LINKS */

.movies-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 80px;
}

.movies-bottom .text-link {
    font-size: 13px;
}

/* DARK MODE */

html[data-theme="dark"] .featured-poster {
    background: #080b12;
}

html[data-theme="dark"] .movie-poster {
    background: #18191d;
}

/* RESPONSIVE */

@media (max-width: 760px) {
    .movie-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px 16px;
    }

    .featured-film-info {
        align-items: start;
        flex-direction: column;
        gap: 20px;
    }

    .featured-film-bottom {
        align-items: start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .taste-grid {
        gap: 22px;
    }

    .watchlist-section {
        gap: 25px;
    }
}

@media (max-width: 600px) {
    .movies-page {
        width: calc(100% - 36px);
    }

    .movies-hero {
        padding-top: 90px;
        padding-bottom: 40px;
    }

    .movies-hero h1 {
        font-size: clamp(46px, 11vw, 68px);
    }

    .movies-intro {
        font-size: 14px;
    }

    .movies-meta {
        margin-top: 40px;
        font-size: 8px;
        letter-spacing: 0.6px;
    }

    .featured-film {
        margin-bottom: 80px;
    }

    .featured-poster {
        min-height: 300px;
    }

    .featured-film-title {
        bottom: 16%;
    }

    .featured-film-title h2 {
        font-size: clamp(23px, 7vw, 38px);
        letter-spacing: 0.08em;
    }

    .featured-film-title > span {
        font-size: 7px;
        letter-spacing: 1.8px;
    }

    .featured-film-title > p {
        font-size: 7px;
    }

    .movies-section-heading {
        align-items: start;
        flex-direction: column;
        gap: 12px;
    }

    .movie-grid {
        gap: 30px 13px;
    }

    .movie-info h3 {
        font-size: 14px;
    }

    .movie-info > p {
        min-height: 0;
        font-size: 11px;
    }

    .movie-genre {
        font-size: 7px;
        line-height: 1.7;
    }

    .poster-title {
        font-size: clamp(12px, 3.4vw, 20px);
    }

    .poster-edit-note {
        font-size: 6px;
    }

    .film-taste {
        padding: 60px 0;
    }

    .taste-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-top: 38px;
    }

    .taste-item h3 {
        margin-top: 10px;
    }

    .watchlist-section {
        grid-template-columns: 1fr;
        padding: 70px 0;
    }

    .movies-bottom {
        padding-bottom: 55px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .movie-poster::before {
        transition: none;
    }
}


/* =========================================
   AUTOMATIC MOVIE POSTER FITTING
========================================= */

/* Make poster containers control their images */
.featured-poster,
.movie-poster {
    position: relative;
    overflow: hidden;
}

/* Make every poster image fill its container */
.featured-poster > .poster-image,
.movie-poster > .poster-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

/* Standard movie poster proportions */
.movie-poster {
    aspect-ratio: 2 / 3;
    height: auto;
}

/* Featured poster keeps its existing dimensions */
.featured-poster > .poster-image {
    object-position: center;
}
