/*
Theme Name: Federica Mormando
Theme URI: https://federicamormando.it/
Author: Enrico Frascati
Author URI: https://federicamormando.it/
Description: Tema custom per il sito di Federica Mormando, psichiatra e psicoterapeuta. Classic theme, editoriale, mobile-first, accessibile, zero dipendenze da page builder. Contenuti interamente editabili dal backend WordPress.
Version: 1.2.1
Requires at least: 6.5
Requires PHP: 8.1
License: Proprietary
Text Domain: federica-mormando
Tags: editorial, custom, professional, classic
*/

/* =========================================================================
   1. Design tokens
   ========================================================================= */
:root {
	/* Colore */
	--ink:           #1d1c1a;
	--ink-soft:      #4a4843;
	--muted:         #76726a;
	--paper:         #fbf8f2;
	--surface:       #ffffff;
	--surface-warm:  #f3eee3;
	--line:          #e4ddcf;
	--line-strong:   #d3c9b4;

	--petrol:        #15526b;
	--petrol-dark:   #0e3a4d;
	--petrol-deep:   #0a2d3c;
	--gold:          #b5862f;
	--gold-soft:     #c79b46;

	--link:          #15526b;
	--link-hover:    #b5862f;

	/* Tipografia */
	--font-display:  "Newsreader", Georgia, "Times New Roman", serif;
	--font-body:     "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	--fs-base:       1.0625rem;   /* 17px */
	--lh-base:       1.7;

	/* Spaziatura */
	--space-xs:      0.5rem;
	--space-sm:      1rem;
	--space-md:      1.75rem;
	--space-lg:      3rem;
	--space-xl:      5rem;
	--space-2xl:     7.5rem;

	/* Layout */
	--wrap:          1200px;
	--wrap-text:     46rem;
	--radius:        4px;
	--radius-lg:     10px;

	--shadow-sm:     0 1px 2px rgba(20,18,14,.06), 0 2px 8px rgba(20,18,14,.05);
	--shadow-md:     0 6px 24px rgba(20,18,14,.10);

	--transition:    160ms ease;
}

/* =========================================================================
   2. Reset / base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--fs-base);
	line-height: var(--lh-base);
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

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

a {
	color: var(--link);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
	transition: color var(--transition);
}
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.18;
	color: var(--ink);
	margin: 0 0 var(--space-sm);
	letter-spacing: -0.012em;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.25rem); }
h3 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p { margin: 0 0 var(--space-sm); }

ul, ol { margin: 0 0 var(--space-sm); padding-left: 1.4em; }
li { margin-bottom: 0.35em; }

blockquote {
	margin: var(--space-md) 0;
	padding: 0.4rem 0 0.4rem var(--space-md);
	border-left: 3px solid var(--gold);
	font-family: var(--font-display);
	font-size: 1.2rem;
	font-style: italic;
	color: var(--ink-soft);
}

hr {
	border: 0;
	height: 1px;
	background: var(--line);
	margin: var(--space-lg) 0;
}

code, pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.9em;
	background: var(--surface-warm);
}
pre { padding: var(--space-sm); border-radius: var(--radius); overflow-x: auto; }
code { padding: 0.1em 0.35em; border-radius: 3px; }

::selection { background: var(--gold-soft); color: #fff; }

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

/* =========================================================================
   3. Layout helpers
   ========================================================================= */
.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--space-md);
}
.wrap--text { max-width: var(--wrap-text); }

.section { padding-block: var(--space-xl); }
.section--tight { padding-block: var(--space-lg); }
.section--warm { background: var(--surface-warm); }
.section--paper { background: var(--paper); }

.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--petrol);
	color: #fff;
	padding: 0.6rem 1rem;
	z-index: 999;
	text-decoration: none;
}
.skip-link:focus { left: var(--space-sm); top: var(--space-sm); }

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

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-md);
	margin-bottom: var(--space-lg);
	padding-bottom: var(--space-sm);
	border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; }
.section-head .section-head__link {
	font-family: var(--font-body);
	font-size: 0.95rem;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
}
.section-head .section-head__link:hover { text-decoration: underline; }

.eyebrow {
	font-family: var(--font-body);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold);
	margin-bottom: var(--space-xs);
	display: block;
}

/* =========================================================================
   4. Header
   ========================================================================= */
