/*
Theme Name: novemstudio
Description: Eenvoudig, typografisch portfolio-thema voor novemstudio. Projecten beheer je via "Projecten" in wp-admin.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: novemstudio
*/

/* ------------------------------------------------------------------
   Basis
------------------------------------------------------------------ */
:root {
	--ink: #0a0a0a;
	--muted: #6e6e6e;
	--line: #e4e4e4;
	--bg: #ffffff;
	--tile: #f2f2f0;
	--font: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--pad: clamp(20px, 4.5vw, 64px);
	--max: 1440px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--slide: cubic-bezier(.77, 0, .175, 1);
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

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

a {
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 4px;
}

[tabindex="-1"]:focus {
	outline: none;
}

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

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

.skip-link {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 100;
	padding: 10px 16px;
	background: var(--ink);
	color: #fff;
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

/* Onderstreping die bij hover/actief inloopt */
.site-nav__link,
.pager__link {
	text-decoration: none;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: background-size .4s var(--ease), color .4s var(--ease);
}

.site-nav__link:hover,
.site-nav__link[aria-current="true"],
.pager__link:hover {
	background-size: 100% 1px;
}

/* ------------------------------------------------------------------
   Header & footer
------------------------------------------------------------------ */
.site-header {
	position: relative;
	z-index: 20;
	background: var(--bg);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 80px;
}

.site-logo img {
	width: auto;
	height: 24px;
}

.site-nav {
	display: flex;
	gap: 28px;
	font-size: 15px;
}

.site-footer__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 56px;
	padding-block: 12px;
	border-top: 1px solid var(--line);
}

.site-footer__meta {
	margin: 0;
	color: var(--muted);
	font-size: 14px;
}

.pager {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.pager__link {
	color: var(--muted);
}

.pager__link[aria-current="true"] {
	color: var(--ink);
}

.pager__line {
	position: relative;
	width: 40px;
	height: 1px;
	overflow: hidden;
	background: var(--line);
}

.pager__line::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--ink);
	transform: scaleX(.5);
	transform-origin: left;
	transition: transform .9s var(--slide);
}

.is-projects .pager__line::after {
	transform: scaleX(1);
}

/* ------------------------------------------------------------------
   Voorpagina: schermvullend, geen verticale scroll
------------------------------------------------------------------ */
.is-front,
.is-front body {
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
}

body.home {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	height: 100vh;
	height: 100dvh;
}

body.home.admin-bar {
	height: calc(100vh - 32px);
	height: calc(100dvh - 32px);
}

@media (max-width: 782px) {
	body.home.admin-bar {
		height: calc(100vh - 46px);
		height: calc(100dvh - 46px);
	}
}

.home .site-main {
	position: relative;
	min-height: 0;
}

.stage {
	height: 100%;
	overflow: hidden;
	overflow: clip;
}

.track {
	display: flex;
	height: 100%;
	transition: transform 1s var(--slide);
}

.is-projects .track,
html:not(.js) .stage:has(#projecten:target) .track {
	transform: translateX(-100%);
}

.no-anim .track,
.no-anim .pager__line::after {
	transition: none;
}

.panel {
	flex: 0 0 100%;
	min-width: 0;
	height: 100%;
	overflow: hidden;
}

.panel__inner {
	height: 100%;
}

/* Intro-paneel */
.panel--intro .panel__inner {
	display: flex;
	align-items: center;
	padding-bottom: 4vh;
}

.hero__content h1 {
	max-width: 10.5em;
	margin: 0;
	font-size: clamp(2.5rem, min(1rem + 7.4vw, 17vh), 8.5rem);
	font-weight: 200;
	line-height: .96;
	letter-spacing: -.045em;
	animation: novem-rise 1s var(--ease) backwards;
}

.hero__content h1 strong,
.hero__content h1 b {
	font-weight: 700;
	letter-spacing: -.05em;
}

.panel--intro .hero__content > * {
	transition: opacity .8s var(--ease), transform 1s var(--slide);
}

.is-projects .panel--intro .hero__content > * {
	opacity: 0;
	transform: translateX(-6vw);
}

