/*
Theme Name: Immersion
Theme URI: https://immersionfilm.com
Author: Richard Levien
Description: A simple, fast, responsive theme for the film "Immersion". Dark, with the poster's texture and scatter letters as the page background. No page builder required.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: immersion
*/

:root {
	--ink: #eaf5fa;
	--muted: #9fc2d3;
	--rule: rgba(120, 200, 235, 0.25);
	--panel: rgba(0, 8, 16, 0.68);
	--page: #000203;           /* matches the bottom edge of the background art */
	--accent: #5ee7f7;
	--accent-strong: #b9f7ff;
	--on-accent: #00131c;
	--serif: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	/* The background art starts just below the white wall line of the poster:
	   scatter letters at the top, emerging out of the blue texture. */
	--art-w: min(100vw, 2200px);

	/* Overridden from Appearance > Customize > Immersion look */
	--fade: linear-gradient(to bottom, rgba(0,2,3,.55) 0, rgba(0,2,3,.42) 9%, rgba(0,2,3,.15) 22%, rgba(0,2,3,.3) 45%, rgba(0,2,3,.7) 75%, #000203 100%);
	--page-w: 96rem;
	--video-w: 62rem;
	--logo-w: 9rem;
	--still-w: 36rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--page); }

body {
	margin: 0;
	/* Always at least as tall as the background art, so the art fades fully to black instead of being cut off on short pages */
	min-height: max(100vh, calc(var(--art-w) * 0.875));
	display: flex;
	flex-direction: column;
	background-color: var(--page);
	background-image: var(--fade), url("assets/bg-wide.jpg");
	background-repeat: no-repeat, no-repeat;
	background-size: 100% calc(var(--art-w) * 0.875), var(--art-w) auto;
	background-position: center top, center top;
	color: var(--ink);
	font-family: var(--serif);
	font-size: 1.125rem;
	line-height: 1.65;
}

@media (max-width: 700px) {
	body { background-image: var(--fade), url("assets/bg-phone.jpg"); background-size: 100% calc(var(--art-w) * 0.875), var(--art-w) auto; }
}

/* On screens wider than the art, fade its left and right edges into the page colour */
@media (min-width: 2201px) {
	body {
		background-image:
			var(--fade),
			linear-gradient(90deg, var(--page) 0, transparent 7%, transparent 93%, var(--page) 100%),
			url("assets/bg-wide.jpg");
		background-repeat: no-repeat, no-repeat, no-repeat;
		background-size: 100% calc(var(--art-w) * 0.875), var(--art-w) 100%, var(--art-w) auto;
		background-position: center top, center top, center top;
	}
}

img, video, iframe { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--accent);
	color: var(--on-accent);
	padding: 0.6rem 1rem;
	z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */

.site-header { position: relative; }

/* One bar across the top: small logo on the left, menu beside it */
.header-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0 1.5rem;
	padding: 0 clamp(0.75rem, 3vw, 2rem);
	background: rgba(0, 5, 10, 0.62);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	border-bottom: 1px solid var(--rule);
}

/* Logo (assets/immersion-logo.png, or the one set in Customize) or, until there is one, the site name as text */
.brand { flex: 0 0 auto; padding: 0.55rem 0; }
.brand a { display: inline-block; text-decoration: none; }
.brand img { display: block; width: var(--logo-w); max-width: 60vw; height: auto; }
.brand-text {
	display: block;
	font-size: 1.35rem;
	font-weight: 400;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	line-height: 1.1;
	color: #fff;
}

.nav-toggle {
	display: none;
	margin: 0 0 0 auto;
	padding: 0.5rem 1rem;
	background: transparent;
	border: 1px solid var(--accent);
	border-radius: 3px;
	font-family: var(--sans);
	font-size: 0.85rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
	cursor: pointer;
}

.site-nav { flex: 1 1 auto; }

.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0 1.15rem;
}

.site-nav a {
	display: block;
	padding: 1.05rem 0;
	font-family: var(--sans);
	font-size: 0.78rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ink);
	border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--accent); }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 1120px) {
	.nav-toggle { display: inline-block; }
	.site-nav { display: none; flex: 1 0 100%; }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; gap: 0; text-align: center; }
	.site-nav li { border-top: 1px solid var(--rule); }
	.site-nav a { padding: 0.85rem 0; border-bottom: 0; }
}

/* ---------- Content ---------- */

.site-main { padding: 2rem clamp(.75rem, 3vw, 2.5rem) 3.5rem; }

/* Content sits on a dark panel so text stays readable over the artwork */
.entry {
	max-width: var(--page-w);
	margin: 0 auto;
	padding: 1.75rem clamp(1.1rem, 4vw, 2.5rem) 1.25rem;
	background: var(--panel);
	border: 1px solid var(--rule);
	border-radius: 4px;
}
.entry--wide { max-width: var(--page-w); }

