/* =====================================================================
   MoviesHD — design glue
   The four files in assets/css/design/ are the reference stylesheets,
   copied verbatim. This file only adds what a server-rendered PHP app
   needs on top of them: font loading, slide transitions, long-form copy,
   the player surface and a few states the client bundle used to inject.
   Everything here uses the design's own tokens (--ink-*, --brand, --ease-out).
   ===================================================================== */

/* ---- Typeface -------------------------------------------------------
   The reference build ships self-hosted Inter woff2 files that are not
   part of the archive, so Inter is loaded from Google Fonts and falls
   back to the system stack exactly like the reference does.            */
:root {
    --font-inter: 'Inter', 'Inter Fallback';
}

/* ---- Hero slides ---------------------------------------------------
   The reference renders every slide absolutely and marks the current one
   with .slideCurrent. We use the same idea plus a data attribute so the
   server can render the first slide as active.                          */
[data-slide] {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.55s var(--ease-out);
}
[data-slide][data-active] {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

/* ---- Scroll rows ---------------------------------------------------
   Arrows are shown only when the row can actually scroll.               */
[data-row-track] {
    scrollbar-width: none;
}
[data-row-track]::-webkit-scrollbar {
    display: none;
}
[data-row-track][data-at-start="true"] ~ .ScrollRow-module-scss-module__-kZXvG__arrowPrev,
[data-row-track][data-at-end="true"] ~ .ScrollRow-module-scss-module__-kZXvG__arrowNext {
    opacity: 0;
    pointer-events: none;
}

/* ---- Long-form copy (guides, legal) --------------------------------- */
.mf-prose {
    max-width: 72ch;
    color: var(--ink-300);
    font-size: 15px;
    line-height: 1.75;
}
.mf-prose > * + * { margin-top: 1em; }
.mf-prose h2 {
    margin-top: 2em;
    color: var(--ink-100);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
}
.mf-prose h3 {
    margin-top: 1.6em;
    color: var(--ink-100);
    font-size: 16px;
    font-weight: 600;
}
.mf-prose p, .mf-prose li { color: var(--ink-300); }
.mf-prose strong { color: var(--ink-100); font-weight: 600; }
.mf-prose a {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
    text-underline-offset: 3px;
}
.mf-prose a:hover { text-decoration-color: #fff; }
.mf-prose ul { list-style: disc; padding-left: 1.2em; }
.mf-prose ol { list-style: decimal; padding-left: 1.4em; }
.mf-prose li { margin-top: 0.4em; }
.mf-prose code {
    padding: 0.1em 0.4em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
    color: var(--ink-100);
}
.mf-prose .legal__note {
    padding: 14px 18px;
    border-left: 2px solid var(--brand);
    border-radius: 0 8px 8px 0;
    background: rgba(229, 9, 20, 0.08);
}

/* ---- Reveal on scroll ------------------------------------------------
   Content is never hidden by CSS: if JavaScript fails, the observer never
   fires or a crawler snapshots early, every section is still visible and
   indexable. The observer only adds a subtle lift.                      */
[data-reveal].is-revealed {
    animation: mf-reveal 0.45s var(--ease-out) both;
}
@keyframes mf-reveal {
    from { opacity: 0.001; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* ---- Search overlay -------------------------------------------------- */
.mf-search-panel {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow-y: auto;
}
.mf-search-panel > div {
    background: rgba(15, 15, 15, 0.97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* ---- Player surface -------------------------------------------------- */
.mf-player {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    background: #000;
}
.mf-player[hidden] { display: none; }
.mf-player__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
}
.mf-player__stage { position: relative; flex: 1; min-height: 0; background: #000; }
.mf-player__frame { width: 100%; height: 100%; border: 0; display: block; }
.mf-player__foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 16px calc(env(safe-area-inset-bottom) + 14px);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
}
.mf-player__status {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    background: rgba(0, 0, 0, 0.92);
}
.mf-select {
    height: 36px;
    padding: 0 32px 0 12px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: rgba(24, 24, 24, 0.9);
    color: var(--ink-100);
    font-size: 13px;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-300) 50%), linear-gradient(135deg, var(--ink-300) 50%, transparent 50%);
    background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.mf-select option { background: #181818; color: #fff; }

/* ---- Episode rows ---------------------------------------------------- */
.mf-episode {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background-color 0.15s, border-color 0.15s;
}
.mf-episode:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}
.mf-episode__num {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--ink-300);
}
.mf-episode__thumb {
    width: 132px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
}

/* ---- Season chips ---------------------------------------------------- */
.mf-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mf-chips::-webkit-scrollbar { display: none; }
.mf-chip {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink-300);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.mf-chip:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.mf-chip[data-active] {
    background: #fff;
    border-color: #fff;
    color: var(--ink-950);
    font-weight: 600;
}

/* ---- Pagination ------------------------------------------------------ */
.mf-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}
.mf-pager__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-100);
}
.mf-pager__btn:hover { background: rgba(255, 255, 255, 0.1); }
.mf-pager__btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.mf-pager__status { font-size: 13px; color: var(--ink-400); font-variant-numeric: tabular-nums; }

