/* ==========================================================================
   liadscher — videos template
   Loaded only on page-videos.php. Same tokens, same rhythm, same RTL-first
   rules as main.css; nothing here redefines a token.

   `.site` is the size container, so the cqi values below are read against the
   page width exactly like the rest of the site. The lightbox is the one place
   that stays viewport-relative — it is drawn in the top layer, over everything.
   ========================================================================== */

/* --------------------------------------------------------- page shell */

.videos {
	padding-inline: var(--pad-x);
	padding-block-end: clamp(20px, 2.4cqi, 34px);
}

.videos__head {
	padding-block: clamp(26px, 3.4cqi, 50px) clamp(6px, 1cqi, 12px);
}

.videos__title {
	font-weight: 700;
	font-size: clamp(40px, 5.6cqi, 84px);
	line-height: 1;
	letter-spacing: -.01em;
	color: var(--ink);
	text-wrap: pretty;
	unicode-bidi: plaintext;
	text-align: right;
}

.videos__intro {
	margin-top: clamp(14px, 1.8cqi, 22px);
	max-width: 62ch;
	font-size: clamp(16px, 1.35cqi, 18px);
	line-height: 1.7;
}

/* --------------------------------------------------------- playlist section */

.playlist {
	--vgap: clamp(16px, 2cqi, 32px);
	padding-top: clamp(28px, 3.4cqi, 46px);
}

.playlist + .playlist {
	margin-top: clamp(26px, 3.2cqi, 48px);
	border-top: 1px solid var(--hair);
}

/* Same head as the discography tiers — only the title carries more weight here,
   because a playlist name is content and not a section label. */
.playlist__head {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: clamp(18px, 2.4cqi, 30px);
}

.playlist__title {
	min-width: 0;
	font-weight: 700;
	font-size: clamp(20px, 2cqi, 30px);
	line-height: 1.2;
	color: var(--ink);
	text-wrap: pretty;
	unicode-bidi: plaintext;
	text-align: right;
}

.playlist__nav {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
}

.playlist__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--hair-3);
	background: var(--card);
	color: var(--muted);
	transition: border-color 200ms var(--ease), background-color 200ms var(--ease), color 200ms var(--ease), opacity 200ms var(--ease);
}

.playlist__arrow:hover {
	border-color: var(--accent);
	background: var(--accent-wash);
	color: var(--ink);
}

.playlist__arrow[disabled] {
	opacity: .35;
	cursor: default;
	border-color: var(--hair-2);
	background: transparent;
	color: var(--faint);
}

.playlist__arrow-icon {
	display: inline-flex;
	line-height: 1;
}

/* The house arrow points left, which reads as "forward" in RTL — the previous
   button is the same glyph mirrored. */
.playlist__arrow-icon--flip { transform: scaleX(-1); }

/* Nothing to press without JS: the rail still scrolls, the buttons would not. */
html:not(.has-js) .playlist__nav { display: none; }

/* --------------------------------------------------------- grid */

.vgrid {
	display: grid;
	grid-template-columns: repeat(var(--cols-d, 3), minmax(0, 1fr));
	gap: clamp(18px, 2.4cqi, 34px) var(--vgap);
}

/* A 9:16 card at full column width gets absurdly tall, so portrait art is capped
   and pinned to the start edge (the right, in RTL). */
.playlist--portrait .vgrid { justify-items: start; }
.playlist--portrait .vcard { width: 100%; max-width: 340px; }

/* --------------------------------------------------------- carousel */

.vcarousel { position: relative; }

.vrail {
	display: flex;
	gap: var(--vgap);
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding-block-end: 2px;
}

.vrail::-webkit-scrollbar { width: 0; height: 0; }

.vrail > .vcard {
	flex: 0 0 calc((100% - (var(--cols-d, 3) - 1) * var(--vgap)) / var(--cols-d, 3));
	/* In RTL the start edge is the right one, so the snap runs right to left. */
	scroll-snap-align: start;
}

/* Edge fades. Both are off until the JS says the rail can actually move that
   way; direction is physical on purpose — the site is RTL only. */
.vcarousel::before,
.vcarousel::after {
	content: "";
	position: absolute;
	inset-block: 0;
	width: clamp(24px, 3.4cqi, 56px);
	z-index: 2;
	opacity: 0;
	pointer-events: none;
	transition: opacity 220ms var(--ease);
}

.vcarousel::before {
	right: 0;
	background: linear-gradient(to left, var(--paper), rgba(247, 244, 239, 0));
}

.vcarousel::after {
	left: 0;
	background: linear-gradient(to right, var(--paper), rgba(247, 244, 239, 0));
}

.vcarousel.can-prev::before,
.vcarousel.can-next::after { opacity: 1; }

