/*
 * The common title page (launch plan R8): resources/views/title/page.blade.php.
 * One template for a catalogue film, a film known only from Streaming data and a TV series.
 * Custom properties only from css/design-tokens.css; the title partials keep their own file
 * (css/title-essentials.css).
 *
 * Phone first: one column, in the order head → My list → Where to watch → description → cast →
 * connections → trailer → info → chart history → admin → the page's own sections. From 1100px the
 * right column (320px) sits beside the main one; all its boxes scroll with the page.
 */

.fs-tp {
    /* break-word, not anywhere: long words wrap without shrinking table columns to one letter */
    overflow-wrap: break-word;
    color: var(--fs-color-text-body);
    font-family: var(--fs-font-body);
}

.fs-tp .breadcrumb {
    margin-bottom: 0;
}

/* ---------- Head: poster, title essentials, chart position ---------- */

.fs-tp__head {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    grid-template-areas:
        "poster summary"
        "chart chart";
    gap: 16px;
    margin-bottom: 24px;
}

.fs-tp__poster {
    grid-area: poster;
    min-width: 0;
}

.fs-tp__poster > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--fs-radius-12);
    border: 1px solid var(--fs-color-border);
    background: var(--fs-color-surface);
}

.fs-tp__summary {
    grid-area: summary;
    min-width: 0;
}

.fs-tp__summary .fs-title-header__kind {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fs-tp__chart {
    grid-area: chart;
    min-width: 0;
}

.fs-tp__tagline {
    margin: 12px 0 0;
    color: var(--fs-color-text-secondary);
    font-style: italic;
}

.fs-tp__aka,
.fs-tp__note {
    margin: 10px 0 0;
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-13);
}

.fs-tp__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.fs-tp__actions .fs-btn {
    padding: 6px 14px;
    font-size: var(--fs-text-14);
}

/* ---------- Body ---------- */

.fs-tp__body {
    display: flex;
    flex-direction: column;
}

.fs-tp__main,
.fs-tp__side,
.fs-tp__pin {
    display: contents;
}

.fs-tp__section,
.fs-tp__box,
.fs-tp__extra {
    min-width: 0;
    margin-bottom: 24px;
}

.fs-tp__box {
    margin-bottom: 16px;
}

.fs-tp__box--mylist { order: 1; }
.fs-tp__box--watch { order: 2; }
.fs-tp__section--description { order: 3; }
.fs-tp__section--tags { order: 3; } /* right after the description (same order: the page order decides) */
.fs-tp__section--cast { order: 4; }
.fs-tp__section--connections { order: 5; }
.fs-tp__section--trailer { order: 6; }
.fs-tp__box--info { order: 7; }
.fs-tp__box--history { order: 8; }
.fs-tp__box--admin { order: 9; }
.fs-tp__extra { order: 10; }

.fs-tp__section > section,
.fs-tp__section--description {
    padding: 20px;
    background: var(--fs-color-surface);
    border: 1px solid var(--fs-color-border);
    border-radius: var(--fs-radius-14);
}

.fs-tp__section--description > section {
    padding: 0;
    background: none;
    border: 0;
}

.fs-tp__section .fs-cast,
.fs-tp__section .fs-connections {
    margin: 0;
}

.fs-tp__description {
    margin: 0;
    color: var(--fs-color-text-body);
    font-size: var(--fs-text-15);
    line-height: 1.7;
    white-space: pre-line;
}

