/**
 * Bismika Allahuma: videos.css (3.0.1)
 *
 * The Videos section: the theatre band (hub lead and video pages), the
 * player, the sideways rows, video cards, the topic grid, the home page
 * row and the "Watch the video" panel on articles.
 *
 * Colours come from the scheme tokens in base.css. The band colour is set
 * in Theme Options, Videos, and reaches this file as --bm-theatre and
 * --bm-theatre-ink.
 *
 * Breakpoints: tablet below 1100px, mobile below 700px.
 *
 * @package Bismika_Allahuma
 * @since   3.0.1
 */

:root {
	--bm-theatre: var(--bm-navy);
	--bm-theatre-ink: #fff;
	--bm-card-w: 300px;
	--bm-short-w: 190px;
}

.bm-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1360px);
	margin-inline: auto;
	padding-inline: 24px;
}

.bismika-videos-main { padding-top: 0; }

/* Breadcrumb */
.bm-crumbs {
	margin: 0 0 16px;
	font: 600 13px/1.4 var(--bm-sans);
	letter-spacing: .02em;
	color: var(--bm-meta);
}
.bm-crumbs a { color: inherit; text-decoration: none; }
.bm-crumbs a:hover { text-decoration: underline; }
.bm-theatre .bm-crumbs { color: var(--bm-theatre-ink); opacity: .75; }
@supports (color: color-mix(in srgb, red 50%, blue)) {
	.bm-theatre .bm-crumbs { opacity: 1; color: color-mix(in srgb, var(--bm-theatre-ink) 72%, transparent); }
}

/* ------------------------------------------------------------------ */
/* Theatre band                                                        */
/* ------------------------------------------------------------------ */

.bm-theatre {
	background: var(--bm-theatre);
	color: var(--bm-theatre-ink);
	padding: 32px 0 40px;
}
.bm-theatre a { color: inherit; }
.bm-theatre h1,
.bm-theatre h2,
.bm-theatre h3,
.bm-theatre .bm-theatre__name a { color: var(--bm-theatre-ink); }

.bm-theatre__head { margin-bottom: 24px; max-width: 760px; }
.bm-theatre__kicker {
	margin: 0 0 6px;
	font: 700 12px/1.3 var(--bm-sans);
	letter-spacing: .14em;
	text-transform: uppercase;
	opacity: .75;
}
.bm-theatre__kicker a { text-decoration: none; }
.bm-theatre__title {
	margin: 0;
	font: 700 clamp(28px, 3.4vw, 44px)/1.12 var(--bm-sans);
	letter-spacing: -.01em;
	color: inherit;
}
.bm-theatre__intro,
.bm-theatre__summary {
	margin: 10px 0 0;
	font: 400 18px/1.55 var(--bm-serif);
	opacity: .88;
}
.bm-theatre__empty { margin: 0; font: 400 18px/1.5 var(--bm-serif); opacity: .8; }

.bm-theatre__stage { display: grid; gap: 28px; }
.bm-theatre__stage.has-next { grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); }
.bm-theatre__name { margin: 16px 0 0; font: 700 24px/1.25 var(--bm-sans); }
.bm-theatre__name a { text-decoration: none; }
.bm-theatre__name a:hover { text-decoration: underline; }

/* Video page */
.bm-theatre--single .bm-theatre__screen { max-width: 1080px; margin-inline: auto; }
.bm-theatre--single.is-portrait .bm-theatre__screen { max-width: 420px; }
.bm-theatre__info { max-width: 1080px; margin: 22px auto 0; }
.bm-theatre__meta { margin: 8px 0 0; font: 500 14px/1.4 var(--bm-sans); opacity: .78; }
.bm-theatre__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 20px 0 0; }
.bm-theatre__article { font: italic 400 16px/1.4 var(--bm-serif); opacity: .85; }

.bm-btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 999px;
	background: var(--bm-accent);
	color: #fff !important;
	font: 700 14px/1 var(--bm-sans);
	letter-spacing: .03em;
	text-decoration: none;
}
.bm-btn:hover { filter: brightness(1.08); }

