/* ==========================================================================
   EEC Press – stile principale
   Mobile first · proprietà logiche (supporto RTL automatico) · WCAG 2.2 AA
   ========================================================================== */

/* 1. Variabili --------------------------------------------------------- */
:root {
	--navy: #000066;          /* blu del logo */
	--navy-900: #00003d;
	--navy-700: #1a1a80;
	--navy-100: #e8e8f5;
	--red: #d00000;           /* rosso del logo scurito per contrasto testo 5.9:1 su bianco */
	--red-bright: #ff0000;    /* rosso del logo, solo per elementi grafici */
	--ink: #14142b;           /* testo principale: 17:1 */
	--ink-soft: #4a4a63;      /* testo secondario: 8.6:1 */
	--line: #dcdde6;
	--surface: #ffffff;
	--surface-alt: #f3f4f8;
	--focus: #d00000;

	--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--font-serif: Georgia, "Iowan Old Style", "Times New Roman", "Noto Serif", serif;
	--font-arabic: "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", sans-serif;

	--step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
	--step-0: clamp(1rem, 0.97rem + 0.15vw, 1.06rem);
	--step-1: clamp(1.13rem, 1.06rem + 0.3vw, 1.3rem);
	--step-2: clamp(1.3rem, 1.17rem + 0.6vw, 1.65rem);
	--step-3: clamp(1.6rem, 1.35rem + 1.1vw, 2.25rem);
	--step-4: clamp(1.9rem, 1.5rem + 1.9vw, 3rem);

	--radius: 6px;
	--gap: clamp(1rem, 0.75rem + 1.2vw, 2rem);
	--container: 1240px;
	--measure: 42rem;
	--header-h: 64px;
	--shadow: 0 1px 2px rgb(0 0 40 / 0.06), 0 4px 16px rgb(0 0 40 / 0.06);
}

/* 2. Base -------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	margin: 0;
	background: var(--surface);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: var(--step-0);
	line-height: 1.6;
	overflow-wrap: break-word;
}

[lang="ar"],
[dir="rtl"] { font-family: var(--font-arabic); }
[lang="ar"] .article__content,
[dir="rtl"] .article__content { line-height: 1.95; }

img,
svg,
video,
iframe { max-width: 100%; height: auto; }
img { display: block; }

a {
	color: var(--navy);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
a:hover { color: var(--red); }

:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
	border-radius: 2px;
}
/* Su sfondo blu il focus diventa bianco per restare visibile */
.topbar :focus-visible,
.primary-nav :focus-visible,
.site-footer :focus-visible,
.latest-bar__title:focus-visible { outline-color: #fff; }

h1, h2, h3, h4 {
	font-family: var(--font-serif);
	line-height: 1.2;
	color: var(--ink);
	margin: 0 0 0.5em;
	text-wrap: balance;
}
[dir="rtl"] :is(h1, h2, h3, h4) { font-family: var(--font-arabic); line-height: 1.45; }

p { margin: 0 0 1em; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2rem);
}
.container--article { max-width: 1120px; }
.container--narrow { max-width: 760px; }

/* 3. Skip link ------------------------------------------------------- */
.skip-links { list-style: none; margin: 0; padding: 0; }
.skip-link {
	position: absolute;
	inset-inline-start: 1rem;
	top: -100px;
	z-index: 1000;
	padding: 0.75rem 1.25rem;
	background: var(--navy);
	color: #fff;
	font-weight: 700;
	border-radius: var(--radius);
	text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }

/* 4. Topbar ------------------------------------------------------------ */
.topbar {
	background: var(--navy-900);
	color: #fff;
	font-size: var(--step--1);
}
.topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 36px;
}
.topbar__date { margin: 0; text-transform: capitalize; }

