/* Restauro 500 — stili di componente (dal design system, styles.css v3), legati ai preset di theme.json */
:root {
	--bg: var(--wp--preset--color--bg);
	--bg-card: var(--wp--preset--color--bg-card);
	--bg-warm: var(--wp--preset--color--bg-warm);
	--bg-warm-2: var(--wp--preset--color--bg-warm-2);
	--bg-dark: var(--wp--preset--color--bg-dark);
	--ink: var(--wp--preset--color--ink);
	--ink-2: var(--wp--preset--color--ink-2);
	--ink-3: var(--wp--preset--color--ink-3);
	--rust: var(--wp--preset--color--rust);
	--rust-deep: var(--wp--preset--color--rust-deep);
	--rust-wash: var(--wp--preset--color--rust-wash);
	--rust-soft: var(--wp--custom--rust-soft);
	--on-rust: #ffffff;
	--ochre: var(--wp--preset--color--ochre);
	--olive: var(--wp--preset--color--olive);
	--olive-soft: var(--wp--custom--olive-soft);
	--blue: var(--wp--preset--color--blue);
	--blue-soft: var(--wp--custom--blue-soft);
	--blue-text: var(--wp--preset--color--blue-text);
	--stamp: var(--rust-deep);
	--tape: var(--wp--custom--tape);
	--line: var(--wp--custom--line);
	--line-2: var(--wp--custom--line-2);
	--glass: var(--wp--custom--glass);
	--font-sans: var(--wp--preset--font-family--sans);
	--font-serif: var(--wp--preset--font-family--serif);
	--font-mono: var(--wp--preset--font-family--mono);
	--font-typewriter: var(--wp--preset--font-family--typewriter);
	--shadow-card-hover: 0 12px 32px -16px rgba(28, 24, 20, 0.12);
	--shadow-tape: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body {
	-webkit-font-smoothing: antialiased;
	/* le due macchie quasi invisibili ruggine/oliva nel fondo pagina */
	background-image:
		radial-gradient(900px 600px at 88% -8%, rgba(212, 86, 27, 0.06), transparent 60%),
		radial-gradient(800px 600px at -6% 38%, rgba(90, 98, 56, 0.05), transparent 60%);
	background-attachment: fixed;
}
::selection { background: var(--rust); color: #fff; }
:where(a, button, input, summary):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
img { height: auto; }

/* ---------- accenti tipografici ---------- */
.serif-em,
:where(h1, h2, h3, h4, .wp-block-heading, .wp-block-post-title) em {
	font-family: var(--font-serif);
	font-style: italic;
	font-weight: 400;
	color: var(--rust);
	letter-spacing: -0.01em;
}
.is-style-hero { font-size: var(--wp--preset--font-size--hero) !important; line-height: 0.92 !important; letter-spacing: -0.035em !important; }
.mono { font-family: var(--font-mono); }
.typewriter, .is-style-typewriter { font-family: var(--font-typewriter); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-2); }
.kicker, .is-style-kicker {
	font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.06em;
	color: var(--ink-2); text-transform: lowercase;
}
.card-kicker, .is-style-card-kicker {
	font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase;
	letter-spacing: 0.08em; color: var(--rust-deep); margin: 0 0 14px;
}
.section-tag, .is-style-section-tag {
	display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono);
	font-size: 12px; font-weight: 500; letter-spacing: 0.04em; color: var(--ink-2);
}
.section-tag .num, .is-style-section-tag strong, .is-style-section-tag b { color: var(--rust-deep); padding: 0 4px; font-weight: 500; }
.is-style-lede { font-size: var(--wp--preset--font-size--lede); line-height: 1.55; color: var(--ink-2); max-width: 640px; }

/* ---------- logo ---------- */
.nav-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.nav-logo:hover { color: var(--ink); }
.nav-logo-words { display: flex; flex-direction: column; line-height: 1.1; }
.logo-mark {
	width: 32px; height: 32px; background: var(--ink); color: var(--bg); border-radius: 50%;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	font-family: var(--font-sans); font-weight: 800; line-height: 0.9; border: 2px solid var(--rust); flex-shrink: 0; box-sizing: border-box;
}
.logo-mark .fiat { font-size: 6px; letter-spacing: 0.08em; color: var(--rust); text-transform: uppercase; }
.logo-mark .five { font-size: 12px; color: var(--bg); }
.nav-logo .est { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; font-weight: 500; }