/* Light band: the ink turns dark and the hairlines show. */
.bismika-videos--light .bm-theatre { border-bottom: 1px solid var(--bm-border); }

/* Up next */
.bm-upnext {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding-left: 24px;
	border-left: 1px solid rgba(255, 255, 255, .18);
	border-left: 1px solid color-mix(in srgb, var(--bm-theatre-ink) 18%, transparent);
}
.bm-upnext__label {
	margin: 0;
	font: 700 12px/1 var(--bm-sans);
	letter-spacing: .14em;
	text-transform: uppercase;
	opacity: .75;
}

/* ------------------------------------------------------------------ */
/* Player                                                              */
/* ------------------------------------------------------------------ */

.bm-player { position: relative; }
.bm-player__poster,
.bm-player iframe,
.bm-player video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--bm-r-card);
	background: #000;
}
.bm-player--portrait .bm-player__poster,
.bm-player--portrait iframe,
.bm-player--portrait video { aspect-ratio: 9 / 16; }

.bm-player__poster {
	position: relative;
	padding: 0;
	overflow: hidden;
	cursor: pointer;
}
.bm-player__poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease, opacity .3s ease;
}
.bm-player__poster:hover img { transform: scale(1.02); opacity: .9; }
.bm-player__play {
	position: absolute;
	inset: 50% auto auto 50%;
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	margin: -36px 0 0 -36px;
	border-radius: 50%;
	background: var(--bm-accent);
	color: #fff;
	box-shadow: 0 6px 22px rgba(0, 0, 0, .35);
	transition: transform .2s ease;
}
.bm-player__play svg { margin-left: 4px; }
.bm-player__poster:hover .bm-player__play,
.bm-player__poster:focus-visible .bm-player__play { transform: scale(1.08); }
.bm-player__len,
.bm-vcard__len,
.bm-vcard__parts {
	position: absolute;
	right: 10px;
	bottom: 10px;
	padding: 3px 7px;
	border-radius: 4px;
	background: rgba(0, 0, 0, .78);
	color: #fff;
	font: 600 12px/1.2 var(--bm-sans);
	font-variant-numeric: tabular-nums;
}
.bm-player__host {
	margin: 8px 0 0;
	font: 500 12px/1.4 var(--bm-sans);
	opacity: .7;
}
.bm-player.is-playing .bm-player__host { display: none; }

/* ------------------------------------------------------------------ */
/* Video cards                                                         */
/* ------------------------------------------------------------------ */

.bm-vcard { position: relative; min-width: 0; }
.bm-vcard__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--bm-r-card);
	background: var(--bm-light);
}
.bm-vcard--portrait .bm-vcard__media { aspect-ratio: 9 / 16; }
.bm-vcard__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}
.bm-vcard:hover .bm-vcard__media img { transform: scale(1.04); }
.bm-vcard__play {
	position: absolute;
	left: 10px;
	bottom: 10px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .7);
	color: #fff;
}
.bm-vcard:hover .bm-vcard__play { background: var(--bm-accent); }
.bm-vcard__play svg { margin-left: 2px; }
.bm-vcard__parts { right: auto; left: 52px; }
.bm-vcard__len + .bm-vcard__parts { left: 52px; }

