/* ==========================================================================
   Pilar López Román · óleos
   ========================================================================== */

:root {
	--paper: #f5f2ec;
	--paper-2: #ebe6dc;
	--card: #fbfaf7;
	--ink: #1f1d1a;
	--ink-2: #4a453e;
	--muted: #635c52; /* contraste ≥ 4.5:1 (WCAG AA) sobre --paper, --paper-2 y --card */
	--line: #d9d2c5;
	--accent: #2f5b63;
	--accent-ink: #ffffff;
	--sold: #9a4a36;
	--shadow: 0 1px 2px rgb(31 29 26 / 0.08), 0 8px 24px rgb(31 29 26 / 0.08);

	--serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
	--sans: 'Jost', 'Segoe UI', system-ui, sans-serif;

	--gutter: clamp(16px, 4vw, 48px);
	--max: 1320px;
	--header-h: 68px;
	--row-h: 240px;

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme='light']) {
		--paper: #171614;
		--paper-2: #201e1b;
		--card: #1d1b19;
		--ink: #eeeae2;
		--ink-2: #c9c2b6;
		--muted: #958d80;
		--line: #34302a;
		--accent: #8fc1c7;
		--accent-ink: #10211f;
		--sold: #e0a08c;
		--shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.3);
		color-scheme: dark;
	}
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 16px);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 17px/1.65 var(--sans);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: inherit;
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
	text-underline-offset: 0.2em;
	transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
	color: var(--accent);
	text-decoration-color: currentColor;
}

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

h1,
h2,
h3 {
	font-family: var(--serif);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.01em;
	margin: 0 0 0.5em;
	text-wrap: balance;
}

h1 {
	font-size: clamp(2.6rem, 6vw, 4.6rem);
}

h2 {
	font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
	font-size: 1.6rem;
}

p {
	margin: 0 0 1em;
	text-wrap: pretty;
}

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

.narrow {
	max-width: 760px;
}

.eyebrow {
	display: block;
	font: 500 0.78rem/1.2 var(--sans);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 1rem;
}

.lead {
	font-family: var(--serif);
	font-size: clamp(1.35rem, 2.2vw, 1.7rem);
	line-height: 1.45;
	color: var(--ink-2);
}

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

.section {
	padding-block: clamp(56px, 9vw, 120px);
}

.section + .section {
	border-top: 1px solid var(--line);
}

.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: 1rem 2rem;
	margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head h2 {
	margin: 0;
}

.button {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.8em 1.4em;
	border: 1px solid var(--ink);
	border-radius: 999px;
	font: 500 0.95rem/1 var(--sans);
	letter-spacing: 0.04em;
	text-decoration: none;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.button:hover {
	background: var(--ink);
	color: var(--paper);
}

.button--solid {
	background: var(--ink);
	color: var(--paper);
}

.button--solid:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
}

.button .arrow {
	transition: transform 0.2s;
}

.button:hover .arrow {
	transform: translateX(3px);
}

/* ---------- Cabecera ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--header-h);
	background: color-mix(in srgb, var(--paper) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(12px);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.3s;
}

.site-header.scrolled {
	border-bottom-color: var(--line);
}

.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	gap: 1rem;
}

.brand {
	font-family: var(--serif);
	font-size: 1.65rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1;
}

.brand span {
	color: var(--muted);
	font-style: italic;
}

.brand:hover {
	color: var(--ink);
}

.nav {
	display: flex;
	align-items: center;
	gap: clamp(16px, 2.2vw, 32px);
}

.nav ul {
	display: flex;
	gap: clamp(14px, 2vw, 30px);
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Selector de idioma */
.lang {
	display: flex;
	gap: 2px;
	padding-left: clamp(12px, 1.6vw, 22px);
	border-left: 1px solid var(--line);
}

.nav .lang a {
	min-width: 32px;
	padding: 5px 7px;
	border-radius: 4px;
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-align: center;
	color: var(--muted);
}

.nav .lang a::after {
	display: none;
}

.nav .lang a[href]:hover {
	color: var(--ink);
	background: var(--paper-2);
}

.nav .lang a[aria-current] {
	color: var(--ink);
	box-shadow: inset 0 0 0 1px var(--line);
}

.nav a {
	font-size: 0.95rem;
	letter-spacing: 0.03em;
	white-space: nowrap;
	text-decoration: none;
	position: relative;
	padding-block: 6px;
}

