/* ==========================================================================
   "Watch" — the row of the school's own videos on the category and course
   pages (template-parts/videos/video-row.php, assets/js/video-row.js).
   Upright boxes like a phone video, a still picture with a play button, and
   a full-screen player when one is tapped.
   ========================================================================== */

.video-row-section { padding-top: 0; }

.video-row {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.video-row-item {
	--accent: var(--accent-sage);
	position: relative;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--color-primary-dark);
	box-shadow: var(--shadow-md);
	transition: transform 350ms ease, box-shadow 350ms ease;
}
.video-row-item--sage       { --accent: var(--accent-sage); }
.video-row-item--terracotta { --accent: var(--accent-terracotta); }
.video-row-item--ochre      { --accent: var(--accent-ochre); }
.video-row-item--dusk-blue  { --accent: var(--accent-dusk-blue); }
.video-row-item--mauve      { --accent: var(--accent-mauve); }
.video-row-item--olive      { --accent: var(--accent-olive); }

.video-row-item:hover,
.video-row-item:focus-within {
	transform: translateY(-6px);
	box-shadow: 0 0 0 3px var(--accent), 0 22px 40px rgba(43, 38, 32, 0.26);
}

.video-row-open {
	display: block;
	width: 100%;
	aspect-ratio: 9 / 16;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	cursor: pointer;
	position: relative;
}
.video-row-open img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 500ms ease;
}
.video-row-item:hover .video-row-open img { transform: scale(1.05); }

/* A soft dark edge so the white play button and words stay readable. */
.video-row-open::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.65) 100%);
}

.video-row-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 58px;
	height: 58px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--color-primary-dark);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
	transition: transform var(--transition), background var(--transition);
	z-index: 2;
}
.video-row-play svg { width: 26px; height: 26px; margin-left: 2px; }
.video-row-item:hover .video-row-play {
	transform: translate(-50%, -50%) scale(1.08);
	background: #fff;
}

.video-row-caption {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 14px;
	z-index: 2;
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.video-row-more { margin: 26px 0 0; text-align: center; }

/* ---- The full-screen player ---- */
.video-row-player {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	place-items: center;
	background: rgba(20, 17, 14, 0.94);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	padding: 20px;
}
.video-row-player.is-open { display: grid; }
.video-row-player video {
	max-width: min(460px, 92vw);
	max-height: 80vh;
	max-height: 80dvh;
	width: auto;
	border-radius: var(--radius-md);
	background: #000;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.video-row-player-title {
	color: #fff;
	text-align: center;
	margin: 16px 0 0;
	font-weight: 600;
}
.video-row-close,
.video-row-prev,
.video-row-next {
	position: absolute;
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	cursor: pointer;
	transition: background var(--transition);
}
.video-row-close:hover,
.video-row-prev:hover,
.video-row-next:hover { background: rgba(255, 255, 255, 0.3); }
.video-row-close { top: 20px; right: 20px; }
.video-row-prev  { top: 50%; left: 20px; margin-top: -24px; }
.video-row-next  { top: 50%; right: 20px; margin-top: -24px; }
.video-row-close svg,
.video-row-prev svg,
.video-row-next svg { width: 22px; height: 22px; }
html.video-row-lock { overflow: hidden; }

/* ---- Tablets and phones ---- */
@media (max-width: 1100px) {
	.video-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
	.video-row-play { width: 48px; height: 48px; }
	.video-row-play svg { width: 22px; height: 22px; }
	.video-row-caption { font-size: 0.82rem; left: 10px; right: 10px; bottom: 10px; }
}
@media (max-width: 640px) {
	.video-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.video-row-caption { font-size: 0.86rem; }
	.video-row-prev { top: auto; bottom: 22px; left: calc(50% - 62px); margin-top: 0; }
	.video-row-next { top: auto; bottom: 22px; right: calc(50% - 62px); margin-top: 0; }
	.video-row-player video { max-height: 70vh; max-height: 70dvh; }
	.video-row-player-title { margin-bottom: 70px; }
}
