/*
Theme Name: patzara
Description: Left-sidebar artist portfolio with a lightbox gallery.
Version: 2.1.1
Requires at least: 6.5
Requires PHP: 8.0
License: GPLv2 or later
Text Domain: patzara
*/

:root {
	--paper: #F4F2EC;
	--ink:   #1C1A17;
	--muted: #64625F;
	--faint: #A9A7A2;
	--rule:  #EAE8E2;

	--serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
	--sans:  system-ui, -apple-system, "Helvetica Neue", sans-serif;

	--measure: 40rem;
	--image-max: 54rem;
	--sidebar: 13rem;
	--pad: clamp(1.25rem, 4vw, 3rem);
}

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--serif);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

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

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

/* ---- Layout: fixed left sidebar, content to the right ---- */

.layout {
	display: grid;
	grid-template-columns: var(--sidebar) minmax(0, 1fr);
	grid-template-rows: 1fr auto;
	column-gap: clamp(2rem, 6vw, 5rem);
	min-height: 100vh;
	padding: var(--pad);
}

.sidebar { grid-column: 1; grid-row: 1; }
.content {
	grid-column: 2;
	grid-row: 1 / span 2;
	min-width: 0;
	max-width: var(--image-max);
}

.brand { display: block; margin-bottom: 2.25rem; }
.brand__mark { display: block; font-size: 1.25rem; line-height: 1.15; }
.brand__byline { display: block; margin-top: 0.5rem; }

.site-nav ul {
	list-style: none; margin: 0; padding: 0;
	display: flex; flex-direction: column; gap: 0.55rem;
}
.site-nav a {
	font-family: var(--sans);
	font-size: 0.8125rem;
	color: var(--muted);
}
.site-nav .current-menu-item > a,
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-group { margin-top: 1.4rem; }

.site-footer {
	grid-column: 1;
	grid-row: 2;
	align-self: end;
	display: flex; flex-direction: column; gap: 0.4rem;
	padding-top: 3rem;
	color: var(--faint);
}
.site-footer a:hover { color: var(--muted); }

/* ---- Landing page (own shell, no sidebar) ---- */
.lp {
	max-width: 60rem;
	margin: 0 auto;
	padding: var(--pad);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.lp__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1.5rem 2rem;
	flex-wrap: wrap;
	margin-bottom: clamp(3rem, 8vw, 6rem);
}
.lp__head .brand { display: flex; align-items: baseline; gap: 0.6rem; margin: 0; }
.lp__head .brand__byline { margin: 0; }
.lp__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.lp__nav a { color: var(--muted); }
.lp__nav .current-menu-item > a, .lp__nav a:hover { color: var(--ink); }

.lp__main { flex: 1; }

.lp__intro { margin-bottom: 2.5rem; }
.lp__heading {
	font-weight: 400;
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	line-height: 1.18;
	margin: 0 0 1.75rem;
}
.lp__aside { max-width: 24rem; }
.lp__text { color: var(--muted); margin: 0 0 0.9rem; }
.lp__link { display: inline-block; border-bottom: 1px solid var(--muted); padding-bottom: 2px; }
.lp__link:hover { color: var(--ink); border-color: var(--ink); }

.lp__feature { margin: 0 0 0.75rem; }
.lp__caption { display: flex; justify-content: space-between; gap: 1rem; }

.lp__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.25rem 1.75rem;
	margin-top: 3.5rem;
}
.lp__cell { margin: 0; }
.lp__cell a { display: block; overflow: hidden; }
.lp__cell img { width: 100%; transition: opacity 0.2s ease; }
.lp__cell a:hover img { opacity: 0.82; }
.lp__cell figcaption { margin-top: 0.55rem; }

.lp__currently { margin-top: clamp(4rem, 9vw, 7rem); }
.lp__currently h2 { margin: 0 0 1.25rem; }
.lp__currently dl { margin: 0; }
.lp__cline {
	display: grid;
	grid-template-columns: 4rem 1fr auto;
	gap: 1.5rem;
	align-items: baseline;
	padding: 0.85rem 0;
	border-top: 1px solid var(--rule);
}
.lp__cline:last-child { border-bottom: 1px solid var(--rule); }
.lp__cline dt { color: var(--faint); font-size: 0.9375rem; }
.lp__citem { margin: 0; }
.lp__ctag { margin: 0; color: var(--faint); }

