/*
 * ═══════════════════════════════════════════════════════════════
 *  COSMIC BUZZKILL — Homepage Styles (v2)
 *  Layout: full-width movie on top, 60%-width archive below
 *
 *  Add this to your Kadence Child Theme folder and enqueue via
 *  functions.php (see functions-snippet.php / INSTRUCTIONS.md)
 *
 *  ACCENT COLOR SWAPS — change these two lines only:
 *  --cb-accent-green : phosphor monitor glow
 *  --cb-accent-red   : tabloid danger red
 *  To switch the active accent, change --cb-accent below.
 * ═══════════════════════════════════════════════════════════════
 */

:root {
	--cb-accent-green : #39ff6e;   /* phosphor green — swap here */
	--cb-accent-red   : #e8003a;   /* tabloid red    — swap here */
	--cb-accent       : var(--cb-accent-green); /* ← active accent */

	--cb-bg           : #080808;
	--cb-bg-panel     : #0d0d0d;
	--cb-text         : #e4e0d5;
	--cb-text-dim     : #3e3e35;
	--cb-text-muted   : #5e5e52;
	--cb-rule         : #1e1e1e;

	--cb-font-display : 'Bebas Neue', 'Impact', 'Arial Narrow', sans-serif;
	--cb-font-body    : 'Special Elite', 'Courier New', monospace;

	/* Psychedelic frame palette — pulled from the archive artwork */
	--cb-psy-1        : #ff7a1a; /* warm orange   */
	--cb-psy-2        : #ffd23f; /* golden yellow */
	--cb-psy-3        : #ff3da6; /* hot pink      */
	--cb-psy-4        : #28c7ff; /* cyan          */
	--cb-psy-5        : #7a3cff; /* violet        */
}

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Special+Elite&display=swap');

.cb-main,
.cb-main * {
	box-sizing: border-box;
}

.cb-main {
	background: var(--cb-bg);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	padding: 0;
	margin: 0;
}

/* Kill Kadence's default content padding on this template */
.page-template-front-page .site-content,
.page-template-front-page .content-container,
.page-template-front-page .entry-content,
body.home .site-content,
body.home .content-container,
body.home .entry-content {
	padding: 0 !important;
	margin: 0 !important;
	max-width: none !important;
}

.page-template-front-page .site-main,
body.home .site-main {
	width: 100%;
	padding: 0 !important;
}

/* ══════════════════════════════════════════════════════════════
   TOP SECTION — Main movie, full width
   ══════════════════════════════════════════════════════════════ */
.cb-movie-section {
	position: relative;
	width: 100%;
	background: #000;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.cb-scanlines {
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(
		0deg,
		transparent,
		transparent 2px,
		rgba(0, 0, 0, 0.14) 2px,
		rgba(0, 0, 0, 0.14) 4px
	);
	pointer-events: none;
	z-index: 2;
}

.cb-movie-frame {
	position: relative;
	width: 75%;
	margin: 0 auto;
	padding-bottom: 56.25%; /* 16:9 — percentage is relative to this element's own (75%) width */
	height: 0;
	overflow: hidden;
	background: #000;
}

.cb-movie-iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
}

.cb-movie-caption {
	font-family: var(--cb-font-body);
	font-size: clamp(0.6rem, 1vw, 0.72rem);
	color: var(--cb-text-muted);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-align: center;
	margin: 0;
	padding: 0.6rem 1rem;
	background: var(--cb-bg);
	width: 100%;
}

/* Unmute button — floats over bottom-right of the video */
.cb-unmute-btn {
	position: absolute;
	bottom: 1rem;
	right: 1rem;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: rgba(8, 8, 8, 0.78);
	border: 1px solid var(--cb-text-dim);
	color: var(--cb-text);
	padding: 0.5rem 0.9rem;
	border-radius: 999px;
	cursor: pointer;
	font-family: var(--cb-font-body);
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	transition: border-color 0.2s, background 0.2s;
}

.cb-unmute-btn:hover {
	border-color: var(--cb-accent);
	background: rgba(8, 8, 8, 0.92);
}

.cb-unmute-btn:focus-visible {
	outline: 2px solid var(--cb-accent);
	outline-offset: 2px;
}

.cb-unmute-btn[aria-pressed="true"] .cb-icon-muted {
	display: none;
}

