/* ==========================================================================
   Video Library — page template styles
   ========================================================================== */

.sowb-button{
  border-width: 1px !important;
}

.vl {
	--vl-accent: #5c1a4f;        /* Popup title + prev/next buttons */
	--vl-text: #1d1d1b;
	--vl-placeholder: #808080;   /* Grey thumbnail placeholder */
	--vl-modal-bg: #f6f6f6;
	--vl-gap-x: 0.75rem;
	--vl-gap-y: 1.75rem;

	max-width: 1140px;
	margin: 0 auto;
	padding: 2rem 1.25rem 4rem;
	color: var(--vl-text);
}

.vl [hidden] {
	display: none !important;
}

.vl .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;
}

.vl-intro {
	margin-bottom: 2rem;
}

/* --- Filter -------------------------------------------------------------- */

.vl-filter {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1.75rem;
}

.vl-filter__label {
	display: inline-flex;
	cursor: pointer;
}

.vl-filter__icon {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: #555;
	stroke-width: 1.75;
	stroke-linecap: round;
}

.vl-filter__icon circle {
	fill: #fff;
}

.vl-filter__select {
	appearance: none;
	-webkit-appearance: none;
	min-width: 200px;
	padding: 0.2rem 1.75rem 0.2rem 0.4rem;
	border: 1px solid #a9a9a9;
	border-radius: 0;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23666'/%3E%3C/svg%3E") no-repeat right 0.5rem center / 8px 5px;
	color: #555;
	font: inherit;
	font-size: 0.8rem;
	line-height: 1.5;
	cursor: pointer;
}

.vl-filter__select:focus-visible {
	outline: 2px solid var(--vl-accent);
	outline-offset: 2px;
}

.vl-filter__clear {
	padding: 0;
	border: 0;
	background: none;
	color: var(--vl-accent);
	font: inherit;
	font-size: 0.8rem;
	text-decoration: underline;
	cursor: pointer;
}

/* --- Sections ------------------------------------------------------------ */

.vl-section {
	margin-bottom: 3.5rem;
}

.vl-section__title {
	margin: 0 0 1.25rem;
	padding-bottom: 0.3rem;
	border-bottom: 3px solid var(--vl-term-color, var(--vl-placeholder));
	color: var(--vl-text);
	font-size: clamp(1.25rem, 2.2vw, 1.6rem);
	font-weight: 400;
	line-height: 1.3;
}

.vl-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--vl-gap-y) var(--vl-gap-x);
	margin: 0;
	padding: 0;
	list-style: none;
}

.vl-card {
	margin: 0;
	padding: 0;
}

.vl-card__btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.vl-card__thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--vl-placeholder);
}

.vl-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.vl-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 52px;
	height: 52px;
	transform: translate(-50%, -50%);
	fill: #fff;
	filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.25));
	transition: transform 0.2s ease;
}

.vl-card__btn:hover .vl-card__img,
.vl-card__btn:focus-visible .vl-card__img {
	transform: scale(1.04);
}

.vl-card__btn:hover .vl-card__play,
.vl-card__btn:focus-visible .vl-card__play {
	transform: translate(-50%, -50%) scale(1.12);
}

.vl-card__btn:focus-visible {
	outline: 2px solid var(--vl-accent);
	outline-offset: 3px;
}

.vl-card__title {
	display: block;
	padding: 0.85rem 0.7rem 0;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
}

.vl-empty {
	padding: 3rem 0;
	text-align: center;
}

/* --- Pills --------------------------------------------------------------- */

.vl-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
}

.vl-pill {
	display: inline-block;
	margin: 0;
	padding: 0.15rem 0.75rem;
	border-radius: 999px;
	background: var(--vl-pill-bg, var(--vl-placeholder));
	color: var(--vl-pill-fg, #fff);
	font-size: 0.7rem;
	line-height: 1.5;
	white-space: nowrap;
}

/* --- Popup --------------------------------------------------------------- */

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

.vl-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.vl-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.55);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
	animation: vl-fade 0.2s ease;
}

