/**
 * YT Most Viewed
 *
 * Namerno neutralno: tipografija i boje se nasledjuju iz teme.
 * Za doterivanje pregazi varijable ispod u svom stylesheet-u.
 */

.ytmv-grid {
	--ytmv-columns: 4;
	--ytmv-gap: 1.5rem;
	--ytmv-radius: 6px;
	--ytmv-muted: rgba(0, 0, 0, 0.6);
	--ytmv-overlay: rgba(0, 0, 0, 0.75);

	display: grid;
	grid-template-columns: repeat(var(--ytmv-columns), minmax(0, 1fr));
	gap: var(--ytmv-gap);
	margin: 0 0 var(--ytmv-gap);
}

.ytmv-item {
	min-width: 0;
}

/* Dugme koje ne izgleda kao dugme teme. */
.ytmv-thumb {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	margin: 0 0 0.75rem;
	border: 0;
	background: none;
	border-radius: var(--ytmv-radius);
	overflow: hidden;
	cursor: pointer;
	line-height: 0;
	aspect-ratio: 16 / 9;
}

.ytmv-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.ytmv-thumb:hover img,
.ytmv-thumb:focus-visible img {
	transform: scale(1.04);
}

.ytmv-thumb:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Trougao za reprodukciju, bez slike. */
.ytmv-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 3.25rem;
	height: 2.25rem;
	transform: translate(-50%, -50%);
	background: var(--ytmv-overlay);
	border-radius: var(--ytmv-radius);
	transition: background 0.2s ease;
}

.ytmv-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-40%, -50%);
	border-style: solid;
	border-width: 0.5rem 0 0.5rem 0.85rem;
	border-color: transparent transparent transparent #fff;
}

.ytmv-thumb:hover .ytmv-play,
.ytmv-thumb:focus-visible .ytmv-play {
	background: #c00;
}

.ytmv-duration {
	position: absolute;
	right: 0.5rem;
	bottom: 0.5rem;
	padding: 0.15em 0.4em;
	background: var(--ytmv-overlay);
	color: #fff;
	font-size: 0.75rem;
	line-height: 1.4;
	border-radius: 3px;
	font-variant-numeric: tabular-nums;
}

.ytmv-title {
	margin: 0 0 0.35rem;
	font-size: 1rem;
	line-height: 1.35;
}

.ytmv-title a {
	text-decoration: none;
	color: inherit;
}

.ytmv-title a:hover,
.ytmv-title a:focus-visible {
	text-decoration: underline;
}

