/*
Theme Name: Clay by PK
Description: Custom portfolio theme for Clay by PK, a ceramic artist. Built for Maud Consulting LLC.
Author: Maud Consulting LLC
Version: 1.0.0
Text Domain: claybypk
*/

/* -------------------------------------------------- */
/* Variables                                           */
/* -------------------------------------------------- */
:root {
	--color-bg: #faf8f5;
	--color-text: #262220;
	--color-text-muted: #837b70;
	--color-accent: #0d4b5d;
	--color-accent-deep: #0a3a48;
	--color-line: #e4ddd3;
	--color-overlay-text: #faf8f5;

	--font-display: 'Cormorant Garamond', Georgia, serif;
	--font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;

	--container-width: 1400px;
	--gutter: 24px;
}

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

html, body, h1, h2, h3, h4, p, figure, ul, ol {
	margin: 0;
	padding: 0;
}

body {
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-weight: 300;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

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

ul {
	list-style: none;
}

button {
	font-family: inherit;
	cursor: pointer;
}

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

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}

/* -------------------------------------------------- */
/* Site header                                         */
/* -------------------------------------------------- */
.site-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10;
	padding: 32px var(--gutter);
}

/* Inner max-width wrapper so the logo keeps a consistent margin on wide
   screens instead of being pushed out to the browser edge. */
.site-header__inner {
	max-width: var(--container-width);
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.site-header.is-solid {
	position: relative;
	background: var(--color-bg);
	border-bottom: 1px solid var(--color-line);
}

.site-title {
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 28px;
	letter-spacing: 0.02em;
	color: var(--color-overlay-text);
}

.site-header.is-solid .site-title {
	color: var(--color-text);
}

.site-nav ul {
	display: flex;
	gap: 32px;
}

.site-nav a {
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-overlay-text);
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease;
}

.site-header.is-solid .site-nav a {
	color: var(--color-text);
}

.site-nav a:hover {
	color: var(--color-accent);
	border-color: var(--color-accent);
}

.site-header.is-solid .site-nav a:hover {
	color: var(--color-accent);
}

/* -------------------------------------------------- */
/* Hero                                                */
/* -------------------------------------------------- */
.hero {
	position: relative;
	height: 80vh;
	min-height: 480px;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
}

.hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(20, 16, 12, 0.15) 0%, rgba(20, 16, 12, 0.05) 40%, rgba(20, 16, 12, 0.55) 100%);
}

.hero__content {
	position: relative;
	z-index: 2;
	padding: 0 var(--gutter) 64px;
	color: var(--color-overlay-text);
	max-width: 720px;
}

.hero__title {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: clamp(48px, 8vw, 96px);
	line-height: 1;
	margin-bottom: 20px;
}

.hero__blurb {
	font-size: 17px;
	font-weight: 300;
	max-width: 480px;
}

/* -------------------------------------------------- */
/* Artwork grid (mixed aspect ratio, full-bleed)       */
/* -------------------------------------------------- */
.artwork-grid {
	column-count: 1;
	column-gap: 4px;
	padding: 4px;
	position: relative;
}

@media (min-width: 640px) {
	.artwork-grid {
		column-count: 2;
	}
}

@media (min-width: 1024px) {
	.artwork-grid {
		column-count: 3;
	}
}

.artwork-tile {
	position: relative;
	display: block;
	break-inside: avoid;
	margin-bottom: 4px;
	overflow: hidden;
	background: var(--color-line);
}

/* Once masonry.js measures real image heights, it takes tiles out of the
   CSS-column flow and positions them precisely so the grid's bottom edge
   stays flush instead of leaving ragged gaps under shorter columns. */
.artwork-grid.is-masonry {
	column-count: unset !important;
}

.artwork-grid.is-masonry .artwork-tile {
	position: absolute;
	top: 0;
	left: 0;
	margin-bottom: 0;
}

.artwork-tile img {
	width: 100%;
	height: auto;
	transition: transform 0.6s ease;
}

.artwork-tile:hover img {
	transform: scale(1.03);
}

.artwork-tile__scrim {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 45%;
	background: linear-gradient(180deg, rgba(20, 16, 12, 0) 0%, rgba(20, 16, 12, 0.55) 100%);
	pointer-events: none;
}

.artwork-tile__name {
	position: absolute;
	bottom: 20px;
	font-family: var(--font-display);
	font-weight: 400;
	font-size: 22px;
	color: var(--color-overlay-text);
	letter-spacing: 0.02em;
}

.artwork-tile__name--left {
	left: 20px;
}

.artwork-tile__name--right {
	right: 20px;
	text-align: right;
}

/* -------------------------------------------------- */
/* Footer                                              */
/* -------------------------------------------------- */
.site-footer {
	border-top: 1px solid var(--color-line);
	padding: 40px var(--gutter);
	text-align: center;
}

