/*
Theme Name: GH Portfolio
Theme URI: https://gregghorvat.com
Author: Gregg Horvat
Description: Portfolio theme for websites, print, branding, and video work. Includes a Project post type, Discipline categories, About and Contact templates, and a built-in contact form.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: gh-portfolio
*/

:root {
	--paper: #f3f4f1;
	--ink: #1b1f2a;
	--muted: #5d6472;
	--rule: #d5d8dd;
	--accent: #c8006a; /* process magenta */
	--mark: #1b1f2a;
	--surface: #ffffff;

	--font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.3125rem;
	--step-2: 1.75rem;
	--step-3: clamp(2rem, 4vw, 2.75rem);
	--hero: clamp(2.1rem, 5.2vw, 4.4rem);

	--gutter: clamp(1.25rem, 4vw, 3rem);
	--max: 1320px;
	--measure: 66ch;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #15171c;
		--ink: #ecedef;
		--muted: #9aa1ae;
		--rule: #2c3039;
		--accent: #ff5aa8;
		--mark: #9aa1ae;
		--surface: #1d2027;
		color-scheme: dark;
	}
}

*, *::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);
	font-size: var(--step-0);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.6em; font-weight: 700; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0 0 1.1em; }

.screen-reader-text, .skip-link:not(:focus) {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 1rem; left: 1rem; z-index: 100; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.site-name { font-weight: 700; font-size: var(--step-1); text-decoration: none; letter-spacing: -0.01em; }
.site-nav ul { list-style: none; display: flex; gap: clamp(1rem, 3vw, 2.25rem); margin: 0; padding: 0; }
.site-nav a { text-decoration: none; font-weight: 500; }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav a[aria-current="page"] { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); color: inherit; font: inherit; padding: 0.4rem 0.8rem; border-radius: 4px; cursor: pointer; }

@media (max-width: 640px) {
	.nav-toggle { display: block; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 72px; background: var(--paper); border-bottom: 1px solid var(--rule); z-index: 20; }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; gap: 0; padding: 0.5rem var(--gutter) 1rem; }
	.site-nav a { display: block; padding: 0.6rem 0; }
	.site-header { position: relative; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(3.5rem, 10vw, 8rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { font-size: var(--hero); font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; max-width: 20ch; margin: 0; }
.hero h1 a { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; text-decoration-color: var(--rule); }
.hero h1 a:hover { color: var(--accent); text-decoration-color: currentColor; }
.hero-sub { margin-top: 1.75rem; color: var(--muted); font-size: var(--step-1); max-width: 46ch; }

/* ---------- Filter ---------- */
.work-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; padding: 1.25rem 0; border-top: 1px solid var(--ink); margin-bottom: 2.5rem; }
.work-head h2 { font-size: var(--step-1); margin: 0; }
.filter { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; }
.filter a { text-decoration: none; color: var(--muted); font-weight: 500; }
.filter a:hover { color: var(--ink); }
.filter a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.filter .count { font-size: var(--step--1); margin-left: 0.2em; }

/* ---------- Work grid + crop marks ---------- */
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(3rem, 6vw, 5rem) var(--gutter); padding-bottom: 5rem; }
.tile { grid-column: span 6; }
.work-grid:not(.is-filtered) .tile:nth-child(4n+1),
.work-grid:not(.is-filtered) .tile:nth-child(4n+4) { grid-column: span 7; }
.work-grid:not(.is-filtered) .tile:nth-child(4n+2),
.work-grid:not(.is-filtered) .tile:nth-child(4n+3) { grid-column: span 5; }
.tile[hidden] { display: none; }
@media (max-width: 760px) { .work-grid .tile, .work-grid:not(.is-filtered) .tile:nth-child(n) { grid-column: 1 / -1; } }