.site-header {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 100;
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-md);
	min-height: 76px;
}

.site-brand {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	line-height: 1.1;
}
.site-brand__name {
	font-family: var(--font-display);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--ink);
	letter-spacing: -0.015em;
}
.site-brand__tag {
	font-family: var(--font-body);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--gold);
	margin-top: 2px;
}
.site-brand:hover .site-brand__name { color: var(--petrol); }

/* Navigation */
.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: var(--space-md);
	align-items: center;
}
.site-nav li { margin: 0; }
.site-nav a {
	font-family: var(--font-body);
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--ink-soft);
	text-decoration: none;
	padding: 0.4rem 0;
	position: relative;
}
.site-nav a::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: -2px;
	height: 2px;
	background: var(--gold);
	transform: scaleX(0);
	transition: transform var(--transition);
}
.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
	color: var(--ink);
}
.site-nav a:hover::after,
.site-nav .current-menu-item > a::after,
.site-nav .current_page_item > a::after { transform: scaleX(1); }

.nav-toggle {
	display: none;
	background: none;
	border: 0;
	border-radius: var(--radius);
	width: 44px; height: 44px;
	cursor: pointer;
	padding: 0;
	align-items: center;
	justify-content: center;
	color: var(--ink);
	margin-right: -8px;
}
.nav-toggle:hover { background: var(--surface-warm); }
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
	display: block;
	width: 20px; height: 2px;
	background: var(--ink);
	position: relative;
	transition: var(--transition);
}
.nav-toggle span::before { content: ""; position: absolute; top: -6px; }
.nav-toggle span::after  { content: ""; position: absolute; top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: rotate(45deg); top: 0; }
.nav-open .nav-toggle span::after  { transform: rotate(-45deg); top: 0; }

/* =========================================================================
   5. Hero (front page)
   ========================================================================= */
.hero {
	background: var(--petrol);
	background: linear-gradient(155deg, var(--petrol-dark) 0%, var(--petrol) 55%, #1a6586 100%);
	color: #fff;
	padding-block: var(--space-2xl);
	position: relative;
	overflow: hidden;
}
.hero::after {
	content: "";
	position: absolute;
	right: -8%;
	top: -20%;
	width: 480px; height: 480px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(181,134,47,.28), transparent 68%);
	pointer-events: none;
}
.hero__inner { position: relative; max-width: 52rem; }
.hero__eyebrow {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--gold-soft);
	margin-bottom: var(--space-sm);
}
.hero h1 {
	color: #fff;
	font-size: clamp(2.6rem, 1.8rem + 3.2vw, 4rem);
	margin-bottom: var(--space-md);
}
.hero__lead {
	font-family: var(--font-display);
	font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
	line-height: 1.55;
	color: rgba(255,255,255,.92);
	margin-bottom: var(--space-md);
}
.hero__body { color: rgba(255,255,255,.82); font-size: 1.05rem; }
.hero__body p:last-child { margin-bottom: 0; }
.hero__body a { color: #fff; text-decoration-color: var(--gold-soft); }
.hero__body a:hover { color: var(--gold-soft); }
.hero__actions {
	margin-top: var(--space-lg);
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
}

/* =========================================================================
   6. Buttons
   ========================================================================= */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-body);
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	padding: 0.8rem 1.5rem;
	border-radius: var(--radius);
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: var(--transition);
}
.btn--primary { background: var(--gold); color: #fff; }
.btn--primary:hover { background: var(--gold-soft); color: #fff; }
.btn--ghost {
	background: transparent;
	color: #fff;
	border-color: rgba(255,255,255,.45);
}
.btn--ghost:hover { background: rgba(255,255,255,.1); color: #fff; border-color: #fff; }
.btn--solid { background: var(--petrol); color: #fff; }
.btn--solid:hover { background: var(--petrol-dark); color: #fff; }

/* =========================================================================
   7. Article cards / lists
   ========================================================================= */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--space-lg) var(--space-md);
}

.card {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	overflow: hidden;
	transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
	border-color: var(--line-strong);
}
.card__thumb {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--surface-warm);
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.card:hover .card__thumb img { transform: scale(1.04); }
.card__body { padding: var(--space-md); display: flex; flex-direction: column; flex: 1; }

/* Card testuale (articolo senza immagine in evidenza): quadratino decorativo gold,
   titolo più grande e respiro maggiore, così è una scelta di stile e non un buco. */
.card--text .card__body { padding: var(--space-lg) var(--space-md) var(--space-md); }
.card--text .card__body::before {
	content: "";
	display: block;
	width: 20px;
	height: 20px;
	border-radius: 3px;
	background: var(--gold);
	margin-bottom: var(--space-md);
}
.card--text .card__title { font-size: 1.5rem; }
.card--text .card__excerpt { font-size: 1rem; }
.card__meta {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gold);
	margin-bottom: var(--space-xs);
}
.card__title {
	font-size: 1.3rem;
	margin-bottom: var(--space-xs);
}
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--petrol); }
.card__excerpt { color: var(--ink-soft); font-size: 0.97rem; margin-bottom: var(--space-sm); }
.card__more {
	margin-top: auto;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--petrol);
}
.card__more:hover { color: var(--gold); }

