/*
Theme Name: Roan Buma
Theme URI: https://roanbuma.nl
Author: Roan Buma
Author URI: https://roanbuma.nl
Description: A custom personal portfolio theme for cinematographer Roan Buma — built around a single principle: the work should speak for itself. Homepage is a single reel. Everything else — grid, credits, stills, contact — recedes so the images and footage carry the page. Designed against Dieter Rams' ten principles of good design: useful, honest, unobtrusive, thorough, and as little design as possible.
Version: 1.12.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: roan-buma
*/

/* =========================================================
   0. Design tokens
   ========================================================= */
:root {
	--paper: #faf9f6;
	--paper-dim: #f1f0ea;
	--ink: #1c1b18;
	--ink-soft: #3a3833;
	--muted: #8a8780;
	--muted-light: #b7b4ac;
	--line: #e3e1d9;
	--line-strong: #cfccc2;

	--font-serif: 'EB Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Times New Roman', serif;
	--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

	--space-1: 0.5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: 2.5rem;
	--space-5: 4rem;
	--space-6: 6rem;

	--container: 1180px;
	--measure: 38em;

	--ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   1. Reset & base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, video, iframe { max-width: 100%; display: block; }

/* Images always keep their own aspect ratio at any rendered width.
   Without this, a browser falls back to the width/height *attributes*
   WordPress prints on the <img> tag (its intrinsic pixel size) as the
   effective CSS height once max-width shrinks the box — stretching
   anything that isn't already cropped to its display box (e.g. the
   `roan-wide` size, which is never hard-cropped) noticeably out of
   shape. video/iframe keep their own explicit sizing where it's set
   (e.g. .project-single__video iframe, .stills__stage img already
   overrides this too) so this is scoped to img alone. */
img { height: auto; }

a {
	color: inherit;
	text-decoration: none;
}

h1, h2, h3, h4 {
	font-family: var(--font-serif);
	font-weight: 500;
	line-height: 1.2;
	margin: 0 0 var(--space-2);
	color: var(--ink);
}

p { margin: 0 0 var(--space-2); }

ul { margin: 0; padding: 0; list-style: none; }

button {
	font-family: inherit;
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
}

::selection { background: var(--ink); color: var(--paper); }

/* Accessible focus — never removed, only refined */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 1.5px solid var(--ink);
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ink);
	color: var(--paper);
	padding: var(--space-1) var(--space-2);
	z-index: 1000;
	font-size: 0.8rem;
	letter-spacing: 0.04em;
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}

/* =========================================================
   2. Layout helpers
   ========================================================= */
.container {
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.measure { max-width: var(--measure); }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* =========================================================
   3. Site header
   ========================================================= */
.site-header {
	border-bottom: 1px solid var(--line);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-2) var(--space-4);
	padding-block: var(--space-3);
}

.site-branding {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
}

.site-title {
	font-family: var(--font-serif);
	font-size: 1.25rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink);
}

.site-title a { transition: color 150ms var(--ease); }
.site-title a:hover { color: var(--ink-soft); }

.site-description {
	font-family: var(--font-sans);
	font-size: 0.7rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
}

.primary-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
}

.primary-nav a {
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
	padding-bottom: 3px;
	border-bottom: 1px solid transparent;
	transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.primary-nav a:hover,
.primary-nav .current-menu-item a,
.primary-nav .current_page_item a {
	color: var(--ink);
	border-bottom-color: var(--ink);
}

/* =========================================================
   4. Site footer
   ========================================================= */
.site-footer {
	border-top: 1px solid var(--line);
	margin-top: var(--space-6);
}

.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	padding-block: var(--space-3);
	font-size: 0.78rem;
	color: var(--muted);
	letter-spacing: 0.02em;
}

.site-footer__byline span { color: var(--muted-light); margin-inline: 0.4em; }

.site-footer__social {
	display: flex;
	gap: var(--space-2);
}

.site-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	color: var(--muted);
	transition: color 150ms var(--ease), background-color 150ms var(--ease);
}

.site-footer__social a:hover {
	color: var(--ink);
	background: var(--paper-dim);
}

.site-footer__social svg { width: 15px; height: 15px; }

/* =========================================================
   5. Home — reel
   ========================================================= */
.reel {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: calc(100vh - 220px);
	padding-block: var(--space-5);
}

