/* AEU blog — loaded AFTER the site stylesheet (/aeu-assets/showcase.css), so it
   only adds what the blog needs and overrides the two site rules that would hurt
   it. It NEVER redefines a colour token: every colour is read as
   var(--token, fallback). When the showcase overlay is on, the tokens are the
   site's live theme (48 of them) and the blog matches the site exactly; when the
   overlay is off and showcase.css is not served, the fallbacks keep the blog
   readable instead of unstyled. No external font, no CDN, no inline style. */

/* Safety net, not duplication: the site stylesheet already sets this, but when
   it is NOT served (showcase overlay off on this domain) its absence turned the
   article's padding into 32px of horizontal overflow on a 390px screen —
   measured on the live page before the head was fixed. */
*, *::before, *::after { box-sizing: border-box; }

/* The site hides its top-level nav links below 640px (it has a hero menu there);
   the blog has no hero, so without this the menu would simply vanish on a phone
   — the very "the blog is outside the menu" problem this template exists to fix. */
/* Il pulsante del menu esiste SOLO sotto i 640px: sopra, la barra e' quella del
   sito e i link stanno tutti in riga. */
body.aeu-blog .nav-toggle { display: none; }

/* La bandiera della lingua (SVG in linea, nessuna richiesta di rete). Sul
   desktop accompagna il nome nella tendina; sul telefono diventa la voce. */
body.aeu-blog .lang-menu .flag {
  width: 21px; height: 14px; flex: 0 0 auto; display: inline-block;
  border-radius: 2px; vertical-align: -2px; margin-right: .5rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
}
body.aeu-blog .lang-menu a { display: flex; align-items: center; }
body.aeu-blog .flag-code {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
}