.nav a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s;
}

.nav a:hover::after,
.nav a[aria-current='page']::after {
	transform: scaleX(1);
}

.nav a[aria-current='page'] {
	color: var(--accent);
}

.nav-toggle {
	display: none;
	width: 44px;
	height: 44px;
	margin-right: -10px;
	border: 0;
	background: none;
	color: var(--ink);
	cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
	display: block;
	width: 22px;
	height: 1.5px;
	margin: auto;
	background: currentColor;
	position: relative;
	transition: transform 0.25s, background 0.25s;
}

.nav-toggle span::before,
.nav-toggle span::after {
	content: '';
	position: absolute;
	left: 0;
}

.nav-toggle span::before {
	top: -7px;
}

.nav-toggle span::after {
	top: 7px;
}

.nav-open .nav-toggle span {
	background: transparent;
}

.nav-open .nav-toggle span::before {
	transform: translateY(7px) rotate(45deg);
}

.nav-open .nav-toggle span::after {
	transform: translateY(-7px) rotate(-45deg);
}

/* Menú desplegable: por debajo de 1080 px el menú completo con el selector de idioma ya no cabe en una línea */
@media (max-width: 1079px) {
	.nav-toggle {
		display: block;
	}

	.nav {
		position: fixed;
		inset: var(--header-h) 0 auto 0;
		background: var(--paper);
		border-bottom: 1px solid var(--line);
		padding: 8px var(--gutter) 24px;
		transform: translateY(-8px);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	}

	.nav-open .nav {
		transform: none;
		opacity: 1;
		visibility: visible;
	}

	.nav ul {
		flex-direction: column;
		gap: 0;
	}

	.nav a {
		display: block;
		padding: 14px 0;
		font-family: var(--serif);
		font-size: 1.5rem;
		border-bottom: 1px solid var(--line);
	}

	.nav a::after {
		display: none;
	}

	.nav {
		display: block;
	}

	.lang {
		margin-top: 18px;
		padding-left: 0;
		border-left: 0;
		gap: 8px;
	}

	.nav .lang a {
		display: inline-block;
		padding: 8px 14px;
		font-family: var(--sans);
		font-size: 0.9rem;
		border-bottom: 0;
		box-shadow: inset 0 0 0 1px var(--line);
	}

	.nav .lang a[aria-current] {
		background: var(--ink);
		color: var(--paper);
		box-shadow: none;
	}
}

/* ---------- Portada ---------- */

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
	gap: clamp(28px, 5vw, 80px);
	align-items: center;
	padding-block: clamp(32px, 6vw, 88px);
}

.hero h1 {
	margin-bottom: 0.3em;
}

.hero h1 em {
	display: block;
	color: var(--muted);
	font-weight: 400;
}