@keyframes novem-rise {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Projecten-paneel */
.panel--projects .panel__inner {
	container-type: size;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-block: clamp(12px, 4vh, 48px);
}

/*
 * Tegels zijn altijd 4:3. De breedte van het grid wordt begrensd door de
 * beschikbare hoogte (100cqh), zodat alles zonder scrollen past.
 * --body is de geschatte hoogte van de tekst onder een tegel.
 */
.project-grid {
	--cols: var(--cols-d, 4);
	--rows: var(--rows-d, 1);
	--gap: clamp(16px, 2vw, 32px);
	--body: 200px;
	width: min(100%, max(320px, calc((((100cqh - (var(--rows) - 1) * var(--gap)) / var(--rows)) - var(--body)) * 4 / 3 * var(--cols) + (var(--cols) - 1) * var(--gap))));
	display: grid;
	grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
	gap: var(--gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.project {
	min-width: 0;
	opacity: 0;
	transform: translateX(40px);
	transition: opacity .7s var(--ease), transform .9s var(--ease);
}

.is-projects .project,
html:not(.js) .project {
	opacity: 1;
	transform: none;
}

.is-projects .project:nth-child(1) { transition-delay: .35s; }
.is-projects .project:nth-child(2) { transition-delay: .42s; }
.is-projects .project:nth-child(3) { transition-delay: .49s; }
.is-projects .project:nth-child(4) { transition-delay: .56s; }

.project__card {
	display: block;
	color: inherit;
	text-decoration: none;
}

.project__media {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--tile);
	border-radius: 8px;
	transition: background-color .6s var(--ease);
}

/* Presentatiebeeld vult de 4:3-tegel */
.project__shot {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 1.2s var(--ease);
}

/* Icoon alleen als er geen presentatiebeeld is */
.has-shot .project__icon {
	display: none;
}

.project__icon,
.project__initial {
	width: 30%;
	aspect-ratio: 1;
	border-radius: 22.5%;
	box-shadow:
		0 1px 2px rgba(0, 0, 0, .06),
		0 20px 40px -16px rgba(0, 0, 0, .32);
	transition: transform .7s var(--ease), box-shadow .7s var(--ease);
}

.project__icon {
	object-fit: cover;
}

.project__initial {
	display: grid;
	place-items: center;
	background: var(--ink);
	color: #fff;
	font-size: 2.5rem;
	font-weight: 700;
	letter-spacing: -.04em;
}

.project__arrow {
	position: absolute;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #fff;
	color: var(--ink);
	opacity: 0;
	transform: translate(-8px, 8px) scale(.85);
	transition: opacity .4s var(--ease), transform .5s var(--ease);
}

.project__body {
	padding-top: clamp(12px, 2vh, 20px);
}

.project__meta {
	display: flex;
	gap: 12px;
	margin: 0 0 8px;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.project__num {
	color: var(--ink);
}

.project__type {
	overflow: hidden;
	text-overflow: ellipsis;
}

.project__title {
	margin: 0;
	font-size: clamp(1.25rem, .4rem + 1.5vw, 2.25rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -.035em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.project__desc {
	display: -webkit-box;
	margin: 10px 0 0;
	overflow: hidden;
	color: var(--muted);
	font-size: 15px;
	line-height: 1.4;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.project__url {
	display: inline-flex;
	gap: 6px;
	margin: 12px 0 0;
	font-size: 14px;
}

.project__url span:first-child {
	background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
	transition: background-size .4s var(--ease);
}

/* Hover/focus */
.project__card:is(:hover, :focus-visible) .project__media {
	background-color: var(--accent, #111);
}

.project__card:is(:hover, :focus-visible) .project__shot {
	transform: scale(1.04);
}

.project__card:is(:hover, :focus-visible) .project__icon,
.project__card:is(:hover, :focus-visible) .project__initial {
	transform: translateY(-4px) scale(1.05);
	box-shadow:
		0 1px 2px rgba(0, 0, 0, .1),
		0 28px 48px -16px rgba(0, 0, 0, .5);
}

.project__card:is(:hover, :focus-visible) .project__arrow {
	opacity: 1;
	transform: none;
}

.project__card:is(:hover, :focus-visible) .project__url span:first-child {
	background-size: 0 1px;
	background-position: 100% 100%;
}

@media (hover: none) {
	.project__arrow {
		opacity: 1;
		transform: none;
	}
}

.projects__empty {
	color: var(--muted);
}

/* Lagere schermen: minder tekst, zodat de 4:3-tegels groot blijven */
@media (max-height: 760px) {
	.project-grid {
		--body: 180px;
	}

	.project__desc {
		-webkit-line-clamp: 2;
	}
}

@media (max-height: 620px) {
	.project-grid {
		--body: 172px;
	}

	.project__desc {
		font-size: 14px;
	}
}

/* Tablet: twee rijen */
@media (min-width: 640px) and (max-width: 1023px) and (min-height: 481px) {
	.project-grid {
		--cols: var(--cols-t, 2);
		--rows: var(--rows-t, 2);
		--body: 180px;
	}

	.project__desc {
		-webkit-line-clamp: 2;
	}
}

/* Liggende telefoon / zeer lage schermen: 4 naast elkaar, alleen titel + link */
@media (max-height: 480px) {
	.site-header__inner {
		height: 56px;
	}

	.site-footer__inner {
		min-height: 44px;
		padding-block: 8px;
	}

	.project-grid {
		--cols: var(--count, 4);
		--rows: 1;
		--gap: 16px;
		--body: 80px;
	}

	.project__meta,
	.project__desc,
	.project__arrow {
		display: none;
	}

	.project__body {
		padding-top: 8px;
	}

	.project__title {
		font-size: 18px;
	}

	.project__url {
		margin-top: 4px;
		font-size: 12px;
	}
}

/* Mobiel: header/footer compacter */
@media (max-width: 639px) {
	body {
		font-size: 16px;
	}

	.site-header__inner {
		height: 64px;
	}

	.site-logo img {
		height: 19px;
	}

	.site-footer__inner {
		min-height: 48px;
	}

	.site-footer__meta,
	.pager {
		font-size: 13px;
	}
}

/* Mobiel staand: lijst (één rij per project) met 4:3-thumbnail */
@media (max-width: 639px) and (min-height: 481px) {
	.panel--projects .panel__inner {
		container-type: normal;
		align-items: stretch;
		padding-block: 8px;
	}

	.project-grid {
		width: 100%;
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: repeat(var(--count, 4), minmax(0, 1fr));
		gap: 0;
	}

	.project {
		display: flex;
		align-items: center;
		min-height: 0;
		border-bottom: 1px solid var(--line);
	}

	.project:last-child {
		border-bottom: 0;
	}

	.project__card {
		display: flex;
		align-items: center;
		gap: 16px;
		width: 100%;
	}

	.project__media {
		flex: none;
		width: clamp(96px, 30vw, 140px);
		border-radius: 6px;
	}

	.project__icon,
	.project__initial {
		width: 40%;
		box-shadow:
			0 1px 2px rgba(0, 0, 0, .08),
			0 8px 16px -8px rgba(0, 0, 0, .35);
	}

	.project__initial {
		font-size: 1.5rem;
	}

	.project__arrow {
		display: none;
	}

	.project__body {
		flex: 1 1 auto;
		min-width: 0;
		padding-top: 0;
	}

	.project__meta {
		margin-bottom: 4px;
		font-size: 12px;
	}

	.project__title {
		font-size: 22px;
	}

	.project__desc {
		margin-top: 6px;
		font-size: 14px;
		-webkit-line-clamp: 2;
	}

	.project__url {
		margin-top: 6px;
		font-size: 13px;
	}
}

@media (max-width: 639px) and (min-height: 481px) and (max-height: 779px) {
	.project__desc {
		display: none;
	}
}

/* ------------------------------------------------------------------
   Overige pagina's
------------------------------------------------------------------ */
.page {
	padding-top: clamp(48px, 8vw, 120px);
	padding-bottom: clamp(64px, 10vw, 160px);
}

.entry {
	max-width: 72ch;
}

.entry + .entry {
	margin-top: 64px;
}

.entry__title {
	margin: 0 0 32px;
	font-size: clamp(2.25rem, 1.4rem + 3vw, 4rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -.04em;
}

.entry__title a {
	text-decoration: none;
}

.entry__content a {
	text-underline-offset: 3px;
}

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