.social {
	display: flex;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.social a {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	color: inherit;
	border-radius: 50%;
}
.social a:hover { background: rgb(255 255 255 / 0.14); color: #fff; }
.social .icon { width: 18px; height: 18px; fill: currentColor; }

/* 5. Header ------------------------------------------------------------ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--surface);
	border-bottom: 3px solid var(--red-bright);
	transition: box-shadow 0.2s;
}
.admin-bar .site-header { top: 46px; }
@media (min-width: 783px) { .admin-bar .site-header { top: 32px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header.is-scrolled { box-shadow: var(--shadow); }

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: var(--header-h);
	padding-block: 0.5rem;
}

.site-branding { min-width: 0; }
.site-title { margin: 0; font-size: 1rem; line-height: 1; }
.custom-logo-link { display: inline-block; }
.custom-logo {
	width: auto;
	height: 38px;
	max-width: 100%;
	transition: height 0.2s;
}
.site-description {
	margin: 0.3rem 0 0;
	font-size: var(--step--1);
	color: var(--ink-soft);
	display: none;
}

.header-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.6rem;
	border: 0;
	border-radius: var(--radius);
	background: transparent;
	color: var(--navy);
	cursor: pointer;
	font-weight: 700;
	font-size: var(--step--1);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.icon-btn:hover { background: var(--navy-100); }
.icon-btn .icon { width: 24px; height: 24px; fill: currentColor; }
.icon-btn[aria-expanded="true"] { background: var(--navy); color: #fff; }

/* Ricerca nell'header */
.header-search {
	background: var(--surface-alt);
	border-top: 1px solid var(--line);
	padding-block: 0.9rem;
}
.header-search[hidden] { display: none; }

.search-form { display: flex; gap: 0.5rem; max-width: 640px; }
.search-field {
	flex: 1;
	min-width: 0;
	min-height: 48px;
	padding: 0.5rem 1rem;
	border: 2px solid var(--ink-soft);
	border-radius: var(--radius);
	background: #fff;
	font-size: 1rem; /* >= 16px: evita lo zoom automatico su iOS */
}
.search-field:focus-visible { border-color: var(--navy); outline-offset: 1px; }
.search-submit {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 48px;
	padding: 0 1.1rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--navy);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}
.search-submit:hover { background: var(--red); }
.search-submit .icon { width: 20px; height: 20px; fill: currentColor; }

/* Navigazione principale — mobile: pannello a scomparsa */
.primary-nav {
	background: var(--navy);
	color: #fff;
}
.js .primary-nav:not(.is-open) { display: none; }
.primary-nav.is-open {
	max-height: calc(100dvh - var(--header-h) - 8px);
	overflow-y: auto;
	overscroll-behavior: contain;
}
.primary-nav .menu {
	list-style: none;
	margin: 0;
	padding: 0.5rem 0 1rem;
}
.primary-nav li { position: relative; }
.primary-nav .menu > li { border-bottom: 1px solid rgb(255 255 255 / 0.14); }
.primary-nav a {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0.5rem 0;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}
.primary-nav a:hover { color: #fff; text-decoration: underline; }
.primary-nav :is(.current-menu-item, .current-cat, .current-menu-ancestor) > a,
.primary-nav a[aria-current="page"] {
	box-shadow: inset 4px 0 0 var(--red-bright);
	padding-inline-start: 0.75rem;
}
[dir="rtl"] .primary-nav :is(.current-menu-item, .current-cat) > a { box-shadow: inset -4px 0 0 var(--red-bright); }

.submenu-toggle {
	position: absolute;
	inset-inline-end: 0;
	top: 0;
	width: 48px;
	height: 48px;
	display: grid;
	place-items: center;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	border-radius: var(--radius);
}
.submenu-toggle .icon { width: 24px; height: 24px; fill: currentColor; transition: transform 0.2s; }
.submenu-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.primary-nav .menu-item-has-children > a { padding-inline-end: 52px; }

.primary-nav .sub-menu {
	list-style: none;
	margin: 0 0 0.5rem;
	padding: 0 0 0 1rem;
	padding-inline: 1rem 0;
}
.js .primary-nav .sub-menu:not(.is-open) { display: none; }
.primary-nav .sub-menu a { font-weight: 400; min-height: 44px; }

/* Barra di avanzamento lettura */
.reading-progress {
	position: absolute;
	inset-inline: 0;
	bottom: -3px;
	height: 3px;
	pointer-events: none;
}
.reading-progress span {
	display: block;
	height: 100%;
	width: 100%;
	background: var(--navy);
	transform-origin: left;
	transform: scaleX(0);
}
[dir="rtl"] .reading-progress span { transform-origin: right; }

/* Ultim'ora */
.latest-bar {
	background: var(--surface-alt);
	border-bottom: 1px solid var(--line);
	font-size: var(--step--1);
}
.latest-bar__inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: 48px;
}
.latest-bar__title {
	flex-shrink: 0;
	margin: 0;
	padding: 0.25rem 0.6rem;
	background: var(--red);
	color: #fff;
	font-family: var(--font-sans);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	border-radius: 3px;
}
.latest-bar__list {
	display: flex;
	gap: 1.5rem;
	margin: 0;
	padding: 0.6rem 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}
.latest-bar__list li {
	flex: 0 0 auto;
	max-width: 80vw;
	scroll-snap-align: start;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.latest-bar__list time { font-weight: 700; color: var(--red); margin-inline-end: 0.4rem; }
.latest-bar__list a { color: var(--ink); text-decoration: none; }
.latest-bar__list a:hover { text-decoration: underline; color: var(--navy); }

/* 6. Elementi comuni -------------------------------------------------- */
.site-main { display: block; padding-block: var(--gap) calc(var(--gap) * 2); }
.site-main:focus { outline: none; }

.page-header {
	margin-block: 0.5rem var(--gap);
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--line);
}
.page-title { font-size: var(--step-3); margin: 0; }
.page-title mark { background: none; color: var(--red); }
.archive-description { color: var(--ink-soft); margin-top: 0.5rem; max-width: var(--measure); }
.search-count { color: var(--ink-soft); margin: 0.4rem 0 1rem; }

.section-title {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
	font-family: var(--font-sans);
	font-size: var(--step-0);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--navy);
}
.section-title::before {
	content: "";
	width: 0.5rem;
	height: 1.25rem;
	background: var(--red-bright);
}
.section-title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}