.tile a { text-decoration: none; display: block; }
.crop { position: relative; margin: 14px; }
.crop::before {
	content: ""; position: absolute; inset: -14px; pointer-events: none;
	--m: linear-gradient(var(--mark), var(--mark));
	background:
		var(--m) left 0 top 14px / 9px 1px no-repeat,
		var(--m) left 14px top 0 / 1px 9px no-repeat,
		var(--m) right 0 top 14px / 9px 1px no-repeat,
		var(--m) right 14px top 0 / 1px 9px no-repeat,
		var(--m) left 0 bottom 14px / 9px 1px no-repeat,
		var(--m) left 14px bottom 0 / 1px 9px no-repeat,
		var(--m) right 0 bottom 14px / 9px 1px no-repeat,
		var(--m) right 14px bottom 0 / 1px 9px no-repeat;
}
.crop img, .crop .ph { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--surface); }
.crop .ph { display: grid; place-items: center; color: var(--muted); font-size: var(--step--1); }
.tile a:hover .crop::before { --mark: var(--accent); }
.tile-cap { margin: 0.9rem 14px 0; }
.tile-cap h3 { font-size: var(--step-1); margin: 0 0 0.15rem; letter-spacing: -0.01em; }
.tile a:hover h3 { color: var(--accent); }
.tile-meta { color: var(--muted); font-size: var(--step--1); margin: 0; }
.tile-play { position: absolute; left: 0.75rem; bottom: 0.75rem; background: var(--ink); color: var(--paper); font-size: var(--step--1); font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 3px; }

.empty { padding: 3rem 0 6rem; color: var(--muted); max-width: var(--measure); }

/* ---------- Sections ---------- */
.band { border-top: 1px solid var(--rule); padding: clamp(3rem, 7vw, 5.5rem) 0; }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gutter); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.prose { max-width: var(--measure); }
.prose > * + h2, .prose > * + h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.muted { color: var(--muted); }

.btn { display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; padding: 0.85rem 1.4rem; border-radius: 4px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--accent); color: #fff; }

/* ---------- Page heads ---------- */
.page-head { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem); }
.page-head h1 { font-size: clamp(2.5rem, 6vw, 4.75rem); letter-spacing: -0.035em; margin: 0; max-width: 18ch; }
.page-head p { color: var(--muted); font-size: var(--step-1); margin: 1rem 0 0; max-width: 50ch; }

/* ---------- Single project ---------- */
.project-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem 2rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 1.1rem 0; margin: 0 0 3rem; }
.project-facts dt { color: var(--muted); font-size: var(--step--1); }
.project-facts dd { margin: 0.15rem 0 0; font-weight: 500; }
.project-media { margin-bottom: 3.5rem; }
.project-media .embed { position: relative; aspect-ratio: 16 / 9; background: #000; }
.project-media .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.project-body { display: grid; grid-template-columns: 4fr 8fr; gap: var(--gutter); padding-bottom: 4rem; }
@media (max-width: 860px) { .project-body { grid-template-columns: 1fr; } }
.project-body .entry > * { max-width: var(--measure); }
.project-body .entry > .alignwide, .project-body .entry > .alignfull,
.project-body .entry > .wp-block-gallery, .project-body .entry > .wp-block-image,
.project-body .entry > .wp-block-embed, .project-body .entry > .wp-block-video { max-width: none; }
.entry .wp-block-image, .entry .wp-block-gallery, .entry .wp-block-embed { margin: 2.5rem 0; }
.project-nav { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); padding: 1.5rem 0 4rem; }
.project-nav a { text-decoration: none; font-weight: 600; }
.project-nav span { display: block; color: var(--muted); font-weight: 400; font-size: var(--step--1); }

/* ---------- About ---------- */
.portrait { margin: 14px 14px 2rem; }
.portrait img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.cap-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.cap-list li { border-bottom: 1px solid var(--rule); }
.cap-list a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; text-decoration: none; font-weight: 500; }
.cap-list .count { color: var(--muted); font-weight: 400; }

/* ---------- Contact ---------- */
.form { display: grid; gap: 1.25rem; max-width: 640px; }
.form label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form .hint { font-weight: 400; color: var(--muted); }
.form input, .form select, .form textarea {
	width: 100%; font: inherit; color: var(--ink); background: var(--surface);
	border: 1px solid var(--rule); border-radius: 4px; padding: 0.75rem 0.85rem;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form textarea { min-height: 180px; resize: vertical; }
.form .hp { position: absolute; left: -9999px; }
.notice { padding: 1rem 1.2rem; border-left: 3px solid var(--accent); background: var(--surface); margin-bottom: 2rem; max-width: 640px; }
.contact-direct dl { margin: 0; }
.contact-direct dt { color: var(--muted); font-size: var(--step--1); margin-top: 1.25rem; }
.contact-direct dd { margin: 0.15rem 0 0; font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--ink); padding: 2.5rem 0 3rem; font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