/* --------------------------------------------------------- clip card */

.vcard { display: block; }

.vcard__frame {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #E9E3DA;
	box-shadow: 0 0 0 1px var(--hair), 0 12px 30px -24px rgba(35, 33, 30, .5);
	transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}

.playlist--portrait .vcard__frame { aspect-ratio: 9 / 16; }

.vcard:hover .vcard__frame {
	transform: scale(1.02);
	box-shadow: 0 0 0 1px rgba(35, 33, 30, .2), 0 22px 44px -24px rgba(35, 33, 30, .55);
}

/*
 * hqdefault is a 4:3 frame with the clip boxed inside it: a 16:9 cover crop
 * takes off exactly the letterbox bars, and a 9:16 crop of the bigger file
 * lands exactly on a vertical clip's pillarboxed content.
 */
.vcard__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vcard__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(30, 28, 25, .28) 0%, rgba(30, 28, 25, .05) 46%, rgba(30, 28, 25, 0) 74%);
}

.vcard__play {
	position: absolute;
	top: 50%;
	inset-inline-start: 50%;
	transform: translate(50%, -50%);
	width: clamp(44px, 4.4cqi, 62px);
	height: clamp(44px, 4.4cqi, 62px);
	border-radius: 50%;
	background: rgba(251, 249, 245, .93);
	color: var(--ink);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 30px -12px rgba(30, 28, 25, .45);
	transition: transform 220ms var(--ease-2), background-color 220ms ease-out;
}

.vcard:hover .vcard__play {
	transform: translate(50%, -50%) scale(1.06);
	background: #fff;
}

.vcard__title {
	margin-top: 12px;
	font-weight: 600;
	font-size: clamp(15.5px, 1.3cqi, 17.5px);
	line-height: 1.4;
	color: var(--ink);
	text-wrap: pretty;
	unicode-bidi: plaintext;
	text-align: right;
}

/* --------------------------------------------------------- lightbox */

.vbox {
	display: none;
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: clamp(0px, 3vw, 40px);
	border: 0;
	background: transparent;
	overflow: hidden;
	overscroll-behavior: contain;
}

/* Only when open — the UA sheet's `display:none` for a closed dialog has to
   keep winning. */
.vbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.vbox::backdrop { background: rgba(24, 22, 20, .74); }

.vbox__panel {
	position: relative;
	width: min(1000px, 100%);
	max-height: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: none;
	background: var(--card);
	border: 1px solid var(--hair-3);
	box-shadow: 0 50px 110px -46px rgba(20, 18, 16, .7);
	animation: vboxIn 340ms var(--ease-2) both;
}

.vbox--portrait .vbox__panel { width: min(680px, 100%); }

.vbox__panel::-webkit-scrollbar { width: 0; height: 0; }

.vbox__bar {
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px clamp(12px, 1.6cqi, 20px);
	background: color-mix(in oklab, var(--card) 92%, transparent);
	border-bottom: 1px solid var(--hair-soft);
	backdrop-filter: blur(6px);
}

.vbox__nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.vbox__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--hair-3);
	background: var(--paper);
	color: var(--muted);
	transition: border-color 200ms var(--ease), background-color 200ms var(--ease), color 200ms var(--ease), opacity 200ms var(--ease);
}

.vbox__arrow:hover {
	border-color: var(--accent);
	background: var(--accent-wash);
	color: var(--ink);
}

.vbox__arrow[disabled] {
	opacity: .3;
	cursor: default;
	border-color: var(--hair-2);
	background: transparent;
}

.vbox__pos {
	font-size: 12px;
	line-height: 1;
	letter-spacing: .1em;
	color: var(--faint);
}

.vbox__close {
	margin-inline-start: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--hair-3);
	background: var(--paper);
	color: var(--muted);
	transition: border-color 200ms var(--ease), background-color 200ms var(--ease), color 200ms var(--ease);
}

.vbox__close:hover {
	border-color: var(--accent);
	background: var(--accent-wash);
	color: var(--ink);
}

.vbox__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #17150F;
	background-size: cover;
	background-position: 50% 50%;
}

/* A vertical clip is bound by height, not width, or it eats the whole panel. */
.vbox--portrait .vbox__player {
	aspect-ratio: 9 / 16;
	width: auto;
	max-width: min(100%, calc(62vh * 9 / 16));
	max-height: 62vh;
	margin-inline: auto;
}

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

.vbox__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: clamp(14px, 1.8cqi, 22px);
	padding: clamp(18px, 2.2cqi, 30px) clamp(16px, 2cqi, 34px) clamp(22px, 2.6cqi, 36px);
}

.vbox__title {
	font-weight: 700;
	font-size: clamp(20px, 2cqi, 28px);
	line-height: 1.25;
	color: var(--ink);
	text-wrap: pretty;
	unicode-bidi: plaintext;
	text-align: right;
}

