/* ==========================================================================
   Kreston video blocks — video cards + video playlist
   Palette: teal #43BBC7 · dark blue #243646 · blue #189cd8 · pale grey #f3f3f3
   ========================================================================== */

.kv-block {
	--kv-teal: #43bbc7;
	--kv-navy: #243646;
	--kv-blue: #189cd8;
	--kv-text: #243646;
	--kv-muted: #5b6b78;
	--kv-line: #d8d8d8;
	--kv-card: #ffffff;
	--kv-focus: #189cd8;
	color: var(--kv-text);
	container-type: inline-size;
}

/* Inside the report template's content column, a coloured background needs its own gutter */
.kv-block.has-pale-grey-background-color,
.kv-block.has-dark-blue-background-color {
	padding-left: 24px;
	padding-right: 24px;
	margin-bottom: 2rem;
}

.kv-block--dark {
	--kv-text: #ffffff;
	--kv-muted: #c9d3db;
	--kv-line: rgba(255, 255, 255, 0.2);
	--kv-card: rgba(255, 255, 255, 0.06);
	--kv-focus: #43bbc7;
}

.kv-inner { max-width: 100%; }

.kv-header { margin-bottom: 1.75rem; max-width: 46rem; }
.kv-heading { color: var(--kv-teal); margin: 0 0 0.75rem; }
.kv-block--dark .kv-heading { color: #ffffff; }
.kv-intro p:last-child { margin-bottom: 0; }

.kv-empty {
	padding: 1rem;
	border: 1px dashed #ea5b0b;
	color: #ea5b0b;
	list-style: none;
}

/* ---------- Poster facade (shared) ---------- */

.kv-poster {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--kv-navy);
	border-radius: 4px;
	color: inherit;
}

.kv-poster__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.kv-poster__img--blank {
	background: linear-gradient(135deg, var(--kv-navy), var(--kv-blue));
}

.kv-play {
	position: absolute;
	left: 50%;
	top: 50%;
	width: clamp(48px, 18%, 72px);
	transform: translate(-50%, -50%);
	transition: transform 0.2s ease;
	line-height: 0;
}

.kv-play svg { width: 100%; height: auto; }
.kv-play circle { fill: rgba(36, 54, 70, 0.85); transition: fill 0.2s ease; }
.kv-play path { fill: #ffffff; }

.kv-poster:hover .kv-poster__img,
.kv-poster:focus-visible .kv-poster__img { transform: scale(1.03); }
.kv-poster:hover .kv-play circle,
.kv-poster:focus-visible .kv-play circle { fill: var(--kv-teal); }
.kv-poster:hover .kv-play { transform: translate(-50%, -50%) scale(1.06); }

.kv-poster:focus-visible,
.kv-playlist__link:focus-visible,
.kv-modal__close:focus-visible {
	outline: 3px solid var(--kv-focus);
	outline-offset: 3px;
}

.kv-duration {
	position: absolute;
	right: 8px;
	bottom: 8px;
	padding: 2px 8px;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #ffffff;
	background: rgba(36, 54, 70, 0.85);
	border-radius: 2px;
}

/* Image items (no player) */
.kv-poster--image { background: var(--kv-line); }
.kv-poster--static:hover .kv-poster__img { transform: none; }

/* Player (after click) */
.kv-frame {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
}

.kv-frame__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

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

.kv-cards__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Column count is chosen in the block (kv-cards--cols-1/2/3); always 1 per row on narrow screens */
.kv-cards--cols-1 .kv-cards__grid { grid-template-columns: minmax(0, 1fr); }
.kv-cards--cols-1 .kv-card,
.kv-cards--cols-1 .kv-poster { width: 100%; }

@container (min-width: 480px) {
	.kv-cards--cols-2 .kv-cards__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (min-width: 640px) {
	.kv-cards--cols-3 .kv-cards__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.25rem; }
}

.kv-card {
	display: flex;
	flex-direction: column;
	margin: 0;
}

.kv-card__body { padding-top: 1rem; }

.kv-card__quote {
	margin: 0 0 0.75rem;
	padding: 0 0 0 0.875rem;
	border-left: 3px solid var(--kv-teal);
	font-size: 1.0625rem;
	line-height: 1.45;
}

.kv-card__quote p { margin: 0; }

.kv-card__name {
	margin: 0 0 0.25rem;
	font-size: 1.125rem;
	line-height: 1.3;
	color: var(--kv-text);
}

.kv-card__role {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	color: var(--kv-muted);
}

.kv-card__place { display: block; }

.kv-card__desc {
	margin: 0;
	font-size: 0.9375rem;
}

/* ---------- Playlist ---------- */

.kv-playlist__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	align-items: start;
}

/* Side-by-side only when the block itself has room (works in the 8-col report column or full width) */
@container (min-width: 820px) {
	.kv-playlist__layout { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 1.5rem; }
	.kv-playlist__list { max-height: var(--kv-list-max, 28rem); overflow-y: auto; }
}

.kv-playlist__stage { scroll-margin-top: 120px; } /* clear the sticky header when scrolled to */

.kv-playlist__now {
	margin: 0.75rem 0 0;
	font-size: 0.9375rem;
}

.kv-playlist__now-title { display: block; font-weight: 700; }
.kv-playlist__now-desc { display: block; color: var(--kv-muted); margin-top: 0.25rem; }
.kv-playlist__now-desc[hidden] { display: none; }

.kv-playlist__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--kv-line);
}

.kv-playlist__item { margin: 0; border-bottom: 1px solid var(--kv-line); }

.kv-playlist__link {
	display: grid;
	grid-template-columns: 2rem 1fr auto;
	gap: 0.75rem;
	align-items: baseline;
	padding: 0.75rem 0.5rem;
	color: var(--kv-text);
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.kv-playlist__link:hover,
.kv-playlist__link:focus-visible {
	background: rgba(67, 187, 199, 0.12);
	color: var(--kv-text);
	text-decoration: none;
}

.kv-playlist__num {
	font-weight: 700;
	color: var(--kv-teal);
	text-align: right;
}

.kv-playlist__title { line-height: 1.35; }

.kv-playlist__dur {
	font-size: 0.8125rem;
	color: var(--kv-muted);
	white-space: nowrap;
}

.kv-playlist__link[aria-current="true"] {
	background: rgba(67, 187, 199, 0.18);
	box-shadow: inset 3px 0 0 var(--kv-teal);
}

.kv-playlist__link[aria-current="true"] .kv-playlist__title { font-weight: 700; }

/* ---------- Modal ---------- */

.kv-modal {
	width: min(1100px, 94vw);
	max-width: none;
	max-height: none;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.kv-modal::backdrop { background: rgba(20, 30, 40, 0.88); }

.kv-modal__box { position: relative; }

.kv-modal__close {
	position: absolute;
	right: 0;
	bottom: calc(100% + 8px);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #ffffff;
	cursor: pointer;
}

.kv-modal__close svg { stroke: var(--kv-navy, #243646); stroke-width: 2.5; fill: none; }
.kv-modal__close:hover { background: #43bbc7; }

html.kv-modal-open { overflow: hidden; }

/* ---------- Utilities / editor ---------- */

.kv-block .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* In the block editor the preview is for layout only */
.block-editor-block-list__layout .kv-block a { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
	.kv-poster__img,
	.kv-play,
	.kv-play circle,
	.kv-playlist__link { transition: none; }
	.kv-poster:hover .kv-poster__img,
	.kv-poster:focus-visible .kv-poster__img { transform: none; }
}
