/* ─────────────────────────────────────────────────────────────
   KRAFT — editoriale da officina, caldo e analogico
   carta kraft · inchiostro · ruggine · ocra
   ───────────────────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
	color-scheme: light;
	--bg: #efe7db;
	--bg-2: #f7f1e8;
	--bg-3: #e4d8c6;
	--ink: #221a12;
	--ink-2: #4b3b2c;
	--ink-dim: #8a7864;
	--rule: #d3c4ae;
	--accent: #b5482e;
	--accent-2: #c08a2e;
	--accent-ink: #faf5ec;
	--font-display: "Fraunces", Georgia, serif;
	--font-sans: "Inter", system-ui, sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, monospace;
	--shell-max: 74rem;
	--reading-width: 44rem;
	--radius: 3px;
	--header-h: 3.75rem;
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font-sans);
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: var(--accent);
	color: var(--accent-ink);
}

.mono {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.01em;
}

.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 100;
	padding: 0.5rem 1rem;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 600;
}
.skip-link:focus {
	left: 1rem;
	top: 1rem;
}

.site-shell {
	max-width: var(--shell-max);
	margin: 0 auto;
	padding: 0 1.5rem 2.5rem;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Header */
.site-header {
	border-bottom: 1px double var(--rule);
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: var(--header-h);
	gap: 1rem;
}
.site-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--ink);
	text-decoration: none;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.25rem;
	letter-spacing: -0.01em;
}
.site-brand__mark {
	width: 0.9rem;
	height: 0.9rem;
	background: var(--accent);
	border-radius: 1px;
	transform: rotate(45deg);
	display: block;
}
.site-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 1.35rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	text-transform: lowercase;
	letter-spacing: 0.04em;
}
.site-nav__link {
	color: var(--ink-dim);
	text-decoration: none;
	border-bottom: 1px dotted transparent;
	padding-bottom: 2px;
}
.site-nav__link:hover {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

.site-main {
	flex: 1;
	padding: 2.75rem 0 3rem;
}

/* Hero */
.home-hero {
	border-bottom: 1px solid var(--rule);
	padding-bottom: 2.25rem;
	margin-bottom: 2.75rem;
}
.home-hero__inner {
	max-width: var(--reading-width);
}
.home-hero__meta {
	margin: 0;
	font-family: var(--font-mono);
	font-size: 0.74rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--accent-2);
}
.home-hero__title {
	margin: 0.7rem 0 0;
	font-family: var(--font-display);
	font-size: clamp(1.85rem, 6vw, 2.7rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.02em;
}
.home-hero__title a {
	color: var(--ink);
	text-decoration: none;
}
.home-hero__title a:hover {
	color: var(--accent);
}
.home-hero__desc {
	color: var(--ink-2);
	margin: 0.9rem 0 0;
	max-width: 38rem;
	font-size: 1.05rem;
}
.home-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin-top: 1.5rem;
	padding: 0.55rem 1.1rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	text-transform: lowercase;
	letter-spacing: 0.04em;
	color: var(--accent);
	background: transparent;
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}
.home-hero__cta:hover {
	background: var(--accent);
	color: var(--accent-ink);
}

.section-title {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin: 0 0 1.1rem;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--ink-dim);
}
.section-title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--rule);
}
.section-title__num {
	color: var(--accent-2);
}

.home-topics {
	margin-bottom: 2.75rem;
}
.topic-chips {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.topic-chips--large {
	flex-direction: column;
	align-items: flex-start;
}
.topic-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.4rem 0.8rem;
	font-family: var(--font-mono);
	font-size: 0.76rem;
	text-transform: lowercase;
	border: 1px solid var(--rule);
	border-radius: 999px;
	color: var(--ink-2);
	text-decoration: none;
	transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.topic-chip:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: rgba(181, 72, 46, 0.06);
}
.topic-chip__n {
	opacity: 0.5;
}

