/* ==========================================================================
   jeddah24 — video section (2026-11-09): play facade, clip cards and rows, hub,
   watch page, home band, article card. "Red Sea Corniche" tokens (v2-base.css).
   Loaded only on pages that print video UI (inc/jd24-vid.php).
   ========================================================================== */

/* ---- pictures + play marks --------------------------------------------------- */
.jd-vid-pic,
.jd-vid-play {
    position: relative;
    display: block !important;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--jd-ink-2);
    line-height: 0;
}
.jd-vid-play--short { aspect-ratio: 9 / 16; }
.jd-vid-pic img,
.jd-vid-play img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    border-radius: 0 !important;
    transition: transform .5s ease;
}
.jd-vid-mark {
    position: absolute;
    z-index: 1;
    inset-inline-start: 10px;
    bottom: 10px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--jd-gold);
    color: var(--jd-ink);
    box-shadow: 0 0 0 4px rgba(225, 174, 38, .25), 0 8px 18px -8px rgba(0, 0, 0, .7);
    transition: transform .2s ease;
}
.jd-vid-mark svg { width: 18px; height: 18px; }
.jd-vid-mark--big {
    inset: 0;
    margin: auto;
    width: 74px;
    height: 74px;
    box-shadow: 0 0 0 9px rgba(225, 174, 38, .24), 0 16px 34px -12px rgba(0, 0, 0, .75);
}
.jd-vid-mark--big svg { width: 34px; height: 34px; }
.jd-vid-play--short .jd-vid-mark--big { width: 54px; height: 54px; box-shadow: 0 0 0 6px rgba(225, 174, 38, .24); }
.jd-vid-play--short .jd-vid-mark--big svg { width: 24px; height: 24px; }
.jd-vid__len {
    position: absolute;
    z-index: 1;
    inset-inline-end: 10px;
    bottom: 10px;
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(6, 25, 34, .84);
    color: #fff;
    font: 700 12px/1 var(--jd-font-ui);
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

/* ---- facade -------------------------------------------------------------------- */
.jd-vid-play { border-radius: var(--jd-radius); background: var(--jd-ink); }
.jd-v2 .jd-vid-play__btn {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    background: var(--jd-ink) !important;
    box-shadow: none !important;
    cursor: pointer;
}
.jd-v2 .jd-vid-play__btn:focus-visible { outline: 3px solid var(--jd-gold); outline-offset: -6px; border-radius: inherit; }
.jd-vid-play__btn:hover .jd-vid-mark,
.jd-vid-card:hover .jd-vid-mark,
.jd-vid-row:hover .jd-vid-mark { transform: scale(1.07); }
.jd-vid-play iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.jd-vid-play.is-on .jd-vid-play__btn { visibility: hidden; }

/* ---- meta: desk kicker, time · channel ------------------------------------------ */
.jd-vid__desk {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: 700 12px/1 var(--jd-font-ui);
    color: var(--c, var(--jd-sea));
}
.jd-vid__desk::before { content: ''; width: 14px; height: 3px; border-radius: 2px; background: currentColor; }
.jd-vid__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin-top: auto;
    font: 500 12.5px/1.5 var(--jd-font-ui);
    color: var(--jd-muted);
}
.jd-vid__meta time::before {
    content: '';
    display: inline-block;
    width: 7px; height: 7px;
    margin-inline-end: 6px;
    border-radius: 50%;
    border: 2px solid var(--jd-gold);
    vertical-align: 1px;
}
.jd-vid__meta > span { position: relative; padding-inline-start: 12px; }
.jd-vid__meta > span::before {
    content: ''; position: absolute; inset-inline-start: 0; top: 50%;
    width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: var(--jd-line-2);
}

/* ---- clip card ------------------------------------------------------------------- */
.jd-vid-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--jd-card);
    border-radius: var(--jd-radius);
    box-shadow: var(--jd-shadow);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.jd-vid-card:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(10, 37, 51, .06), 0 18px 34px -18px rgba(10, 37, 51, .38); }