.hero .lead {
	max-width: 30ch;
	margin-bottom: 2rem;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.hero-art {
	margin: 0;
}

.hero-art > a {
	display: block;
	overflow: hidden;
	box-shadow: var(--shadow);
	aspect-ratio: 1435 / 1060;
}

.hero-art img {
	width: 100%;
	height: auto;
	transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-art > a:hover img {
	transform: scale(1.03);
}

.hero-art figcaption {
	margin-top: 12px;
	font-size: 0.9rem;
	color: var(--muted);
}

.hero-art figcaption a {
	text-decoration: none;
}

.hero-art figcaption i {
	font-family: var(--serif);
	font-size: 1.1rem;
	color: var(--ink-2);
}

@media (max-width: 880px) {
	.hero {
		grid-template-columns: 1fr;
	}

	.hero-art {
		order: -1;
	}
}

.about {
	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
	gap: clamp(28px, 6vw, 96px);
	align-items: start;
}

.portrait {
	margin: 0;
	position: sticky;
	top: calc(var(--header-h) + 24px);
}

.portrait img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 2px;
	filter: saturate(0.92);
}

.portrait figcaption {
	margin-top: 10px;
	font-size: 0.85rem;
	color: var(--muted);
}

@media (max-width: 760px) {
	.about {
		grid-template-columns: 1fr;
	}

	.portrait {
		position: static;
		max-width: 320px;
	}
}

.quote {
	margin: 0;
	padding: 0;
	text-align: center;
}

.quote p {
	font-family: var(--serif);
	font-style: italic;
	font-size: clamp(1.6rem, 3.4vw, 2.5rem);
	line-height: 1.3;
	max-width: 32ch;
	margin: 0 auto 1.2rem;
	text-wrap: balance;
}

.quote cite {
	font-style: normal;
	font-size: 0.9rem;
	letter-spacing: 0.06em;
	color: var(--muted);
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 20px;
}

.card {
	display: block;
	padding: 28px;
	background: var(--card);
	border: 1px solid var(--line);
	text-decoration: none;
	transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
	border-color: var(--ink);
	color: var(--ink);
	transform: translateY(-2px);
}

.card h3 {
	margin-bottom: 0.3em;
}

.card p {
	margin: 0;
	color: var(--muted);
	font-size: 0.95rem;
}

/* ---------- Cabecera de página ---------- */

.page-head {
	padding-block: clamp(40px, 7vw, 96px) clamp(24px, 4vw, 48px);
}

.page-head h1 {
	margin-bottom: 0.25em;
}

.page-head .lead {
	max-width: 46ch;
	margin: 0;
}

.error-page {
	min-height: 40vh;
}

.error-page .hero-actions {
	margin-top: 2rem;
}

/* ---------- Galería (filas justificadas) ---------- */

.toolbar {
	position: sticky;
	top: var(--header-h);
	z-index: 10;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	padding-block: 12px;
	margin-bottom: 20px;
	background: color-mix(in srgb, var(--paper) 92%, transparent);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.chip {
	/* position: relative contiene los .sr-only: si no, escapan de la fila desplazable y ensanchan la página en móvil */
	position: relative;
	padding: 7px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: transparent;
	color: var(--ink-2);
	font: 400 0.9rem/1 var(--sans);
	cursor: pointer;
	transition: all 0.2s;
}

.chip:hover {
	border-color: var(--ink);
	color: var(--ink);
}

.chip[aria-pressed='true'] {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

.chip small {
	opacity: 0.6;
	margin-left: 4px;
}

.search {
	flex: 1 1 220px;
	max-width: 320px;
	margin-left: auto;
	position: relative;
}

.search input {
	width: 100%;
	padding: 9px 14px 9px 38px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink);
	font: inherit;
	font-size: 0.95rem;
}

.search input:focus {
	outline: none;
	border-color: var(--ink);
}

.search svg {
	position: absolute;
	left: 13px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	color: var(--muted);
	pointer-events: none;
}

.count {
	font-size: 0.85rem;
	color: var(--muted);
	margin: 0 0 16px;
}

.gallery {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(14px, 2vw, 28px);
}

.gallery::after {
	content: '';
	flex-grow: 999;
}

/* .tile sin position: el plugin scroll-to-thumbnail usa offsetTop respecto a la página */
.tile {
	margin: 0;
	min-width: 0;
	flex-grow: var(--rc);
	flex-basis: calc(var(--row-h) * var(--rc));
	max-width: calc(var(--row-h) * var(--rc) * 1.6);
}

/*
 * La miniatura muestra el cuadro completo: sólo se oculta la franja inferior con la dirección de la web.
 * --r  proporción real del cuadro sin la franja
 * --rc proporción de la celda (mínimo 0.6: los cuadros muy estrechos quedan centrados con margen)
 */
.tile > a {
	display: flex;
	justify-content: center;
	aspect-ratio: var(--rc);
	cursor: zoom-in;
}

.frame {
	display: block;
	height: 100%;
	aspect-ratio: var(--r);
	max-width: 100%;
	overflow: hidden;
	background: var(--paper-2);
}

.frame img {
	width: 100%;
	height: auto;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
	transform-origin: 50% 40%;
}

.tile > a:hover .frame img {
	transform: scale(1.025);
}

.tile figcaption a {
	text-decoration: none;
}

.tile figcaption .nota {
	display: block;
}

.tile figcaption .tag-sold {
	display: block;
	width: fit-content;
	margin: 5px 0 0;
}

.tile figcaption {
	padding-top: 8px;
	font-size: 0.85rem;
	line-height: 1.35;
	color: var(--muted);
	overflow-wrap: anywhere;
}

.tile figcaption b {
	display: block;
	font-family: var(--serif);
	font-size: 1.12rem;
	font-weight: 500;
	color: var(--ink);
}

.empty {
	padding: 60px 0;
	text-align: center;
	color: var(--muted);
}

@media (max-width: 600px) {
	:root {
		--row-h: 150px;
	}

	.tile figcaption {
		font-size: 0.78rem;
	}

	.tile figcaption b {
		font-size: 1rem;
	}

	.search {
		max-width: none;
		margin-left: 0;
	}

	.toolbar {
		position: static;
	}

	.chips {
		position: relative;
		flex-wrap: nowrap;
		overflow-x: auto;
		margin-inline: calc(-1 * var(--gutter));
		padding-inline: var(--gutter);
		scrollbar-width: none;
	}

	.chip {
		white-space: nowrap;
	}
}

.year-group + .year-group {
	margin-top: clamp(48px, 6vw, 80px);
}

.year-group h2 {
	display: flex;
	align-items: baseline;
	gap: 16px;
	font-size: clamp(1.8rem, 3vw, 2.4rem);
	margin-bottom: 20px;
}

.year-group h2 small {
	font-size: 0.5em;
}

.year-group h2::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--line);
}

