/* In-page YouTube popup (lightbox) */
.ylc-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(2px);
}

.ylc-popup[hidden] {
	display: none !important;
}

.ylc-popup__dialog {
	position: relative;
	width: 100%;
	max-width: min(960px, 100vw - 32px);
	max-height: calc(100vh - 32px);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	outline: none;
}

.ylc-popup__frame-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.ylc-popup__frame-wrap iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: none;
}

.ylc-popup__topbar {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.ylc-popup__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 8px 12px;
	border: none;
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	transition: background 0.15s ease;
}

.ylc-popup__btn:hover {
	background: rgba(255, 255, 255, 0.22);
}

.ylc-popup__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.ylc-popup__btn--close {
	padding: 8px 16px;
}

.ylc-popup__btn[hidden] {
	display: none !important;
}

/*
 * Explicit grid columns (not plain flex — when Prev is display:none it's gone
 * from layout and Next would otherwise become item 1 and sit on the left).
 * Prev is always column 1; Next is always column 2 and justify-self:end.
 */
.ylc-popup__nav {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	column-gap: 12px;
	width: 100%;
	box-sizing: border-box;
	max-width: 100%;
	margin-top: 12px;
	min-height: 44px;
}

.ylc-popup__btn--prev {
	grid-column: 1;
	grid-row: 1;
	justify-self: start;
}

.ylc-popup__btn--next {
	grid-column: 2;
	grid-row: 1;
	justify-self: end;
	width: fit-content;
	max-width: 100%;
}

.ylc-popup__nav[hidden] {
	display: none !important;
}

body.ylc-popup-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.ylc-popup {
		padding: 8px;
	}

	.ylc-popup__frame-wrap {
		border-radius: 4px;
	}
}