/* Compact list (sidebar / archives secondary) */
.post-row {
	display: grid;
	grid-template-columns: 7.5rem 1fr;
	gap: var(--space-md);
	padding-block: var(--space-md);
	border-bottom: 1px solid var(--line);
}
.post-row:first-child { padding-top: 0; }
.post-row--text { grid-template-columns: 1fr; }
.post-row__thumb { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--surface-warm); }
.post-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-row__meta { font-size: 0.76rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.post-row__title { font-size: 1.15rem; margin: 0.2rem 0 0.3rem; }
.post-row__title a { color: var(--ink); text-decoration: none; }
.post-row__title a:hover { color: var(--petrol); }
.post-row__excerpt { font-size: 0.92rem; color: var(--muted); margin: 0; }

/* =========================================================================
   8. Single / page content
   ========================================================================= */
.page-hero {
	background: var(--surface-warm);
	border-bottom: 1px solid var(--line);
	padding-block: var(--space-xl);
}
.page-hero__inner { max-width: var(--wrap-text); }
.page-hero h1 { margin-bottom: var(--space-xs); }
.page-hero .entry-meta { color: var(--muted); font-size: 0.92rem; }
.page-hero .breadcrumbs {
	font-size: 0.82rem;
	color: var(--muted);
	margin-bottom: var(--space-sm);
}
.page-hero .breadcrumbs a { color: var(--muted); }
.page-hero .breadcrumbs a:hover { color: var(--petrol); }

.entry-content {
	font-size: 1.075rem;
	line-height: 1.78;
}
.entry-content > * { margin-bottom: var(--space-md); }
.entry-content h2 { margin-top: var(--space-lg); }
.entry-content h3 { margin-top: var(--space-md); }
.entry-content img { border-radius: var(--radius); }
.entry-content figure { margin: var(--space-md) 0; }
.entry-content figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 0.5rem; }
.entry-content a { text-decoration-color: var(--gold-soft); }
.entry-content .wp-block-embed,
.entry-content iframe { margin-block: var(--space-md); }
.entry-content .wp-block-embed iframe { border-radius: var(--radius); }
.entry-content ul li::marker { color: var(--gold); }
.entry-content ol li::marker { color: var(--gold); font-weight: 600; }

.entry-featured {
	margin-bottom: var(--space-lg);
	border-radius: var(--radius-lg);
	overflow: hidden;
}
.entry-featured img { width: 100%; }

.entry-footer {
	margin-top: var(--space-lg);
	padding-top: var(--space-md);
	border-top: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	align-items: center;
	justify-content: space-between;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-list a {
	font-size: 0.82rem;
	font-weight: 600;
	text-decoration: none;
	background: var(--surface-warm);
	color: var(--ink-soft);
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
}
.tag-list a:hover { background: var(--gold); color: #fff; }

.post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-md);
	margin-top: var(--space-lg);
}
.post-nav a {
	display: block;
	padding: var(--space-md);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	text-decoration: none;
	background: var(--surface);
	transition: var(--transition);
}
.post-nav a:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.post-nav small { color: var(--gold); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; }
.post-nav span { display: block; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); margin-top: 0.3rem; }
.post-nav .post-nav__next { text-align: right; }

/* =========================================================================
   9. Layout with sidebar
   ========================================================================= */