.year-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	font-size: 0.95rem;
}

.year-nav a {
	text-decoration: none;
	color: var(--muted);
}

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

/* ---------- Trayectoria ---------- */

.prose p {
	font-size: 1.05rem;
}

.about .prose p:first-of-type {
	font-family: var(--serif);
	font-size: clamp(1.35rem, 2.2vw, 1.6rem);
	line-height: 1.45;
	color: var(--ink-2);
}

.toc {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 28px;
}

.timeline {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 0 48px;
}

.timeline li {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--line);
	font-size: 0.98rem;
	break-inside: avoid;
}

.timeline time {
	font-family: var(--serif);
	font-size: 1.25rem;
	line-height: 1.2;
	color: var(--accent);
}

.timeline time small {
	display: block;
	font-family: var(--sans);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.tag {
	display: inline-block;
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 1px 6px;
	margin-right: 6px;
	vertical-align: 2px;
}

@media (max-width: 420px) {
	.timeline {
		grid-template-columns: 1fr;
	}
}

.photos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 20px;
}

.photos figure {
	margin: 0;
}

.photos a {
	display: block;
	overflow: hidden;
	cursor: zoom-in;
}

.photos img {
	width: 100%;
	aspect-ratio: 550 / 400;
	object-fit: cover;
	transition: transform 0.6s;
}

.photos a:hover img {
	transform: scale(1.03);
}

.photos figcaption {
	padding-top: 8px;
	font-size: 0.88rem;
	color: var(--muted);
	line-height: 1.45;
}

.critique {
	display: grid;
	grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.5fr);
	gap: clamp(20px, 5vw, 72px);
}

.critique + .critique {
	margin-top: clamp(48px, 6vw, 80px);
}

.critique header h3 {
	font-size: clamp(1.6rem, 2.6vw, 2.1rem);
}

.critique header p {
	color: var(--muted);
	font-size: 0.92rem;
}

@media (max-width: 760px) {
	.critique {
		grid-template-columns: 1fr;
	}
}

.poem {
	columns: 4 220px;
	column-gap: 48px;
	font-family: var(--serif);
	font-size: 1.2rem;
	line-height: 1.55;
	color: var(--ink-2);
}

.poem p {
	break-inside: avoid;
	margin-bottom: 1.2em;
}

.links {
	columns: 3 240px;
	column-gap: 40px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.links li {
	break-inside: avoid;
	padding: 8px 0;
	border-bottom: 1px solid var(--line);
	font-size: 0.98rem;
}

.links li a + a {
	margin-left: 8px;
	font-size: 0.85rem;
	color: var(--muted);
}

/* ---------- Proceso ---------- */

.steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: clamp(20px, 3vw, 36px);
	counter-reset: step;
}

.steps li {
	counter-increment: step;
}

.steps a {
	display: block;
	overflow: hidden;
	cursor: zoom-in;
}

.steps img {
	width: 100%;
	aspect-ratio: 370 / 246;
	object-fit: cover;
	transition: transform 0.6s;
}

.steps a:hover img {
	transform: scale(1.03);
}

.steps h3 {
	margin: 16px 0 6px;
	display: flex;
	align-items: baseline;
	gap: 12px;
}