.kicker {
	position: relative;
	z-index: 2;
	display: inline-block;
	margin-bottom: 0.4rem;
	color: var(--red);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}
[dir="rtl"] .kicker { letter-spacing: 0; }
.kicker:hover { text-decoration: underline; color: var(--red); }

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 1rem;
	color: var(--ink-soft);
	font-family: var(--font-sans);
	font-size: var(--step--1);
}
.entry-meta a { color: var(--ink); font-weight: 600; position: relative; z-index: 2; }
.reading-time { display: inline-flex; align-items: center; gap: 0.3rem; }
.reading-time .icon { width: 16px; height: 16px; fill: currentColor; }

.breadcrumbs { font-size: var(--step--1); margin-bottom: 1rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-inline: 0.5rem; color: var(--ink-soft); }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs [aria-current] { color: var(--ink); }

/* 7. Schede articolo --------------------------------------------------- */
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	min-width: 0;
}
.card__media {
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--navy-100);
	aspect-ratio: 16 / 9;
}
.card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}
.card:hover .card__media img { transform: scale(1.03); }
.card__title { font-size: var(--step-1); margin: 0 0 0.4rem; }
.card__link { color: var(--ink); text-decoration: none; }
.card__link:hover { color: var(--navy); text-decoration: underline; }
/* Tutta la scheda è cliccabile, ma il link resta uno solo (meno rumore per gli screen reader) */
.card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__link:focus-visible { outline: none; }
.card:has(.card__link:focus-visible) {
	outline: 3px solid var(--focus);
	outline-offset: 4px;
	border-radius: var(--radius);
}
.card__excerpt { color: var(--ink-soft); font-size: var(--step--1); }
.card__excerpt p { margin: 0 0 0.5rem; }

.card--lead .card__title { font-size: var(--step-4); line-height: 1.1; }
.card--lead .card__excerpt { font-size: var(--step-1); color: var(--ink); }