.bm-vcard__body { padding-top: 10px; }
.bm-vcard__topic {
	margin: 0 0 4px;
	font: 700 11px/1.2 var(--bm-sans);
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--bm-accent);
}
.bm-vcard__title {
	margin: 0;
	font: 700 16px/1.3 var(--bm-sans);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.bm-vcard__title a { color: var(--bm-ink); text-decoration: none; }
.bm-vcard__title a::after { content: ""; position: absolute; inset: 0; }
.bm-vcard__title a:hover { text-decoration: underline; }
.bm-vcard__meta { margin: 6px 0 0; font: 500 12px/1.4 var(--bm-sans); color: var(--bm-meta); }

/* List cards (Up next, article panel): poster beside the title. */
.bm-vcard--list { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 12px; align-items: start; }
.bm-vcard--list .bm-vcard__body { padding-top: 0; }
.bm-vcard--list .bm-vcard__title { font-size: 14px; }
.bm-vcard--list .bm-vcard__play { width: 26px; height: 26px; left: 6px; bottom: 6px; }
.bm-vcard--list .bm-vcard__play svg { width: 13px; height: 13px; }
.bm-vcard--list .bm-vcard__len { right: 6px; bottom: 6px; font-size: 11px; }
.bm-vcard--list .bm-vcard__parts { display: none; }
.bm-theatre .bm-vcard__title a { color: var(--bm-theatre-ink); }
.bm-theatre .bm-vcard__meta { color: inherit; opacity: .7; }

/* ------------------------------------------------------------------ */
/* Rows that scroll sideways                                           */
/* ------------------------------------------------------------------ */

.bm-rails { padding-block: 36px 16px; }
.bm-rails--after { padding-top: 8px; }
.bm-rail { margin-bottom: 40px; }
.bm-rail__head {
	display: flex;
	align-items: baseline;
	gap: 16px;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--bm-border);
}
.bm-rail__title {
	margin: 0;
	font: 700 20px/1.2 var(--bm-sans);
	letter-spacing: .01em;
	color: var(--bm-navy);
}
.bm-rail__more {
	font: 700 13px/1 var(--bm-sans);
	color: var(--bm-accent);
	text-decoration: none;
}
.bm-rail__more:hover { text-decoration: underline; }
.bm-rail__stage { position: relative; }
.bm-rail__nav { display: contents; }
.bm-rail__nav[hidden] { display: none; }
.bm-rail__btn {
	position: absolute;
	z-index: 2;
	top: calc(var(--bm-card-w) * 9 / 32 - 24px);
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--bm-navy);
	box-shadow: 0 6px 18px rgba(21, 39, 76, .28);
	cursor: pointer;
	transition: opacity .2s ease, transform .2s ease, background .2s ease, color .2s ease;
}
.bm-rail--portrait .bm-rail__btn { top: calc(var(--bm-short-w) * 16 / 18 - 24px); }
.bm-rail__btn--prev { left: -18px; }
.bm-rail__btn--next { right: -18px; }
.bm-rail__btn--next svg { transform: scaleX(-1); }
.bm-rail__btn:hover:not(:disabled),
.bm-rail__btn:focus-visible { background: var(--bm-accent); color: #fff; transform: scale(1.06); }
.bm-rail__btn:disabled { opacity: 0; pointer-events: none; }

.bm-rail__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: var(--bm-card-w);
	gap: 20px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 2px;
	padding-bottom: 10px;
	scrollbar-width: thin;
}
.bm-rail--portrait .bm-rail__track { grid-auto-columns: var(--bm-short-w); }
.bm-rail__track > * { scroll-snap-align: start; }
.bm-rail__track:focus-visible { outline-offset: 4px; }

/* Topic pages: a grid */
.bm-topic { padding-block: 28px 48px; }
.bm-topic .bismika-archive-head { margin-bottom: 28px; }
.bm-vgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 28px 22px;
}
.bm-pagination { margin-top: 36px; display: flex; justify-content: center; gap: 8px; font: 600 14px/1 var(--bm-sans); }
.bm-pagination .page-numbers { padding: 9px 13px; border-radius: 999px; color: var(--bm-navy); text-decoration: none; }
.bm-pagination .current { background: var(--bm-navy); color: #fff; }

/* Notes and transcript under a video */
.bm-video-notes { padding-block: 32px 8px; }
.bm-video-notes .bismika-prose:empty { display: none; }

/* Home page row */
.bismika-home-videos .bm-rail__head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; padding: 0; border: 0; }
.bismika-home-videos .bm-rail { margin-bottom: 0; }