/* Lista articoli */
.post-list {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: post;
}
.post-list__item {
	border-bottom: 1px solid var(--rule);
	counter-increment: post;
}
.post-list__item:last-child {
	border-bottom: none;
}
.post-list__link {
	display: grid;
	gap: 0.3rem 1.25rem;
	padding: 1.05rem 0.25rem;
	text-decoration: none;
	color: inherit;
	transition: background 0.12s ease;
}
@media (min-width: 640px) {
	.post-list__link {
		grid-template-columns: 8.5rem 1fr auto;
		align-items: baseline;
	}
}
.post-list__link:hover {
	background: var(--bg-2);
}
.post-list__date {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	color: var(--ink-dim);
}
.post-list__date::before {
	content: counter(post, decimal-leading-zero);
	margin-right: 0.5rem;
	color: var(--accent);
}
.post-list__main {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}
.post-list__title {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.08rem;
	color: var(--ink);
}
.post-list__link:hover .post-list__title {
	color: var(--accent);
}
.post-list__desc {
	color: var(--ink-dim);
	font-size: 0.9rem;
	line-height: 1.45;
}
.post-list__topic {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	text-transform: lowercase;
	color: var(--ink-dim);
	text-align: right;
}

/* Articolo */
.post,
.topic-page {
	max-width: var(--reading-width);
	margin: 0 auto;
	width: 100%;
}
.post__header {
	margin-bottom: 2.75rem;
}
.post__meta {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--ink-dim);
}
.post__title {
	margin: 0.7rem 0 0;
	font-family: var(--font-display);
	font-size: clamp(1.75rem, 5.5vw, 2.5rem);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
}
.post__rule {
	border: none;
	height: 1px;
	background: var(--rule);
	margin: 1.6rem 0 0;
}
.row-between {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	flex-wrap: wrap;
}
.prose {
	color: var(--ink-2);
}
.prose > *:first-child {
	margin-top: 0;
}
.prose p,
.prose ul,
.prose ol {
	margin: 0 0 1.25rem;
}
.prose a {
	color: var(--accent);
	text-decoration: underline;
	text-decoration-color: rgba(181, 72, 46, 0.4);
	text-underline-offset: 3px;
}
.prose a:hover {
	text-decoration-color: var(--accent);
}
.prose h2,
.prose h3 {
	font-family: var(--font-display);
	color: var(--ink);
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 2.2rem 0 0.7rem;
	line-height: 1.2;
}
.prose h2 {
	font-size: 1.45rem;
}
.prose h3 {
	font-size: 1.15rem;
}
.prose img,
.prose figure img {
	width: 100%;
	max-width: 100%;
	height: auto;
	display: block;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}
.prose figure {
	margin: 1.75rem 0;
}
.prose figcaption {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	color: var(--ink-dim);
	margin-top: 0.55rem;
}

/* Callout — scheda di carta */
.callout {
	margin: 1.6rem 0;
	padding: 1rem 1.2rem;
	border: 1px solid var(--rule);
	border-left: 4px solid var(--accent-2);
	background: var(--bg-2);
	border-radius: var(--radius);
}
.callout::before {
	display: block;
	font-family: var(--font-mono);
	font-size: 0.66rem;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--accent-2);
	margin-bottom: 0.4rem;
}
.callout--note::before {
	content: "Nota";
}
.callout--warning {
	border-left-color: var(--accent);
}
.callout--warning::before {
	content: "Attenzione";
	color: var(--accent);
}
.callout--tip {
	border-left-color: #6b7a3a;
}
.callout--tip::before {
	content: "Suggerimento";
	color: #6b7a3a;
}

/* Codice — lavagna scura */
pre {
	position: relative;
	margin: 1.7rem 0;
	padding: 2.2rem 1.15rem 1.1rem;
	background: #2a2018;
	color: #e8ddc9;
	border: 1px solid #3d3022;
	border-radius: var(--radius);
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: 0.79rem;
	line-height: 1.6;
}
pre::before {
	content: "codice";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	padding: 0.4rem 1.15rem;
	font-family: var(--font-mono);
	font-size: 0.62rem;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: #c08a2e;
	border-bottom: 1px solid #3d3022;
}
pre code {
	background: none;
	padding: 0;
	font-size: inherit;
	color: inherit;
}
:not(pre) > code {
	font-family: var(--font-mono);
	font-size: 0.85em;
	padding: 0.1em 0.35em;
	background: var(--bg-3);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	color: var(--accent);
}