/* ---- Grid ------------------------------------------------------------ */
.mf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px 10px;
}
@media (min-width: 768px) {
    .mf-grid { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 22px 12px; }
}
.mf-grid > * { width: auto !important; }

/* ---- Empty / error states -------------------------------------------- */
.mf-empty { text-align: center; padding: 80px 20px; }
.mf-empty__code {
    font-size: clamp(56px, 12vw, 96px);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--brand);
}

/* ---- Focus + motion -------------------------------------------------- */
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* =====================================================================
   Editorial sections
   These wrap long-form SEO copy so it reads as part of the design rather
   than a wall of paragraphs at the bottom of a page.
   ===================================================================== */

/* ---- Genre tiles in a wrapped grid ---------------------------------- */
.mf-genre-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (min-width: 640px) {
    .mf-genre-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .mf-genre-grid { grid-template-columns: repeat(var(--mf-cols, 4), minmax(0, 1fr)); gap: 12px; }
}
.mf-genre-grid .GenreCard-module-scss-module___dKX4G__card { width: 100%; }
.mf-genre-grid .genreRail-module-scss-module__S29P9q__slide { width: auto; }

/* ---- Breadcrumbs ---------------------------------------------------- */
.mf-crumbs { margin: 0 0 14px; }
.mf-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: var(--ink-400);
}
.mf-crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.mf-crumbs a { color: var(--ink-300); transition: color 0.15s; }
.mf-crumbs a:hover { color: #fff; }
.mf-crumbs [aria-current] { color: var(--ink-100); }
.mf-crumbs__sep { color: var(--ink-600); }

/* ---- Section shell -------------------------------------------------- */
.mf-section { margin-top: 56px; }
.mf-section__head { max-width: 62ch; }
.mf-section__title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--ink-100);
}
@media (min-width: 768px) {
    .mf-section__title { font-size: 26px; }
}
.mf-section__sub {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-400);
}

/* ---- Two column editorial ------------------------------------------- */
.mf-editorial {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    margin-top: 24px;
}
@media (min-width: 1024px) {
    .mf-editorial { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; }
}

/* ---- Fact panel ------------------------------------------------------ */
.mf-facts {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    align-self: start;
}
.mf-facts__title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-400);
}
.mf-facts dl { margin: 0; }
.mf-facts dl > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
}
.mf-facts dl > div:first-child { border-top: 0; }
.mf-facts dt { color: var(--ink-400); }
.mf-facts dd { margin: 0; color: var(--ink-100); text-align: right; }

/* ---- Guide cards ----------------------------------------------------- */
.mf-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 20px;
}
@media (min-width: 640px) {
    .mf-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.mf-card-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.mf-card-link:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--line-strong);
    transform: translateY(-2px);
}
.mf-card-link strong { font-size: 14px; font-weight: 600; color: var(--ink-100); }
.mf-card-link span { font-size: 13px; line-height: 1.5; color: var(--ink-400); }

/* ---- FAQ block ------------------------------------------------------- */
.mf-faq { margin-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.mf-faq details {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 0;
}
.mf-faq summary {
    cursor: pointer;
    list-style: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.mf-faq summary::-webkit-details-marker { display: none; }
.mf-faq summary::after {
    content: "+";
    font-size: 18px;
    line-height: 1;
    color: var(--ink-400);
    transition: transform 0.2s;
}
.mf-faq details[open] summary::after { content: "−"; }
.mf-faq p { margin: 10px 0 0; font-size: 14px; line-height: 1.7; color: var(--ink-300); }
.mf-faq p a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Detail page text blocks ---------------------------------------- */
.mf-detail-text { max-width: 74ch; }
.mf-detail-text h2 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink-100);
}
@media (min-width: 768px) {
    .mf-detail-text h2 { font-size: 23px; }
}
.mf-detail-text h3 {
    margin: 26px 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-100);
}
.mf-detail-text p,
.mf-detail-text li {
    font-size: 14px;
    line-height: 1.75;
    color: var(--ink-300);
}
.mf-detail-text p + p { margin-top: 12px; }
.mf-detail-text ul { margin: 10px 0 0; padding-left: 1.2em; list-style: disc; }
.mf-detail-text li { margin-top: 6px; }
.mf-detail-text a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); text-underline-offset: 3px; }
.mf-detail-text a:hover { text-decoration-color: #fff; }

/* ---- Cast list (text, for crawlers and readers) ---------------------- */
.mf-cast-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
@media (min-width: 768px) {
    .mf-cast-list { grid-template-columns: minmax(0, 1fr); }
    .mf-cast-list__row { padding: 10px 0; }
}
.mf-cast-list__row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
}
.mf-cast-list__row strong { font-weight: 500; color: var(--ink-100); }
.mf-cast-list__row span { color: var(--ink-400); text-align: right; }

/* ---- Season list (text) ---------------------------------------------- */
.mf-season-list { margin: 14px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.mf-season-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px;
    color: var(--ink-300);
}
.mf-season-list a { color: var(--ink-100); font-weight: 500; text-decoration: none; }
.mf-season-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