.steps h3::before {
	content: counter(step, decimal-leading-zero);
	font-size: 0.9rem;
	font-family: var(--sans);
	letter-spacing: 0.1em;
	color: var(--accent);
}

.steps p {
	color: var(--ink-2);
	margin: 0;
}

/* ---------- Comentarios ---------- */

.comments {
	columns: 3 320px;
	column-gap: 20px;
}

.comment {
	break-inside: avoid;
	margin: 0 0 20px;
	padding: 24px;
	background: var(--card);
	border: 1px solid var(--line);
}

.comment header {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.comment h3 {
	font-size: 1.3rem;
	margin: 0;
}

.comment .from {
	font-size: 0.82rem;
	color: var(--muted);
	line-height: 1.4;
}

.comment .flag {
	display: inline-block;
	width: 16px;
	height: auto;
	margin-right: 4px;
	vertical-align: -1px;
	border-radius: 1px;
}

.comment time {
	font-size: 0.8rem;
	color: var(--muted);
	white-space: nowrap;
}

.comment p {
	font-size: 0.97rem;
	margin: 0 0 0.6em;
	overflow-wrap: anywhere;
}

.comment p:last-child {
	margin-bottom: 0;
}

.more {
	text-align: center;
	margin-top: 24px;
}

/* ---------- Pie ---------- */

.site-footer {
	margin-top: clamp(40px, 6vw, 80px);
	padding-block: clamp(48px, 7vw, 88px) 28px;
	background: var(--paper-2);
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 32px;
}

.footer-grid h2 {
	font-size: clamp(2rem, 4vw, 2.8rem);
}

.footer-grid h3 {
	font-family: var(--sans);
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 14px;
}

.footer-grid ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-grid li {
	margin-bottom: 6px;
}

.footer-grid a {
	text-decoration: none;
}

.mail {
	font-family: var(--serif);
	font-size: clamp(1.3rem, 2.4vw, 1.7rem);
	text-decoration: underline !important;
	overflow-wrap: anywhere;
}

.colophon {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	margin-top: 56px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
	font-size: 0.82rem;
	color: var(--muted);
}

.colophon a {
	text-decoration: none;
}

@media (max-width: 760px) {
	.footer-grid {
		grid-template-columns: 1fr 1fr;
	}

	.footer-grid > :first-child {
		grid-column: 1 / -1;
	}
}

.to-top {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 40;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
	border-radius: 50%;
	background: color-mix(in srgb, var(--card) 88%, transparent);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	color: var(--ink);
	box-shadow: var(--shadow);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s, color 0.2s, border-color 0.2s;
}

.to-top svg {
	display: block;
	transition: transform 0.2s;
}

.to-top.visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.to-top:hover {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

.to-top:hover svg {
	transform: translateY(-2px);
}

.nav-open .to-top,
.dialog-open .to-top {
	opacity: 0;
	visibility: hidden;
}

/* ---------- Accesibilidad ---------- */

/* Texto sólo para lectores de pantalla */
.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.tile > a:focus-visible,
.artwork-image a:focus-visible,
.photos a:focus-visible,
.steps a:focus-visible,
.hero-art > a:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 4px;
}

.comment:focus {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

@media (forced-colors: active) {
	.chip[aria-pressed='true'],
	.button--solid {
		border: 2px solid CanvasText;
	}
}

.skip {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 100;
	padding: 10px 16px;
	background: var(--ink);
	color: var(--paper);
	text-decoration: none;
}

.skip:focus {
	top: 12px;
}

/* ---------- Ficha de cuadro ---------- */

.breadcrumb {
	padding-top: 28px;
	font-size: 0.88rem;
	color: var(--muted);
}

.breadcrumb a {
	text-decoration: none;
}

.breadcrumb span {
	margin-inline: 6px;
}

.breadcrumb [aria-current] {
	margin: 0;
	color: var(--ink-2);
}

.artwork {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
	gap: clamp(28px, 5vw, 72px);
	align-items: start;
	padding-block: clamp(24px, 4vw, 48px) clamp(32px, 5vw, 64px);
}

.artwork-image {
	margin: 0;
	position: sticky;
	top: calc(var(--header-h) + 20px);
}

.artwork-image a {
	display: flex;
	justify-content: center;
	cursor: zoom-in;
}

.artwork-image .frame {
	height: auto;
	width: 100%;
	max-width: calc((100vh - var(--header-h) - 90px) * var(--r));
	box-shadow: var(--shadow);
}

.artwork-image figcaption {
	margin-top: 10px;
	text-align: center;
	font-size: 0.82rem;
	color: var(--muted);
}

.artwork-info {
	min-width: 0;
}

.artwork-info h1 {
	font-size: clamp(2.3rem, 4.5vw, 3.6rem);
	overflow-wrap: break-word;
	hyphens: auto;
}

.specs {
	margin: 24px 0 32px;
	border-top: 1px solid var(--line);
}

.specs div {
	display: grid;
	grid-template-columns: 7.5rem 1fr;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
}

.specs dt {
	font-size: 0.78rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
	padding-top: 3px;
}

.specs dd {
	margin: 0;
}

.pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 40px;
}

.pager a {
	display: block;
	padding: 14px 0;
	border-top: 1px solid var(--line);
	font-family: var(--serif);
	font-size: 1.15rem;
	line-height: 1.25;
	text-decoration: none;
}

.pager a[rel='next'] {
	text-align: right;
}

.pager small {
	display: block;
	margin-bottom: 4px;
	font: 400 0.78rem/1 var(--sans);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

@media (max-width: 880px) {
	.artwork {
		grid-template-columns: 1fr;
	}

	.artwork-image {
		position: static;
	}

	.artwork-image .frame {
		max-width: calc(75vh * var(--r));
	}
}

/* ---------- Formularios ---------- */

.form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px 20px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.field--full,
.form-actions {
	grid-column: 1 / -1;
}

.field label {
	font-size: 0.88rem;
	color: var(--ink-2);
}

.field label small {
	color: var(--muted);
}

.field .req {
	color: var(--accent);
}

.field input[type='text'],
.field input[type='email'],
.field input[type='url'],
.field textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--card);
	color: var(--ink);
	font: inherit;
	font-size: 1rem;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea {
	resize: vertical;
	min-height: 120px;
}

.field input:focus,
.field textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.validated .field :invalid {
	border-color: #b4483b;
}

.field--check {
	flex-direction: row;
	align-items: flex-start;
	gap: 10px;
}

.field--check input {
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--accent);
	flex: none;
}

