/*
Theme Name: Brasella
Description: Standalone artist theme for brasella.com – works catalogue with enquiry form.
Version: 1.2.0
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: brasella
*/

:root {
	--paper: #f6f3ee;
	--paper-2: #ece6dc;
	--white: #fffdf9;
	--ink: #1f1c19;
	--ink-2: #5b544c;
	--line: #d9d1c4;
	--accent: #8c3a26;      /* Sicilian oxide red */
	--accent-ink: #6f2c1b;
	--ok: #2f6b45;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wrap: 1180px;
	--radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 17px/1.65 var(--serif);
	text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.eyebrow { font: 600 .75rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 1rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 38em; }
.lead p:last-child { margin-bottom: 0; }

/* Buttons & links */
.btn {
	display: inline-block; border: 0; cursor: pointer;
	background: var(--ink); color: var(--white);
	font: 600 .85rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
	padding: 16px 26px; border-radius: var(--radius); text-decoration: none;
	transition: background .2s;
}
.btn:hover { background: var(--accent); color: var(--white); }
.link-arrow { font: 600 .85rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 4px; }
.link-arrow::after { content: " →"; }
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 84px; gap: 24px; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.brand__name { font: 400 1.9rem/1 var(--serif); letter-spacing: .02em; }
.brand__name--small { font-size: 1.5rem; margin-bottom: .4rem; }
.brand__sub { font: 500 .7rem/1.6 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin-top: 6px; }
.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 34px; }
.site-nav a { font: 500 .8rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); text-decoration: none; padding: 8px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current_page_item > a { border-color: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after { position: absolute; left: 11px; width: 22px; height: 1.5px; background: var(--ink); content: ""; transition: transform .2s; }
.nav-toggle__bar { top: 21px; }
.nav-toggle__bar::before { left: 0; top: -7px; }
.nav-toggle__bar::after { left: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

/* The "mat": white passe-partout around each artwork */
.mat {
	background: var(--white);
	padding: 28px;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 1px 2px rgba(31,28,25,.06), 0 10px 30px -12px rgba(31,28,25,.18);
}
.mat img { box-shadow: 0 0 0 1px rgba(0,0,0,.06); }

/* Hero */
.hero { padding: clamp(48px, 8vw, 110px) 0; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.hero__title { max-width: 12em; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 2rem; }
.hero__work { margin: 0; }
.mat--hero { padding: clamp(28px, 4vw, 48px); min-height: 420px; }
.mat--hero img { max-height: 460px; width: auto; }
.hero__work figcaption { font-size: .95rem; color: var(--ink-2); margin-top: 14px; text-align: right; }

/* Sections */
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section--flush { padding-top: 0; }
.section--tint { background: var(--paper-2); }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 36px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: start; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 18px 0 18px 56px; border-top: 1px solid var(--line); position: relative; }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 14px; font-size: 1.6rem; color: var(--accent); }

.page-head { padding: clamp(44px, 7vw, 88px) 0 clamp(28px, 4vw, 44px); }
.page-head--split { padding-bottom: clamp(48px, 7vw, 88px); }
.page-head--split .page-head__inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.page-head__image { margin: 0; }
.page-head__image figcaption, .contact__caption { font-size: .9rem; color: var(--ink-2); margin-top: 12px; }

/* Photos (not artworks): smaller mat, no inner frame */
.mat--photo { padding: 14px; }
.mat--photo img { box-shadow: none; width: 100%; }

/* Home: the artist */
.artist { padding-top: 0; }
.artist__inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 90px); align-items: center; border-top: 1px solid var(--line); padding-top: clamp(48px, 7vw, 96px); }
.artist__image { margin: 0; }
.artist__text h2 { max-width: 16em; }
.artist__text p { color: var(--ink-2); max-width: 34em; }

/* Contact */
.contact { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: start; }
.contact__aside .mat { aspect-ratio: 1 / 1; }
.contact__aside .mat img { max-height: 100%; width: auto; }

/* Gallery block inside prose (e.g. studio photos) */
.prose .wp-block-gallery { display: flex; gap: 16px; flex-wrap: wrap; margin: 2em 0; }
.prose .wp-block-gallery .wp-block-image { flex: 1 1 200px; margin: 0; }
.prose .wp-block-gallery img { margin: 0; width: 100%; height: 280px; object-fit: cover; background: var(--white); padding: 10px; box-shadow: 0 10px 30px -12px rgba(31,28,25,.18); }