.content-area {
	display: grid;
	grid-template-columns: minmax(0,1fr) 18rem;
	gap: var(--space-2xl);
	align-items: start;
}
.content-area--full { grid-template-columns: 1fr; }

.sidebar { position: sticky; top: 100px; }
.widget {
	margin-bottom: var(--space-lg);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: var(--space-md);
}
.widget__title {
	font-size: 1.05rem;
	margin-bottom: var(--space-sm);
	padding-bottom: var(--space-xs);
	border-bottom: 1px solid var(--line);
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { margin-bottom: 0.5rem; }
.widget a { text-decoration: none; color: var(--ink-soft); }
.widget a:hover { color: var(--petrol); }

/* Lista "Articoli recenti": ogni voce separata da un filetto, con data,
   font ridotto e respiro, così i titoli lunghi non si attaccano fra loro. */
.widget-posts li {
	margin: 0;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--line);
}
.widget-posts li:first-child { padding-top: 0; }
.widget-posts li:last-child { border-bottom: 0; padding-bottom: 0; }
.widget-posts a {
	display: block;
	font-size: 0.92rem;
	line-height: 1.4;
	color: var(--ink);
}
.widget-posts a:hover { color: var(--petrol); }
.widget-posts time {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gold);
}

/* =========================================================================
   10. Archive / search header
   ========================================================================= */
.archive-header {
	padding-block: var(--space-xl) var(--space-lg);
}
.archive-header h1 { margin-bottom: var(--space-xs); }
.archive-header .archive-desc { color: var(--muted); max-width: var(--wrap-text); }

.pagination {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
	margin-top: var(--space-xl);
	justify-content: center;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px; height: 44px;
	padding: 0 0.6rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--ink-soft);
	background: var(--surface);
	font-weight: 600;
	font-size: 0.95rem;
}
.pagination .page-numbers:hover { border-color: var(--petrol); color: var(--petrol); }
.pagination .page-numbers.current { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.pagination .page-numbers.dots { border-color: transparent; background: transparent; }

/* =========================================================================
   11. Search form
   ========================================================================= */
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] {
	flex: 1 1 0;
	min-width: 0; /* permette all'input di restringersi: senza, il bottone esce dal box */
	font-family: var(--font-body);
	font-size: 0.95rem;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
}
.search-form button { flex: 0 0 auto; }
.search-form input[type="search"]:focus { outline: 2px solid var(--petrol); outline-offset: 1px; }
.search-form button {
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 0.95rem;
	padding: 0.7rem 1.1rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--petrol);
	color: #fff;
	cursor: pointer;
}
.search-form button:hover { background: var(--petrol-dark); }

/* =========================================================================
   12. Contact / info blocks
   ========================================================================= */
.info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--space-md);
	margin-top: var(--space-lg);
}
.info-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: var(--space-md);
}
.info-card h3 { font-size: 1.05rem; margin-bottom: var(--space-xs); }
.info-card p { margin: 0; color: var(--ink-soft); }
.info-card a { word-break: break-word; }

/* =========================================================================
   13. Footer
   ========================================================================= */