.jd-vid-card:hover .jd-vid-pic img, .jd-vid-row:hover .jd-vid-pic img { transform: scale(1.03); }
.jd-vid-card__body { display: flex; flex-direction: column; gap: 9px; flex: 1; padding: 14px 16px 16px; }
.jd-vid-card__t, .jd-vid-row__t, .jd-vid-short__t {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 !important;
    font: 700 16px/1.6 var(--jd-font-ui) !important;
    color: var(--jd-text) !important;
    letter-spacing: 0;
}
.jd-vid-card__t a, .jd-vid-row__t a { color: inherit !important; text-decoration: none; }
.jd-vid-card__t a::after, .jd-vid-row__t a::after { content: ''; position: absolute; inset: 0; z-index: 2; }
.jd-vid-card:hover .jd-vid-card__t, .jd-vid-row:hover .jd-vid-row__t { color: var(--jd-sea) !important; }

/* ---- compact rows ------------------------------------------------------------------ */
.jd-vid-rows { margin: 0 !important; padding: 0 !important; list-style: none; }
.jd-vid-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    margin: 0;
    padding: 12px 0;
    border-top: 1px dashed var(--jd-line-2);
}
.jd-vid-row:first-child { border-top: 0; }
.jd-vid-row .jd-vid-pic { border-radius: var(--jd-radius-sm); }
.jd-vid-row .jd-vid-mark { inset-inline-start: 6px; bottom: 6px; width: 28px; height: 28px; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .7); }
.jd-vid-row .jd-vid-mark svg { width: 14px; height: 14px; }
.jd-vid-row .jd-vid__len { inset-inline-end: 6px; bottom: 6px; padding: 4px 6px; font-size: 11px; }
.jd-vid-row__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* fixed text height (2 lines + one meta line): rows keep their height when the web font arrives */
.jd-vid-row__t { -webkit-line-clamp: 2; min-height: 3.2em; font-size: 14.5px !important; font-weight: 600 !important; }
.jd-vid-row .jd-vid__meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; font-size: 12px; }
.jd-vid-row .jd-vid__meta time { flex: none; }
.jd-vid-row .jd-vid__meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.jd-vid-all {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 2px 0 14px;
    font: 700 14px/1 var(--jd-font-ui);
    color: var(--jd-sea) !important;
    text-decoration: none;
}
.jd-vid-all:hover { color: var(--jd-gold-ink) !important; }
.jd-vid-railbox .jd-rail__h svg, .jd-vid-latest .jd-rail__h svg { flex: none; }

/* ---- Shorts ------------------------------------------------------------------------ */
.jd-vid-shorts {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 5 * 16px) / 6);
    gap: 16px;
    margin: 0 !important;
    padding: 2px 2px 12px !important;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--jd-line-2) transparent;
}
.jd-vid-short { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; scroll-snap-align: start; }
.jd-vid-short .jd-vid-play { box-shadow: var(--jd-shadow); }
.jd-vid-short__t { margin-top: 6px !important; font-size: 14px !important; }

