/* TITLE HERO */

.title-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: var(--clr-black);
}

.title-hero__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 0.7) 25%,
        rgba(0, 0, 0, 0) 75%
    );
    pointer-events: none;
}

.title-hero__content {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 100%;
}

.title-hero__heading {
    max-width: 400px;
    font-size: 60px;
    line-height: 1.05;
    text-wrap: balance;
}

.title-hero__trailer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 287px;
    height: 50px;
    margin-top: 32px;
    padding: 0 16px;
    border-radius: 12px;
    background-color: var(--clr-white);
    color: var(--clr-black);
    text-decoration: none;
    font-size: 16px;
    transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease;
}

.title-hero__trailer img {
    display: block;
    width: 24px;
    height: 24px;
    border: 1px solid transparent;
    transition: filter 250ms ease;
}

.title-hero__summary {
    max-width: 740px;
    margin-top: 32px;
}

.title-hero__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 24px;
    font-size: 16px;
}

.title-hero__separator {
    display: inline-block;
    width: 1px;
    height: 20px;
    background-color: var(--clr-white);
    font-size: 0;
}

.title-hero__genres {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-hero__genres a + a {
    border-left: 1px solid var(--clr-white);
    padding-left: 12px;
}

.title-hero__genres a {
    color: var(--clr-white);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 250ms ease;
}

.title-hero__meta-item,
.title-hero__rating {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--clr-white);
}

.title-hero__rating {
    gap: 8px;
    color: #f5c518;
}

.title-hero__star {
    display: block;
    width: 20px;
    height: 20px;
}

/* HOVER EFFECTS */

@media (hover: hover) {
    .title-hero__trailer:hover {
        background-color: var(--clr-red);
        color: #FFFFFF;
        border-color: #FFFFFF;
    }

    .title-hero__trailer:hover img {
        filter: invert(1);
    }

    .title-hero__genres a:hover {
        color: var(--clr-red);
    }
}

/* TABLET */

@media (min-width: 768px) and (max-width: 991px) {
    .title-hero__overlay {
        background: linear-gradient(
            to bottom,
            transparent 80%,
            rgba(0, 0, 0, 0.65) 90%,
            rgba(0, 0, 0, 1) 100%
        );
    }

    .title-hero__content {
        bottom: -120px;
    }

    .title-hero__heading {
        font-size: 48px;
    }

    .title-hero__trailer,
    .title-hero__summary {
        margin-top: 24px;
    }

    .title-hero__meta {
        margin-top: 24px;
    }

    .title-hero__genres {
        gap: 10px;
    }

    .title-hero__meta-item,
    .title-hero__rating {
        margin-left: 10px;
        padding-left: 10px;
    }
}

/* MOBILE */

@media (max-width: 767px) {
    .title-hero__overlay {
        background: linear-gradient(
            0deg,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.65) 10%,
            rgba(0, 0, 0, 0) 20%
        );
    }

    .title-hero__content {
        bottom: -200px;
    }

    .title-hero__heading {
        font-size: 36px;
    }

    .title-hero__trailer {
        width: 200px;
        height: 48px;
        margin-top: 24px;
    }

    .title-hero__summary {
        margin-top: 24px;
    }

    .title-hero__meta {
        margin-top: 24px;
        font-size: 14px;
    }

    .title-hero__genres {
        gap: 10px;
    }

    .title-hero__meta-item,
    .title-hero__rating {
        margin-left: 10px;
        padding-left: 10px;
    }
}

/* MOBILE PORTRAIT */

@media (max-width: 767px) and (orientation: portrait) {
    .title-hero__content {
        bottom: -264px;
    }

    .title-hero__trailer {
        width: 180px;
        height: 40px;
    }

    .title-hero__trailer img {
        width: 20px;
        height: 20px;
    }
}



/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    .title-hero__genres a {
        transition: none;
    }
}


/* DETAILS SECTION */

.title-details {
    padding-top: 96px;
    padding-bottom: 96px;
    background-color: var(--clr-black);
}

.title-details__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 64px;
}

.title-details__story {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.title-details__story p {
    line-height: 1.6;
}

.title-details__cast {
    padding: 32px;
    border-radius: 16px;
    background-color: #121519;
}

.title-details__cast-heading {
    margin-bottom: 32px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 400;
}

.title-details__cast-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin: 0;
}

.title-details__cast-row {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 24px;
}

.title-details__cast-row dt,
.title-details__cast-row dd {
    margin: 0;
}

/* TABLET */

@media (min-width: 768px) and (max-width: 991px) {
    .title-details {
        padding-top: 192px;
        padding-bottom: 72px;
    }

    .title-details__layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .title-details__cast {
        width: fit-content;
        max-width: 100%;
    }

    .title-details__story {
        gap: 24px;
    }
}

/* MOBILE */

@media (max-width: 767px) {
    .title-details {
        padding-top: 248px;
        padding-bottom: 48px;
    }

    .title-details__layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .title-details__story {
        gap: 24px;
    }

    .title-details__cast {
        padding: 24px;
        width: fit-content;
        max-width: 100%;
    }

    .title-details__cast-heading {
        margin-bottom: 24px;
        font-size: 24px;
    }

    .title-details__cast-list {
        gap: 24px;
    }

    .title-details__cast-row {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 24px;
    }
}

/* MOBILE PORTRAIT */

@media (max-width: 767px) and (orientation: portrait) {
    .title-details {
        padding-top: 312px;
    }
}


/* RELATED TITLES */

.title-related {
    background-color: var(--clr-black);
}

.title-related__heading {
    margin-bottom: 40px;
    font-size: 40px;
    line-height: 1.2;
    font-weight: 400;
}

.title-related__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 48px;
}

/* RELATED MOVIE CARDS */

.title-related .movie-card {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.title-related .movie-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 240 / 306;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 250ms ease;
}

.title-related .movie-card__title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-top: 12px;
    font-size: 16px;
    line-height: 1;
    font-weight: 600;
    font-family: var(--ff-body);
}

.title-related .movie-card__details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-size: 16px;
}

.title-related .movie-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.title-related .movie-card__rating img {
    display: block;
    width: 20px;
    height: 20px;
}

/* HOVER EFFECTS */

@media (hover: hover) {
    .title-related .movie-card:hover .movie-card__image {
        transform: scale(1.04);
    }
}

/* TABLET */

@media (min-width: 768px) and (max-width: 991px) {
    .title-related__heading {
        margin-bottom: 32px;
        font-size: 32px;
    }

    .title-related__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .title-related .movie-card__title,
    .title-related .movie-card__details {
        font-size: 14px;
    }
}

/* MOBILE */

@media (max-width: 767px) {
    .title-related__heading {
        margin-bottom: 24px;
        font-size: 24px;
    }

    .title-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .title-related .movie-card__title,
    .title-related .movie-card__details {
        font-size: 14px;
    }
}

/* MOBILE LANDSCAPE */

@media (max-width: 767px) and (orientation: landscape) {
    .title-related__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* MOBILE PORTRAIT */

@media (max-width: 480px) {
    .title-related__grid {
        gap: 12px;
    }
}

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    .title-related .movie-card__image {
        transition: none;
    }
}