/* Prism — tema caldo su lavagna */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: #8a7864;
}
.token.punctuation {
	color: #c9b79c;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol {
	color: #e0a458;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin {
	color: #a8c07a;
}
.token.operator,
.token.entity,
.token.url {
	color: #c9b79c;
}
.token.atrule,
.token.attr-value,
.token.keyword {
	color: #e08a6a;
}
.token.function,
.token.class-name {
	color: #9fc6d6;
}

/* Nav articolo */
.post__nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 2.75rem;
	padding-top: 1.4rem;
	border-top: 1px double var(--rule);
}
.post__nav-link {
	color: var(--accent);
	text-decoration: none;
	font-family: var(--font-mono);
	font-size: 0.76rem;
	text-transform: lowercase;
}
.post__nav-link:hover {
	text-decoration: underline;
}
.post__nav-link--next {
	margin-left: auto;
}
.post__nav-link--disabled {
	opacity: 0.3;
	pointer-events: none;
}

/* Topic + archivio */
.archive-page {
	max-width: var(--shell-max);
	margin: 0 auto;
	width: 100%;
}
.archive-page__title,
.topics-index__title,
.topic-page__title {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: clamp(1.5rem, 4vw, 1.95rem);
	letter-spacing: -0.02em;
	margin: 0 0 0.4rem;
}
.topic-page__title {
	text-transform: capitalize;
}
.archive-page__meta,
.topic-page__count {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--ink-dim);
	margin: 0 0 1.9rem;
}
.topics-index {
	max-width: var(--reading-width);
	margin: 0 auto;
}
.archive-page__back,
.home-archive__more {
	margin-top: 1.75rem;
	font-family: var(--font-mono);
	font-size: 0.78rem;
}
.archive-page__back a,
.home-archive__more a {
	color: var(--accent);
	text-decoration: none;
}
.archive-page__back a:hover,
.home-archive__more a:hover {
	text-decoration: underline;
}

/* Footer — colophon */
.site-footer {
	border-top: 1px double var(--rule);
	padding: 1.35rem 0;
	margin-top: auto;
}
.site-footer__inner {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}
.site-footer__meta {
	margin: 0;
	font-family: var(--font-mono);
	font-size: 0.7rem;
	text-transform: lowercase;
	letter-spacing: 0.06em;
	color: var(--ink-dim);
}
.site-footer__meta:last-child {
	color: var(--accent);
}

/* ── Topic: metadata (titolo + descrizione per categoria) ── */
.topic-chips--large {
	gap: 0;
	max-width: 46rem;
}
.topic-chips--large li {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	width: 100%;
	padding: 1.05rem 0;
	border-bottom: 1px solid var(--rule);
}
.topic-chips--large li:last-child {
	border-bottom: none;
}
.topic-chip__name {
	font-family: var(--font-display);
	font-size: 1.2rem;
}
.topic-chip__desc {
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--ink-dim);
	max-width: 40rem;
}
.topic-page__kicker {
	margin: 0 0 0.5rem;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--accent-2);
}
.topic-page__desc {
	color: var(--ink-2);
	margin: 0.3rem 0 0;
	max-width: 42rem;
}
.topic-page__count {
	margin-top: 0.7rem;
}
.post__topic {
	margin: 0.8rem 0 0;
	font-family: var(--font-mono);
	font-size: 0.74rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--accent-2);
}

/* ── Figure & didascalie ── */
.prose .fig,
.fig {
	margin: 1.75rem 0;
}
.fig img,
.prose .fig img {
	width: auto;
	height: auto;
	max-width: min(100%, 34rem);
	max-height: 28rem;
	margin-inline: auto;
	display: block;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}