/* ---------- testata ---------- */
.r5-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .r5-header { top: var(--wp-admin--admin-bar--height, 32px); }
.r5-header .wp-block-navigation a { color: var(--ink-2); }
.r5-header .wp-block-navigation a:hover,
.r5-header .wp-block-navigation .current-menu-item > a { color: var(--ink); }
.r5-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--bg); }

/* ---------- bottoni ---------- */
.wp-block-button__link { display: inline-flex; align-items: center; gap: 8px; transition: transform 0.1s ease, background 0.15s ease; white-space: nowrap; }
.wp-block-button__link:hover { transform: translateY(-1px); }
.wp-block-button__link::after { content: "→"; font-weight: 500; }
.wp-block-button.no-arrow .wp-block-button__link::after,
.is-style-stamp .wp-block-button__link::after { content: none; }
.wp-block-button.is-style-ghost .wp-block-button__link { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.wp-block-button.is-style-ghost .wp-block-button__link:hover { background: var(--bg-card); color: var(--ink); }
.wp-block-button.is-style-dark .wp-block-button__link { background: var(--ink); color: var(--bg); }
.wp-block-button.is-style-dark .wp-block-button__link:hover { background: #000; color: var(--bg); }
.wp-block-button.is-style-stamp .wp-block-button__link {
	background: transparent; color: var(--stamp); border: 2px dashed var(--stamp); padding: 12px 20px;
	font-family: var(--font-typewriter); font-weight: 400; font-size: 14px; letter-spacing: 0.05em; border-radius: 999px;
}
.wp-block-button.is-style-small .wp-block-button__link { padding: 8px 14px; font-size: 13px; }
.wp-block-button.is-style-outline .wp-block-button__link { border: 1px solid var(--line-2); color: var(--ink); background: transparent; }

/* ---------- timbro e nastro ---------- */
.stamp, p.is-style-stamp {
	display: inline-block; color: var(--stamp); border: 2.5px solid var(--stamp); padding: 5px 12px;
	font-family: var(--font-sans); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
	font-size: 11px; line-height: 1.2; transform: rotate(-4deg); opacity: 0.85; border-radius: 4px; width: fit-content;
}
.tape, .is-style-tape::before, .is-style-taped::before {
	content: ""; position: absolute; background: var(--tape); border: 1px solid rgba(0, 0, 0, 0.06);
	box-shadow: var(--shadow-tape); width: 80px; height: 20px; transform: rotate(-3deg); z-index: 3;
}
.wp-block-image.is-style-tape, .wp-block-group.is-style-taped { position: relative; }
.wp-block-image.is-style-tape::before, .is-style-taped::before { top: -10px; left: 50%; margin-left: -40px; }
.wp-block-image.is-style-tape img { border-radius: 12px; }
.wp-block-image.is-style-multiply img, .r5-pino img, .r5-badge img, .r5-car-well img { mix-blend-mode: multiply; border-radius: 0; }
.wp-block-image.is-style-placeholder img { display: none; }
.wp-block-image.is-style-placeholder, .r5-ph {
	aspect-ratio: 4 / 3; border-radius: 12px; background: var(--bg-warm); border: 1px solid var(--line); position: relative; overflow: hidden;
	background-image: repeating-linear-gradient(135deg, rgba(28, 24, 20, 0.04) 0 6px, transparent 6px 14px);
}
.wp-block-image.is-style-placeholder figcaption, .r5-ph span {
	position: absolute; bottom: 10px; left: 12px; margin: 0;
	font-family: var(--font-typewriter); font-size: 11px; color: var(--ink-2); letter-spacing: 0.04em;
}

/* ---------- tag ---------- */
.tag, p[class*="is-style-tag"] {
	display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
	background: var(--bg-warm); color: var(--ink); font-family: var(--font-mono); font-size: 11px; line-height: 1.4;
	font-weight: 500; white-space: nowrap; text-decoration: none; width: fit-content;
}
a.tag:hover { background: var(--bg-warm-2); color: var(--ink); }
.tag.rust, p.is-style-tag-rust { background: var(--rust-soft); color: var(--rust-deep); }
.tag.blue, p.is-style-tag-blue { background: var(--blue-soft); color: var(--blue-text); }
.tag.olive, p.is-style-tag-olive { background: var(--olive-soft); color: var(--olive); }
.tag.dark { background: var(--ink); color: var(--bg); }
.wp-block-post-terms a, .wp-block-tag-cloud a {
	display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--bg-warm); color: var(--ink);
	font-family: var(--font-mono); font-size: 11px !important; font-weight: 500; text-transform: lowercase; margin: 0 4px 4px 0;
}
.wp-block-post-terms__separator { display: none; }

/* ---------- chip filtro ---------- */
.r5-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.r5-chip {
	background: var(--bg-card); color: var(--ink); border: 1px solid var(--line-2); padding: 6px 13px;
	border-radius: 999px; cursor: pointer; font-family: var(--font-mono); font-size: 12px; font-weight: 500;
	display: inline-flex; gap: 6px; align-items: center; text-decoration: none; line-height: 1.4;
}
.r5-chip:hover { border-color: var(--ink); color: var(--ink); }
.r5-chip.active, .r5-chip[aria-pressed="true"], .r5-chip.current-cat { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.r5-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.r5-chip .count { opacity: 0.6; }

/* ---------- card ---------- */
.card, .wp-block-group.is-style-card, .wp-block-group.is-style-card-hover {
	background: var(--bg-card); border: 1px solid var(--line); border-radius: 18px; padding: 24px;
	position: relative; transition: transform 0.15s ease, box-shadow 0.15s ease; box-sizing: border-box;
}
.card-hover:hover, .wp-block-group.is-style-card-hover:hover, .r5-cards .wp-block-post:hover > .card { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.card-title { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 10px; }
.card-title a, .r5-cards .wp-block-post-title a { color: var(--ink); }
.card-title a:hover, .r5-cards .wp-block-post-title a:hover { color: var(--rust-deep); }
.card-body { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.card-meta {
	margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--font-mono);
	font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; display: flex; justify-content: space-between;
}
.r5-cards .wp-block-post-featured-image { margin: 0 0 18px; }
.r5-cards .wp-block-post-featured-image img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.r5-cards .wp-block-post-template { gap: 20px; }
.r5-cards .wp-block-post > .card { height: 100%; }

/* ---------- numeri ---------- */
.stat-num { font-size: var(--wp--preset--font-size--stat); font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--rust); }
.stat-num.sm { font-size: 24px; letter-spacing: 0; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.is-style-dark-section .stat-label { color: rgba(244, 241, 230, 0.7); }

/* ---------- avanzamento ---------- */
.progress { height: 6px; background: var(--bg-warm); border-radius: 999px; overflow: hidden; margin: 12px 0; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--rust); }
.stage-dots { display: flex; gap: 4px; margin-top: 16px; }
.stage-dot { flex: 1; height: 4px; border-radius: 999px; background: var(--bg-warm); }
.r5-progress-head { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.r5-progress-head .pct { font-family: var(--font-mono); font-size: 14px; font-weight: 600; }

/* ---------- scheda auto ---------- */
.r5-car-card { height: 100%; }
.r5-car-well {
	aspect-ratio: 16 / 10; border-radius: 12px; margin-bottom: 24px;
	background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-warm-2) 100%); border: 1px solid var(--line);
	display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.r5-car-well img { width: 62%; max-width: 280px; height: auto; }
.r5-car-head { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.r5-car-title { font-size: 28px; letter-spacing: -0.02em; }
.r5-car-title .serif-em { font-size: 1.1em; margin-left: 4px; }
.r5-car-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.r5-car-figures .fig { font-size: 20px; font-weight: 700; margin-top: 2px; }
.r5-quote { font-size: 14px; color: var(--ink-2); font-style: italic; margin: 16px 0 0; line-height: 1.5; }
.r5-car-link { display: inline-block; margin-top: 14px; }

/* ---------- timeline del diario ---------- */
.r5-timeline .wp-block-post-template { position: relative; gap: 28px; }
.r5-timeline .wp-block-post-template::before {
	content: ""; position: absolute; left: 26px; top: 26px; bottom: 26px;
	border-left: 2px dashed var(--line-2); z-index: 0;
}
.r5-timeline .wp-block-post > .wp-block-columns { gap: 24px; margin: 0; flex-wrap: nowrap !important; }
.r5-timeline .wp-block-post > .wp-block-columns > .wp-block-column:first-child { flex: 0 0 60px !important; }
.timeline-dot {
	width: 52px; height: 52px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--rust);
	display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2; position: relative; box-sizing: border-box;
}
.timeline-dot.blue { border-color: var(--blue); }
.timeline-dot .n { font-family: var(--font-sans); font-weight: 700; font-size: 13px; color: var(--rust-deep); line-height: 1.1; }
.timeline-dot.blue .n { color: var(--blue-text); }
.timeline-dot .d { font-family: var(--font-mono); font-size: 8px; color: var(--ink-3); letter-spacing: 0.04em; margin-top: 1px; }
.r5-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.r5-tags .r5-date { margin-left: auto; }
.r5-entry-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.r5-link { color: var(--rust-deep); text-decoration: none; }
.r5-link:hover { color: var(--rust); }
.r5-timeline .wp-block-post-title { font-size: var(--wp--preset--font-size--entry-title); font-weight: 700; letter-spacing: -0.018em; line-height: 1.2; margin: 0 0 10px; }
.r5-timeline .wp-block-post-title a { color: var(--ink); }
.r5-timeline .wp-block-post-title a:hover { color: var(--rust-deep); }
.r5-timeline .wp-block-post-excerpt { margin: 0; }
.r5-timeline .wp-block-post-excerpt__excerpt { margin: 0; font-size: 15px; line-height: 1.6; }
.r5-timeline .wp-block-post.is-hidden { display: none; }

/* ---------- blocchi dati ---------- */
.wp-block-group.is-style-data, .wp-block-group.is-style-data-accent { border-radius: 18px; padding: 24px; background: var(--bg-card); border: 1px solid var(--line); }
.wp-block-group.is-style-data-accent { border: 1.5px solid var(--rust); background: var(--rust-wash); }
ul.is-style-data-rows { list-style: none; padding: 0; margin: 0; }
ul.is-style-data-rows li {
	display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 6px 0; border-bottom: 1px dotted var(--line-2); font-size: 13.5px;
}
ul.is-style-data-rows li strong, ul.is-style-data-rows li b { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-2); text-transform: lowercase; letter-spacing: 0.04em; padding-top: 2px; }

/* ---------- ritmo: bande, scuro, bento ---------- */
.wp-block-group.is-style-warm-band { background: var(--bg-warm); border-radius: 32px; }
.wp-block-group.is-style-dark-section { background: var(--bg-dark); color: var(--bg); border-radius: 32px; position: relative; overflow: hidden; }
.is-style-dark-section :where(h1, h2, h3, h4, .wp-block-heading) { color: var(--bg); }
.is-style-dark-section .is-style-section-tag, .is-style-dark-section .section-tag, .is-style-dark-section .kicker { color: rgba(244, 241, 230, 0.7); }
.is-style-dark-section .is-style-section-tag strong, .is-style-dark-section .section-tag .num { color: var(--ochre); }
.is-style-dark-section .stat-num { color: var(--ochre); }
.is-style-dark-section p { color: rgba(244, 241, 230, 0.8); }
.is-style-dark-section a:not(.wp-block-button__link) { color: var(--bg); text-decoration: underline; text-decoration-color: var(--ochre); text-underline-offset: 3px; }
.wp-block-group.is-style-bento {
	background: var(--rust); color: var(--on-rust); border-radius: 28px; position: relative; overflow: hidden; isolation: isolate;
}
.wp-block-group.is-style-bento::after {
	content: "500"; position: absolute; right: -2%; bottom: -18%; z-index: -1;
	font-family: var(--font-serif); font-style: italic; font-size: clamp(200px, 32vw, 420px); line-height: 1;
	color: rgba(255, 255, 255, 0.08); pointer-events: none;
}
.is-style-bento :where(h1, h2, h3, p, .wp-block-heading) { color: var(--on-rust); }
.is-style-bento h2 { font-size: var(--wp--preset--font-size--bento); font-weight: 800; letter-spacing: -0.025em; line-height: 1; }
.is-style-bento h2 em { color: var(--on-rust); }
.is-style-bento .is-style-kicker { color: rgba(255, 255, 255, 0.85); }

/* form newsletter nel bento */
.r5-form { display: flex; gap: 8px; background: var(--bg-card); border-radius: 14px; padding: 6px; max-width: 520px; }
.r5-form input[type="email"] {
	flex: 1; border: 0; background: transparent; padding: 12px 14px; font: 500 15px var(--font-sans); color: var(--ink); min-width: 0;
}
.r5-form input[type="email"]:focus { outline: none; }
.r5-form:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.r5-form button {
	border: 0; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 12px 18px;
	font: 600 15px var(--font-sans); cursor: pointer; white-space: nowrap;
}
.r5-form button:hover { background: #000; }
.r5-form-note { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; margin-top: 10px; opacity: 0.85; }

/* ---------- mascotte e badge ---------- */
.r5-pino, .r5-badge { margin: 0; text-align: center; }
.r5-pino img, .r5-badge img { max-width: 100%; display: inline-block; }
.r5-pino figcaption { margin-top: 6px; }

/* ---------- articolo singolo ---------- */
.r5-single .wp-block-post-content { font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.r5-single .wp-block-post-content :where(h2) { font-size: 36px; margin-top: 1.6em; }
.r5-single .wp-block-post-content :where(h3) { font-size: 24px; margin-top: 1.4em; }
.r5-single .wp-block-post-content :where(p, li) { max-width: 70ch; }
.r5-single .wp-block-post-featured-image img { border-radius: 24px; border: 1px solid var(--line); }
.wp-block-post-navigation-link a { color: var(--ink); font-weight: 600; }
.wp-block-post-navigation-link a:hover { color: var(--rust-deep); }

/* ---------- impaginazione e ricerca ---------- */
.wp-block-query-pagination { font-family: var(--font-mono); font-size: 12px; gap: 8px; }
.wp-block-query-pagination a, .wp-block-query-pagination .page-numbers {
	display: inline-flex; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink); background: var(--bg-card);
}
.wp-block-query-pagination .page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.wp-block-search__input { border: 1px solid var(--line-2) !important; border-radius: 999px !important; padding: 10px 16px !important; background: var(--bg-card); font-family: var(--font-sans); }
.wp-block-search__button { border-radius: 999px !important; background: var(--ink) !important; color: var(--bg) !important; margin-left: 8px !important; }

/* ---------- piè di pagina ---------- */
.r5-footer { border-top: 1px solid var(--line); }
.r5-footer .wp-block-navigation a { color: var(--ink-2); }
.r5-footer .wp-block-navigation a:hover { color: var(--ink); }
.r5-foot-head { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 10px; }

/* ---------- commenti ---------- */
.wp-block-comments .wp-block-comment-author-name { font-weight: 700; }
.wp-block-comments .wp-block-comment-date { font-family: var(--font-mono); font-size: 11px; }
.wp-block-post-comments-form input[type="submit"] { background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 600; cursor: pointer; }
.wp-block-post-comments-form :where(input[type="text"], input[type="email"], input[type="url"], textarea) {
	border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-card); padding: 10px 12px; font-family: var(--font-sans);
}

/* ---------- responsive ---------- */
@media (max-width: 781px) {
	.r5-timeline .wp-block-post-template::before { left: 20px; }
	.r5-timeline .wp-block-post > .wp-block-columns > .wp-block-column:first-child { flex: 0 0 44px !important; }
	.r5-timeline .timeline-dot { width: 42px; height: 42px; }
	.r5-timeline .timeline-dot .d { display: none; }
	.r5-tags .r5-date { margin-left: 0; }
	ul.is-style-data-rows li { grid-template-columns: 1fr; gap: 2px; }
	.r5-form { flex-direction: column; }
	.wp-block-group.is-style-dark-section, .wp-block-group.is-style-warm-band { border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; }
}
@media (max-width: 599px) { .r5-hide-mobile { display: none !important; } }
.section-tag, .is-style-section-tag { margin-left: 0; }
.is-style-bento .r5-form-note { color: rgba(255, 255, 255, 0.85); }