.reel__player {
	width: 100%;
	max-width: 980px;
	margin-inline: auto;
	aspect-ratio: 16 / 9;
	background: var(--ink);
	position: relative;
}

.reel__player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.reel__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: var(--space-1);
	color: var(--muted-light);
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	padding: var(--space-2);
}

.reel__caption {
	max-width: 980px;
	margin: var(--space-3) auto 0;
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--space-2);
	font-size: 0.78rem;
	color: var(--muted);
}

/* =========================================================
   6. Projects grid
   ========================================================= */
.projects-intro {
	padding-block: var(--space-4) var(--space-2);
	border-bottom: 1px solid var(--line);
}

.filter-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	padding-block: var(--space-3);
}

.filter-tabs button {
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
	padding-bottom: 3px;
	border-bottom: 1px solid transparent;
	transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.filter-tabs button:hover { color: var(--ink); }
.filter-tabs button[aria-pressed="true"] {
	color: var(--ink);
	border-bottom-color: var(--ink);
}

.project-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: var(--space-4) var(--space-3);
	padding-block: var(--space-4) var(--space-5);
}

.project-card[hidden] { display: none; }

.project-card__thumb {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--paper-dim);
	position: relative;
}

.project-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms var(--ease);
}

.project-card:hover .project-card__thumb img { transform: scale(1.015); }

.project-card__thumb--empty::after {
	content: '';
	position: absolute;
	inset: 0;
	border: 1px solid var(--line);
}

.project-card__meta {
	padding-top: var(--space-1);
	display: flex;
	justify-content: space-between;
	gap: var(--space-2);
}

.project-card__title {
	font-family: var(--font-serif);
	font-size: 1rem;
	color: var(--ink);
}

.project-card__cat {
	font-size: 0.68rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	white-space: nowrap;
	padding-top: 0.3em;
}

.empty-state {
	padding-block: var(--space-5);
	color: var(--muted);
	font-size: 0.9rem;
}

/* =========================================================
   7. Single project
   ========================================================= */
.project-single {
	padding-block: var(--space-4) var(--space-6);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
	gap: var(--space-5);
	align-items: start;
}

.project-single__media {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	min-width: 0;
}

.project-single__video {
	aspect-ratio: 16 / 9;
	background: var(--ink);
	position: relative;
}

.project-single__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.project-single__stills img { width: 100%; height: auto; }
.project-single__stills figure { margin: 0; }
.project-single__stills figcaption {
	font-size: 0.75rem;
	color: var(--muted);
	padding-top: var(--space-1);
}

.project-single__sidebar {
	position: sticky;
	top: var(--space-3);
}

.project-single__title {
	font-size: 1.5rem;
	margin-bottom: 0.2em;
}

.project-single__year {
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: var(--space-3);
}

.project-single__categories {
	display: flex;
	gap: 0.5em;
	flex-wrap: wrap;
	margin-bottom: var(--space-3);
}

.project-single__categories a {
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	border: 1px solid var(--line);
	padding: 0.25em 0.6em;
	transition: border-color 150ms var(--ease), color 150ms var(--ease);
}
.project-single__categories a:hover { color: var(--ink); border-color: var(--ink); }

/* Shared wrapper for the whole "who made this" block — production
   context, department-heads credits, and Cast. One border/heading
   divider for all three, and an owl selector (`> * + *`) that spaces
   out whichever parts are actually present, so a project missing the
   context line or the Cast section doesn't end up with an orphaned
   gap where it would have been. */
.project-credits {
	border-top: 1px solid var(--line);
	padding-top: var(--space-3);
}

.project-credits > * + * {
	margin-top: var(--space-3);
}

.project-credits__context {
	font-family: var(--font-serif);
	font-style: italic;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--ink-soft);
	margin: 0;
}

.credits-list {
	display: grid;
	grid-template-columns: minmax(90px, auto) 1fr;
	column-gap: var(--space-1);
	row-gap: 0.55em;
	align-items: baseline;
	font-size: 0.85rem;
}

