/* ==================================================================
   JISETF — videos

   The page is a set of playlists, each built from one object: a
   player beside the list it plays from. The player starts as the
   video's own thumbnail and only becomes a YouTube player when it is
   asked to play (scripts/videos.js), so the page costs a few small
   images to load, not three copies of YouTube.
   ================================================================== */

.pl__head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 760px;
    margin-bottom: clamp(22px, 3vw, 36px);
}
.pl__head .section-title {
    /* three playlists share one page: a title per playlist, not per page */
    font-size: clamp(30px, 3.4vw, 46px);
    line-height: 1.2;
    text-wrap: balance;
}
.pl__sub { font-size: var(--text-md); line-height: 1.7; color: rgba(49, 49, 49, 0.82); }
.pl__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--slate);
}
.pl__meta span + span::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-inline-end: 18px;
    border-radius: 50%;
    background: var(--gold);
    vertical-align: middle;
}

/* ---- the nine steps: where the series has got to ----------------- */
.rail {
    margin-bottom: clamp(26px, 3.4vw, 40px);
}
.rail__list > li { display: flex; }
.rail__list {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 8px;
}
.rail__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 4px 10px;
    border: 1.5px solid var(--hairline);
    border-radius: 12px;
    color: var(--slate);
    text-align: center;
}
.rail__state { margin-top: auto; }
.rail__n {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 900;
    background: var(--paper);
    color: var(--slate);
}
.rail__name { font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.rail__state { font-size: 11.5px; color: var(--slate); opacity: 0.8; }

/* a step with a video is a link that plays it */
.rail__step--on {
    border-color: rgba(21, 87, 137, 0.28);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.rail__step--on .rail__n { background: var(--blue); color: var(--white); }
.rail__step--on .rail__state { color: var(--blue); font-weight: 800; opacity: 1; }
.rail__step--on:hover { border-color: var(--blue); background: rgba(21, 87, 137, 0.04); }
.rail__step--on:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.rail__step--on[aria-current="true"] { border-color: var(--gold); background: rgba(247, 181, 49, 0.1); }

/* ---- the player beside its list ---------------------------------- */
.pl__body {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
    gap: clamp(18px, 2.4vw, 32px);
    align-items: start;
}

.vp__frame {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--paper);
    border-radius: var(--card-radius) 0 var(--card-radius) 0;
}
.vp__frame iframe,
.vp__poster,
.vp__poster img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.vp__poster { display: block; cursor: pointer; }
.vp__poster img { object-fit: cover; transition: transform 0.5s var(--ease); }
.vp__poster:hover img { transform: scale(1.02); }

/* the play mark: the brand's yellow, the one accent */
.vp__play {
    position: absolute;
    inset-block-end: clamp(14px, 2.4vw, 26px);
    inset-inline-end: clamp(14px, 2.4vw, 26px);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 16px;
    border-radius: 99px;
    background: var(--gold);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(14, 63, 99, 0.25);
    transition: transform 0.18s var(--ease);
}
.vp__play svg { width: 16px; height: 16px; }
.vp__poster:hover .vp__play { transform: scale(1.05); }
.vp__poster:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.vp__dur {
    padding-inline-start: 10px;
    border-inline-start: 1.5px solid rgba(49, 49, 49, 0.25);
    font-weight: 700;
    opacity: 0.8;
}

.vp__info { padding-top: 16px; display: flex; flex-direction: column; gap: 4px; }
.vp__title { font-size: var(--text-lg); font-weight: 900; line-height: 1.35; }
.vp__sub { font-size: var(--text-sm); color: var(--slate); font-weight: 600; }
.vp__yt {
    align-self: flex-start;
    margin-top: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--blue);
    border-bottom: 2px solid var(--gold);
}

/* ---- the list ------------------------------------------------------ */
.pl__list {
    border: 1.5px solid var(--hairline);
    border-radius: 0 var(--card-radius) 0 var(--card-radius);
    overflow: hidden;
    background: var(--white);
}
.pl__listhead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    background: var(--paper);
    font-size: var(--text-sm);
    font-weight: 800;
    color: var(--blue);
}
.pl__listhead span { font-weight: 600; color: var(--slate); font-size: 13px; }
.pl__items { display: flex; flex-direction: column; }
.pl__item {
    position: relative;
    display: grid;
    grid-template-columns: 22px 116px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-top: 1px solid var(--hairline);
    transition: background-color 0.18s var(--ease);
}
.pl__item:hover { background: rgba(21, 87, 137, 0.04); }
.pl__item:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.pl__item[aria-current="true"] { background: rgba(247, 181, 49, 0.12); }
.pl__item[aria-current="true"]::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: var(--gold);
}
.pl__n { font-size: 14px; font-weight: 900; color: var(--slate); text-align: center; }
.pl__item[aria-current="true"] .pl__n { color: var(--blue); }
.pl__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: var(--paper);
}
.pl__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl__thumb em {
    position: absolute;
    inset-block-end: 4px;
    inset-inline-start: 4px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(14, 63, 99, 0.86);
    color: var(--white);
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
}
.pl__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pl__text strong { font-size: 14.5px; font-weight: 800; line-height: 1.45; color: var(--ink); }
.pl__text small { font-size: 12.5px; color: var(--slate); line-height: 1.5; }
.pl__now {
    display: none;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--blue);
}
.pl__item[aria-current="true"] .pl__now { display: block; }

