/* ==========================================================================
   F2F YouTube TV — Widget Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared base
   -------------------------------------------------------------------------- */

.f2f-ytv-wrap {
	box-sizing: border-box;
}

.f2f-ytv-wrap *,
.f2f-ytv-wrap *::before,
.f2f-ytv-wrap *::after {
	box-sizing: inherit;
}

/* --------------------------------------------------------------------------
   Thumbnail wrapper + play overlay
   -------------------------------------------------------------------------- */

.f2f-ytv-thumb-wrap {
	position: relative;
	display: block;
	overflow: hidden;
	line-height: 0;
	/* Ensures border-radius clips the image correctly in all browsers including Safari */
	-webkit-mask-image: -webkit-radial-gradient(white, black);
	transform: translateZ(0);
}

.f2f-ytv-thumbnail {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.f2f-ytv-card:hover .f2f-ytv-thumbnail,
.f2f-ytv-single-wrapper:hover .f2f-ytv-thumbnail {
	transform: scale(1.03);
}

/* Play button — centered over thumbnail */
.f2f-ytv-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background-color: rgba(255, 0, 0, 0.85);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
	z-index: 2;
	padding: 0;
}

.f2f-ytv-play:hover {
	background-color: #ff0000;
	transform: translate(-50%, -50%) scale(1.1);
}

.f2f-ytv-play svg {
	width: 26px;
	height: 26px;
	fill: #ffffff;
	display: block;
	/* slight right offset for visual centering of the triangle */
	margin-left: 3px;
}

/* Inline iframe replacing the thumbnail */
.f2f-ytv-iframe-wrap {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9 */
}

.f2f-ytv-iframe-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* --------------------------------------------------------------------------
   Badge / channel label
   -------------------------------------------------------------------------- */

.f2f-ytv-badge {
	display: inline-block;
	padding: 3px 10px;
	background-color: #ff0000;
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	border-radius: 4px;
	line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Title & date
   -------------------------------------------------------------------------- */

.f2f-ytv-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.f2f-ytv-date {
	font-size: 13px;
	opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Channel icon (large / medium)
   -------------------------------------------------------------------------- */

.f2f-ytv-channel-icon {
	height: 28px;
	width: auto;
	object-fit: contain;
}

/* --------------------------------------------------------------------------
   Meta row (badge + icon / badge + date)
   -------------------------------------------------------------------------- */

.f2f-ytv-meta-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Autoplay background mode (large & medium)
   -------------------------------------------------------------------------- */

.f2f-ytv-has-autoplay {
	position: relative;
	overflow: hidden;
	width: 100%;
}

.f2f-ytv-medium .f2f-ytv-has-autoplay {
	height: 100%;
}

.f2f-ytv-large .f2f-ytv-has-autoplay {
	aspect-ratio: 16 / 9;
}

/* Background iframe fills the container */
.f2f-ytv-bg-wrap {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.f2f-ytv-bg-iframe {
	/*
	 * YouTube adds black bars when the container ratio doesn't exactly match 16:9.
	 * Slight scale removes them; pointer-events:none lets clicks pass to the overlay.
	 */
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	transform: translate(-50%, -50%) scale(1.02);
	border: 0;
	pointer-events: none;
}

/* Overlay covers the video area in both models */
.f2f-ytv-autoplay-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: flex-end;
}

/* Dark gradient overlay from bottom — medium only (large keeps info below) */
.f2f-ytv-medium .f2f-ytv-autoplay-overlay {
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.75) 0%,
		rgba(0, 0, 0, 0.2) 50%,
		transparent 100%
	);
}

/* Transparent overlay on large — just captures clicks */
.f2f-ytv-large .f2f-ytv-autoplay-overlay {
	background: transparent;
}

/* Info block pinned to bottom-left — medium autoplay only */
.f2f-ytv-medium .f2f-ytv-has-autoplay .f2f-ytv-single-info {
	padding: 20px 24px;
	flex: 1;
}

.f2f-ytv-medium .f2f-ytv-has-autoplay .f2f-ytv-title {
	color: #ffffff;
}

.f2f-ytv-medium .f2f-ytv-has-autoplay .f2f-ytv-date {
	color: rgba(255, 255, 255, 0.75);
}

/* Play button in autoplay mode — hidden; the whole wrapper is the click target */
.f2f-ytv-has-autoplay .f2f-ytv-play {
	display: none;
}

.f2f-ytv-has-autoplay {
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   Large model
   -------------------------------------------------------------------------- */

.f2f-ytv-large .f2f-ytv-single-wrapper {
	width: 100%;
}

.f2f-ytv-large .f2f-ytv-thumb-wrap {
	aspect-ratio: 16 / 9;
}

.f2f-ytv-large .f2f-ytv-single-info {
	padding: 16px 0;
}

/* In autoplay mode, info lives below the video — restore normal flow */
.f2f-ytv-large .f2f-ytv-has-autoplay + .f2f-ytv-single-info {
	padding: 16px 0;
}

.f2f-ytv-large .f2f-ytv-title {
	font-size: 20px;
}

/* --------------------------------------------------------------------------
   Medium model
   -------------------------------------------------------------------------- */

.f2f-ytv-medium .f2f-ytv-single-wrapper {
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
}

.f2f-ytv-medium .f2f-ytv-thumb-wrap {
	aspect-ratio: 16 / 9;
}

.f2f-ytv-medium .f2f-ytv-single-info {
	padding: 14px 0;
}

/* --------------------------------------------------------------------------
   Card (shared by grid + carousel)
   -------------------------------------------------------------------------- */

.f2f-ytv-card {
	display: flex;
	flex-direction: column;
}

.f2f-ytv-card .f2f-ytv-thumb-wrap {
	aspect-ratio: 16 / 9;
}

.f2f-ytv-card-info {
	padding: 10px 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.f2f-ytv-card-info .f2f-ytv-meta-top {
	margin-bottom: 4px;
}

.f2f-ytv-card-info .f2f-ytv-title {
	font-size: 14px;
}

/* --------------------------------------------------------------------------
   Grid model
   -------------------------------------------------------------------------- */

.f2f-ytv-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr); /* fallback; overridden by Elementor responsive selector */
	column-gap: 16px;
	row-gap: 24px;
}

/* Load More */
.f2f-ytv-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.f2f-ytv-load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 28px;
	background-color: #ff0000;
	color: #ffffff;
	border: 2px solid transparent;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.f2f-ytv-load-more:hover {
	background-color: #cc0000;
}

.f2f-ytv-load-more[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Carousel model
   -------------------------------------------------------------------------- */

.f2f-ytv-model-carousel .f2f-ytv-carousel {
	position: relative;
}

.f2f-ytv-model-carousel .swiper-slide {
	height: auto;
}

.f2f-ytv-model-carousel .f2f-ytv-card {
	height: 100%;
}

/* --------------------------------------------------------------------------
   Lightbox modal
   -------------------------------------------------------------------------- */

#f2f-ytv-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.88);
	z-index: 999999;
	align-items: center;
	justify-content: center;
}

#f2f-ytv-lightbox.is-open {
	display: flex;
}

.f2f-ytv-lightbox-inner {
	position: relative;
	width: 90vw;
	max-width: 960px;
}

.f2f-ytv-lightbox-ratio {
	position: relative;
	padding-top: 56.25%;
}

.f2f-ytv-lightbox-ratio iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.f2f-ytv-lightbox-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
}

.f2f-ytv-lightbox-close:hover {
	color: #cccccc;
}
