/*
 * Playlisturile video (inc/video-playlist.php): grila / caruselul de carduri.
 *
 * Trei formate de card:
 *   .mcv--tall - 9:16: desktop >= 1024px 4 coloane (8 pe pagina), tableta
 *                640-1023px 3 coloane, telefon <= 639px o coloana (4 pe pagina);
 *   .mcv--wide - 16:9: 2 coloane (4 pe pagina) pe desktop si tableta, o
 *                coloana pe telefon (4 pe pagina);
 *   .mcv--square - 1:1 (si 4:5, cu .mcv--portrait): 3 coloane (6 pe pagina) pe desktop si tableta, o
 *                coloana pe telefon (4 pe pagina).
 *
 * Caruselul: 4 carduri pe desktop (3 pe tableta), 1 pe telefon; la 16:9 - 2 / 1;
 * la patrat - 3 (2 pe tableta) / 1. Navigarea: .mcv-nav--dots (‹ puncte ›,
 * centrate), .mcv-nav--hint (‹ Derulează pentru mai multe ›, centrat) sau
 * .mcv-nav--progress (bara de progres + sagetile la dreapta).
 *
 * Tema potriveste culorile prin variabile, de ex.:
 *   :root { --mcv-accent: var(--blue); --mcv-accent-dark: var(--dark-blue); }
 */

/* Valori implicite cu specificitate zero (:where), ca .mcv { --mcv-accent: ... }
   din tema sa castige oricare ar fi ordinea fisierelor CSS. */
:where(.mcv) {
	--mcv-accent: #1e88e5;
	--mcv-accent-dark: #0d47a1;
	--mcv-on-accent: #fff;
	--mcv-radius: 16px;
	--mcv-title-size: 15px;
}

.mcv {
	--mcv-gap: 20px;
	--mcv-cols: 4;

	max-width: var(--mcv-max);
	/* doar pe orizontala: marginile de sus / jos raman ale temei (ex. clase mb-60) */
	margin-right: auto;
	margin-left: auto;
}

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

/* ---------- Grila ---------- */

.mcv-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--mcv-gap);
}

.mcv--grid .mcv-card {
	flex: 0 0 calc((100% - (var(--mcv-cols) - 1) * var(--mcv-gap)) / var(--mcv-cols));
	min-width: 0;
}

/* Inainte de script: doar prima pagina (scriptul preia apoi). */
@media (min-width: 640px) {
	.mcv:not(.is-ready) .mcv-pre-lg {
		display: none;
	}
}

@media (max-width: 639px) {
	.mcv:not(.is-ready) .mcv-pre-sm {
		display: none;
	}
}

/* ---------- Card ---------- */

.mcv-card__stage {
	position: relative;
	aspect-ratio: 9 / 16;
	overflow: hidden;
	border-radius: var(--mcv-radius);
	background: #0b0d12;
	isolation: isolate;
}

.mcv-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .5s ease, filter .3s ease;
}

.mcv-card__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .35) 32%, rgba(0, 0, 0, 0) 55%);
	pointer-events: none;
	transition: opacity .3s ease;
}

.mcv-card__btn {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	cursor: pointer;
}

.mcv-card__btn:focus-visible {
	outline: 3px solid var(--mcv-accent);
	outline-offset: -3px;
	border-radius: var(--mcv-radius);
}

.mcv-card__play {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	padding-left: 3px;
	border-radius: 50%;
	background: var(--mcv-accent);
	color: var(--mcv-on-accent);
	box-shadow: 0 0 0 8px rgba(255, 255, 255, .22), 0 8px 24px rgba(0, 0, 0, .3);
	transition: transform .25s ease, background-color .25s ease, opacity .3s ease;
}

.mcv-card__title {
	position: absolute;
	right: 16px;
	bottom: 16px;
	left: 16px;
	z-index: 2;
	text-align: left; /* si in sectiunile centrate (text-center) */
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	color: #fff;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.3;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
	pointer-events: none;
	transition: opacity .3s ease;
}

@media (hover: hover) and (pointer: fine) {
	.mcv-card:hover .mcv-card__img {
		transform: scale(1.04);
	}

	.mcv-card:hover .mcv-card__play {
		transform: scale(1.08);
		background: var(--mcv-accent-dark);
	}
}

/* Playerul (previzualizare sau redare): formatul real al videoului, intreg in
   card, centrat - dimensiunile le pune scriptul. */