.fig__cap {
	display: block;
	margin-top: 0.55rem;
	font-size: 0.72rem;
	letter-spacing: 0.02em;
	color: var(--ink-dim);
}

/* ── Galleria ── */
.gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.9rem;
	margin: 1.9rem 0;
	align-items: start;
}
.gallery .fig {
	margin: 0;
}
.gallery .fig img {
	max-width: 100%;
	max-height: 20rem;
}
@media (max-width: 540px) {
	.gallery {
		grid-template-columns: 1fr;
	}
}

/* ── Copertine ── */
.post__cover,
.rubrica__cover {
	margin: 0 0 2rem;
}
.post__cover img,
.rubrica__cover img {
	width: 100%;
	height: auto;
	display: block;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}
.rubrica__cover img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
}
.rubrica__cover-cap {
	display: block;
	margin-top: 0.55rem;
	font-size: 0.72rem;
	color: var(--ink-dim);
}

/* ── Layout rubrica fotografica ── */
.rubrica {
	max-width: var(--reading-width);
	margin: 0 auto;
	width: 100%;
}
.rubrica__header {
	margin: 0 0 1.75rem;
}
.rubrica__kicker {
	margin: 0 0 0.6rem;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--accent);
}
.rubrica__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(1.75rem, 5.5vw, 2.5rem);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
}
.rubrica__meta {
	margin: 0.8rem 0 0;
	font-family: var(--font-mono);
	font-size: 0.74rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ink-dim);
}
.rubrica__lead {
	margin: 1rem 0 0;
	font-size: 1.15rem;
	line-height: 1.55;
	color: var(--ink-2);
	max-width: 40rem;
}

/* ── Lightbox ── */
.is-zoomable {
	cursor: zoom-in;
}
html.has-lightbox,
html.has-lightbox body {
	overflow: hidden;
}
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 3rem 1rem 1.5rem;
	background: rgba(28, 19, 9, 0.93);
}
.lightbox[hidden] {
	display: none;
}
.lightbox__frame {
	margin: 0;
	max-width: min(1100px, 92vw);
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
}
.lightbox__img {
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
	border: 1px solid rgba(239, 231, 219, 0.25);
	border-radius: var(--radius);
}
.lightbox__cap {
	color: #efe7db;
	font-size: 0.74rem;
	letter-spacing: 0.04em;
	opacity: 0.75;
	text-align: center;
}
.lightbox__close,
.lightbox__nav {
	background: transparent;
	color: #efe7db;
	border: 1px solid rgba(239, 231, 219, 0.3);
	border-radius: 999px;
	width: 2.6rem;
	height: 2.6rem;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	flex: 0 0 auto;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover {
	background: rgba(239, 231, 219, 0.12);
	border-color: #efe7db;
}
.lightbox__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
}
.lightbox__nav--prev {
	order: -1;
}

/* ═══════════════════════════════════════════════════════════
   VARIANTE V2 — DOSSIER / OFFICINA
   ═══════════════════════════════════════════════════════════ */
.v2-hero {
	position: relative;
	margin-bottom: 2.75rem;
}
.v2-hero__media {
	display: block;
}
.v2-hero__media img {
	width: 100%;
	aspect-ratio: 21 / 9;
	object-fit: cover;
	display: block;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}
.v2-hero__plate {
	background: var(--bg);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	padding: 1.6rem 1.75rem;
	margin-top: 1.5rem;
	max-width: 46rem;
}
@media (min-width: 860px) {
	.v2-hero--media .v2-hero__plate {
		position: relative;
		margin-top: -5.5rem;
		margin-left: 2.5rem;
		box-shadow: 0 18px 40px rgba(34, 26, 18, 0.14);
	}
}
.v2-hero__kicker {
	margin: 0;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--accent);
}
.v2-hero__title {
	margin: 0.7rem 0 0;
	font-family: var(--font-display);
	font-size: clamp(1.8rem, 5.5vw, 2.6rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.025em;
}
.v2-hero__title a {
	color: var(--ink);
	text-decoration: none;
}
.v2-hero__title a:hover {
	color: var(--accent);
}
.v2-hero__desc {
	margin: 0.9rem 0 0;
	color: var(--ink-2);
	font-size: 1.05rem;
}
.v2-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 1.35rem;
	padding: 0.55rem 1.1rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	text-transform: lowercase;
	letter-spacing: 0.04em;
	color: var(--accent);
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}
.v2-hero__cta:hover {
	background: var(--accent);
	color: var(--accent-ink);
}

