/* ==========================================================================
   OIB Video — modern click-to-load YouTube player (facade)
   ==========================================================================
   The visitor sees a crisp thumbnail with an animated play button; the real
   YouTube iframe is only injected on click (see assets/js/video.js). */

.oib-yt {
	--oib-yt-pt: 96px;
	--oib-yt-pb: 96px;

	position: relative;
	padding: var(--oib-yt-pt) 24px var(--oib-yt-pb);
	background: #ffffff;
	font-family: var(--oib-font, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	-webkit-font-smoothing: antialiased;
}

.oib-yt__inner {
	margin: 0 auto;
}

.oib-yt__inner--narrow { max-width: 900px; }
.oib-yt__inner--wide   { max-width: 1180px; }
.oib-yt__inner--full   { max-width: calc(100% - 32px); }

/* ==========================================================================
   Header
   ========================================================================== */

.oib-yt__header {
	margin: 0 0 40px;
}

.oib-yt__header--center {
	text-align: center;
	margin-left: auto;
	margin-right: auto;
	max-width: 680px;
}

.oib-yt__eyebrow {
	display: inline-block;
	padding: 7px 16px;
	margin: 0 0 18px;
	border-radius: 999px;
	background: var(--oib-primary, #7E5D74);
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.005em;
	line-height: 1.4;
}

.oib-yt__heading {
	margin: 0 0 16px;
	color: var(--oib-color-heading, #111111);
	font-family: var(--oib-font-heading, "Satoshi", "Inter", sans-serif);
	font-size: clamp(28px, 4vw, 46px);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -0.025em;
}

.oib-yt__desc {
	margin: 0;
	color: #475569;
	font-size: clamp(15px, 1.2vw, 17px);
	line-height: 1.7;
}

.oib-yt__header--center .oib-yt__desc {
	margin-left: auto;
	margin-right: auto;
}

/* ==========================================================================
   Player frame (responsive aspect-ratio box)
   ========================================================================== */

.oib-yt__frame {
	position: relative;
	width: 100%;
	border-radius: 24px;
	overflow: hidden;
	background: #0b0a10;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.06) inset,
		0 40px 80px -36px rgba(var(--oib-primary-rgb, 126, 93, 116), 0.45),
		0 18px 36px -24px rgba(15, 23, 42, 0.35);
}

/* Aspect-ratio via padding so it scales on every browser. */
.oib-yt__frame::before {
	content: "";
	display: block;
	padding-top: 56.25%; /* 16:9 default */
}

.oib-yt__frame--ratio-16-9::before { padding-top: 56.25%; }
.oib-yt__frame--ratio-4-3::before  { padding-top: 75%; }
.oib-yt__frame--ratio-21-9::before { padding-top: 42.857%; }
.oib-yt__frame--ratio-1-1::before  { padding-top: 100%; }
.oib-yt__frame--ratio-9-16::before { padding-top: 177.78%; }

/* The 9:16 (Shorts) player would be enormous full-bleed, so cap its width. */
.oib-yt__frame--ratio-9-16 {
	max-width: 420px;
	margin-left: auto;
	margin-right: auto;
}

.oib-yt__facade,
.oib-yt__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ==========================================================================
   Facade (clickable thumbnail + play button)
   ========================================================================== */

.oib-yt__facade {
	display: block;
	margin: 0;
	padding: 0;
	cursor: pointer;
	background: #0b0a10;
	overflow: hidden;
	-webkit-appearance: none;
	appearance: none;
}

.oib-yt__thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.oib-yt__overlay {
	position: absolute;
	inset: 0;
	background: rgba(31, 29, 44, 0.28);
	background-image: linear-gradient(
		180deg,
		rgba(15, 13, 24, 0.05) 0%,
		rgba(15, 13, 24, 0.45) 100%
	);
	transition: background 0.3s ease, opacity 0.3s ease;
}

/* ---- Play button ---- */
.oib-yt__play {
	--oib-yt-play-bg: var(--oib-primary, #7E5D74);

	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: clamp(64px, 9vw, 92px);
	height: clamp(64px, 9vw, 92px);
	border-radius: 50%;
	background: var(--oib-yt-play-bg);
	background-image: linear-gradient(
		145deg,
		rgba(255, 255, 255, 0.22) 0%,
		rgba(255, 255, 255, 0) 55%
	);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.35) inset,
		0 18px 40px -12px rgba(0, 0, 0, 0.55);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
	z-index: 2;
}

.oib-yt__play svg {
	position: relative;
	z-index: 1;
	margin-left: 4px; /* optically centre the triangle */
	fill: #ffffff;
	width: clamp(26px, 3.4vw, 34px);
	height: clamp(26px, 3.4vw, 34px);
}

/* Animated pulse ring */
.oib-yt__pulse {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(var(--oib-primary-rgb, 126, 93, 116), 0.55);
	animation: oib-yt-pulse 2.4s ease-out infinite;
}

@keyframes oib-yt-pulse {
	0%   { box-shadow: 0 0 0 0   rgba(var(--oib-primary-rgb, 126, 93, 116), 0.5); }
	70%  { box-shadow: 0 0 0 22px rgba(var(--oib-primary-rgb, 126, 93, 116), 0); }
	100% { box-shadow: 0 0 0 0   rgba(var(--oib-primary-rgb, 126, 93, 116), 0); }
}

/* ---- Corner badge ---- */
.oib-yt__badge {
	position: absolute;
	left: 16px;
	bottom: 16px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	padding: 7px 14px;
	border-radius: 999px;
	background: rgba(11, 10, 16, 0.55);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.01em;
}

/* ---- Hover / focus states ---- */
.oib-yt__facade:hover .oib-yt__thumb,
.oib-yt__facade:focus-visible .oib-yt__thumb {
	transform: scale(1.05);
}

.oib-yt__facade:hover .oib-yt__overlay,
.oib-yt__facade:focus-visible .oib-yt__overlay {
	background-color: rgba(31, 29, 44, 0.18);
}

.oib-yt__facade:hover .oib-yt__play,
.oib-yt__facade:focus-visible .oib-yt__play {
	transform: translate(-50%, -50%) scale(1.08);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.4) inset,
		0 24px 50px -12px rgba(0, 0, 0, 0.6);
}

.oib-yt__facade:focus-visible {
	outline: 3px solid rgba(var(--oib-primary-rgb, 126, 93, 116), 0.6);
	outline-offset: 3px;
}

/* While the iframe loads, hide the facade pieces gracefully. */
.oib-yt__frame.is-playing .oib-yt__facade {
	pointer-events: none;
}

/* Editor / empty-state hint */
.oib-yt--empty {
	padding: 48px 24px;
	text-align: center;
	color: #6b7280;
	background: #f4eef2;
	border: 1px dashed #c9b6c2;
	border-radius: 16px;
	font-family: var(--oib-font, "Inter", sans-serif);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.oib-yt__header {
		margin-bottom: 28px;
	}

	.oib-yt__frame {
		border-radius: 18px;
	}
}

@media (max-width: 480px) {
	.oib-yt {
		padding: clamp(56px, 14vw, 80px) 16px clamp(56px, 14vw, 80px);
	}

	.oib-yt__frame {
		border-radius: 16px;
	}

	.oib-yt__badge {
		left: 12px;
		bottom: 12px;
		padding: 6px 11px;
		font-size: 12px;
	}
}

/* ==========================================================================
   A11y / motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.oib-yt__thumb,
	.oib-yt__play,
	.oib-yt__overlay { transition: none !important; }
	.oib-yt__pulse { animation: none !important; }
	.oib-yt__facade:hover .oib-yt__thumb { transform: none; }
	.oib-yt__facade:hover .oib-yt__play  { transform: translate(-50%, -50%); }
}