/* The artist's own stamped mark, signing off the site the way he signs a pot. */
.site-footer__mark-link {
	display: block;
	width: fit-content;
	margin: 0 auto 24px;
}

.site-footer__mark {
	width: 104px;
	height: auto;
	opacity: 0.9;
	transition: opacity 0.2s ease;
}

.site-footer__mark-link:hover .site-footer__mark {
	opacity: 1;
}

.site-footer p {
	font-size: 12px;
	color: var(--color-text-muted);
	letter-spacing: 0.02em;
}

.site-footer a {
	border-bottom: 1px solid currentColor;
}

.site-footer a:hover {
	color: var(--color-accent);
}

/* -------------------------------------------------- */
/* Single artwork template                             */
/* -------------------------------------------------- */
.artwork-single {
	padding: 56px var(--gutter) 100px;
}

.artwork-single__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 48px;
	max-width: 1120px;
	margin: 0 auto;
}

@media (min-width: 900px) {
	.artwork-single__layout {
		/* auto (not a fraction) so the gallery column hugs the fixed-width
		   image — a fractional track left a growing dead gap before the
		   details column as the viewport widened. */
		grid-template-columns: auto minmax(0, 1fr);
		gap: 64px;
	}
}

.artwork-details {
	max-width: 540px;
}

.artwork-gallery-col {
	min-width: 0;
}

/* Space is reserved whether or not the current image has a note, so stepping
   through the gallery doesn't shunt the rest of the page up and down. This is
   the no-JS fallback (two lines); gallery.js replaces it by measuring the
   tallest caption actually present at the current width. */
.artwork-gallery__caption-slot {
	max-width: 480px;
	margin-top: 16px;
	min-height: 46px;
}

.artwork-gallery__caption {
	font-size: 14px;
	line-height: 1.6;
	color: var(--color-text-muted);
	border-left: 2px solid var(--color-accent);
	padding-left: 12px;
}

.artwork-gallery__caption[hidden] {
	display: none;
}

/* Fixed height (not aspect-ratio) is deliberate: aspect-ratio combined with
   flex's default stretch alignment created a feedback loop where a long
   thumbnail column made the main image balloon to match it. A hard height
   here is the one thing that keeps both the image and the thumbnail strip's
   scroll area a genuinely constant size regardless of thumbnail count. */
.artwork-gallery {
	display: flex;
	gap: 12px;
	max-width: 480px;
	height: 600px;
}

@media (max-width: 599px) {
	.artwork-gallery {
		height: 480px;
	}
}

.artwork-gallery__main {
	position: relative;
	flex: 1;
	min-width: 0;
	height: 100%;
	background: var(--color-line);
	overflow: hidden;
}

.artwork-gallery__main img,
.artwork-gallery__main video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.artwork-gallery__main.is-zoomable {
	cursor: zoom-in;
}

.artwork-gallery__main.is-zoom-active {
	cursor: zoom-out;
}

.artwork-gallery__main img {
	transition: transform 0.25s ease;
}

.artwork-gallery__main img.is-zoomed {
	transform: scale(2);
}

/* Vertical thumbnail strip beside the main image, Sézane-style. The up/down
   arrows step through images (and keep the active thumb in view) rather than
   overlaying intrusive controls on the artwork itself. */
.artwork-gallery__thumbs-col {
	flex: none;
	width: 64px;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.artwork-gallery__thumb-nav {
	flex: none;
	width: 100%;
	height: 34px;
	border: none;
	background: none;
	color: var(--color-text-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.artwork-gallery__thumb-nav:hover {
	color: var(--color-accent);
}

.artwork-gallery__thumbs-track {
	flex: 1;
	min-height: 0;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow-y: auto;
	scrollbar-width: none;
}

.artwork-gallery__thumbs-track::-webkit-scrollbar {
	display: none;
}

.artwork-gallery__thumbs-track button {
	flex: none;
	border: 1px solid var(--color-line);
	background: var(--color-line);
	padding: 0;
	width: 64px;
	height: 64px;
	overflow: hidden;
	opacity: 0.6;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.artwork-gallery__thumbs-track button.is-active {
	opacity: 1;
	border-color: var(--color-accent);
}

.artwork-gallery__thumbs-track img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Shown for videos with no poster image, since WordPress can't generate a
   still frame from a video on its own. */
.artwork-gallery__thumb-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-line);
	color: var(--color-accent);
}

.artwork-details__name {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: 40px;
	margin-bottom: 8px;
}

.artwork-details__meta {
	position: relative;
	font-size: 14px;
	color: var(--color-text-muted);
	margin-bottom: 32px;
	padding-bottom: 24px;
}

.artwork-details__meta::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 40px;
	height: 2px;
	background: var(--color-accent);
}

.artwork-details__facts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 24px;
	padding: 24px 0;
	border-top: 1px solid var(--color-line);
	border-bottom: 1px solid var(--color-line);
	margin-bottom: 32px;
}