@media (max-width: 640px) {
  /* MENU MOBILE. Prima di questo i 5 link andavano a capo su tre righe e
     l'intestazione occupava 176px su uno schermo da 844: misurato sulla pagina
     viva. Ora i link stanno in un pannello che si apre sotto l'intestazione. */
  body.aeu-blog .site-header .wrap { flex-wrap: wrap; position: relative; }
  body.aeu-blog .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;              /* bersaglio pieno per il dito */
    margin-left: auto; order: 2;
    background: none; border: 1px solid var(--border, rgba(127,127,127,.35));
    border-radius: 8px; color: inherit; cursor: pointer;
  }
  body.aeu-blog .nav-toggle:focus-visible { outline: 2px solid var(--accent, #2f6feb); outline-offset: 2px; }
  /* le tre barrette, disegnate in CSS: nessuna icona da scaricare */
  body.aeu-blog .nav-toggle-bars,
  body.aeu-blog .nav-toggle-bars::before,
  body.aeu-blog .nav-toggle-bars::after {
    display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
    transition: transform .18s ease, opacity .18s ease;
  }
  body.aeu-blog .nav-toggle-bars { position: relative; }
  body.aeu-blog .nav-toggle-bars::before { content: ""; position: absolute; top: -6px; }
  body.aeu-blog .nav-toggle-bars::after  { content: ""; position: absolute; top: 6px; }
  /* aperto: le barrette diventano una X */
  body.aeu-blog .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  body.aeu-blog .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
  body.aeu-blog .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { top: 0; transform: rotate(-45deg); }

  /* Come su aeu-dns (operatore 2026-10-13): nel pannello ci sta TUTTO, lingua
     compresa. Chiuso, nell'intestazione restano solo il logo e il pulsante. */
  body.aeu-blog .nav { display: none; }
  body.aeu-blog .nav.is-open {
    display: flex; order: 3; width: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .3rem 0 .2rem; margin-top: .5rem;
    border-top: 1px solid var(--border, rgba(127,127,127,.25));
  }
  body.aeu-blog .nav.is-open > a {
    display: block; width: 100%; padding: .8rem .2rem; min-height: 44px;
    border-bottom: 1px solid var(--border, rgba(127,127,127,.14));
  }
  /* la lingua e' l'ultima voce del pannello, larga quanto le altre */
  body.aeu-blog .nav.is-open .lang-switch { display: block; width: 100%; margin: .2rem 0 0; }
  body.aeu-blog .nav.is-open .lang-current { width: 100%; justify-content: space-between; min-height: 44px; }
  /* il suo elenco si apre nel flusso, non sospeso sopra la pagina: dentro un
     pannello gia' aperto un secondo strato sospeso finisce fuori schermo */
  body.aeu-blog .nav.is-open .lang-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding: 0; margin: .2rem 0 0; min-width: 0;
  }
  /* BANDIERE, 4 IN FILA (operatore 2026-10-13): nel menu la lingua si sceglie
     guardando, non leggendo. Griglia a 4 colonne fissa, cosi' le quattro lingue
     stanno su una riga sola; il nome resta nel markup per i lettori di schermo
     ma non occupa spazio. Il bersaglio resta 44px di lato. */
  body.aeu-blog .nav.is-open .lang-menu {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem;
  }
  body.aeu-blog .nav.is-open .lang-menu li { list-style: none; }
  body.aeu-blog .nav.is-open .lang-menu a {
    display: flex; align-items: center; justify-content: center;
    min-height: 44px; padding: .35rem; border-radius: 8px;
    border: 1px solid var(--border, rgba(127,127,127,.25));
  }
  body.aeu-blog .nav.is-open .lang-menu a[aria-current="true"] {
    border-color: var(--accent, #2f6feb);
    box-shadow: inset 0 0 0 1px var(--accent, #2f6feb);
  }
  body.aeu-blog .nav.is-open .lang-menu .lang-name {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

body.aeu-blog {
  margin: 0;
  color: var(--text, #10243a);
  background: var(--bg, #f7f8fa);
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-size: 17px;
  line-height: 1.65;
}
body.aeu-blog a { color: var(--accent, #2f6feb); text-decoration: none; }
body.aeu-blog a:hover { text-decoration: underline; }
/* NAVIGAZIONE (operatore 2026-10-13): niente sottolineatura e niente iniziali
   maiuscole. Le voci sono etichette, non frasi: in minuscolo la barra e' piu'
   calma e le parole si leggono per forma. La sottolineatura resta sui link
   DENTRO il testo dell'articolo, dove serve a dire "questo e' un link". */
body.aeu-blog .nav a,
body.aeu-blog .nav a:hover,
body.aeu-blog .site-footer a:hover { text-decoration: none; }
body.aeu-blog .nav > a { text-transform: lowercase; }

/* ── Rifinitura di ridisegno (2026-10-13) — le STESSE regole della landing,
   cosi' blog e sito non divergono. Nate da misure sulla pagina viva: zero
   regole :active, zero :focus-visible, zero cifre tabulari in tutto il foglio
   del sito, e titoli con text-wrap:wrap (quindi parole orfane). Nessuna
   introduce un colore: leggono i token del tema. */
body.aeu-blog h1, body.aeu-blog h2, body.aeu-blog h3 { text-wrap: balance; }
body.aeu-blog p, body.aeu-blog li, body.aeu-blog figcaption { text-wrap: pretty; }
body.aeu-blog .btn:active,
body.aeu-blog .lang-current:active,
body.aeu-blog .nav-toggle:active,
body.aeu-blog button:active { transform: translateY(1px) scale(.985); }
body.aeu-blog :where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent, #2f6feb); outline-offset: 2px; border-radius: 4px;
}
body.aeu-blog time, body.aeu-blog .meta { font-variant-numeric: tabular-nums; }
body.aeu-blog .blog-card img, body.aeu-blog .blog-hero img { border-radius: 10px; }
.blog-main { padding-block: clamp(1.6rem, 4vw, 3rem) 3.5rem; }
/* LARGHEZZA (operatore 2026-10-13): il corpo dell'articolo deve essere largo
   quanto l'intestazione, dal logo al selettore della lingua. Misurato prima:
   l'intestazione andava da 77 a 1193 e l'articolo da 255 a 1015 — 178px di
   rientro per lato. Ora si usano le STESSE misure di .wrap del sito (--maxw),
   quindi i bordi del testo cadono esattamente sotto il logo e sotto la lingua. */
.blog-wrap { width: 100%; max-width: var(--maxw, 1180px); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

/* page heading */
.blog-head { margin: 0 0 clamp(1.4rem, 3vw, 2.2rem); }
.blog-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 0 0 .4rem; letter-spacing: -.01em; }
.blog-head p { margin: 0; color: var(--text-secondary, #5b6674); }
.blog-crumbs { font-size: .86rem; color: var(--text-secondary, #5b6674); margin: 0 0 1rem; }
.blog-crumbs a { color: var(--text-secondary, #5b6674); }
.blog-crumbs span { opacity: .6; margin: 0 .35rem; }

/* article cards — own class names, so the site's .card rules do not fight them */
.blog-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(1rem, 2.4vw, 1.6rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.blog-card { display: flex; flex-direction: column; overflow: hidden;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e6e9ee);
  border-radius: var(--radius, 14px);
  box-shadow: 0 1px 2px var(--shadow, rgba(16,24,40,.06)), 0 10px 28px var(--shadow, rgba(16,24,40,.05));
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.blog-card:hover { transform: translateY(-2px); border-color: var(--border-strong, #cfd6e0);
  box-shadow: 0 2px 4px var(--shadow, rgba(16,24,40,.08)), 0 16px 40px var(--shadow, rgba(16,24,40,.08)); }
/* covers: the 3:2 shape the newsroom generates, shown WHOLE (contain), never
   cropped or zoomed (operator 2026-10-09) */
.blog-card .thumb { display: block; aspect-ratio: 3/2; overflow: hidden;
  background: var(--bg-secondary, #eef1f5); border-bottom: 1px solid var(--border, #e6e9ee); }
.blog-card .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.blog-card .body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1 1 auto; }
.blog-card h2 { font-size: 1.12rem; line-height: 1.35; margin: 0; }
.blog-card h2 a { color: var(--text, #10243a); }
.blog-card .meta { color: var(--text-secondary, #5b6674); font-size: .8rem; margin: 0; letter-spacing: .02em; }
.blog-card .excerpt { color: var(--text-secondary, #5b6674); font-size: .95rem; margin: 0; }
.blog-card .more { margin-top: auto; font-weight: 600; font-size: .9rem; color: var(--accent, #2f6feb); }

/* a single article */
.blog-article { max-width: none; margin-inline: 0;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e6e9ee);
  border-radius: var(--radius, 14px);
  box-shadow: 0 1px 2px var(--shadow, rgba(16,24,40,.06)), 0 10px 28px var(--shadow, rgba(16,24,40,.05));
  padding: clamp(1.3rem, 3.4vw, 2.4rem); }
.blog-article h1 { font-size: clamp(1.55rem, 3.6vw, 2.2rem); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5rem; }
.blog-article .meta { color: var(--text-secondary, #5b6674); font-size: .86rem; margin: 0 0 1.4rem; }
.blog-article .lead-img { width: 100%; height: auto; display: block; margin: 0 0 1.5rem;
  border-radius: calc(var(--radius, 14px) - 4px); border: 1px solid var(--border, #e6e9ee); }
.blog-article p { margin: 0 0 1.05rem; }
.blog-article p:last-child { margin-bottom: 0; }

/* read this article in another language */
.blog-translations { margin: 1.6rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--border, #e6e9ee);
  font-size: .9rem; color: var(--text-secondary, #5b6674); }
.blog-translations a { margin-right: .7rem; font-weight: 600; }

/* previous / next, and the way back to the index */
.blog-pager { max-width: none; margin: 1.4rem 0 0; display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; }
.blog-pager a { font-weight: 600; font-size: .92rem; }
.blog-back { display: inline-block; margin: 0 0 1rem; font-size: .92rem; font-weight: 600; }

.blog-empty { background: var(--card-bg, #ffffff); border: 1px dashed var(--border, #e6e9ee);
  border-radius: var(--radius, 14px); padding: clamp(2rem, 6vw, 3.4rem) 1.4rem; text-align: center;
  color: var(--text-secondary, #5b6674); }