.v2-layout {
	display: grid;
	gap: 2.5rem;
}
@media (min-width: 900px) {
	.v2-layout {
		grid-template-columns: 15rem 1fr;
		gap: 3.5rem;
	}
	.v2-rail {
		position: sticky;
		top: 1.5rem;
		align-self: start;
	}
}
.v2-rail {
	border-top: 2px solid var(--ink);
	padding-top: 1rem;
}
.v2-rail__label {
	margin: 0 0 0.85rem;
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--ink-dim);
}
.v2-rail__list {
	list-style: none;
	margin: 0 0 1.4rem;
	padding: 0;
}
.v2-rail__link {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid var(--rule);
	color: var(--ink-2);
	text-decoration: none;
	font-family: var(--font-display);
	font-size: 1.02rem;
}
.v2-rail__link:hover {
	color: var(--accent);
}
.v2-rail__n {
	color: var(--ink-dim);
	font-size: 0.72rem;
}
.v2-rail__all {
	color: var(--accent);
	text-decoration: none;
	font-size: 0.74rem;
}
.v2-rail__all:hover {
	text-decoration: underline;
}

/* Articolo V2 — due colonne con meta sticky */
.v2-post {
	max-width: 58rem;
}
.v2-post__lead {
	margin: 0.9rem 0 0;
	font-size: 1.15rem;
	line-height: 1.55;
	color: var(--ink-2);
	max-width: 42rem;
}
.v2-post__grid {
	display: grid;
	gap: 2rem;
}
@media (min-width: 880px) {
	.v2-post__grid {
		grid-template-columns: 10.5rem 1fr;
		grid-template-areas:
			"meta cover"
			"meta body";
		column-gap: 2.75rem;
		row-gap: 0;
	}
	.v2-post__meta {
		grid-area: meta;
		position: sticky;
		top: 1.5rem;
		align-self: start;
	}
	.post__cover {
		grid-area: cover;
	}
	.post__body {
		grid-area: body;
	}
}
.v2-post__meta {
	border-top: 2px solid var(--ink);
	padding-top: 1rem;
}
.v2-post__meta dl {
	margin: 0;
}
.v2-post__meta dt {
	margin: 0 0 0.15rem;
	font-family: var(--font-mono);
	font-size: 0.62rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--ink-dim);
}
.v2-post__meta dd {
	margin: 0 0 0.9rem;
	font-size: 0.9rem;
	color: var(--ink-2);
}
.v2-post__meta a {
	color: var(--accent);
	text-decoration: none;
}
.v2-post__meta a:hover {
	text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   POLISH — tema scuro, TOC, miniature, progresso, figure
   ═══════════════════════════════════════════════════════════ */

/* Tema scuro "officina notturna" */
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #1b1611;
	--bg-2: #241d15;
	--bg-3: #2c2319;
	--ink: #efe7db;
	--ink-2: #cabda6;
	--ink-dim: #8f8065;
	--rule: #3a3024;
	--accent: #d9603f;
	--accent-2: #d8a53f;
	--accent-ink: #1b1611;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #1b1611;
		--bg-2: #241d15;
		--bg-3: #2c2319;
		--ink: #efe7db;
		--ink-2: #cabda6;
		--ink-dim: #8f8065;
		--rule: #3a3024;
		--accent: #d9603f;
		--accent-2: #d8a53f;
		--accent-ink: #1b1611;
	}
}