.vbox__desc-wrap {
	align-self: stretch;
	max-width: 74ch;
}

.vbox__desc {
	font-size: clamp(14.5px, 1.2cqi, 16px);
	line-height: 1.75;
	color: var(--ink-4);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	unicode-bidi: plaintext;
	text-align: start;
}

.vbox__desc.is-clamped {
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.vbox__more {
	margin-top: 8px;
	padding-bottom: 3px;
	border-bottom: 1px solid color-mix(in oklab, var(--accent) 55%, #E4DED4);
	font-weight: 600;
	font-size: 14px;
	line-height: 1;
	color: var(--accent-ink);
	transition: border-color 200ms var(--ease), color 200ms var(--ease);
}

.vbox__more:hover {
	border-color: var(--accent);
	color: var(--ink);
}

/* --------------------------------------------------------- comments */

.vbox__comments {
	align-self: stretch;
	max-width: 74ch;
	padding-top: clamp(14px, 1.8cqi, 22px);
	border-top: 1px solid var(--hair-soft);
}

.vbox__comments-title {
	margin-bottom: clamp(12px, 1.6cqi, 18px);
	font-weight: 700;
	font-size: 12.5px;
	line-height: 1;
	letter-spacing: .18em;
	color: var(--muted);
}

.comments {
	display: flex;
	flex-direction: column;
	gap: clamp(14px, 1.6cqi, 20px);
}

.comment {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.comment__avatar {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--paper-2);
	box-shadow: 0 0 0 1px var(--hair-soft);
}

.comment__body {
	flex: 1 1 0;
	min-width: 0;
}

.comment__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
}

.comment__author {
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	color: var(--ink-2);
	unicode-bidi: plaintext;
}

.comment__date {
	font-size: 12px;
	line-height: 1.3;
	color: var(--faint);
}

.comment__text {
	margin-top: 5px;
	font-size: 15px;
	line-height: 1.65;
	color: var(--ink-4);
	/* The API sends <br> for breaks; pre-line keeps plain newlines honest too. */
	white-space: pre-line;
	overflow-wrap: anywhere;
	unicode-bidi: plaintext;
	text-align: start;
}

.comment__text a {
	text-decoration: underline;
	text-underline-offset: 3px;
	color: var(--accent-ink);
}

.comment__likes {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 6px;
	font-size: 12px;
	line-height: 1;
	color: var(--muted-2);
}

/* --------------------------------------------------------- lightbox cta */

.vbox__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 12px 20px;
	background: var(--accent);
	color: #fff;
	font-weight: 700;
	font-size: clamp(14.5px, 1.2cqi, 16.5px);
	line-height: 1;
	box-shadow: 0 12px 30px -16px color-mix(in oklab, var(--accent) 78%, transparent);
	transition: background-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.vbox__cta:hover {
	background: color-mix(in oklab, var(--accent) 84%, #1E1C19);
	color: #fff;
	box-shadow: 0 16px 36px -16px color-mix(in oklab, var(--accent) 78%, transparent);
}

/* --------------------------------------------------------- scroll lock */

html.has-vbox,
html.has-vbox body { overflow: hidden; }

/* --------------------------------------------------------- tablet */

@media (max-width: 1023px) {

	.vgrid { grid-template-columns: repeat(var(--cols-t, 2), minmax(0, 1fr)); }

	/* The column counts are a desktop hint; below that the rail peeks the next
	   card instead, which is the affordance that actually reads on touch. */
	.vrail > .vcard { flex-basis: calc((100% - var(--vgap)) / 2.2); }

	.vbox { padding: 0; }
	.vbox__panel { max-height: 100%; }
	.vbox--portrait .vbox__player { max-height: 56vh; max-width: min(100%, calc(56vh * 9 / 16)); }
}

/* --------------------------------------------------------- mobile */

@media (max-width: 767px) {

	.vgrid { grid-template-columns: repeat(var(--cols-m, 1), minmax(0, 1fr)); }

	.vrail > .vcard { flex-basis: 80%; }
	.playlist--portrait .vrail > .vcard { flex-basis: 62%; }

	.playlist__head { gap: 12px; }
	.playlist__arrow { width: 34px; height: 34px; }

	.vbox__body { gap: 16px; }
	.vbox__cta { align-self: stretch; justify-content: center; }
}

/* --------------------------------------------------------- motion */

@keyframes vboxIn {
	from { opacity: 0; transform: translateY(14px) scale(.99); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.vcard:hover .vcard__frame,
	.vcard:hover .vcard__play { transform: none; }

	.vcard:hover .vcard__play { transform: translate(50%, -50%); }

	.vrail { scroll-behavior: auto; }
}