.cb-unmute-btn[aria-pressed="true"] .cb-icon-unmuted {
	display: block;
}

.cb-unmute-btn[aria-pressed="true"] .cb-unmute-label::after {
	content: "ed";
}

/* ══════════════════════════════════════════════════════════════
   BOTTOM SECTION — Archive, 60% width, psychedelic frame
   ══════════════════════════════════════════════════════════════ */
.cb-archive-section {
	width: 100%;
	display: flex;
	justify-content: center;
	padding: 2.5rem 1rem 3rem;
	background: var(--cb-bg);
}

.cb-archive-frame {
	width: 60%;
	max-width: 980px;
	position: relative;
	padding: 1.75rem;
	background: var(--cb-bg-panel);
	border-radius: 6px;

	/* Psychedelic gradient border */
	border: 3px solid transparent;
	background-image:
		linear-gradient(var(--cb-bg-panel), var(--cb-bg-panel)),
		conic-gradient(
			from 180deg,
			var(--cb-psy-1),
			var(--cb-psy-2),
			var(--cb-psy-3),
			var(--cb-psy-4),
			var(--cb-psy-5),
			var(--cb-psy-1)
		);
	background-origin: border-box;
	background-clip: padding-box, border-box;
	box-shadow: 0 0 28px -6px rgba(255, 122, 26, 0.35);
}

.cb-archive-heading {
	position: relative;
	z-index: 1;
	font-family: var(--cb-font-display);
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: center;
	margin: 0 0 1.25rem;
	color: var(--cb-psy-2); /* solid fallback color, always visible */
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
	.cb-archive-heading {
		background: linear-gradient(
			90deg,
			var(--cb-psy-2),
			var(--cb-psy-1),
			var(--cb-psy-3),
			var(--cb-psy-4)
		);
		-webkit-background-clip: text;
		background-clip: text;
		-webkit-text-fill-color: transparent;
		color: transparent;
	}
}

.cb-archive__video {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%; /* 16:9 */
	height: 0;
	overflow: hidden;
	background: #000;
	border: 1px solid var(--cb-rule);
	margin-bottom: 1.25rem;
}

.cb-archive__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
}

.cb-archive__row {
	display: flex;
	gap: 1.5rem;
	align-items: stretch;
}

.cb-archive__image {
	flex: 0 1 45%;
	min-width: 0;
	overflow: hidden;
	background: #050505;
	border: 1px solid var(--cb-rule);
	display: flex;
	align-items: center;
	justify-content: center;
}

.cb-archive__image img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
	display: block;
}

.cb-archive__text {
	flex: 1 1 55%;
	display: flex;
	align-items: center;
	min-width: 0;
}

.cb-archive__copy {
	font-family: var(--cb-font-body);
	font-size: clamp(0.85rem, 1.4vw, 1.05rem);
	color: var(--cb-text);
	line-height: 1.55;
	letter-spacing: 0.01em;
	margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
	.cb-archive-frame {
		width: 75%;
	}
}

/* Mobile landscape & portrait */
@media (max-width: 767px) {
	.cb-movie-frame {
		width: 100%; /* full width on small screens — 75% would be too cramped */
	}

	.cb-archive-section {
		padding: 1.75rem 1rem 2.5rem;
	}

	.cb-archive-frame {
		width: 100%;
		padding: 1.25rem;
	}

	.cb-archive__row {
		flex-direction: column;
		gap: 1rem;
	}

	.cb-archive__image {
		flex: none;
		width: 100%;
		height: auto;
	}

	.cb-archive__image img {
		height: auto;
	}

	.cb-unmute-btn {
		bottom: 0.6rem;
		right: 0.6rem;
		padding: 0.4rem 0.7rem;
		font-size: 0.6rem;
	}
}

/* Mobile portrait specifically — tighten further */
@media (max-width: 480px) {
	.cb-archive-heading {
		font-size: 1.5rem;
	}

	.cb-archive__copy {
		font-size: 0.85rem;
	}
}

/* Landscape phones — shorten the movie section slightly so the archive
   below isn't pushed too far down on short viewports */
@media (max-width: 900px) and (orientation: landscape) {
	.cb-movie-caption {
		padding: 0.4rem 1rem;
		font-size: 0.6rem;
	}

	.cb-archive-section {
		padding: 1.5rem 1rem 2rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cb-unmute-btn {
		transition: none;
	}
}