.entry-title {
	max-width: 56rem;
	margin: 0 auto 1.5rem;
	font-size: clamp(1.8rem, 5vw, 2.5rem);
	font-weight: 400;
	line-height: 1.2;
}
.entry-title a { color: var(--ink); text-decoration: none; }

.entry h2, .entry h3 { font-weight: 600; line-height: 1.3; }
.entry h2 { font-size: 1.5rem; margin: 2.2rem 0 0.8rem; }
.entry h3 { font-size: 1.2rem; margin: 1.8rem 0 0.6rem; }

.entry p { margin: 0 0 1.15rem; }
/* On the wide home page, keep text lines a readable length and centred under the video */
.entry.entry--wide > p,
.entry.entry--wide > .wp-block-heading { max-width: 46rem; margin-left: auto; margin-right: auto; }
.entry ul, .entry ol { padding-left: 1.6rem; margin: 0 0 1.4rem; }
.entry li { margin-bottom: 0.5rem; }
/* Full-width panel, but keep running text a readable width, centred in the panel */
.entry > p, .entry > ul, .entry > ol, .entry > blockquote, .entry > h2, .entry > h3, .entry > .wp-block-buttons { max-width: 56rem; margin-left: auto; margin-right: auto; }

.entry blockquote {
	margin: 1.8rem 0;
	padding: 0 0 0 1.25rem;
	border-left: 4px solid var(--accent);
	font-style: italic;
}
.entry blockquote p { margin-bottom: 0.4rem; }
.entry > blockquote { margin: 1.8rem auto; }
.entry cite { font-style: normal; font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }

.entry figure { margin: 1.5rem 0; }
.entry figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }

/* Video embeds: keep 16:9 even if the block-library CSS isn't loaded */
.wp-block-embed { margin: 0 0 2rem; }
.entry--wide .wp-block-embed { max-width: var(--video-w); margin-left: auto; margin-right: auto; }
.wp-block-embed__wrapper { position: relative; aspect-ratio: 16 / 9; background: #000; }
.wp-block-embed__wrapper::before { display: none !important; } /* core adds its own aspect padding; avoid doubling it */
.wp-block-embed__wrapper iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Buttons */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.2rem; }
.wp-block-button__link {
	display: inline-block;
	padding: 0.65em 1.2em;
	background: var(--accent);
	color: var(--on-accent);
	border: 2px solid var(--accent);
	border-radius: 3px;
	font-family: var(--sans);
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
}
.wp-block-button__link:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.is-style-outline .wp-block-button__link { background: transparent; color: var(--accent); }
.is-style-outline .wp-block-button__link:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Home page call-to-action cards */
.cta-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 1.25rem;
	margin: 2.5rem 0 1rem;
}
.cta-card {
	background: rgba(94, 231, 247, 0.06);
	border: 1px solid var(--rule);
	border-top: 4px solid var(--accent);
	padding: 1.25rem 1.4rem 0.4rem;
}
.cta-card h2 { margin: 0 0 0.6rem; font-size: 1.15rem; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--sans); }
.cta-card p { font-size: 1rem; }

/* Crew */
.crew-member { max-width: 64rem; margin-left: auto; margin-right: auto; display: flow-root; padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.crew-member:first-of-type { border-top: 0; padding-top: 0; }
.crew-member h2 { margin-top: 0; }
.crew-photo { float: right; width: 9rem; margin: 0.3rem 0 1rem 1.5rem !important; }
.crew-photo img { display: block; width: 100%; border-radius: 2px; }
@media (max-width: 520px) { .crew-photo { float: none; margin: 0 0 1rem !important; } }

/* ---------- Footer ---------- */

.site-footer {
	margin-top: auto; /* keeps the footer at the very bottom of short pages */
	width: 100%;
	padding: 1.75rem 1rem 2.5rem;
	text-align: center;
	font-family: var(--sans);
	font-size: 0.85rem;
	color: var(--muted);
}
.site-footer p { margin: 0.25rem auto; text-align: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* Film still, top left of each inner page's box, with the title and text beside it */
.entry-body { max-width: 70rem; margin: 0 auto; display: flow-root; } /* flow-root: the box always grows to contain the floated still */
.entry-body > * { max-width: none; }
.entry-body .entry-title { margin: 0 0 1.25rem; }
.entry-still { float: left; width: min(var(--still-w), 52%); margin: 0.35rem 2rem 1rem 0 !important; }
.entry-still img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--rule); border-radius: 2px; }
.entry-body ul, .entry-body ol, .entry-body blockquote, .entry-body .cta-grid { display: flow-root; }
@media (max-width: 600px) {
	.entry-still { float: none; width: 100%; margin: 0 0 1.25rem !important; }
}