.vl-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 1000px;
	max-height: calc(100vh - 3rem);
	overflow-y: auto;
	padding: 2.25rem 1.25rem 1rem;
	background: var(--vl-modal-bg);
	box-shadow: 0 6px 30px rgba(0, 0, 0, 0.18);
	animation: vl-rise 0.25s ease;
}

.vl-modal__dialog:focus {
	outline: none;
}

.vl-modal__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.vl-modal__close svg {
	width: 16px;
	height: 16px;
	stroke: var(--vl-text);
	stroke-width: 2.5;
	stroke-linecap: round;
}

.vl-modal__body {
	display: grid;
	grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
	gap: 0.6rem;
	align-items: start;
}

.vl-modal__media {
	position: relative;
	aspect-ratio: 16 / 10;
	background: var(--vl-placeholder);
}

.vl-modal__player,
.vl-modal__player > *:not(script) {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
}

.vl-modal__player iframe,
.vl-modal__player video,
.vl-modal__player embed,
.vl-modal__player object {
	display: block;
	width: 100% !important;
	height: 100% !important;
	border: 0;
	background: #000;
}

.vl-modal__noembed {
	display: grid;
	place-items: center;
	color: #fff;
}

.vl-modal__title {
	margin: 0 0 0.4rem;
	color: var(--vl-accent);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.25;
}

.vl-modal__desc {
	font-size: 0.82rem;
	line-height: 1.45;
}

.vl-modal__desc p {
	margin: 0 0 0.75em;
}

.vl-modal__desc p:last-child {
	margin-bottom: 0;
}

.vl-modal__nav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1.5rem;
}

.vl-modal__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.35rem 0.8rem;
	border: 0;
	border-radius: 0;
	background: var(--vl-accent);
	color: #fff;
	font: inherit;
	font-size: 0.8rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.vl-modal__btn svg {
	width: 10px;
	height: 10px;
	fill: currentColor;
}

.vl-modal__btn:hover {
	opacity: 0.88;
}

.vl-modal__btn:focus-visible,
.vl-modal__close:focus-visible {
	outline: 2px solid var(--vl-accent);
	outline-offset: 2px;
}

.vl-modal__btn:disabled {
	visibility: hidden;
}

@keyframes vl-fade {
	from { opacity: 0; }
}

@keyframes vl-rise {
	from { opacity: 0; transform: translateY(12px); }
}

@media (prefers-reduced-motion: reduce) {
	.vl *,
	.vl *::before,
	.vl *::after {
		animation: none !important;
		transition: none !important;
	}
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
	.vl-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.vl-modal__body {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.vl-modal__media {
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 560px) {
	.vl {
		--vl-gap-x: 4px;
		--vl-gap-y: 1.1rem;
		padding: 1.5rem 1rem 3rem;
	}

	/* Filter: larger icon, dropdown fills the row */
	.vl-filter {
		gap: 0.6rem;
		margin-bottom: 1.75rem;
	}

	.vl-filter__icon {
		width: 22px;
		height: 22px;
	}

	.vl-filter__select {
		flex: 1;
		min-width: 0;
		padding: 0.3rem 2rem 0.3rem 0.4rem;
		background-position: right 0.6rem center;
		background-size: 11px 7px;
		font-size: 1rem;
	}

	.vl-filter__clear {
		flex-shrink: 0;
	}

	/* Sections */
	.vl-section {
		margin-bottom: 2.5rem;
	}

	.vl-section__title {
		margin-bottom: 1.25rem;
		padding-bottom: 0.25rem;
		font-size: 1.15rem;
	}

	/* Two-up grid with compact cards */
	.vl-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.vl-card__play {
		width: 26px;
		height: 26px;
	}

	.vl-card__title {
		padding: 0.5rem 0 0;
		font-size: 0.72rem;
		line-height: 1.3;
	}

	.vl-modal {
		padding: 0.75rem;
	}

	.vl-modal__dialog {
		max-height: calc(100vh - 1.5rem);
	}

	.vl-modal__btn {
		font-size: 0.72rem;
	}
}