.artwork-details__fact-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-text-muted);
	margin-bottom: 4px;
}

.artwork-details__fact-value {
	font-size: 15px;
}

.artwork-details__description {
	font-size: 16px;
	line-height: 1.8;
}

.related-artworks {
	max-width: 1120px;
	margin: 100px auto 0;
	padding: 0;
}

.related-artworks__title {
	position: relative;
	font-family: var(--font-display);
	font-weight: 400;
	font-size: 28px;
	margin-bottom: 32px;
	padding-bottom: 20px;
}

.related-artworks__title::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 40px;
	height: 2px;
	background: var(--color-accent);
}

.related-artworks__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

@media (min-width: 900px) {
	.related-artworks__grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.related-artworks__item-image {
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--color-line);
	margin-bottom: 10px;
}

.related-artworks__item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.related-artworks__item:hover .related-artworks__item-image img {
	transform: scale(1.03);
}

.related-artworks__item-name {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: 17px;
}

/* -------------------------------------------------- */
/* Generic page (About, Privacy Policy)                */
/* -------------------------------------------------- */
.page-content {
	padding: 72px var(--gutter) 100px;
	max-width: 760px;
	margin: 0 auto;
}

.page-content__title {
	position: relative;
	font-family: var(--font-display);
	font-weight: 400;
	font-size: 48px;
	margin-bottom: 40px;
	padding-bottom: 24px;
}

.page-content__title::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 40px;
	height: 2px;
	background: var(--color-accent);
}

.page-content .entry-content {
	font-size: 17px;
	line-height: 1.9;
}

.page-content .entry-content p {
	margin-bottom: 1.4em;
}

.about-portrait {
	width: 100%;
	margin-bottom: 40px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* -------------------------------------------------- */
/* Catalogue (public artwork table)                    */
/* -------------------------------------------------- */
.catalogue {
	padding: 72px var(--gutter) 100px;
	max-width: 1120px;
	margin: 0 auto;
}

.catalogue__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 28px;
}

.catalogue__search {
	flex: 1 1 320px;
	max-width: 420px;
	padding: 12px 16px;
	border: 1px solid var(--color-line);
	background: #fff;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 300;
	color: var(--color-text);
}

.catalogue__search:focus {
	outline: none;
	border-color: var(--color-accent);
}

.catalogue__count {
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-text-muted);
}

.catalogue__table-wrap {
	overflow-x: auto;
}

.catalogue__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.catalogue__table th,
.catalogue__table td {
	text-align: left;
	padding: 14px 16px;
	border-bottom: 1px solid var(--color-line);
	vertical-align: middle;
}

.catalogue__table thead th {
	border-bottom: 1px solid var(--color-text-muted);
	padding: 0 16px 12px;
}

.catalogue__sort {
	border: none;
	background: none;
	padding: 0;
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-text-muted);
	transition: color 0.2s ease;
}

.catalogue__sort::after {
	content: '';
	display: inline-block;
	margin-left: 6px;
	border-left: 3px solid transparent;
	border-right: 3px solid transparent;
	border-bottom: 4px solid currentColor;
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.catalogue__sort:hover {
	color: var(--color-accent);
}

.catalogue__sort.is-sorted {
	color: var(--color-accent);
}

.catalogue__sort.is-sorted::after {
	opacity: 1;
}

.catalogue__sort.is-sorted.is-descending::after {
	transform: rotate(180deg);
}

.catalogue__col-image {
	width: 76px;
}

.catalogue__col-image img {
	width: 60px;
	height: 60px;
	object-fit: cover;
}

.catalogue__name {
	font-family: var(--font-display);
	font-size: 20px;
	transition: color 0.2s ease;
}

.catalogue__name:hover {
	color: var(--color-accent);
}

/* The outline mark turns an otherwise dead "no results" moment into something
   that still feels like PK's. Deliberately the only place it appears, so it
   stays a small surprise rather than another logo. */
.catalogue__empty {
	padding: 64px 0;
	text-align: center;
	color: var(--color-text-muted);
}

.catalogue__empty[hidden] {
	display: none;
}

.catalogue__empty-mark {
	width: 84px;
	height: auto;
	margin: 0 auto 20px;
	opacity: 0.25;
}

.artist-signature {
	margin: 48px 0 8px;
	padding-top: 40px;
	border-top: 1px solid var(--color-line);
}

.artist-signature img {
	width: 140px;
	height: auto;
}

.artist-signature figcaption {
	margin-top: 14px;
	font-size: 13px;
	letter-spacing: 0.02em;
	color: var(--color-text-muted);
}

.btn-outline {
	display: inline-block;
	margin-top: 40px;
	padding: 14px 28px;
	border: 1px solid var(--color-text-muted);
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-text);
	transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-outline:hover {
	border-color: var(--color-accent);
	color: var(--color-accent);
}