/* ---- a playlist of one: the list gives way to what the video covers */
.pl__about {
    padding: clamp(20px, 2.6vw, 28px);
    border: 1.5px solid var(--hairline);
    border-radius: 0 var(--card-radius) 0 var(--card-radius);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pl__about h3 { font-size: var(--text-sm); font-weight: 800; color: var(--blue); }
.pl__about ul { display: flex; flex-direction: column; gap: 9px; }
.pl__about li {
    position: relative;
    padding-inline-start: 18px;
    font-size: var(--text-sm);
    line-height: 1.7;
    color: rgba(49, 49, 49, 0.86);
}
.pl__about li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.65em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
}

/* ---- a playlist still waiting for its videos ---------------------- */
.pl__empty {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(20px, 3vw, 44px);
    padding: clamp(24px, 3.4vw, 44px);
    background: var(--white);
    border-radius: var(--card-radius) 0 var(--card-radius) 0;
}
.pl__empty-copy { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.pl__empty-copy h3 { font-size: var(--text-lg); font-weight: 900; color: var(--blue); }
.pl__empty-copy p { font-size: var(--text-sm); line-height: 1.75; color: rgba(49, 49, 49, 0.84); max-width: 52ch; }
.pl__empty-copy .btn { margin-top: 6px; }
.pl__empty img { width: clamp(150px, 18vw, 230px); height: auto; }

.btn--yt { background: var(--blue); color: var(--white); }
.btn--yt:hover { background: var(--blue-deep); }

/* ---- narrower screens --------------------------------------------- */
@media (max-width: 960px) {
    .pl__body { grid-template-columns: minmax(0, 1fr); }
    .rail__list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    /* on a phone the nine steps become one strip you swipe along */
    .rail { margin-inline: calc(-1 * var(--gutter, 20px)); }
    .rail__list {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 96px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        padding-inline: var(--gutter, 20px);
        padding-bottom: 6px;
        scrollbar-width: none;
    }
    .rail__list::-webkit-scrollbar { display: none; }
    .rail__list > li { scroll-snap-align: start; }
    .pl__item { grid-template-columns: 18px 104px minmax(0, 1fr); gap: 10px; padding: 11px 12px; }
    .pl__empty { grid-template-columns: minmax(0, 1fr); }
    .pl__empty img { justify-self: center; order: -1; }
    .vp__play { padding: 8px 16px 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .vp__poster:hover img, .vp__poster:hover .vp__play { transform: none; }
}

/* ---- the sessions playlist: the last live session, and the slides ---- */
.pl__live {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(16px, 2.4vw, 32px);
    margin-bottom: clamp(18px, 2.4vw, 28px);
    padding: clamp(16px, 2.2vw, 24px) clamp(18px, 2.6vw, 30px);
    background: var(--white);
    border-inline-start: 8px solid var(--green);
    color: var(--ink);
    transition: box-shadow 0.18s var(--ease);
}
.pl__live[hidden] { display: none; }
.pl__live:hover { box-shadow: 0 10px 30px rgba(14, 63, 99, 0.12); }
.pl__live:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.pl__live-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    background: var(--blue);
    color: var(--white);
}
.pl__live-day b { font-size: 38px; font-weight: 900; line-height: 1; }
.pl__live-day span { font-size: 12.5px; font-weight: 700; opacity: 0.85; margin-top: 4px; }
.pl__live-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl__live-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    font-size: 13px;
    font-weight: 800;
    color: var(--green-dark);
}
.pl__live-tag::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(15, 186, 137, 0.2);
}
.pl__live-copy strong { font-size: var(--text-md); font-weight: 900; line-height: 1.4; }
.pl__live-copy > span:last-child { font-size: var(--text-sm); color: var(--slate); font-weight: 600; }
.pl__live-cta { white-space: nowrap; }
.pl__live:hover .pl__live-cta { background: var(--green-dark); }

/* the list and the slides share the column beside the player */
.pl__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* the slides: red is the colour people already read as "PDF" */
.pl__doc {
    --pdf: #d93025;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px 16px;
    align-items: center;
    padding: 18px;
    background: var(--white);
    border: 1.5px solid var(--hairline);
    border-inline-start: 6px solid var(--pdf);
    color: var(--ink);
    transition: box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.pl__doc:hover { box-shadow: 0 10px 30px rgba(14, 63, 99, 0.12); }
.pl__doc:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.pl__doc-icon { color: var(--pdf); line-height: 0; }
.pl__doc-icon svg { width: 52px; height: 65px; }
.pl__doc-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pl__doc-copy strong { font-size: var(--text-md); font-weight: 900; color: var(--ink); line-height: 1.35; }
.pl__doc-copy > span { font-size: 13.5px; line-height: 1.6; color: rgba(49, 49, 49, 0.8); }
.pl__doc-copy small { font-size: 12.5px; font-weight: 700; color: var(--slate); }
.pl__doc-btn {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--pdf);
    color: var(--white);
}
.pl__doc-btn svg { width: 16px; height: 16px; }
.pl__doc:hover .pl__doc-btn { background: #b3261e; }

@media (max-width: 760px) {
    .pl__live { grid-template-columns: auto minmax(0, 1fr); }
    .pl__live-cta { grid-column: 1 / -1; justify-content: center; }
}