/* ---- hub ---------------------------------------------------------------------------- */
.jd-vid-top { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.jd-vid-top--solo { grid-template-columns: minmax(0, 1fr); }
.jd-vid-lead { background: var(--jd-card); border-radius: var(--jd-radius); box-shadow: var(--jd-shadow); overflow: hidden; }
.jd-vid-lead .jd-vid-play { border-radius: 0; }
.jd-vid-lead__body { display: flex; flex-direction: column; gap: 11px; padding: 20px 24px 22px; }
.jd-vid-lead__t { margin: 0 !important; font: 800 clamp(21px, 2.2vw, 27px)/1.55 var(--jd-font-ui) !important; color: var(--jd-ink) !important; letter-spacing: 0; }
.jd-vid-lead__t a { color: inherit !important; text-decoration: none; }
.jd-vid-lead__t a:hover { color: var(--jd-sea) !important; }
.jd-vid-latest { padding-bottom: 6px; }
.jd-vid-sec { margin-top: 34px; scroll-margin-top: 90px; }
.jd-vid-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* ---- watch -------------------------------------------------------------------------- */
.jd-vid-watch .jd-art__crumbs + .jd-vid-play { margin-top: 18px; }
.jd-vid-watch .jd-art__avatar svg { width: 22px; height: 22px; }
.jd-vid-watch .jd-art__read svg { color: var(--jd-coral); }
.jd-vid-watch__desc {
    margin-top: 18px;
    padding: 16px 20px;
    border-radius: 14px;
    background: var(--jd-mist);
    font: 400 16.5px/1.95 var(--jd-font-read);
    color: #1a2831;
}
.jd-vid-watch__desc p { margin: 0 !important; white-space: pre-line; overflow-wrap: anywhere; }
.jd-vid-cov__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

/* ---- home band (navy, corniche wave edges) ---------------------------------------- */
.jd-vid-band {
    position: relative;
    margin-block: 10px;
    padding-block: 30px 36px;
    background: var(--jd-ink);
    color: #d5e6ea;
}
.jd-vid-band::after {
    content: '';
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(46%, 560px);
    background: var(--jd-lattice-gold) left center / 36px 36px;
    opacity: .1;
    -webkit-mask-image: linear-gradient(to right, #000 10%, transparent 100%);
    mask-image: linear-gradient(to right, #000 10%, transparent 100%);
    pointer-events: none;
}
.jd-vid-band__wave { position: absolute; inset-inline: 0; width: 100%; height: 12px; pointer-events: none; }
.jd-vid-band__wave path { fill: var(--jd-ink); }
.jd-vid-band__wave--t { top: -11px; transform: scaleY(-1); }
.jd-vid-band__wave--b { top: calc(100% - 1px); }
.jd-vid-band > .jd24-container { position: relative; z-index: 1; }
body.jd-v2 .jd-vid-band .jd24-section-header { border-bottom-color: rgba(255, 255, 255, .16); margin-bottom: 20px; }
body.jd-v2 .jd-vid-band .jd24-section-title { display: flex; align-items: center; gap: 10px; color: #fff !important; }
.jd-vid-band .jd24-section-title svg { flex: none; color: var(--jd-gold); }
body.jd-v2 .jd-vid-band .jd24-section-more { background: var(--jd-gold); color: var(--jd-ink) !important; box-shadow: none; }
body.jd-v2 .jd-vid-band .jd24-section-more:hover { background: #fff; color: var(--jd-ink) !important; }
.jd-vid-band__grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.jd-vid-band .jd-vid-card { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
.jd-vid-band .jd-vid-card:hover { transform: none; box-shadow: none; }
.jd-vid-band .jd-vid-card__body { padding: 16px 0 0; }
.jd-vid-card--play .jd-vid-card__body { position: relative; } /* the title link covers the text only, not the player */
.jd-vid-band .jd-vid-card__t { font-size: clamp(19px, 1.8vw, 24px) !important; font-weight: 800 !important; line-height: 1.55 !important; }
.jd-vid-band .jd-vid-card__t, .jd-vid-band .jd-vid-row__t { color: #fff !important; }
.jd-vid-band .jd-vid-card:hover .jd-vid-card__t, .jd-vid-band .jd-vid-row:hover .jd-vid-row__t { color: var(--jd-gold-2) !important; }
.jd-vid-band .jd-vid__desk { color: var(--jd-gold); }
.jd-vid-band .jd-vid__meta { color: #9fbac2; }
.jd-vid-band .jd-vid__meta > span::before { background: rgba(255, 255, 255, .3); }
.jd-vid-band .jd-vid-row { border-top-color: rgba(255, 255, 255, .14); }
.jd-vid-band .jd-vid-row:first-child { padding-top: 0; }

/* ---- article card (inside the text) ------------------------------------------------ */
.jd-v2 .jd-art__body .jd-vid-inart {
    margin: 1.7em 0 !important;
    border-radius: 18px;
    background: var(--jd-ink);
    box-shadow: var(--jd-shadow);
    overflow: hidden;
}
.jd-vid-inart__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font: 600 13px/1 var(--jd-font-ui);
    color: #a9c3cb;
}
.jd-vid-inart__k { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; color: var(--jd-gold); }
.jd-vid-inart__k + span { padding-inline-start: 12px; border-inline-start: 1px solid rgba(255, 255, 255, .18); }
.jd-vid-inart .jd-vid-play { border-radius: 0; }
.jd-v2 .jd-art__body .jd-vid-inart__cap { margin: 0; padding: 14px 18px 16px; text-align: start; font: inherit; }
.jd-vid-inart__t { display: block; font: 700 18px/1.6 var(--jd-font-ui); color: #fff; }
.jd-vid-inart .jd-vid__meta { margin-top: 8px; color: #9fbac2; }
.jd-vid-inart .jd-vid__meta > span::before { background: rgba(255, 255, 255, .3); }
.jd-v2 .jd-art__body a.jd-vid-inart__go {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-inline-start: auto;
    color: var(--jd-gold) !important;
    font-weight: 700;
    text-decoration: none;
}
.jd-v2 .jd-art__body a.jd-vid-inart__go:hover { color: #fff !important; }

/* ---- responsive ------------------------------------------------------------------- */
@media (max-width: 1023.98px) {
    .jd-vid-top, .jd-vid-band__grid { grid-template-columns: minmax(0, 1fr); }
    /* desk rails scroll sideways (no orphan card under a short row) */
    .jd-vid-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 38%;
        gap: 16px;
        padding: 2px 2px 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .jd-vid-grid > * { scroll-snap-align: start; }
    .jd-vid-shorts { grid-auto-columns: calc((100% - 3 * 16px) / 4); }
    .jd-vid-band .jd-vid-rows, .jd-vid-latest .jd-vid-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
    .jd-vid-band .jd-vid-row:nth-child(2), .jd-vid-latest .jd-vid-row:nth-child(2) { border-top: 0; }
    .jd-vid-band .jd-vid-row:nth-child(2) { padding-top: 0; }
}
@media (max-width: 719.98px) {
    .jd-vid-grid { grid-auto-columns: 76%; gap: 14px; }
    .jd-vid-shorts { grid-auto-columns: 44%; gap: 12px; }
    .jd-vid-grid, .jd-vid-shorts { margin-inline: -16px !important; padding-inline: 16px !important; scroll-padding-inline: 16px; }
    .jd-vid-lead__body { padding: 16px 18px 18px; }
    .jd-vid-sec { margin-top: 28px; }
    .jd-vid-cov__grid { grid-template-columns: minmax(0, 1fr); }
    .jd-vid-band .jd-vid-rows, .jd-vid-latest .jd-vid-rows { grid-template-columns: minmax(0, 1fr); }
    .jd-vid-latest .jd-vid-row:nth-child(2) { border-top: 1px dashed var(--jd-line-2); }
    .jd-vid-band .jd-vid-row:nth-child(2) { border-top: 1px dashed rgba(255, 255, 255, .14); padding-top: 12px; }
    .jd-vid-row { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
    .jd-vid-mark--big { width: 60px; height: 60px; }
    .jd-vid-mark--big svg { width: 28px; height: 28px; }
    .jd-vid-inart__t { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) {
    .jd-vid-pic img, .jd-vid-play img, .jd-vid-mark, .jd-vid-card { transition: none; }
    .jd-vid-card:hover, .jd-vid-card:hover .jd-vid-pic img, .jd-vid-row:hover .jd-vid-pic img { transform: none; }
}