.ytmv-stats {
	margin: 0;
	font-size: 0.85rem;
	color: var(--ytmv-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.ytmv-stats span + span::before {
	content: "·";
	margin-right: 0.5rem;
}

/* Iframe zamenjuje sliku posle klika. */
.ytmv-player {
	position: relative;
	aspect-ratio: 16 / 9;
	margin: 0 0 0.75rem;
	border-radius: var(--ytmv-radius);
	overflow: hidden;
	background-color: #000;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

.ytmv-player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ytmv-notice {
	padding: 0.75rem 1rem;
	border-left: 3px solid #c00;
	background: rgba(204, 0, 0, 0.06);
	font-size: 0.9rem;
}

/* Ugradjeni prelomi. Elementor ih iskljucuje preko data atributa
   i sam upravlja brojem kolona po uredjaju. */
@media (max-width: 900px) {
	.ytmv-grid[data-ytmv-responsive="1"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.ytmv-grid[data-ytmv-responsive="1"] {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ytmv-thumb img,
	.ytmv-play {
		transition: none;
	}

	.ytmv-thumb:hover img,
	.ytmv-thumb:focus-visible img {
		transform: none;
	}
}

/* ---------------------------------------------------------------
 * Lightbox
 *
 * Doteruje se pregazivanjem varijabli na .ytmv-lightbox, npr:
 *
 * .ytmv-lightbox {
 *     --ytmv-lb-backdrop: rgba(10, 10, 30, 0.9);
 *     --ytmv-lb-bg: #101014;
 *     --ytmv-lb-radius: 0;
 *     --ytmv-lb-max: 1400px;
 * }
 * --------------------------------------------------------------- */

.ytmv-lb-open,
.ytmv-lb-open body {
	overflow: hidden;
}

.ytmv-lightbox {
	--ytmv-lb-backdrop: rgba(0, 0, 0, 0.88);
	--ytmv-lb-bg: #111;
	--ytmv-lb-fg: #fff;
	--ytmv-lb-muted: rgba(255, 255, 255, 0.65);
	--ytmv-lb-radius: 8px;
	--ytmv-lb-max: 1100px;
	--ytmv-lb-pad: 1.5rem;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Gornji razmak pravi mesto za dugme za zatvaranje iznad dijaloga. */
	padding: calc(var(--ytmv-lb-pad) + 3.4rem) var(--ytmv-lb-pad) var(--ytmv-lb-pad);
	overflow-y: auto;
	overscroll-behavior: contain;
	color: var(--ytmv-lb-fg);
}

.ytmv-lb-backdrop {
	position: absolute;
	inset: 0;
	background: var(--ytmv-lb-backdrop);
	animation: ytmv-fade 0.2s ease;
}

.ytmv-lb-dialog {
	position: relative;
	width: 100%;
	max-width: var(--ytmv-lb-max);
	background: var(--ytmv-lb-bg);
	border-radius: var(--ytmv-lb-radius);
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
	animation: ytmv-rise 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.ytmv-lb-frame {
	position: relative;
	aspect-ratio: 16 / 9;
	background-color: #000;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
	border-radius: var(--ytmv-lb-radius) var(--ytmv-lb-radius) 0 0;
	overflow: hidden;
}

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

.ytmv-lb-bar {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.9rem 1.1rem;
}

.ytmv-lb-info {
	min-width: 0;
	flex: 1;
}

.ytmv-lb-title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.3;
	color: var(--ytmv-lb-fg);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ytmv-lb-link {
	display: inline-block;
	margin-top: 0.2rem;
	font-size: 0.8rem;
	color: var(--ytmv-lb-muted);
	text-decoration: none;
}

.ytmv-lb-link:hover,
.ytmv-lb-link:focus-visible {
	color: var(--ytmv-lb-fg);
	text-decoration: underline;
}

.ytmv-lb-counter {
	flex: none;
	font-size: 0.8rem;
	color: var(--ytmv-lb-muted);
	font-variant-numeric: tabular-nums;
}

/* Dugmad: zatvaranje i navigacija.
 *
 * z-index je obavezan: dugmad su u DOM-u pre plejera, pa bi ih iframe
 * inace prekrio svuda gde se preklapaju. Zato je i dugme za zatvaranje
 * izmesteno iznad dijaloga, van povrsine videa. */
.ytmv-lb-close,
.ytmv-lb-nav {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.ytmv-lb-close:hover,
.ytmv-lb-nav:hover,
.ytmv-lb-close:focus-visible,
.ytmv-lb-nav:focus-visible {
	background: rgba(255, 255, 255, 0.3);
	border-color: rgba(255, 255, 255, 0.7);
}

.ytmv-lb-close:focus-visible,
.ytmv-lb-nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.ytmv-lb-close {
	top: -3.4rem;
	right: 0;
	width: 2.6rem;
	height: 2.6rem;
}

.ytmv-lb-close::before,
.ytmv-lb-close::after {
	content: "";
	position: absolute;
	width: 1.1rem;
	height: 2px;
	background: currentColor;
}

.ytmv-lb-close::before {
	transform: rotate(45deg);
}

.ytmv-lb-close::after {
	transform: rotate(-45deg);
}

.ytmv-lb-nav {
	top: calc(50% - 3rem);
	width: 2.8rem;
	height: 2.8rem;
}

.ytmv-lb-prev {
	left: -3.6rem;
}

.ytmv-lb-next {
	right: -3.6rem;
}

.ytmv-lb-nav::before {
	content: "";
	width: 0.7rem;
	height: 0.7rem;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.ytmv-lb-prev::before {
	transform: rotate(-135deg);
	margin-left: 0.25rem;
}

.ytmv-lb-next::before {
	transform: rotate(45deg);
	margin-right: 0.25rem;
}

/* Na uzim ekranima strelice nemaju mesta sa strane, pa idu ispod.
   Visina se racuna preko dvh, jer se na telefonima traka pretrazivaca
   uvlaci i izvlaci, a vh tada daje pogresnu visinu. */
@media (max-width: 900px) {
	.ytmv-lightbox {
		--ytmv-lb-pad: 0.75rem;
		align-items: flex-start;
		padding-bottom: calc(var(--ytmv-lb-pad) + 4rem);
	}

	.ytmv-lb-dialog {
		max-height: none;
	}

	.ytmv-lb-nav {
		top: auto;
		bottom: -3.6rem;
	}

	.ytmv-lb-prev {
		left: 0;
	}

	.ytmv-lb-next {
		right: 0;
	}

	.ytmv-lb-title {
		white-space: normal;
	}
}

@supports (height: 100dvh) {
	.ytmv-lightbox {
		height: 100dvh;
	}
}

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

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

@media (prefers-reduced-motion: reduce) {
	.ytmv-lb-backdrop,
	.ytmv-lb-dialog {
		animation: none;
	}
}

/* ---------------------------------------------------------------
 * Paginacija
 * --------------------------------------------------------------- */

/* Selektor je namerno specificniji od pukog .ytmv-item, da bi nadjacao
   teme koje deci mreze postavljaju sopstveni display. */
.ytmv-item[hidden] {
	display: none;
}

.ytmv-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 var(--ytmv-gap, 1.5rem);
}

.ytmv-pagination button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.7rem;
	border: 1px solid currentColor;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.9rem;
	line-height: 1;
	border-radius: var(--ytmv-radius, 6px);
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s ease, background 0.2s ease;
}

.ytmv-pagination button:hover,
.ytmv-pagination button:focus-visible {
	opacity: 1;
}

.ytmv-pagination button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ytmv-pagination button[aria-current="true"] {
	color: inherit;
	background: rgba(127, 127, 127, 0.25);
	border-color: currentColor;
	font-weight: 600;
}

.ytmv-pagination button:disabled {
	opacity: 0.25;
	cursor: default;
}

.ytmv-page-arrow::before {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.ytmv-page-prev::before {
	transform: rotate(-135deg);
	margin-left: 0.2rem;
}

.ytmv-page-next::before {
	transform: rotate(45deg);
	margin-right: 0.2rem;
}

.ytmv-page-status {
	font-size: 0.85rem;
	opacity: 0.7;
	font-variant-numeric: tabular-nums;
	padding: 0 0.4rem;
}

.ytmv-page-more {
	min-width: 10rem;
	height: 2.6rem;
}

.ytmv-page-more[hidden] {
	display: none;
}

.ytmv-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------
 * Podaci u lightboxu: kanal i pretplata
 * --------------------------------------------------------------- */

.ytmv-lb-meta {
	margin: 0.25rem 0 0;
	font-size: 0.85rem;
	color: var(--ytmv-lb-muted);
	font-variant-numeric: tabular-nums;
}

.ytmv-lb-meta[hidden] {
	display: none;
}

.ytmv-lb-link {
	margin-top: 0.35rem;
}

.ytmv-lb-side {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex: none;
}

.ytmv-lb-channel {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--ytmv-lb-fg);
	text-decoration: none;
	font-size: 0.9rem;
	white-space: nowrap;
}

.ytmv-lb-channel img {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	display: block;
}

.ytmv-lb-channel:hover span,
.ytmv-lb-channel:focus-visible span {
	text-decoration: underline;
}

.ytmv-lb-subscribe {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 1rem;
	background: var(--ytmv-lb-subscribe-bg, #c00);
	color: var(--ytmv-lb-subscribe-fg, #fff);
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	text-decoration: none;
	border-radius: 999px;
	white-space: nowrap;
	transition: filter 0.2s ease;
}

.ytmv-lb-subscribe:hover,
.ytmv-lb-subscribe:focus-visible {
	filter: brightness(1.15);
	color: var(--ytmv-lb-subscribe-fg, #fff);
}

.ytmv-lb-channel:focus-visible,
.ytmv-lb-subscribe:focus-visible {
	outline: 2px solid var(--ytmv-lb-fg);
	outline-offset: 2px;
}

@media (max-width: 700px) {
	.ytmv-lb-bar {
		flex-wrap: wrap;
		gap: 0.6rem;
	}

	.ytmv-lb-side {
		width: 100%;
		justify-content: space-between;
	}
}

/* ---------------------------------------------------------------
 * Rezerva za pretrazivace bez aspect-ratio
 *
 * aspect-ratio je najnovija osobina koju plugin koristi (Chrome 88,
 * Firefox 89). Bez nje okvir dobija visinu nula i video se ne vidi,
 * pa se ista srazmera postize starim postupkom preko padding-a.
 * --------------------------------------------------------------- */

@supports not (aspect-ratio: 16 / 9) {
	.ytmv-thumb,
	.ytmv-player,
	.ytmv-lb-frame {
		height: 0;
		padding-bottom: 56.25%;
	}

	.ytmv-thumb img,
	.ytmv-player iframe,
	.ytmv-lb-frame iframe {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
	}
}

/* ---------------------------------------------------------------
 * Dugme za pokretanje unutar lightboxa (uredjaji sa dodirom)
 * --------------------------------------------------------------- */

.ytmv-lb-start {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.25);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ytmv-lb-start:active {
	background: rgba(0, 0, 0, 0.4);
}

/* Dugme je krupnije nego na karticama, jer se ovde cilja prstom. */
.ytmv-lb-start .ytmv-play {
	position: static;
	transform: none;
	width: 4.5rem;
	height: 3.2rem;
	background: rgba(0, 0, 0, 0.75);
}

.ytmv-lb-start:active .ytmv-play {
	background: #c00;
}

.ytmv-lb-start .ytmv-play::after {
	border-width: 0.7rem 0 0.7rem 1.15rem;
}