.lp__foot {
	display: flex;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
	margin-top: clamp(4rem, 9vw, 7rem);
	padding-top: 2.5rem;
	border-top: 1px solid var(--rule);
	color: var(--faint);
}
.lp__foot a:hover { color: var(--muted); }

@media (min-width: 820px) {
	.lp__intro {
		display: grid;
		grid-template-columns: 1fr 19rem;
		column-gap: clamp(2rem, 5vw, 3.5rem);
		align-items: start;
	}
	.lp__heading { margin-bottom: 0; }
	.lp__aside { margin-top: 2rem; }
}

@media (max-width: 640px) {
	.lp__grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
	.lp__cline { grid-template-columns: 3rem 1fr; }
	.lp__ctag { grid-column: 2; }
	.lp__foot { justify-content: flex-start; gap: 0.4rem; flex-direction: column; }
}

/* ---- Collection + medium pages ---- */
.collection__title { font-size: 1.75rem; font-weight: 400; margin: 0 0 0.25rem; line-height: 1.2; }
.collection__meta { margin: 0 0 2rem; }
.collection__feature { margin: 0 0 2.5rem; }
.collection__about { margin-bottom: 3rem; }

.works { margin: 3rem 0 0; }
.work { margin: 0 0 4.5rem; }
.work__link { display: block; }
.work figcaption { margin-top: 0.75rem; max-width: var(--measure); }
.work__note { max-width: var(--measure); margin-top: 1rem; font-style: italic; color: var(--muted); }

/* ---- Gallery ---- */
.gallery .content,
body.page-template-page-gallery .content { max-width: none; }
.gallery__intro { margin-bottom: 2.5rem; }
.gallery__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem 2rem; }
.gallery__item { display: block; overflow: hidden; }
.gallery__item img { width: 100%; transition: opacity 0.2s ease; }
.gallery__item:hover img { opacity: 0.82; }

/* ---- Text pages (About, Contact) ---- */
.page__title { font-size: 1.75rem; font-weight: 400; margin: 0 0 2rem; }
.entry-content { max-width: var(--measure); }

/* ---- Lightbox ---- */
.lb {
	position: fixed; inset: 0; z-index: 1000;
	display: none;
	background: rgba(28, 26, 23, 0.94);
	padding: clamp(1rem, 4vw, 3rem);
}
.lb.is-open { display: grid; place-items: center; }
.lb__stage { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.lb__img { max-width: 100%; max-height: 80vh; width: auto; object-fit: contain; }
.lb__cap { color: var(--faint); text-align: center; }
.lb__close, .lb__nav {
	position: fixed;
	background: none; border: 0; cursor: pointer;
	color: var(--paper); opacity: 0.7;
	font-family: var(--serif);
	line-height: 1;
}
.lb__close:hover, .lb__nav:hover { opacity: 1; }
.lb__close { top: 1rem; right: 1.25rem; font-size: 2rem; }
.lb__nav { top: 50%; transform: translateY(-50%); font-size: 2.75rem; padding: 1rem; }
.lb__prev { left: 0.5rem; }
.lb__next { right: 0.5rem; }

/* ---- Responsive ---- */
@media (max-width: 1000px) {
	.gallery__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
	.layout {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr auto;
		column-gap: 0;
	}
	.sidebar     { grid-column: 1; grid-row: 1; margin-bottom: 2rem; }
	.content     { grid-column: 1; grid-row: 2; max-width: none; }
	.site-footer { grid-column: 1; grid-row: 3; margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--rule); }

	.brand { margin-bottom: 1.25rem; }
	.site-nav ul { flex-direction: row; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
	.site-nav .nav-group { margin-top: 0; }
	.site-nav .nav-group::before { content: "·"; margin-right: 1.25rem; color: var(--faint); }

	.gallery__grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
	.work { margin-bottom: 3rem; }
	.landing__caption { flex-direction: column; gap: 0.25rem; }
}
