/* Base */
:root {
	--editoria-header-height: 72px;
	--editoria-border: 1px solid var(--wp--preset--color--border);
}

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

html {
	scroll-behavior: smooth;
	text-rendering: optimizeLegibility;
}

body {
	margin: 0;
	overflow-wrap: break-word;
}

img,
video,
iframe {
	max-width: 100%;
}

img {
	height: auto;
}

a {
	text-underline-offset: .15em;
}

a:hover {
	text-decoration: underline;
}

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

/* Header */
.site-header {
	position: relative;
	z-index: 20;
	border-bottom: var(--editoria-border);
	background: rgba(255, 255, 255, .98);
}

.site-header__inner {
	min-height: var(--editoria-header-height);
}

.site-header .wp-block-site-title {
	line-height: 1;
}

.site-header .wp-block-site-title a {
	color: var(--wp--preset--color--ink);
}

.site-header .wp-block-navigation {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}

/* Utility editoriali */
.eyebrow,
.taxonomy-label,
.wp-block-post-terms {
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.section-heading {
	padding-bottom: .6rem;
	border-bottom: 3px solid var(--wp--preset--color--accent);
}

.meta-row {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.card {
	height: 100%;
	border: var(--editoria-border);
	border-radius: var(--wp--custom--radius--medium);
	overflow: hidden;
	background: var(--wp--preset--color--paper);
}

.card .wp-block-post-featured-image {
	margin: 0;
	border-radius: 0;
	overflow: hidden;
}

.card .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform .25s ease;
}

.card:hover .wp-block-post-featured-image img {
	transform: scale(1.015);
}

.card__body {
	padding: clamp(1rem, 2vw, 1.4rem);
}

.lead-story .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.lead-story .wp-block-post-title {
	max-width: 18ch;
}

.story-list .wp-block-post {
	padding-block: 1.25rem;
	border-bottom: var(--editoria-border);
}

.story-list .wp-block-post:first-child {
	border-top: var(--editoria-border);
}

.archive-grid .wp-block-post {
	min-width: 0;
}

.wp-block-query-pagination {
	gap: .5rem;
	margin-top: var(--wp--preset--spacing--70);
}

.wp-block-query-pagination a,
.wp-block-query-pagination .current {
	display: inline-flex;
	min-width: 42px;
	min-height: 42px;
	align-items: center;
	justify-content: center;
	border: var(--editoria-border);
	border-radius: 999px;
}

/* Articolo */
.article-shell {
	padding-block: clamp(2rem, 6vw, 5rem);
}

.article-header {
	max-width: 980px;
}

.article-header .wp-block-post-title {
	max-width: 21ch;
}

.article-deck {
	max-width: 760px;
	color: var(--wp--preset--color--muted);
}

.article-featured {
	max-width: 1180px;
}

.article-featured img {
	width: 100%;
	max-height: 720px;
	object-fit: cover;
}

.article-body {
	position: relative;
}

.article-body > * {
	max-width: 760px;
	margin-inline: auto;
}

.article-body > .alignwide {
	max-width: 1180px;
}

.article-body > .alignfull {
	max-width: none;
}

.article-body p {
	margin-block: 0 1.35em;
}

.article-body h2,
.article-body h3 {
	margin-top: 1.7em;
	margin-bottom: .7em;
}

.article-body blockquote {
	padding: 1rem 0 1rem 1.5rem;
	border-left: 5px solid var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--system);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	line-height: 1.2;
}

.article-body figcaption {
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--system);
	font-size: var(--wp--preset--font-size--small);
}

.article-footer {
	max-width: 760px;
}

.author-box {
	padding: clamp(1.25rem, 4vw, 2rem);
	border: var(--editoria-border);
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--surface);
}

/* Correlati generati dallo shortcode */
.related-posts {
	max-width: 1180px;
	margin: var(--wp--preset--spacing--80) auto 0;
}

.related-posts > h2 {
	padding-bottom: .65rem;
	border-bottom: 3px solid var(--wp--preset--color--accent);
}

.related-posts__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem;
}

.related-card {
	border: var(--editoria-border);
	border-radius: var(--wp--custom--radius--medium);
	overflow: hidden;
}

.related-card__media {
	display: block;
	background: var(--wp--preset--color--surface);
}

.related-card__media img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.related-card__body {
	padding: 1rem;
}

.related-card__meta {
	margin: 0 0 .4rem;
	color: var(--wp--preset--color--muted);
	font-size: .75rem;
}

.related-card__title {
	margin: 0;
	font-size: 1.15rem;
}

.related-card__title a {
	color: var(--wp--preset--color--ink);
}

/* Footer */
.site-footer {
	margin-top: var(--wp--preset--spacing--80);
	border-top: var(--editoria-border);
}

/* Accessibilità */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 781px) {
	:root {
		--editoria-header-height: 64px;
	}

	.site-header .wp-block-search {
		display: none;
	}

	.related-posts__grid {
		grid-template-columns: 1fr;
	}

	.article-header .wp-block-post-title {
		max-width: none;
	}

	.article-body blockquote {
		font-size: 1.5rem;
	}
}

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

	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