/* The film's own description block (intro sentence, synopsis, "Read more"), inside the common section */
.fs-tp__section--description .movie-description-card {
    margin: 0 !important;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

.fs-tp__section--description .movie-description-card::before,
.fs-tp__section--description .movie-description-card::after {
    display: none;
}

.fs-tp__section--description .description-header {
    margin-bottom: 12px;
    padding: 0;
    border: 0;
    color: var(--fs-color-text);
}

.fs-tp__section--description .description-header i {
    display: none;
}

.fs-tp__section--description .description-header h2 {
    color: var(--fs-color-text);
    font-family: var(--fs-font-heading);
    font-size: var(--fs-text-16);
    font-weight: var(--fs-weight-semibold);
}

.fs-tp__section--description .description-text {
    color: var(--fs-color-text-body);
    font-size: var(--fs-text-15);
    line-height: 1.7;
}

/* ---------- Side cards ---------- */

.fs-side-card {
    padding: 16px;
    background: var(--fs-color-surface);
    border: 1px solid var(--fs-color-border);
    border-radius: var(--fs-radius-14);
}

.fs-side-card .fs-essential-heading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fs-side-card .fs-essential-heading .bi {
    color: var(--fs-color-accent);
}

.fs-side-card a:not(.fs-btn):not(.fs-watch__link) {
    color: var(--fs-color-link);
    text-decoration: none;
}

.fs-side-card a:not(.fs-btn):not(.fs-watch__link):hover {
    color: var(--fs-color-link-hover);
    text-decoration: underline;
}

.fs-side-card .fs-watch {
    margin: 0;
}

.fs-side-card--admin {
    border-color: var(--fs-color-border-strong);
    border-style: dashed;
}

.fs-tp__admin-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fs-tp__admin-links .fs-btn {
    min-height: 36px;
    padding: 4px 12px;
    font-size: var(--fs-text-13);
    white-space: normal;
}

/* My list */

.fs-mylist__text,
.fs-mylist__slots {
    margin: 0 0 12px;
    color: var(--fs-color-text-secondary);
    font-size: var(--fs-text-14);
}

.fs-mylist__slots {
    margin: 12px 0 0;
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-13);
}

.fs-mylist__state {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    color: var(--fs-color-text);
    font-weight: var(--fs-weight-semibold);
    background: var(--fs-color-surface-2);
    border: 1px solid var(--fs-color-border-strong);
    border-radius: var(--fs-radius-10);
}

.fs-mylist__state .bi {
    color: var(--fs-color-accent);
}

.fs-mylist__form {
    margin: 0 0 8px;
}

.fs-mylist__label {
    display: block;
    margin-bottom: 6px;
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-13);
}

.fs-mylist__select {
    width: 100%;
    min-height: var(--fs-control-min-height);
    margin-bottom: 8px;
    padding: 8px 12px;
    color: var(--fs-color-text);
    font-family: var(--fs-font-body);
    font-size: var(--fs-text-15);
    background: var(--fs-color-surface-2);
    border: 1px solid var(--fs-color-border-strong);
    border-radius: var(--fs-radius-10);
}

.fs-mylist__select:focus-visible {
    outline: 2px solid var(--fs-color-accent);
    outline-offset: 2px;
}

.fs-mylist__button {
    width: 100%;
    white-space: normal;
    cursor: pointer;
}

.fs-mylist .streaming-mark-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.fs-mylist .streaming-mark-actions form {
    margin: 0;
}

.fs-mylist .fs-btn:disabled {
    color: var(--fs-color-text-muted);
    border-color: var(--fs-color-border);
    cursor: not-allowed;
}

.fs-mylist .fs-btn--primary:disabled {
    color: var(--fs-color-on-accent);
    border-color: var(--fs-color-accent);
    opacity: 0.7;
}

.fs-mylist__all {
    margin: 12px 0 0;
    font-size: var(--fs-text-13);
}

/* Info */

.fs-info__ratings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.fs-info__ratings li {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: var(--fs-color-surface-2);
    border: 1px solid var(--fs-color-border);
    border-radius: var(--fs-radius-10);
}

.fs-info__source,
.fs-info__note {
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-12);
}

.fs-info__score {
    color: var(--fs-color-text);
    font-family: var(--fs-font-heading);
    font-size: var(--fs-text-16);
    font-weight: var(--fs-weight-semibold);
}

.fs-info__out {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: var(--fs-text-12);
}

.fs-info__rows {
    margin: 0;
}

.fs-info__rows > div {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--fs-color-divider);
    font-size: var(--fs-text-14);
}

.fs-info__rows > div:first-child {
    border-top: 0;
}