/* "Watch the video" on an article */
.bm-watch {
	clear: both;
	margin: 32px 0 0;
	padding: 18px 20px;
	border: 1px solid var(--bm-border);
	border-left: 4px solid var(--bm-accent);
	border-radius: var(--bm-r-card);
	background: var(--bm-light);
	display: grid;
	gap: 14px;
}
.bm-watch__label {
	margin: 0;
	font: 700 12px/1 var(--bm-sans);
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--bm-navy);
}

/* ------------------------------------------------------------------ */
/* Overlay                                                             */
/* ------------------------------------------------------------------ */

.bm-lightbox {
	box-sizing: border-box;
	width: min(1180px, 100vw);
	max-width: none;
	max-height: 100vh;
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	overflow: visible;
}
.bm-lightbox[open] { display: block; }
.bm-lightbox:not([open]) { display: none; }
.bm-lightbox::backdrop { background: rgba(6, 10, 20, .88); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
/* Without showModal support the dialog draws its own backdrop. */
/* Browsers without showModal (Safari before 15.4): videos.js adds .is-fallback. */
.bm-lightbox.is-fallback[open] { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; width: 100vw; height: 100vh; background: rgba(6, 10, 20, .88); }
.bm-lightbox__inner { position: relative; padding: 52px 24px 24px; }
.bm-lightbox__screen iframe,
.bm-lightbox__screen video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: calc(100vh - 160px);
	border: 0;
	border-radius: var(--bm-r-card);
	background: #000;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.bm-lightbox.is-portrait { width: min(440px, 100vw); }
.bm-lightbox.is-portrait .bm-lightbox__screen iframe,
.bm-lightbox.is-portrait .bm-lightbox__screen video { aspect-ratio: 9 / 16; }
.bm-lightbox__close {
	position: absolute;
	top: 8px;
	right: 24px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
.bm-lightbox__close:hover { background: rgba(255, 255, 255, .12); }
.bm-lightbox__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 14px; }
.bm-lightbox__title { margin: 0; font: 700 18px/1.3 var(--bm-sans); }
.bm-lightbox__links { display: flex; align-items: center; gap: 16px; margin: 0; font: 600 14px/1 var(--bm-sans); }
.bm-lightbox__links a { color: #fff; }
[data-bm-video] { cursor: pointer; }

/* ------------------------------------------------------------------ */
/* Tablet and phone                                                    */
/* ------------------------------------------------------------------ */

@media (max-width: 1099px) {
	.bm-theatre__stage.has-next { grid-template-columns: 1fr; }
	.bm-upnext { padding-left: 0; padding-top: 20px; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .18); border-top: 1px solid color-mix(in srgb, var(--bm-theatre-ink) 18%, transparent); display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
	.bm-upnext__label { grid-column: 1 / -1; }
}

@media (max-width: 699px) {
	:root { --bm-card-w: 76vw; --bm-short-w: 42vw; }
	.bm-wrap { padding-inline: 16px; }
	.bm-theatre { padding: 20px 0 28px; }
	.bm-theatre--single .bm-wrap { padding-inline: 0; }
	.bm-theatre--single .bm-crumbs,
	.bm-theatre--single .bm-theatre__info { padding-inline: 16px; }
	.bm-theatre--single .bm-player__poster,
	.bm-theatre--single .bm-player iframe { border-radius: 0; }
	.bm-theatre--single .bm-player__host { padding-inline: 16px; }
	.bm-player__play { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
	.bm-rail__btn { display: none; }
	.bm-rail__track { gap: 14px; }
	.bm-vcard--list { grid-template-columns: 120px minmax(0, 1fr); }
	.bm-lightbox__inner { padding: 56px 0 16px; }
	.bm-lightbox__close { right: 12px; }
	.bm-lightbox__screen iframe,
	.bm-lightbox__screen video { border-radius: 0; }
	.bm-lightbox__bar { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.bm-player__poster img,
	.bm-vcard__media img,
	.bm-player__play { transition: none; }
	.bm-rail__track { scroll-behavior: auto; }
}

@media print {
	.bm-rail, .bm-upnext, .bm-player__play { display: none; }
	.bm-theatre { background: none; color: #000; }
}