.site-footer {
	background: var(--petrol-deep);
	color: rgba(255,255,255,.78);
	padding-block: var(--space-xl) var(--space-lg);
	margin-top: var(--space-2xl);
}
.site-footer a { color: rgba(255,255,255,.92); text-decoration: none; }
.site-footer a:hover { color: var(--gold-soft); }
.site-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: var(--space-xl);
	margin-bottom: var(--space-lg);
}
.site-footer__brand .site-brand__name { color: #fff; }
.site-footer__brand p { margin-top: var(--space-sm); font-size: 0.95rem; max-width: 26rem; }
.site-footer h4 {
	color: #fff;
	font-family: var(--font-body);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	margin-bottom: var(--space-sm);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.5rem; font-size: 0.95rem; }
.site-footer__bottom {
	border-top: 1px solid rgba(255,255,255,.14);
	padding-top: var(--space-md);
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	justify-content: space-between;
	font-size: 0.85rem;
	color: rgba(255,255,255,.55);
}
.site-footer__bottom a { color: rgba(255,255,255,.7); }

/* =========================================================================
   14. WordPress core / block alignment
   ========================================================================= */
.aligncenter { margin-inline: auto; }
.alignleft { float: left; margin: 0.3rem var(--space-md) var(--space-sm) 0; }
.alignright { float: right; margin: 0.3rem 0 var(--space-sm) var(--space-md); }
.wp-caption { max-width: 100%; }
.wp-caption-text, .wp-element-caption { font-size: 0.85rem; color: var(--muted); text-align: center; }
.sticky, .gallery-caption, .bypostauthor { display: block; }
.wp-block-image img { border-radius: var(--radius); }
.entry-content .alignwide { width: min(100%, 56rem); margin-inline: auto; }
.entry-content .alignfull { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }

/* =========================================================================
   15. Responsive
   ========================================================================= */

/* Menu a comparsa: attivo su tablet e mobile, dove la barra orizzontale
   non avrebbe spazio per tutte le voci senza andare a capo. */
@media (max-width: 1024px) {
	.nav-toggle { display: inline-flex; }

	.site-nav {
		position: absolute;
		left: 0; right: 0;
		top: 100%;
		background: var(--paper);
		border-bottom: 1px solid var(--line);
		box-shadow: var(--shadow-md);
		display: none;
	}
	.nav-open .site-nav { display: block; }

	/* Le voci si allineano alla stessa colonna del logo e dei contenuti. */
	.site-nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
		max-width: var(--wrap);
		margin-inline: auto;
		padding: var(--space-xs) var(--space-md);
	}
	.site-nav li { margin: 0; border-bottom: 1px solid var(--line); }
	.site-nav li:last-child { border-bottom: 0; }
	.site-nav a { display: block; padding: 0.9rem 0; font-size: 1rem; }
	.site-nav a::after { display: none; }
}

@media (max-width: 980px) {
	.content-area { grid-template-columns: 1fr; gap: var(--space-xl); }
	.sidebar { position: static; }
	.site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
}

@media (max-width: 760px) {
	:root { --space-xl: 3.5rem; --space-2xl: 5rem; }

	.post-nav { grid-template-columns: 1fr; }
	.site-footer__grid { grid-template-columns: 1fr; }
	.post-row { grid-template-columns: 5.5rem 1fr; gap: var(--space-sm); }
	.section-head { flex-direction: column; gap: var(--space-xs); align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	* { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* =========================================================================
   16. Capolettera articoli
   ========================================================================= */
.entry-content > p:first-of-type::first-letter {
	-webkit-initial-letter: 2;
	initial-letter: 2;
	font-family: var(--font-display);
	font-weight: 600;
	color: var(--petrol);
	margin-right: 0.22em;
}

/* =========================================================================
   17. Popup annuncio
   ========================================================================= */
.fm-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.55);
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-md);
}
.fm-popup-overlay[hidden] { display: none; }

.fm-popup__box {
	position: relative;
	background: #fff;
	border-radius: var(--radius-lg);
	max-width: 680px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.fm-popup__close {
	position: absolute;
	top: 0.75rem;
	right: 0.85rem;
	background: rgba(0,0,0,.08);
	border: 0;
	border-radius: 50%;
	width: 2rem;
	height: 2rem;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	color: var(--ink);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
}
.fm-popup__close:hover { background: rgba(0,0,0,.16); }
body.popup-open { overflow: hidden; }

/* =========================================================================
   18. Griglia video (pagina Media)
   ========================================================================= */
.video-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--space-lg) var(--space-md);
}

.video-item {
	display: flex;
	flex-direction: column;
}

.video-facade {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--petrol-deep);
	border-radius: var(--radius-lg);
	overflow: hidden;
	cursor: pointer;
}

.video-facade img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity var(--transition);
}

.video-facade:hover img,
.video-facade:focus img { opacity: 0.82; }

.video-facade:focus { outline: 2px solid var(--petrol); outline-offset: 2px; }

.video-facade__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.video-facade__play svg {
	filter: drop-shadow(0 2px 10px rgba(0,0,0,.45));
	transition: transform var(--transition);
}

.video-facade:hover .video-facade__play svg,
.video-facade:focus .video-facade__play svg { transform: scale(1.1); }

.video-facade iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.video-item__title {
	margin: var(--space-xs) 0 0;
	font-family: var(--font-body);
	font-size: 0.93rem;
	font-weight: 500;
	color: var(--ink);
	line-height: 1.4;
}

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