.validated .field--check input:invalid + label {
	color: #b4483b;
}

.field--sum input {
	max-width: 110px;
	text-align: center;
}

.hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
}

.form-actions .button[disabled] {
	opacity: 0.5;
	cursor: wait;
}

.form-status {
	margin: 0;
	font-size: 0.95rem;
}

.form-status.ok {
	color: var(--accent);
}

.form-status.error {
	color: #b4483b;
}

.form-section {
	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
	gap: clamp(24px, 5vw, 72px);
	border-top: 1px solid var(--line);
	margin-top: clamp(40px, 6vw, 72px);
}

@media (max-width: 760px) {
	.form,
	.form-section {
		grid-template-columns: 1fr;
	}
}

.dialog {
	width: min(620px, calc(100vw - 24px));
	max-height: calc(100dvh - 24px);
	padding: clamp(22px, 4vw, 36px);
	border: 0;
	border-radius: 6px;
	background: var(--paper);
	color: var(--ink);
	box-shadow: 0 20px 60px rgb(0 0 0 / 0.4);
	overflow: auto;
}

.dialog::backdrop {
	background: rgb(10 10 9 / 0.6);
	backdrop-filter: blur(3px);
}

.dialog[open] {
	animation: dialogIn 0.25s ease;
}

.dialog h2 {
	grid-column: 1 / -1;
	font-size: clamp(1.8rem, 4vw, 2.3rem);
	margin: 0;
	padding-right: 40px;
}

.dialog-close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}

.dialog-close:hover {
	background: var(--paper-2);
}

.consulta-obra {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 14px;
}

.consulta-obra:empty {
	display: none;
}

.consulta-obra img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	object-position: top;
	border-radius: 3px;
}