.mcv-card__player {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	max-width: none;
	border: 0;
	transform: translate(-50%, -50%);
}

/* Previzualizarea (hover, fara sunet): apare abia cand videoul ruleaza, ca sa
   nu se vada playerul gol. Click-ul trece prin ea, la butonul cardului. */
.mcv-card.is-preview .mcv-card__player {
	opacity: 0;
	pointer-events: none;
	transition: opacity .35s ease;
}

.mcv-card.is-preview-on .mcv-card__player {
	opacity: 1;
}

.mcv-card.is-preview-on .mcv-card__img {
	filter: blur(14px) brightness(.45);
}

.mcv-card.is-preview-on .mcv-card__play {
	opacity: 0;
}

/* Redarea, cu sunet: playerul primeste click-urile (controalele YouTube). */
.mcv-card.is-playing .mcv-card__player {
	z-index: 4;
}

.mcv-card.is-playing .mcv-card__img {
	filter: blur(14px) brightness(.35);
	transform: scale(1.1);
}

.mcv-card.is-playing .mcv-card__shade,
.mcv-card.is-playing .mcv-card__title,
.mcv-card.is-playing .mcv-card__btn {
	opacity: 0;
	visibility: hidden;
}

/* Acordul pentru cookie-uri cerut in card (MinCode Cookie Consent). */
.mcv-consent {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	background: rgba(11, 13, 18, .82);
}

.mcv-consent .mcc-embed {
	width: 100%;
	min-height: 0 !important;
	border-radius: 12px;
}

.mcv-consent .mcc-embed__notice {
	padding: 18px 14px;
}

/* ---------- Paginare ---------- */

.mcv-pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 32px;
}

.mcv-pages:empty {
	display: none;
}

.mcv-page,
.mcv-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 6px;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 50%;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.is-apple .mcv-more__btn {
	padding:14px 28px 10px
}

.mcv-page:hover,
.mcv-arrow:hover:not(:disabled) {
	border-color: var(--mcv-accent);
	color: var(--mcv-accent-dark);
}

.mcv-page.is-active {
	border-color: var(--mcv-accent);
	background: var(--mcv-accent);
	color: var(--mcv-on-accent);
	cursor: default;
}

.mcv-arrow:disabled {
	opacity: .35;
	cursor: default;
}

.mcv-gap {
	min-width: 20px;
	text-align: center;
	opacity: .6;
}

/* ---------- "Vezi mai multe" ---------- */

.mcv-more {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.mcv-more__btn {
	padding: 14px 28px;
	border: 0;
	border-radius: 999px;
	background: var(--mcv-accent);
	color: var(--mcv-on-accent);
	font: inherit;
	cursor: pointer;
	transition: background-color .2s ease;
}

.mcv-more__btn:hover {
	background: var(--mcv-accent-dark);
}

/* ---------- Carusel ---------- */

.mcv--carousel {
	--mcv-per-view: 4;
}

.mcv-viewport {
	overflow: hidden;
}

.mcv-track {
	display: flex;
	gap: var(--mcv-gap);
	transition: transform .45s ease;
	touch-action: pan-y;
}

.mcv--carousel .mcv-card {
	flex: 0 0 calc((100% - (var(--mcv-per-view) - 1) * var(--mcv-gap)) / var(--mcv-per-view));
	min-width: 0;
}

/* Mai putine videoclipuri decat incap: centrate, fara navigare. */
.mcv--carousel.is-static .mcv-track {
	justify-content: center;
}

.mcv--carousel.is-static .mcv-nav {
	display: none;
}

.mcv-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 28px;
}

.mcv-dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.mcv-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .2);
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}

.mcv-dot.is-active {
	background: var(--mcv-accent);
	transform: scale(1.25);
}

/* Pe telefon se vad cel mult 5 puncte; cele de la margine (mai urmeaza) sunt mai mici. */
.mcv-dot.is-edge {
	transform: scale(.6);
}

/* Navigare "hint": textul intre sageti, in locul punctelor. */
.mcv-hint {
	font-size: 18px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	color: rgba(0, 0, 0, .65);
}

/* Telefoane foarte inguste (sub 360px): textul ramane pe un rand intre sageti. */
@media (max-width: 359px) {
	.mcv-hint {
		font-size: 16px;
	}

	.mcv-nav--hint {
		gap: 10px;
	}
}