.credits-list__role {
	color: var(--muted);
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.credits-list__name { color: var(--ink); }
.credits-list__name--full { grid-column: 1 / -1; }

/* Extra breathing room above a group's first row (Cast, Elsewhere) so
   it reads as its own group rather than running straight into the
   row above — applied to *both* cells of that row equally (see
   roan_buma_render_credit_group()) so they shift down together and
   stay aligned on the same baseline as each other; margin on only
   one of the two would break that. */
.credits-list__cell--group-start { margin-top: var(--space-2); }

/* A credits-list name can be a link (Elsewhere entries) — same
   understated underline-on-hover treatment as the Contact page's
   email link, not a bordered "pill" like the category tags. */
.credits-list__name a {
	color: inherit;
	border-bottom: 1px solid var(--line);
	transition: border-color 150ms var(--ease);
}
.credits-list__name a:hover { border-color: var(--ink); }

.project-single__gear {
	margin-top: var(--space-3);
	padding-top: var(--space-2);
	border-top: 1px solid var(--line);
	font-family: var(--font-serif);
	font-style: italic;
	font-size: 0.85rem;
	color: var(--ink-soft);
}

.project-single__description {
	font-size: 0.92rem;
	color: var(--ink-soft);
	margin-top: var(--space-3);
	padding-top: var(--space-3);
	border-top: 1px solid var(--line);
}

.back-link {
	display: inline-block;
	margin-bottom: var(--space-3);
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	transition: color 150ms var(--ease);
}
.back-link:hover { color: var(--ink); }

@media (max-width: 860px) {
	.project-single {
		grid-template-columns: 1fr;
	}
	.project-single__sidebar { position: static; }
}

/* =========================================================
   8. Stills lightbox
   ========================================================= */
.stills {
	padding-block: var(--space-4) var(--space-5);
}

.stills__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	position: relative;
}

.stills__stage img {
	max-height: 74vh;
	width: auto;
	max-width: 100%;
	margin-inline: auto;
	transition: opacity 200ms var(--ease);
}

.stills__nav-zone {
	position: absolute;
	top: 0; bottom: 0;
	width: 25%;
	display: flex;
	align-items: center;
	color: transparent;
}
.stills__nav-zone--prev { left: 0; justify-content: flex-start; }
.stills__nav-zone--next { right: 0; justify-content: flex-end; }
.stills__nav-zone:hover { color: var(--muted-light); }
.stills__nav-zone span {
	font-size: 1.6rem;
	padding: var(--space-2);
}

.stills__filmstrip {
	display: flex;
	gap: var(--space-1);
	overflow-x: auto;
	padding-block: var(--space-3);
	margin-top: var(--space-2);
	border-top: 1px solid var(--line);
	scrollbar-width: thin;
}

.stills__thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	opacity: 0.55;
	transition: opacity 150ms var(--ease), outline-color 150ms var(--ease);
	outline: 1px solid transparent;
	outline-offset: 2px;
}
.stills__thumb img { width: 100%; height: 100%; object-fit: cover; }
.stills__thumb:hover { opacity: 0.85; }
.stills__thumb[aria-current="true"] { opacity: 1; outline-color: var(--ink); }

.stills__counter {
	text-align: center;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	color: var(--muted);
	margin-top: var(--space-1);
}

/* =========================================================
   9. Generic page content (About / Contact)
   ========================================================= */
.page-content {
	padding-block: var(--space-5) var(--space-6);
}

.page-content__title {
	font-size: 2rem;
	margin-bottom: var(--space-3);
}

.page-content__body {
	max-width: var(--measure);
	font-size: 1rem;
	color: var(--ink-soft);
}

.page-content__body p { margin-bottom: 1.2em; }
.page-content__body a { text-decoration: underline; text-underline-offset: 2px; color: var(--ink); }
.page-content__body a:hover { color: var(--muted); }

.contact-block {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: var(--space-4);
	max-width: 640px;
	margin-top: var(--space-4);
}

.contact-block h2 {
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-family: var(--font-sans);
	color: var(--muted);
	margin-bottom: var(--space-2);
	font-weight: 500;
}

.contact-block dl { display: flex; flex-direction: column; gap: 0.5em; }
.contact-block dt { display: none; }
.contact-block dd { margin: 0; font-size: 0.95rem; }
.contact-block dd a { border-bottom: 1px solid var(--line); transition: border-color 150ms var(--ease); }
.contact-block dd a:hover { border-color: var(--ink); }

/* =========================================================
   10. 404
   ========================================================= */
.not-found {
	padding-block: var(--space-6);
	text-align: center;
}
.not-found h1 { font-size: 1.6rem; }
.not-found a { text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   11. Print
   ========================================================= */
@media print {
	.site-header, .site-footer, .filter-tabs, .stills__nav-zone { display: none; }
}