.consulta-obra small {
	display: block;
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.consulta-obra b {
	font-family: var(--serif);
	font-size: 1.35rem;
	font-weight: 500;
}

@keyframes dialogIn {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

.legal h2 {
	font-size: 1.7rem;
	margin-top: 2em;
}

.legal p,
.legal li {
	font-size: 1rem;
}

.legal h2 {
	scroll-margin-top: calc(var(--header-h) + 16px);
}

.legal h3 {
	font-family: var(--sans);
	font-size: 0.82rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 1.8em 0 0.6em;
}

.legal ul {
	padding-left: 1.2em;
}

.legal .table {
	overflow-x: auto;
	margin: 0 0 1em;
}

.legal table {
	width: 100%;
	min-width: 560px;
	border-collapse: collapse;
	font-size: 0.92rem;
	line-height: 1.45;
}

.legal th,
.legal td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.legal th {
	font-weight: 500;
	color: var(--ink-2);
	background: var(--paper-2);
}

.reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}

	.reveal {
		opacity: 1;
		transform: none;
	}
}

/* ---------- PhotoSwipe ---------- */

.pswp {
	--pswp-bg: #12110f;
}

.pswp.pswp--open {
	backdrop-filter: blur(7px) opacity(0);
	transition: backdrop-filter 500ms;
}

.pswp.pswp--open.pswp--ui-visible {
	backdrop-filter: blur(7px) opacity(1);
}

.pswp .pswp__counter {
	white-space: nowrap;
	font-family: var(--sans);
}

.pswp__caption {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: min(760px, 100%);
	max-height: 140px;
	overflow: hidden;
	padding: 14px 20px 16px;
	text-align: center;
	color: #d9d3c7;
	font: 400 0.9rem/1.4 var(--sans);
	pointer-events: auto;
	transition: opacity 0.3s;
}

.pswp__caption:empty {
	display: none;
}

.pswp__caption > * {
	display: block;
}

.pswp__caption .t {
	font-family: var(--serif);
	font-size: 1.5rem;
	font-weight: 500;
	color: #fff;
	line-height: 1.15;
	margin-bottom: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pswp__caption .d {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pswp__caption .m {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px 16px;
	margin-top: 8px;
}

.pswp__caption a {
	color: #fff;
}

.pswp__caption .sold {
	padding: 3px 10px;
	border: 1px solid rgb(255 255 255 / 0.35);
	border-radius: 999px;
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #f1d3c8;
}

.pswp__caption .ficha {
	font-size: 0.85rem;
}

/* Oculta la franja inferior con la dirección de la web en la imagen ampliada */
.pswp--marca .pswp__img {
	clip-path: inset(0 0 3.5% 0);
}

.pswp--marca .pswp__sin-marca .pswp__img {
	clip-path: none;
}

/* ---------- Vendido ---------- */

.tag-sold {
	display: inline-block;
	margin-left: 6px;
	padding: 0 7px;
	border: 1px solid color-mix(in srgb, var(--sold) 45%, transparent);
	border-radius: 999px;
	font-size: 0.68rem;
	letter-spacing: 0.1em;
	line-height: 1.6;
	text-transform: uppercase;
	color: var(--sold);
	vertical-align: 1px;
}

.sold-note,
.sold-box {
	margin: 8px 0 0;
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--ink-2);
}

.sold-box {
	margin: 0 0 24px;
	padding: 14px 16px;
	border-left: 3px solid var(--sold);
	background: color-mix(in srgb, var(--sold) 8%, transparent);
}

.sold-box b {
	display: block;
	color: var(--sold);
	font-weight: 500;
}

.chip-sep {
	width: 1px;
	align-self: stretch;
	margin: 4px 4px;
	background: var(--line);
}

.pswp:not(.pswp--ui-visible) .pswp__caption {
	opacity: 0;
}

.pswp .pswp__link-button {
	overflow: hidden;
}

.pswp .pswp__link-button > .copyLinkToClipboard {
	animation: fadeInOut 2s ease-in-out 1;
	background-color: #fff;
	border-radius: 5px;
	color: #000;
	display: none;
	font: 400 0.85rem/1.3 var(--sans);
	max-width: 150px;
	opacity: 0;
	padding: 10px;
	pointer-events: none;
	position: absolute;
}

.pswp .pswp__link-button > .copyLinkToClipboard::before {
	border: 10px solid transparent;
	border-bottom-color: #fff;
	content: '';
	left: 15px;
	pointer-events: none;
	position: absolute;
	top: -18px;
}

.pswp .pswp__link-button.linkButtonMessageVisible > .copyLinkToClipboard {
	display: block;
}

@keyframes fadeInOut {
	0% {
		opacity: 0;
	}

	10%,
	90% {
		opacity: 1;
	}

	100% {
		opacity: 0;
	}
}