/* Navigare "progress": bara pe toata latimea, sagetile la dreapta. */
.mcv-nav--progress {
	justify-content: space-between;
	gap: 24px;
}

.mcv-progress {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	height: 4px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(0, 0, 0, .12);
}

.mcv-progress__bar {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 0;
	border-radius: inherit;
	background: var(--mcv-accent);
	transition: width .45s ease;
}

.mcv-arrows {
	display: flex;
	flex: none;
	gap: 8px;
}

/* ---------- Latimi ---------- */

@media (max-width: 1023px) {
	.mcv {
		--mcv-cols: 3;
		--mcv-gap: 16px;
	}

	.mcv--carousel {
		--mcv-per-view: 3;
	}
}

@media (max-width: 639px) {
	.mcv {
		--mcv-cols: 1;
	}

	.mcv--grid .mcv-list {
		max-width: 360px;
		margin: 0 auto;
	}

	.mcv--carousel {
		--mcv-per-view: 1;
		max-width: 360px;
	}

	.mcv-card__play {
		width: 64px;
		height: 64px;
	}

	.mcv-page,
	.mcv-arrow {
		min-width: 40px;
		height: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mcv-card__img,
	.mcv-track,
	.mcv-progress__bar {
		transition: none;
	}
}

/* ---------- Carduri 16:9 (liste cu videoclipuri orizontale) ---------- */

.mcv.mcv--wide {
	--mcv-cols: 2;
	--mcv-gap: 24px;
}

.mcv--wide .mcv-card__stage {
	aspect-ratio: 16 / 9;
}

.mcv--wide .mcv-card__play {
	width: 72px;
	height: 72px;
}

.mcv--wide .mcv-card__title {
	right: 24px;
	bottom: 20px;
	left: 24px;
}

.mcv--wide .mcv-card__shade {
	background: linear-gradient(to top, rgba(0, 0, 0, .8) 0%, rgba(0, 0, 0, .3) 30%, rgba(0, 0, 0, 0) 50%);
}

.mcv--wide.mcv--carousel {
	--mcv-per-view: 2;
}

@media (max-width: 1023px) {
	.mcv.mcv--wide {
		--mcv-cols: 2;
		--mcv-gap: 16px;
	}

	.mcv--wide.mcv--carousel {
		--mcv-per-view: 2;
	}
}

@media (max-width: 639px) {
	.mcv.mcv--wide {
		--mcv-cols: 1;
	}

	.mcv--wide.mcv--grid .mcv-list,
	.mcv--wide.mcv--carousel {
		max-width: none;
	}

	.mcv--wide.mcv--carousel {
		--mcv-per-view: 1;
	}

	.mcv--wide .mcv-card__play {
		width: 56px;
		height: 56px;
	}

	.mcv--wide .mcv-card__title {
		right: 16px;
		bottom: 14px;
		left: 16px;
	}
}

/* ---------- Carduri patrate (1:1) ---------- */

.mcv.mcv--square {
	--mcv-cols: 3;
	--mcv-gap: 24px;
}

.mcv--square .mcv-card__stage {
	aspect-ratio: 1 / 1;
}

/* 4:5 - ca patratul (aceeasi grila), doar putin mai inalt. */
.mcv--portrait .mcv-card__stage {
	aspect-ratio: 4 / 5;
}

.mcv--square .mcv-card__play {
	width: 68px;
	height: 68px;
}

.mcv--square .mcv-card__title {
	right: 20px;
	bottom: 18px;
	left: 20px;
}

.mcv--square.mcv--carousel {
	--mcv-per-view: 3;
}

@media (max-width: 1023px) {
	.mcv.mcv--square {
		--mcv-cols: 3;
		--mcv-gap: 16px;
	}

	.mcv--square.mcv--carousel {
		--mcv-per-view: 2;
	}
}

@media (max-width: 639px) {
	.mcv.mcv--square {
		--mcv-cols: 1;
	}

	.mcv--square.mcv--grid .mcv-list,
	.mcv--square.mcv--carousel {
		max-width: 420px;
		margin-right: auto;
		margin-left: auto;
	}

	.mcv--square.mcv--carousel {
		--mcv-per-view: 1;
	}

	.mcv--square .mcv-card__play {
		width: 60px;
		height: 60px;
	}

	.mcv--square .mcv-card__title {
		right: 16px;
		bottom: 14px;
		left: 16px;
	}
}
