/* Episodarr's own pieces, on top of the shared styles.css (the same base the
   Marquee site uses, so the two sites look like one family). */

/* ── Grids of three ────────────────────────────────────────────
   Three across, then straight to one per row before the columns get narrow
   enough for their text to wrap unevenly. Skipping a two-column step also
   means no box is ever paired with a neighbour whose text wraps differently. */
.grid--3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

/* Six feature cards: three across, two rows (the shared stylesheet lets them
   flow freely, which can leave a lone card on the last row). */
.grid--features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--3 .step,
.grid--3 .card {
    height: 100%;
}

/* Avoid a lone word on the last line of a box. */
.card__text,
.step__text,
.flow__text,
.note__text {
    text-wrap: pretty;
}

.card a:hover,
a.card:hover {
    text-decoration: none;
}

/* ── Mock Plex season (hero) ──────────────────────────────────── */
.mock__head {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    padding: 20px 20px 14px;
}

.mock__poster {
    width: 74px;
    height: 110px;
    flex: none;
    position: relative;
    border-radius: 8px;
    background:
        radial-gradient(circle at 70% 28%, #ffd58a 0 9%, transparent 10%),
        linear-gradient(180deg, #1d4a6b 0%, #2f6f8f 45%, #0e2333 46%, #0b1a26 100%);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
}

.mock__poster::after {
    content: "HARBOR LIGHTS";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    text-align: center;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .12em;
    color: #f6e7c4;
}

.mock__show {
    font-size: 19px;
}

.mock__season {
    color: var(--muted);
    font-size: 14px;
}

.mock__toggle {
    display: flex;
    gap: 4px;
    margin: 0 20px 12px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-deep);
}

.mock__toggle button {
    flex: 1;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease;
}

.mock__toggle button:hover {
    color: var(--ink);
}

.mock__toggle button[aria-pressed="true"] {
    background: var(--surface-2);
    color: var(--ink);
}

.mock__toggle button.is-episodarr[aria-pressed="true"] {
    background: var(--accent);
    color: #1c1e24;
}

.eps {
    list-style: none;
    margin: 0;
    padding: 0 12px 12px;
}

.ep {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.ep:nth-child(odd) {
    background: rgba(255, 255, 255, .025);
}

.ep__thumb {
    position: relative;
    height: 52px;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--h1, #2b4f66), var(--h2, #132430));
}

.ep__thumb.is-blank {
    background: repeating-linear-gradient(45deg, #2f3238 0 6px, #282a2d 6px 12px);
}

.ep__thumb span {
    position: absolute;
    right: 6px;
    bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, .8);
}

.ep__title,
.ep__file,
.ep__note {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep__title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
}

.ep__file {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    color: #737985;
    line-height: 1.5;
}

.ep__note {
    font-size: 12.5px;
    line-height: 1.5;
    color: #f07167;
}

.ep__note.is-ok {
    color: #5fcf94;
}

.ep__badge {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

.ep__badge.is-ok {
    background: rgba(95, 207, 148, .14);
    color: #5fcf94;
}

.ep__badge.is-bad {
    background: rgba(240, 113, 103, .14);
    color: #f07167;
}

/* Both captions sit in the same spot and only one is visible, so the mock is
   always as tall as the longer one and the headline beside it (centred against
   the mock) never moves when you switch tabs. */
.mock__foot {
    display: grid;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.5;
}

.mock__foot span {
    grid-area: 1 / 1;
    visibility: hidden;
}

.mock__foot span.is-on {
    visibility: visible;
}

/* ── How it works: Sonarr → Episodarr → Plex ──────────────────── */
.flow {
    display: grid;
    grid-template-columns: 1fr 44px 1fr 44px 1fr;
    align-items: stretch;
}

.flow__card {
    text-align: center;
    padding: 28px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.flow__card.is-center {
    border-color: rgba(229, 160, 13, .45);
    background:
        radial-gradient(260px 160px at 50% 0%, rgba(229, 160, 13, .12), transparent 70%),
        var(--surface);
    box-shadow: var(--shadow);
}

/* Every logo sits in the same well, so the three read as one row and each one
   stands out against the card (the Plex chevron has no background of its own). */
.flow__logo {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-deep);
}

.flow__logo img {
    width: 48px;
    height: 48px;
}

.flow__logo img.is-rounded {
    border-radius: 11px;
}

.flow__title {
    font-size: 19px;
    margin-bottom: 9px;
}

.flow__text {
    color: var(--muted);
    font-size: 15.5px;
}

.flow__arrow {
    display: grid;
    place-items: center;
    color: var(--accent);
}

.flow__arrow svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notes {
    margin-top: 22px;
}

.note {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .18);
}

.note__title {
    font-size: 15.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.note__text {
    color: var(--muted);
    font-size: 15px;
}

/* ── Why it exists ─────────────────────────────────────────────── */
.why__num {
    margin-bottom: 18px;
}

/* ── More from tvtime.dev ──────────────────────────────────────── */
.family__card {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--ink);
}

.family__card img {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 12px;
}

.family__name {
    font-size: 18px;
    font-weight: 700;
}

.family__tag {
    color: var(--muted);
    font-size: 14.5px;
}

.center-note {
    margin-top: 26px;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1090px) {
    .grid--3 {
        grid-template-columns: 1fr;
    }

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

    .flow {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .flow__arrow svg {
        transform: rotate(90deg);
    }
}

@media (max-width: 620px) {
    .grid--features {
        grid-template-columns: 1fr;
    }

    .ep {
        grid-template-columns: 70px minmax(0, 1fr) auto;
        gap: 10px;
    }

    .ep__thumb {
        height: 42px;
    }
}