html {
	scroll-padding-top: 1.5rem;
}

/* Header: strumenti a destra */
.site-header__end {
	display: flex;
	align-items: center;
	gap: 1.1rem;
}
.theme-toggle {
	width: 2.1rem;
	height: 2.1rem;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--rule);
	border-radius: 999px;
	color: var(--ink-2);
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle::before {
	content: "\25d0";
	font-size: 0.95rem;
	line-height: 1;
}
.theme-toggle:hover {
	border-color: var(--accent);
	color: var(--accent);
}
.theme-toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Miniature nella lista */
.post-list__thumb {
	display: none;
	width: 4.5rem;
	height: 3rem;
	border-radius: var(--radius);
	overflow: hidden;
}
.post-list__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}
@media (min-width: 640px) {
	.post-list--with-covers .post-list__link {
		grid-template-columns: 4.5rem 8.5rem 1fr auto;
		align-items: center;
	}
	.post-list__thumb {
		display: block;
	}
}

/* Indice articolo (TOC) */
.toc {
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rule);
}
.toc__label {
	margin: 0 0 0.7rem;
	font-size: 0.62rem;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--accent-2);
}
.toc__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.toc__item {
	font-size: 0.82rem;
	line-height: 1.35;
}
.toc__item--h3 {
	padding-left: 0.85rem;
}
.toc__item a {
	color: var(--ink-2);
	text-decoration: none;
}
.toc__item a:hover {
	color: var(--accent);
	text-decoration: underline;
}

/* Barra di avanzamento lettura */
.read-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 150;
	pointer-events: none;
}
.read-progress__bar {
	display: block;
	height: 100%;
	width: 100%;
	transform: scaleX(0);
	transform-origin: 0 50%;
	background: var(--accent);
	transition: transform 0.08s linear;
}

/* Figure numerate */
.prose {
	counter-reset: fig;
}
.prose .fig {
	counter-increment: fig;
}
.prose .fig .fig__cap::before {
	content: "FIG. " counter(fig, decimal-leading-zero) " — ";
	color: var(--accent-2);
}

/* Pagina 404 */
.error-page {
	max-width: 44rem;
	margin: 0 auto;
	padding: 3rem 0 4rem;
}
.error-page__code {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(4rem, 18vw, 9rem);
	line-height: 0.85;
	letter-spacing: -0.04em;
	color: var(--accent);
}
.error-page__title {
	margin: 0.5rem 0 0;
	font-family: var(--font-display);
	font-size: clamp(1.5rem, 4vw, 2rem);
}
.error-page__desc {
	margin: 0.9rem 0 0;
	color: var(--ink-2);
}
.error-page__links {
	margin-top: 1.75rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--ink-dim);
}
.error-page__links a {
	color: var(--accent);
	text-decoration: none;
}
.error-page__links a:hover {
	text-decoration: underline;
}

/* ── Pagine statiche (Chi sono, ecc.) ── */
.page {
	max-width: var(--reading-width);
	margin: 0 auto;
	width: 100%;
}
.page__header {
	margin-bottom: 1.75rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--rule);
}
.page__kicker {
	margin: 0 0 0.6rem;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--accent);
}
.page__title {
	margin: 0;
	font-family: var(--font-display);
	font-size: clamp(1.7rem, 5vw, 2.4rem);
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

/* ── Header su mobile: brand sopra, nav a capo ── */
@media (max-width: 600px) {
	.site-header__inner {
		flex-wrap: wrap;
		row-gap: 0.4rem;
		padding: 0.55rem 0;
	}
	.site-header__end {
		flex-basis: 100%;
		justify-content: space-between;
	}
	.site-brand {
		font-size: 1.1rem;
	}
	.lightbox {
		padding: 3.25rem 0.75rem 1.25rem;
		gap: 0.5rem;
	}
	.lightbox__close,
	.lightbox__nav {
		width: 2.2rem;
		height: 2.2rem;
		font-size: 1rem;
	}
}