.card--compact {
	flex-direction: row;
	align-items: flex-start;
	gap: 0.9rem;
	padding-block: 0.9rem;
	border-bottom: 1px solid var(--line);
}
.card--compact:first-child { padding-top: 0; }
.card--compact .card__media { flex: 0 0 96px; aspect-ratio: 3 / 2; }
.card--compact .card__title { font-size: var(--step-0); }
.card--compact .kicker { margin-bottom: 0.2rem; font-size: 0.72rem; }

.sticky .card__title::before {
	content: "★ ";
	color: var(--red);
}

/* Home: in evidenza */
.top-stories {
	display: grid;
	gap: var(--gap);
	margin-bottom: calc(var(--gap) * 1.5);
	padding-bottom: calc(var(--gap) * 1.5);
	border-bottom: 3px double var(--line);
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: calc(var(--gap) * 1.25) var(--gap);
}
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

.layout { display: grid; gap: calc(var(--gap) * 1.5); }
.layout__main { min-width: 0; }

/* Paginazione */
.pagination { margin-top: calc(var(--gap) * 1.5); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.9rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-decoration: none;
	font-weight: 600;
}
.pagination .page-numbers.current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--navy); background: var(--navy-100); color: var(--navy); }

/* Sidebar e widget */
.sidebar { display: grid; gap: calc(var(--gap) * 1.25); align-content: start; }
.widget-title {
	font-family: var(--font-sans);
	font-size: 0.85rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--navy);
	padding-bottom: 0.6rem;
	margin-bottom: 0.75rem;
	border-bottom: 3px solid var(--red-bright);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding-block: 0.55rem; border-bottom: 1px solid var(--line); }
.widget li a { text-decoration: none; color: var(--ink); }
.widget li a:hover { color: var(--navy); text-decoration: underline; }
.widget select { width: 100%; min-height: 44px; padding: 0.4rem; border: 1px solid var(--ink-soft); border-radius: var(--radius); }
.wp-block-tag-cloud a,
.tagcloud a {
	display: inline-block;
	margin: 0 0.3rem 0.4rem 0;
	padding: 0.3rem 0.7rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-size: 0.85rem !important;
	text-decoration: none;
}

/* 8. Articolo singolo --------------------------------------------------- */
.article { margin-inline: auto; }
.article__header { max-width: 900px; margin-bottom: 1.5rem; }
.article__title { font-size: var(--step-4); line-height: 1.12; margin-bottom: 0.6rem; }
.article__title a { color: inherit; text-decoration: none; }
.article__title a:hover { text-decoration: underline; }
.article__standfirst {
	font-size: var(--step-1);
	line-height: 1.5;
	color: var(--ink-soft);
	max-width: var(--measure);
	margin-bottom: 1rem;
}

.article__media { margin: 0 0 1.75rem; }
.article__media img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; background: var(--navy-100); }
.article__media figcaption { margin-top: 0.5rem; font-size: var(--step--1); color: var(--ink-soft); }

.article__layout { display: grid; gap: 1.25rem; }
.article__content { max-width: var(--measure); min-width: 0; }

