/* ============================================================
   Video Tutorial — single watch page (/video-tutorials/<slug>)
   ============================================================ */

/* The page band, its measure, and the heading lockup all come from elsewhere:
   .s-video-tutorials (video-tutorials.css) supplies the footer's gutter ladder
   so the player starts on the same left edge as the header above it, and
   .support-head--split (page-head.css) draws the title. Only the player, its
   meta row and the related rail are new here. */

/* ── Player ─────────────────────────────────────────────────── */
/* The main content of the page — but capped short of the 1600px measure and
   left-anchored on it, the way the rest of the site hangs off the footer
   gutter. At the full measure a 16:9 frame stands ~900px tall and pushes the
   title, the meta row and everything under them off a laptop screen; the cap
   keeps the whole lockup on one view while the player still dominates it. */
.vtw-player {
    position: relative;
    max-width: 68rem;
    aspect-ratio: 16 / 9;
    background: #0b0b0c;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.09));
    border-radius: var(--theme-radius-md, 1rem);
    box-shadow: var(--theme-shadow-card, 0 14px 34px rgba(0, 0, 0, 0.34));
    overflow: hidden;
}

.vtw-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ── Meta row ───────────────────────────────────────────────── */
/* Capped with the player so the row reads as the player's caption — the
   YouTube link is pushed to the far end, and at the full measure it would
   land a long way right of the frame it belongs to. */
.vtw-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.4rem;
    max-width: 68rem;
    margin: 1.15rem 0 0;
    color: var(--theme-text-soft, #989ba3);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.vtw-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.vtw-meta__item i {
    font-size: 0.78rem;
    opacity: 0.75;
}

/* Pushed to the far end of the row, the way .vt-card__tag sits in the card. */
.vtw-meta__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    color: var(--theme-text-muted, #c4c6cc);
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.18s ease;
}

.vtw-meta__link:hover {
    color: var(--theme-text-strong, #ffffff);
}

.vtw-meta__link i {
    font-size: 0.68rem;
}

/* ── Action row ─────────────────────────────────────────────── */
.vtw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.75rem 0 0;
}

.vtw-actions .tv-cta i {
    margin-right: 0.5rem;
    font-size: 0.78rem;
}

/* ── Related rail ───────────────────────────────────────────── */
.vtw-rail {
    margin: clamp(2.75rem, 5vw, 4rem) 0 0;
    padding: clamp(2rem, 3.5vw, 2.75rem) 0 0;
    border-top: 1px solid var(--theme-border, rgba(255, 255, 255, 0.09));
}

.vtw-rail__title {
    margin: 0 0 1.35rem;
    color: var(--theme-text-strong, #ffffff);
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.vtw-rail__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: clamp(1rem, 1.6vw, 1.5rem);
}

/* .vt-card's recipe — same surface, border, radius and lift — but built
   around a still rather than a player. */
.vtw-rail__card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--theme-surface-white-04, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.09));
    border-radius: var(--theme-radius-md, 1rem);
    overflow: hidden;
    transition:
        transform 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease;
}

.vtw-rail__card:hover {
    transform: translateY(-3px);
    border-color: var(--theme-border-strong, rgba(255, 255, 255, 0.18));
    box-shadow: var(--theme-shadow-card, 0 14px 34px rgba(0, 0, 0, 0.34));
}

.vtw-rail__link {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.vtw-rail__link:focus-visible {
    outline: 2px solid var(--theme-accent, #aa0000);
    outline-offset: 3px;
}

/* YouTube's hqdefault still is 4:3 with the 16:9 frame letterboxed inside it.
   Cropping the box back to 16:9 with `cover` removes exactly the black bars,
   so the tile carries the frame and nothing else. */
.vtw-rail__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #0b0b0c;
    overflow: hidden;
}

.vtw-rail__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vtw-rail__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition:
        background-color 220ms ease,
        border-color 220ms ease;
}

.vtw-rail__card:hover .vtw-rail__play {
    background: var(--theme-accent, #aa0000);
    border-color: var(--theme-accent, #aa0000);
}

.vtw-rail__time {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    padding: 0.18rem 0.42rem;
    border-radius: 0.3rem;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.vtw-rail__name {
    padding: 0.85rem 1rem;
    padding-right: 5.5rem;
    color: var(--theme-text-main, #ececef);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.35;
}

/* Outside the link so the tag is not part of its text, but positioned on the
   same footer line — the card's whole tile is the target anyway. */
.vtw-rail__tag {
    position: absolute;
    right: 1rem;
    bottom: 0.85rem;
    color: var(--theme-text-soft, #989ba3);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.35;
    text-transform: uppercase;
    pointer-events: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
    .vtw-meta__link {
        margin-left: 0;
    }

    .vtw-actions .tv-cta {
        flex: 1 1 100%;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .vtw-rail__grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}
