/* Scoped to the video library. Body rules only affect this page. */

body.reem-vl-page,
body.custom-background.reem-vl-page {
	background-color: #f8f4ee !important;
	background-image: none !important;
}

body.reem-vl-page .main-title-section-wrapper {
	display: none !important;
}

html.reem-vl-locked,
html.reem-vl-locked body {
	overflow: hidden;
}

.reem-video-library {
	--reem-vl-green: #344b43;
	--reem-vl-ink: #4f5e57;
	--reem-vl-rose: #9f4258;
	--reem-vl-clay: #c76b3d;
	--reem-vl-brown: #6e3b2e;
	--reem-vl-paper: #fffdfc;
	--reem-vl-line: #e1d8cc;
	--reem-vl-cream: #f8f4ee;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 3.25rem clamp(1rem, 2.4vw, 1.75rem) 4rem;
	background:
		radial-gradient(ellipse at 100% 0%, rgba(199, 107, 61, 0.08), transparent 42%),
		linear-gradient(180deg, #f7efe7 0%, var(--reem-vl-cream) 220px);
	color: var(--reem-vl-ink);
	font-family: Tajawal, "Noto Sans Arabic", Arial, sans-serif;
	direction: rtl;
	text-align: start;
}

.reem-video-library *,
.reem-video-library *::before,
.reem-video-library *::after,
.reem-vl__modal *,
.reem-vl__modal *::before,
.reem-vl__modal *::after {
	box-sizing: border-box;
}

.reem-vl__inner {
	width: min(1220px, 100%);
	margin-inline: auto;
}

.reem-vl__intro {
	margin: 0 auto 2.15rem;
	max-width: 40rem;
	text-align: center;
}

.reem-vl__kicker {
	margin: 0 0 0.7rem;
	color: var(--reem-vl-rose);
	font-size: 0.98rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.6;
}

.reem-vl__heading {
	margin: 0;
	color: var(--reem-vl-green);
	font-family: inherit;
	font-size: clamp(2rem, 1.45rem + 2vw, 3rem);
	font-weight: 700;
	line-height: 1.35;
}

.reem-vl__lead {
	margin: 0.9rem auto 0;
	max-width: 36rem;
	color: var(--reem-vl-ink);
	font-size: 1.05rem;
	font-weight: 400;
	line-height: 1.9;
}

.reem-vl__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.15rem;
	align-items: stretch;
}