.entry-content { font-size: clamp(1.06rem, 1rem + 0.3vw, 1.18rem); line-height: 1.75; }
.entry-content > * { margin-block: 0 1.25em; }
.entry-content h2 { font-size: var(--step-2); margin-top: 1.75em; }
.entry-content h3 { font-size: var(--step-1); margin-top: 1.5em; }
.entry-content a { color: var(--navy); text-decoration-thickness: 2px; text-decoration-color: rgb(208 0 0 / 0.5); }
.entry-content a:hover { color: var(--red); text-decoration-color: currentColor; }
.entry-content ul,
.entry-content ol { padding-inline-start: 1.4em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content blockquote,
.entry-content .wp-block-quote {
	margin-inline: 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	padding-inline: 1.25rem 0;
	border-inline-start: 4px solid var(--red-bright);
	font-family: var(--font-serif);
	font-size: var(--step-1);
	font-style: italic;
	color: var(--navy);
}
.entry-content .wp-block-pullquote { border-block: 4px solid var(--navy); padding: 1.5rem 0; text-align: center; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption,
.entry-content .wp-element-caption { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.5rem; }
.entry-content img { border-radius: 4px; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: var(--step--1); display: block; overflow-x: auto; }
.entry-content th,
.entry-content td { padding: 0.6rem; border: 1px solid var(--line); text-align: start; }
.entry-content th { background: var(--surface-alt); }
.entry-content hr { border: 0; border-top: 1px solid var(--line); }
.entry-content pre { overflow-x: auto; padding: 1rem; background: var(--surface-alt); border-radius: var(--radius); }
.entry-content iframe,
.entry-content .wp-block-embed__wrapper { max-width: 100%; }
.alignwide { max-width: 100%; }

/* Condivisione */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.share-label {
	font-size: 0.75rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ink-soft);
	margin-inline-end: 0.25rem;
}
.share-btn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: #fff;
	color: var(--navy);
	cursor: pointer;
	padding: 0;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.share-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.share-btn .icon { width: 20px; height: 20px; fill: currentColor; }
.share-btn.is-done { background: #0a6b2e; color: #fff; border-color: #0a6b2e; }

/* Fine articolo */
.article__footer { max-width: var(--measure); margin-top: 2rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0 0 1.5rem; padding: 0; }
.tags a {
	display: inline-block;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	background: var(--navy-100);
	color: var(--navy);
	font-size: var(--step--1);
	font-weight: 600;
	text-decoration: none;
}
.tags a::before { content: "#"; opacity: 0.6; }
.tags a:hover { background: var(--navy); color: #fff; }
.article__comments-link a { font-weight: 700; }

/* Prossimo articolo + lettura continua */
.stream-end { max-width: var(--measure); margin-top: 2.5rem; }
.next-teaser a {
	display: block;
	padding: 1.1rem 1.25rem;
	border: 2px solid var(--navy);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--ink);
	background: var(--surface-alt);
}
.next-teaser a:hover { background: var(--navy-100); color: var(--ink); }
.next-teaser__label {
	display: block;
	margin-bottom: 0.5rem;
	color: var(--red);
	font-size: 0.78rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.next-teaser__label::after { content: " ↓"; }
.next-teaser__body { display: flex; gap: 1rem; align-items: center; }
.next-teaser__body img { width: 96px; height: 64px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.next-teaser__title { font-family: var(--font-serif); font-size: var(--step-1); font-weight: 700; line-height: 1.3; }

.stream-divider {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 3.5rem 0 2.5rem;
	color: var(--navy);
	font-size: 0.8rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}
.stream-divider::before,
.stream-divider::after { content: ""; flex: 1; height: 3px; background: var(--navy); }
.stream-divider span { display: inline-flex; align-items: center; gap: 0.5rem; }
.stream-divider span::before { content: ""; width: 10px; height: 10px; background: var(--red-bright); border-radius: 50%; }

.article--appended { animation: eec-fade 0.4s ease both; }
@keyframes eec-fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.stream-status {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 1.5rem;
	color: var(--ink-soft);
	font-weight: 600;
}
.stream-status[hidden] { display: none; }
.spinner {
	width: 22px;
	height: 22px;
	border: 3px solid var(--navy-100);
	border-top-color: var(--navy);
	border-radius: 50%;
	animation: eec-spin 0.8s linear infinite;
}
@keyframes eec-spin { to { transform: rotate(360deg); } }
.is-loading .next-teaser { display: none; }

/* Commenti (pannello apribile per non interrompere la lettura continua) */
.comments-toggle { max-width: var(--measure); margin-top: 2rem; border: 1px solid var(--line); border-radius: var(--radius); }
.comments-toggle > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 52px;
	padding: 0.75rem 1.1rem;
	font-weight: 700;
	color: var(--navy);
	cursor: pointer;
	list-style: none;
}
.comments-toggle > summary::-webkit-details-marker { display: none; }
.comments-toggle > summary::after { content: "+"; font-size: 1.5rem; line-height: 1; }
.comments-toggle[open] > summary::after { content: "−"; }
.comments-toggle > summary:hover { background: var(--surface-alt); }
.comments-toggle .comments-area { margin: 0; padding: 0 1.1rem 1.25rem; border: 0; }

.comments-area { max-width: var(--measure); margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-inline-start: 1.25rem; border-inline-start: 2px solid var(--line); }
.comment-body { padding-block: 1rem; border-bottom: 1px solid var(--line); }
.comment-author { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: var(--step--1); margin-bottom: 0.5rem; }
.comment-metadata a { color: var(--ink-soft); }
.comment-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.comment-form input:not([type="checkbox"]):not([type="submit"]),
.comment-form textarea {
	width: 100%;
	min-height: 48px;
	padding: 0.6rem 0.8rem;
	border: 2px solid var(--ink-soft);
	border-radius: var(--radius);
	font-size: 1rem;
}
.comment-form-cookies-consent { display: flex; gap: 0.5rem; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }
.comment-form input[type="submit"],
.more-link,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 0.6rem 1.4rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--navy);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}
.comment-form input[type="submit"]:hover,
.more-link:hover { background: var(--red); color: #fff; }

/* 404 */
.error-404 { text-align: center; }
.error-404 .search-form { margin: 1.5rem auto 3rem; }
.error-404 .grid { text-align: start; }
.error-404__code { font-family: var(--font-serif); font-size: clamp(4rem, 15vw, 8rem); font-weight: 700; line-height: 1; margin: 0; color: var(--navy); }
.error-404__code::after { content: "."; color: var(--red-bright); }

/* 9. Footer ------------------------------------------------------------ */
.site-footer {
	background: var(--navy);
	color: #fff;
	padding-block: 3rem 1.5rem;
	border-top: 4px solid var(--red-bright);
}
.site-footer:focus { outline: none; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #fff; text-decoration-thickness: 2px; }
.footer-top { display: grid; gap: 2.5rem; }
.footer-logo img { width: 220px; height: auto; }
.footer-about { margin-top: 1rem; max-width: 32rem; color: rgb(255 255 255 / 0.85); }
.social--footer { margin-inline-start: -8px; }
.site-footer .widget-title { color: #fff; border-color: var(--red-bright); }
.site-footer .widget li,
.footer-cats li { border-color: rgb(255 255 255 / 0.15); }
.site-footer .widget li a,
.footer-cats a { color: #fff; }
.footer-cats ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2rem; }
.footer-cats li { padding-block: 0.5rem; border-bottom: 1px solid rgb(255 255 255 / 0.15); break-inside: avoid; }
.footer-cats a { text-decoration: none; }
.footer-cats a:hover { text-decoration: underline; }
.footer-widgets { display: grid; gap: 2rem; }

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 2rem;
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgb(255 255 255 / 0.2);
	font-size: var(--step--1);
	color: rgb(255 255 255 / 0.85);
}
.footer-bottom p { margin: 0; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.footer-menu a { display: inline-block; padding-block: 0.6rem; }

/* Torna su */
.back-to-top {
	position: fixed;
	inset-inline-end: 1rem;
	bottom: 1rem;
	z-index: 90;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--navy);
	color: #fff;
	box-shadow: var(--shadow);
	border: 2px solid #fff;
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { background: var(--red); color: #fff; }
.back-to-top .icon { width: 24px; height: 24px; fill: currentColor; }
.back-to-top:focus-visible { outline-color: var(--navy); }

/* 10. Classi WordPress ----------------------------------------------- */
.alignleft { float: inline-start; margin-inline-end: 1.25rem; margin-bottom: 1rem; }
.alignright { float: inline-end; margin-inline-start: 1.25rem; margin-bottom: 1rem; }
.aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text,
.gallery-caption { font-size: var(--step--1); color: var(--ink-soft); }
.bypostauthor > .comment-body .fn::after { content: " ✓"; color: var(--navy); }
.page-links { display: flex; gap: 0.5rem; flex-wrap: wrap; font-weight: 700; }
.page-links a,
.page-links > span:not(:first-child) { min-width: 44px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); }
.sr-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* 11. Breakpoint ----------------------------------------------------- */
@media (min-width: 600px) {
	.custom-logo { height: 46px; }
	.top-stories__side { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
	.top-stories__side .card--compact:nth-child(2) { padding-top: 0; }
	.card--compact .card__media { flex-basis: 120px; }
	.footer-top { grid-template-columns: 1fr 1fr; }
	.footer-widgets { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
	.next-teaser__body img { width: 140px; height: 93px; }
}

@media (min-width: 960px) {
	:root { --header-h: 72px; }

	.custom-logo { height: 56px; }
	.site-header.is-scrolled .custom-logo { height: 40px; }
	.site-header.is-scrolled .site-description { display: none; }
	.site-description { display: block; }

	.menu-toggle { display: none; }

	/* Navigazione orizzontale */
	.js .primary-nav:not(.is-open),
	.primary-nav { display: block; }
	.primary-nav.is-open { max-height: none; overflow: visible; }
	.primary-nav .menu { display: flex; flex-wrap: wrap; padding: 0; }
	.primary-nav .menu > li { border: 0; }
	.primary-nav .menu > li > a {
		padding: 0 1rem;
		min-height: 48px;
		font-size: 0.95rem;
		letter-spacing: 0.02em;
	}
	.primary-nav .menu > li:first-child > a { padding-inline-start: 0; }
	.primary-nav .menu > li > a:hover { background: var(--navy-700); text-decoration: none; }
	.primary-nav :is(.current-menu-item, .current-cat, .current-menu-ancestor) > a,
	.primary-nav a[aria-current="page"],
	[dir="rtl"] .primary-nav :is(.current-menu-item, .current-cat) > a {
		box-shadow: inset 0 -4px 0 var(--red-bright);
		padding-inline-start: 1rem;
	}
	.primary-nav .menu > .menu-item-has-children > a { padding-inline-end: 2.6rem; }
	.primary-nav .submenu-toggle { width: 36px; inset-inline-end: 0.2rem; }
	.primary-nav .submenu-toggle .icon { width: 20px; height: 20px; }

	.primary-nav .sub-menu {
		position: absolute;
		top: 100%;
		inset-inline-start: 0;
		z-index: 10;
		min-width: 240px;
		margin: 0;
		padding: 0.5rem 0;
		background: var(--navy-900);
		box-shadow: var(--shadow);
		border-top: 3px solid var(--red-bright);
	}
	.primary-nav .sub-menu a { padding: 0.5rem 1.1rem; }
	.primary-nav .sub-menu a:hover { background: var(--navy-700); text-decoration: none; }
	/* Con mouse: apertura anche al passaggio */
	@media (hover: hover) {
		.js .primary-nav .menu-item-has-children:hover > .sub-menu { display: block; }
	}

	.top-stories { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
	.top-stories__side { display: block; }
	.top-stories__side .card--compact:nth-child(2) { padding-top: 0.9rem; }

	.layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
	.no-sidebar .layout { grid-template-columns: 1fr; }
	.sidebar { position: sticky; top: calc(var(--header-h) + 64px); }

	.article__layout { grid-template-columns: 64px minmax(0, var(--measure)); gap: 2rem; }
	.article__aside .share { position: sticky; top: calc(var(--header-h) + 72px); flex-direction: column; align-items: center; }
	.article__aside .share-label { margin: 0 0 0.25rem; }
	.article__footer,
	.stream-end,
	.comments-toggle { margin-inline-start: calc(64px + 2rem); }
	.article--page ~ .comments-area { margin-inline-start: 0; }

	.footer-top { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}

@media (min-width: 1200px) {
	.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.no-sidebar .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 12. Preferenze utente ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

@media (forced-colors: active) {
	.section-title::before,
	.stream-divider::before,
	.stream-divider::after { background: CanvasText; }
	.share-btn,
	.icon-btn { border: 1px solid ButtonText; }
	.card__link::after { forced-color-adjust: none; }
}

@media print {
	.topbar,
	.site-header,
	.latest-bar,
	.article__aside,
	.stream-end,
	.comments-area,
	.site-footer,
	.back-to-top,
	.sidebar { display: none !important; }
	body { font-size: 12pt; color: #000; }
	.article__content { max-width: none; }
	.entry-content a::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