.fs-info__rows dt {
    color: var(--fs-color-text-muted);
    font-weight: var(--fs-weight-regular);
}

.fs-info__rows dd {
    margin: 0;
    color: var(--fs-color-text);
}

.fs-info__guide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    font-size: var(--fs-text-14);
    font-weight: var(--fs-weight-semibold);
    background: var(--fs-color-surface-2);
    border: 1px solid var(--fs-color-border-strong);
    border-radius: var(--fs-radius-10);
}

.fs-side-card a.fs-info__guide:hover {
    border-color: var(--fs-color-accent);
    text-decoration: none;
}

/* Netflix chart history */

.fs-history__last {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 12px;
    font-size: var(--fs-text-14);
}

.fs-history__last span,
.fs-history__note {
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-13);
}

.fs-history__last strong {
    color: var(--fs-color-text);
    font-weight: var(--fs-weight-semibold);
}

.fs-history__sub {
    margin: 14px 0 8px;
    color: var(--fs-color-text-secondary);
    font-family: var(--fs-font-body);
    font-size: var(--fs-text-13);
    font-weight: var(--fs-weight-semibold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fs-history__list,
.fs-history__topics {
    margin: 0;
    padding: 0;
    list-style: none;
}

.fs-history__list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 6px 0;
    border-top: 1px solid var(--fs-color-divider);
    font-size: var(--fs-text-14);
}

.fs-history__list li:first-child {
    border-top: 0;
}

.fs-history__position {
    margin-left: auto;
    color: var(--fs-color-text);
    font-weight: var(--fs-weight-semibold);
}

.fs-history__kind {
    flex-basis: 100%;
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-12);
}

.fs-history__pages {
    margin-top: 12px;
}

.fs-history__pages .pagination {
    flex-wrap: wrap;
    margin: 0;
}

.fs-history__topics li {
    padding: 4px 0;
    font-size: var(--fs-text-14);
}

.fs-history__forum-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 10px 0 0;
    font-size: var(--fs-text-13);
}

.fs-history__forum-links .fs-btn {
    min-height: 36px;
    padding: 4px 12px;
    font-size: var(--fs-text-13);
}

/* ---------- Trailer ---------- */

.fs-player__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 180px;
    overflow: hidden;
    background: var(--fs-color-bg);
    border: 1px solid var(--fs-color-border);
    border-radius: var(--fs-radius-12);
}

.fs-player__preview {
    position: absolute;
    inset: 0;
}

.fs-player__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* A poster standing in for a wide image is shown whole, not cropped */
.fs-player--poster .fs-player__preview img {
    object-fit: contain;
}

.fs-player__play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    padding: 10px 22px;
    color: var(--fs-color-on-accent);
    font-family: var(--fs-font-body);
    font-size: var(--fs-text-16);
    font-weight: var(--fs-weight-semibold);
    background: var(--fs-color-accent);
    border: 0;
    border-radius: var(--fs-radius-pill);
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.fs-player__play:hover {
    background: var(--fs-color-accent-light);
}

.fs-player__play:focus-visible {
    outline: 3px solid var(--fs-color-text);
    outline-offset: 3px;
}

.fs-player__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.fs-player__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 10px 0 0;
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-13);
}

.fs-player__page,
.fs-player__stats a {
    color: var(--fs-color-link);
    font-weight: var(--fs-weight-semibold);
    text-decoration: none;
}

.fs-player__page:hover,
.fs-player__stats a:hover {
    color: var(--fs-color-link-hover);
    text-decoration: underline;
}

.fs-player__stats {
    margin: 8px 0 0;
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-13);
}

.fs-player__stats a {
    font-weight: var(--fs-weight-regular);
}

/* ---------- Wider screens ---------- */

@media (min-width: 576px) {
    .fs-tp__head {
        grid-template-columns: 160px minmax(0, 1fr);
        gap: 20px;
    }
}