.reem-vl__card {
	display: flex;
	min-width: 0;
	height: 100%;
	margin: 0;
	overflow: hidden;
	background: var(--reem-vl-paper);
	border: 1px solid var(--reem-vl-line);
	border-radius: 1.15rem;
	box-shadow: 0 12px 28px rgba(52, 75, 67, 0.07);
	transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.reem-video-library button.reem-vl__open {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: inherit;
	text-align: start;
	cursor: pointer;
	appearance: none;
	box-shadow: none;
}

.reem-vl__media {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #31443c;
}

.reem-video-library .reem-vl__thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.reem-vl__media.is-fallback .reem-vl__thumb {
	display: none;
}

.reem-vl__play {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 3.15rem;
	height: 3.15rem;
	margin: auto;
	border-radius: 50%;
	background: rgba(255, 253, 252, 0.95);
	color: var(--reem-vl-brown);
	box-shadow: 0 8px 22px rgba(36, 49, 44, 0.28);
	transition: transform 0.3s ease, background-color 0.3s ease;
}

.reem-vl__play svg {
	display: block;
	margin-inline-start: 2px;
}

.reem-vl__body {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 0.85rem 0.95rem 1rem;
}

.reem-vl__title {
	display: -webkit-box;
	overflow: hidden;
	min-height: calc(1.45em * 2);
	color: var(--reem-vl-green);
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.45;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.reem-vl__desc {
	display: -webkit-box;
	overflow: hidden;
	color: var(--reem-vl-ink);
	font-size: 0.92rem;
	font-weight: 400;
	line-height: 1.6;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

@media (hover: hover) {
	.reem-vl__card:hover {
		border-color: rgba(199, 107, 61, 0.45);
		box-shadow: 0 16px 34px rgba(52, 75, 67, 0.11);
		transform: translateY(-4px);
	}

	.reem-vl__open:hover .reem-vl__thumb {
		transform: scale(1.045);
	}

	.reem-vl__open:hover .reem-vl__play {
		transform: scale(1.06);
		background: #fff;
	}
}

.reem-vl__card:focus-within {
	outline: 3px solid var(--reem-vl-brown);
	outline-offset: 3px;
}

.reem-vl__open:focus {
	outline: none;
}

.reem-vl__status {
	min-height: 0;
	margin: 0.85rem 0 0;
	color: var(--reem-vl-ink);
	font-size: 0.95rem;
	text-align: center;
}

.reem-vl__status:empty {
	display: none;
}

.reem-vl__more {
	display: flex;
	align-items: center;
	justify-content: center;
	width: fit-content;
	min-width: 11.5rem;
	min-height: 3rem;
	margin: 1.75rem auto 0;
	padding: 0.75rem 1.5rem;
	border-radius: 0.85rem;
	background: var(--reem-vl-brown);
	color: #fffdfc;
	font-family: inherit;
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	box-shadow: 0 10px 24px rgba(110, 59, 46, 0.18);
	transition: background-color 0.25s ease, transform 0.25s ease;
}

.reem-vl__more:hover,
.reem-vl__more:focus {
	color: #fffdfc;
	text-decoration: none;
}

@media (hover: hover) {
	.reem-vl__more:hover {
		background: #572e24;
		transform: translateY(-1px);
	}
}

.reem-vl__more:focus {
	outline: none;
}

.reem-vl__more:focus-visible {
	outline: 3px solid var(--reem-vl-brown);
	outline-offset: 3px;
}

.reem-vl__more[aria-busy="true"] {
	opacity: 0.72;
	pointer-events: none;
}

.reem-vl__empty {
	margin: 0 auto;
	max-width: 34rem;
	padding: 2.2rem 1.4rem;
	border: 1px solid var(--reem-vl-line);
	border-radius: 1.15rem;
	background: var(--reem-vl-paper);
	box-shadow: 0 12px 28px rgba(52, 75, 67, 0.06);
	text-align: center;
}

.reem-vl__empty-title {
	margin: 0 0 0.45rem;
	color: var(--reem-vl-green);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.6;
}

.reem-vl__empty p:last-child {
	margin: 0;
	line-height: 1.85;
}

.reem-vl__modal[hidden] {
	display: none !important;
}

.reem-vl__modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(28, 40, 36, 0.72);
	direction: rtl;
}

.reem-vl__modal-dialog {
	display: flex;
	flex-direction: column;
	width: min(960px, 100%);
	max-height: calc(100dvh - 1.5rem);
	overflow: auto;
	padding: 0.85rem 0.9rem 0.9rem;
	border-radius: 1.15rem;
	background: var(--reem-vl-paper, #fffdfc);
	box-shadow: 0 24px 60px rgba(20, 28, 24, 0.28);
}

.reem-vl__modal-bar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.reem-vl__modal-title {
	margin: 0;
	color: var(--reem-vl-green, #344b43);
	font-family: Tajawal, "Noto Sans Arabic", Arial, sans-serif;
	font-size: 1.12rem;
	font-weight: 700;
	line-height: 1.55;
}

.reem-vl__modal button.reem-vl__modal-close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 1px solid var(--reem-vl-line, #e1d8cc);
	border-radius: 0.75rem;
	background: #fff;
	color: var(--reem-vl-green, #344b43);
	font-family: inherit;
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
}

.reem-vl__modal-close:hover {
	background: #f7efe7;
}

.reem-vl__modal-close:focus {
	outline: none;
}

.reem-vl__modal-close:focus-visible {
	outline: 3px solid var(--reem-vl-brown, #6e3b2e);
	outline-offset: 2px;
}

.reem-vl__modal-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 0.75rem;
	background: #1c2824;
}

.reem-vl__modal-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

@media (min-width: 768px) {
	.reem-vl__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.35rem;
	}
}

@media (min-width: 1100px) {
	.reem-vl__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1.5rem;
	}
}

@media (max-width: 767px) {
	.reem-video-library {
		padding-top: 2.4rem;
		padding-bottom: 3rem;
	}

	.reem-vl__intro {
		margin-bottom: 1.6rem;
	}

	.reem-vl__more {
		width: 100%;
	}

	.reem-vl__modal {
		padding: 0.75rem;
	}

	.reem-vl__modal-dialog {
		width: 100%;
		padding: 0.75rem;
		border-radius: 1rem;
	}
}

@media (max-height: 520px) {
	.reem-vl__modal-frame {
		height: min(56vw, calc(100dvh - 7.5rem));
		aspect-ratio: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.reem-vl__card,
	.reem-vl__thumb,
	.reem-vl__play,
	.reem-vl__more {
		transition: none;
	}

	.reem-vl__card:hover,
	.reem-vl__open:hover .reem-vl__thumb,
	.reem-vl__open:hover .reem-vl__play,
	.reem-vl__more:hover {
		transform: none;
	}
}