/* Works grid */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 44px 32px; }
.work-card[hidden] { display: none; }
.work-card__link { color: inherit; text-decoration: none; display: block; }
.work-card .mat { aspect-ratio: 1 / 1; padding: 30px; transition: transform .25s ease, box-shadow .25s ease; }
.work-card .mat img { max-height: 100%; width: auto; object-fit: contain; }
.work-card__link:hover .mat { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(31,28,25,.06), 0 18px 40px -14px rgba(31,28,25,.28); }
.work-card__meta { padding-top: 16px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: start; }
.work-card__title { font-size: 1.15rem; margin: 0; }
.work-card__sub { grid-column: 1; margin: 0; font: .82rem/1.5 var(--sans); color: var(--ink-2); }
.work-card .badge { grid-column: 2; grid-row: 1 / span 2; }
.empty { color: var(--ink-2); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font: 600 .68rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--available { color: var(--ok); }
.badge--reserved { color: #9a6a12; }
.badge--sold { color: var(--accent); }
.badge--nfs { color: var(--ink-2); }

/* Filter */
.filter { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.filter__btn { font: 500 .8rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 40px; padding: 11px 18px; cursor: pointer; }
.filter__btn span { color: var(--ink-2); margin-left: 4px; }
.filter__btn:hover { border-color: var(--ink); }
.filter__btn.is-active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.filter__btn.is-active span { color: #cfc6b8; }

/* Single work */
.work { padding: clamp(36px, 6vw, 72px) 0 0; }
.work__inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.work__image { margin: 0; position: sticky; top: 120px; }
.mat--large { padding: clamp(32px, 6vw, 72px); min-height: 480px; }
.mat--large img { max-height: 70vh; width: auto; }
.work__title { margin-bottom: .2em; }
.work__artist { color: var(--ink-2); font-style: italic; margin-bottom: 28px; }
.work__details { margin: 0 0 28px; border-top: 1px solid var(--line); }
.work__details > div { display: grid; grid-template-columns: 120px 1fr; padding: 12px 0; border-bottom: 1px solid var(--line); }
.work__details dt { font: 600 .72rem/1.9 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.work__details dd { margin: 0; }
.work__enquiry { margin-top: 36px; padding: 32px; background: var(--white); border: 1px solid var(--line); }
.work__enquiry h2 { font-size: 1.4rem; }
.work__nav { display: flex; justify-content: space-between; gap: 20px; padding-top: 56px; padding-bottom: 56px; font-family: var(--sans); font-size: .9rem; }
.work__nav a { color: var(--ink); text-decoration: none; }
.work__nav a:hover { color: var(--accent); }

/* Prose */
.prose { max-width: 40em; font-size: 1.08rem; }
.prose h2 { margin-top: 1.6em; }
.prose img { margin: 1.5em 0; }
.prose .wp-block-image figcaption, .prose figcaption { font-size: .9rem; color: var(--ink-2); }
.prose blockquote { margin: 1.5em 0; padding-left: 1.2em; border-left: 2px solid var(--accent); font-style: italic; color: var(--ink-2); }
.wp-block-columns { gap: 32px; }

/* Form */
.enquiry { display: grid; gap: 16px; margin-top: 18px; font-family: var(--sans); }
.enquiry__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.enquiry label { display: grid; gap: 6px; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.enquiry .opt { text-transform: none; letter-spacing: 0; font-weight: 400; }
.enquiry input[type=text], .enquiry input[type=email], .enquiry textarea {
	font: 1rem/1.5 var(--sans); color: var(--ink); text-transform: none; letter-spacing: 0;
	background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; width: 100%;
}
.enquiry input:focus, .enquiry textarea:focus { border-color: var(--ink); outline: none; background: var(--white); }
.enquiry label.check { display: flex; gap: 10px; align-items: flex-start; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .88rem; }
.enquiry label.check input { margin-top: 4px; }
.enquiry .btn { justify-self: start; }
.notice { padding: 14px 18px; border-radius: var(--radius); font: .95rem/1.5 var(--sans); margin-bottom: 8px; }
.notice--ok { background: #e4efe6; color: var(--ok); }
.notice--err { background: #f6e1db; color: var(--accent-ink); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; margin-top: 0; }
.site-footer__inner { display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; }
.site-footer .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer .menu a { font: 500 .78rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.site-footer .small { grid-column: 1 / -1; margin: 0; }

/* Responsive */
@media (max-width: 900px) {
	.hero__inner, .split, .work__inner, .artist__inner, .contact, .page-head--split .page-head__inner { grid-template-columns: 1fr; }
	.contact__aside { max-width: 360px; }
	.work__image { position: static; }
	.mat--hero { min-height: 0; }
	.mat--large { min-height: 0; }
	.hero__work figcaption { text-align: left; }
}
@media (max-width: 760px) {
	body { font-size: 16px; }
	.nav-toggle { display: block; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); }
	.site-nav.is-open { display: block; }
	.site-nav .menu { flex-direction: column; gap: 0; padding: 8px 24px 20px; }
	.site-nav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
	.site-header__inner { min-height: 72px; }
	.brand__name { font-size: 1.6rem; }
	.works-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
	.work-card .mat { padding: 16px; }
	.work-card__meta { grid-template-columns: 1fr; }
	.work-card .badge { grid-column: 1; grid-row: auto; margin-top: 6px; }
	.enquiry__row { grid-template-columns: 1fr; }
	.work__enquiry { padding: 22px; }
	.site-footer__inner { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