@media (min-width: 768px) {
    .fs-tp__head {
        grid-template-columns: 200px minmax(0, 1fr);
        grid-template-areas:
            "poster summary"
            "poster chart";
        grid-template-rows: auto 1fr;
        gap: 16px 24px;
    }

    .fs-tp__chart {
        align-self: start;
    }
}

@media (min-width: 1100px) {
    .fs-tp__body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 320px;
        align-items: start;
        gap: 24px;
    }

    .fs-tp__main,
    .fs-tp__side {
        display: block;
        min-width: 0;
    }

    /* Every box of the right column scrolls with the page */
    .fs-tp__pin {
        display: block;
    }
}

/* ---------- A catalogue film's own blocks inside the common page ---------- */

/* The page's actions (rate, share, report) under the title essentials */
.fs-tp__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 14px;
    font-size: var(--fs-text-14);
    border-radius: var(--fs-radius-10);
}

/* The film's admin actions, in the right column */
.fs-tp__box--admin > .card {
    margin: 0 !important;
    background: var(--fs-color-surface) !important;
    border: 1px dashed var(--fs-color-border-strong) !important;
    border-radius: var(--fs-radius-14);
}

/* The gallery of other posters, under the poster */
.fs-tp__poster > .d-flex {
    margin: 10px 0 0 !important;
    justify-content: flex-start !important;
}

/* The fade over a collapsed synopsis ends in the card's own colour */
.fs-tp__section--description .description-wrapper.collapsed::after {
    background: linear-gradient(transparent, var(--fs-color-surface));
}

/* ---------- Chart position box on the title page: badge and trend side by side, no gap between them ---------- */

.fs-tp__chart .fs-chartpos {
    display: inline-flex;
    max-width: 100%;
    justify-content: flex-start;
    gap: 16px 40px;
    vertical-align: top;
}

/* ---------- Trailer: never wider than 900px in the main column ---------- */

.fs-player__frame,
.fs-player__foot,
.fs-player__stats {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.fs-tp .fs-btn:hover {
    text-decoration: none;
}

/* ---------- "Also known as": one row of alternative titles, the rest unfolded by "Show more" ---------- */

.fs-aka {
    display: flex;
    align-items: flex-start;
    gap: 8px 12px;
    min-width: 0;
    margin-top: 12px;
}

.fs-aka__label {
    flex: none;
    padding-top: 6px;
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-13);
    font-weight: var(--fs-weight-semibold);
}

.fs-aka__list {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 6px 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Collapsed (set by the script): exactly one row of pills */
.fs-aka.is-collapsed .fs-aka__list {
    max-height: 30px;
    overflow: hidden;
}

.fs-aka__list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 30px;
    padding: 2px 10px;
    color: var(--fs-color-text-secondary);
    font-size: var(--fs-text-13);
    background: var(--fs-color-surface);
    border: 1px solid var(--fs-color-border);
    border-radius: var(--fs-radius-pill);
}

.fs-aka__lang {
    flex: none;
    color: var(--fs-color-text-muted);
    font-size: var(--fs-text-12);
    font-weight: var(--fs-weight-semibold);
}

.fs-aka__title {
    min-width: 0;
    color: var(--fs-color-text);
    unicode-bidi: isolate;
    overflow-wrap: anywhere;
}

.fs-aka__more {
    flex: none;
    min-height: 30px;
    padding: 2px 12px;
    color: var(--fs-color-link);
    font-family: var(--fs-font-body);
    font-size: var(--fs-text-13);
    font-weight: var(--fs-weight-semibold);
    white-space: nowrap;
    background: transparent;
    border: 1px solid var(--fs-color-border-strong);
    border-radius: var(--fs-radius-pill);
    cursor: pointer;
}

.fs-aka__more:hover {
    color: var(--fs-color-link-hover);
    border-color: var(--fs-color-accent);
}

.fs-aka__more:focus-visible {
    outline: 2px solid var(--fs-color-accent);
    outline-offset: 2px;
}

@media (max-width: 575.98px) {
    .fs-aka {
        flex-wrap: wrap;
    }

    .fs-aka__label {
        flex-basis: 100%;
        padding-top: 0;
    }
}
