/* ContentNest — Magazine theme
 * CSS custom properties iniettate runtime via Ghost codeinjection_head per-blog.
 */

/* Font self-hosted (woff2 variabile, subset latin) — sostituiscono Google Fonts
   esterno (render-blocking). font-display: swap evita il FOIT; unicode-range
   limita al latino (i glifi fuori range usano il fallback di sistema). */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url('../fonts/playfair-display.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/inter.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-primary: #1a1a1a;
  --color-accent: #b91c1c;
  --color-bg: #ffffff;
  --color-surface: #fafaf9;
  --color-text: #111111;
  --color-muted: #5a5f6f;
  --color-border: #e5e5e4;
  --font-heading: var(--gh-font-heading, "Playfair Display", Georgia, serif);
  --font-body: var(--gh-font-body, "Inter", system-ui, sans-serif);
  --radius: 0;
  --max-width: 1200px;

  --rubric-color: var(--color-accent);
}

[data-theme="dark"] {
  --color-bg: #0a0a0a;
  --color-surface: #171717;
  --color-text: #f5f5f4;
  --color-muted: #9ca3af;
  --color-border: #262626;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* Header: masthead forte */
.site-header {
  border-bottom: 2px solid var(--color-text);
  padding: 2rem 1.5rem 1.5rem;
}
.site-header .wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}
.site-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  max-width: min(60%, 420px);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.site-title img { max-height: 2.5rem; width: auto; max-width: 100%; display: block; }
/* Barra rubriche — skin magazine (struttura in cn-responsive.css) */
.rubric-bar { background: var(--color-bg); border-top: 1px solid var(--color-border); }
.rubric-bar__track a {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  transition: color 0.15s;
}
.rubric-bar__track a:hover,
.rubric-bar__track a[aria-current="page"] { color: var(--color-accent); }
.btn-subscribe {
  background: var(--color-accent);
  color: #fff;
  padding: 0.65rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-block;
  transition: background 0.15s;
}
.btn-subscribe:hover { background: var(--color-text); }
.theme-toggle {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Intro */
.intro {
  max-width: var(--max-width);
  margin: 3rem auto 2rem;
  padding: 0 1.5rem;
  text-align: center;
}
.intro h1 { display: none; }
.intro p {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--color-muted);
  font-size: 1.4rem;
  margin: 0;
}

/* Feed = griglia magazine */
.feed {
  max-width: var(--max-width);
  margin: 2rem auto 5rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 2.5rem;
}
.post-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: none;
}
.post-card-image {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 1rem;
  background: var(--rubric-color);
}
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card-content { flex: 1; display: flex; flex-direction: column; }
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.post-tag { color: var(--rubric-color); }
.post-dot { display: none; }
.post-meta time, .post-meta span { color: var(--color-muted); }
.post-card h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0.3rem 0 0.6rem;
}
.post-card:hover h2 { color: var(--color-accent); }
.post-excerpt {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
  line-height: 1.5;
}
.post-footer {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}
.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
}

/* Tag hero */
.tag-hero {
  max-width: var(--max-width);
  margin: 3rem auto 3rem;
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--color-text);
  color: var(--color-bg);
}
[data-theme="dark"] .tag-hero {
  background: var(--color-surface);
  color: var(--color-text);
}
.tag-eyebrow {
  color: var(--color-bg);
  opacity: 0.7;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: block;
}
[data-theme="dark"] .tag-eyebrow { color: var(--color-muted); opacity: 1; }
.tag-hero h1 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2.25rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.tag-hero p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.25rem;
  opacity: 0.75;
  margin: 0 auto 1rem;
  max-width: 620px;
}
.tag-count {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 1rem;
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tags-cloud {
  max-width: var(--max-width);
  margin: 4rem auto;
  padding: 0 1.5rem;
  text-align: center;
}
.tags-cloud h3 {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--color-muted);
  margin: 0 0 1rem;
  font-weight: 400;
}
.tags-cloud a {
  display: inline-block;
  margin: 0.25rem 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}
.tags-cloud a:hover { border-bottom-color: var(--color-accent); }

/* Post single */
.post {
  max-width: 780px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.post .post-tag {
  display: inline-block;
  text-align: center;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--rubric-color);
  margin-bottom: 1rem;
}
.post-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  text-align: center;
}
.post-subtitle {
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: italic;
  color: var(--color-muted);
  font-size: 1.35rem;
  line-height: 1.35;
  text-align: center;
  margin: 0 auto 2.5rem;
  max-width: 640px;
}
.post-byline {
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}
.post-byline .author-avatar { width: 36px; height: 36px; }
.byline-name { color: var(--color-text); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.05em; }
.byline-meta { display: inline-flex; gap: 0.5rem; align-items: center; }

.hero-image { margin: 0 0 2.5rem; }
.hero-image img { width: 100%; height: auto; display: block; }
.hero-image figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
  font-style: italic;
}

.post-body {
  font-size: 1.15rem;
  line-height: 1.7;
}
.post-body p { margin: 0 0 1.5rem; }
.post-body p:first-of-type { font-size: 1.3rem; line-height: 1.55; }
.post-body p:first-of-type::first-letter {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 5rem;
  line-height: 1;
  float: left;
  margin: 0.3rem 0.7rem 0 -0.15rem;
  color: var(--color-accent);
}
.post-body h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.6rem, 4.5vw, 2rem);
  letter-spacing: -0.015em;
  margin: 3rem 0 1rem;
}
.post-body h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
}
.post-body a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote {
  margin: 2.5rem 0;
  padding: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: italic;
  font-size: 1.75rem;
  line-height: 1.35;
  text-align: center;
  color: var(--color-text);
}
.post-body blockquote::before, .post-body blockquote::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  background: var(--color-text);
  margin: 1.5rem auto;
}
.post-body ul, .post-body ol { padding-left: 1.2rem; margin: 0 0 1.5rem; }
.post-body li { margin-bottom: 0.5rem; }
.post-body figure { margin: 2rem 0; }
.post-body img { max-width: 100%; height: auto; }
.post-body pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.9rem;
}
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--color-surface);
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}
.post-body pre code { background: none; padding: 0; }

/* Ghost Koenig card widths */
.gh-content .kg-width-wide {
  max-width: calc(780px + 200px);
  margin-left: 50%;
  transform: translateX(-50%);
  position: relative;
}
.gh-content .kg-width-full {
  max-width: 100vw;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  position: relative;
}
.gh-content .kg-width-full img { width: 100%; }

.post-footer-cta {
  margin: 4rem 0 2rem;
  padding: 2.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-align: center;
}
.post-footer-cta h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
.post-footer-cta p { color: var(--color-muted); margin: 0 0 1.5rem; }

/* Footer */
.site-footer {
  border-top: 2px solid var(--color-text);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 4rem;
}
.site-footer a { color: var(--color-accent); text-decoration: underline; }

/* Error page */
.error-page {
  max-width: var(--max-width);
  margin: 6rem auto;
  padding: 0 1.5rem;
  text-align: center;
}
.error-code {
  font-family: var(--font-heading);
  font-size: 8rem;
  font-weight: 900;
  color: var(--color-accent);
  margin: 0;
  line-height: 1;
  letter-spacing: -0.03em;
}
.error-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin: 1rem 0 1.5rem;
}
.error-message { color: var(--color-muted); margin-bottom: 2rem; }

/* Pagination */
.pagination {
  max-width: var(--max-width);
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
}
.pagination a { color: var(--color-accent); }
.pagination .older { margin-left: auto; }
.pagination .newer { margin-right: auto; }

/* Feed responsivo via auto-fit (niente media query manuali); riduzioni
   tipografiche ora nei clamp() di .post-title / .tag-hero h1 / .site-title. */

/* Skip-link accessibilità: visibile solo al focus tastiera */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1rem;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.15s ease-in;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Touch target ≥ 44px su mobile (WCAG 2.5.5) */
.btn-subscribe {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 820px) {
  .theme-toggle {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .post-tag {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.25rem 0;
  }
}

/* Error page suggerimenti (404) */
.error-actions { margin: 1.5rem 0; }
.error-suggestions {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: left;
}
.error-suggestions h2 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  margin: 0 0 0.75rem;
}
.error-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.error-suggestions li { margin: 0.5rem 0; }
.error-suggestions a {
  color: var(--color-accent);
  font-weight: 500;
}
.error-suggestions a:hover { text-decoration: underline; }

/* === AEO/GEO 2026: breadcrumb, lead answer, key takeaways === */
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.breadcrumb a { color: var(--color-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-primary); text-decoration: underline; }
.breadcrumb-sep { margin: 0 0.4em; color: var(--color-border); }
.breadcrumb-current { color: var(--color-text); }

.lead-answer {
  font-size: 1.15rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.key-takeaways {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 0 0 2rem;
}
.key-takeaways > p:first-child {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary);
}
.key-takeaways ul { margin: 0; padding-left: 1.25rem; }
.key-takeaways li { margin: 0.35rem 0; }

/* === TOC (indice ancorato) === */
.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
  font-size: 0.9375rem;
}
.toc-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}
.toc ul { margin: 0; padding-left: 1.25rem; }
.toc li { margin: 0.25rem 0; }
.toc a { color: var(--color-text); text-decoration: none; }
.toc a:hover { color: var(--color-primary); text-decoration: underline; }

/* Autore E-E-A-T — card baked (partial cn-author): box in coda articolo + pagina autore */
.cn-author-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 3rem 0;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}
.cn-author-card .cn-author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.cn-author-info { flex: 1; min-width: 0; }
.cn-author-name { margin: 0; font-weight: 600; font-size: 1rem; }
.cn-author-name a { color: inherit; text-decoration: none; }
.cn-author-name a:hover { text-decoration: underline; }
.cn-author-jobtitle { margin: 0.15rem 0 0; color: var(--color-muted); font-size: 0.85rem; }
.cn-author-bio { margin: 0.6rem 0 0; color: var(--color-text); font-size: 0.9rem; line-height: 1.5; }
.cn-author-social { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0 0; padding: 0; list-style: none; font-size: 0.85rem; }
.cn-author-social a { color: var(--color-primary); text-decoration: none; }
.cn-author-social a:hover { text-decoration: underline; }
.cn-author-knows { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.7rem 0 0; padding: 0; list-style: none; }
.cn-author-knows .cn-author-topic {
  background: var(--color-border);
  color: var(--color-muted);
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* Variante compatta in byline: solo avatar + nome (bio/social/competenze nascosti) */
.post-byline .cn-author-card {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  gap: 0.6rem;
  align-items: center;
}
.post-byline .cn-author-card .cn-author-avatar { width: 40px; height: 40px; }
.post-byline .cn-author-jobtitle,
.post-byline .cn-author-bio,
.post-byline .cn-author-social,
.post-byline .cn-author-knows { display: none; }


/* === cn-responsive.css (shared) === */
/* ContentNest — CSS responsive condiviso
 *
 * Regole STRUTTURALI agnostiche ai token, identiche nei 3 temi. build.mjs le
 * concatena in coda a `assets/css/main.css` di ogni tema (un solo file
 * render-blocking, niente <link> extra). Usano le variabili già definite dai
 * temi (--color-*, --max-width, --radius, --rubric-color), così ereditano sia
 * il default del tema sia il branding per-blog iniettato dal backend.
 *
 * Lo SKIN visivo (colori, tipografia, padding) resta in ciascun main.css.
 */

/* ============================================================
   Header chrome — gruppo azioni (logo + Tema + Iscriviti)
   ============================================================ */
.site-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-shrink: 0;
}
/* Contesto di posizionamento per il dropdown rubriche (vedi sotto) */
.site-header { position: relative; }

/* ============================================================
   Menu rubriche — Disclosure Navigation (editorial)
   Pattern W3C APG: <button aria-expanded> + pannello di link.
   Fallback no-JS: pannello visibile come lista inline (il bottone è
   nascosto finché non c'è JS). Con .js (settato nello <script> inline in
   <head>, prima del paint → niente FOUC) il pannello diventa un dropdown
   ancorato e position:absolute, quindi la sua apertura NON causa reflow/CLS.
   ============================================================ */
.rubric-nav { position: relative; }

/* No-JS: bottone nascosto, pannello = lista inline */
.rubric-nav__button {
  display: none;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 0.25rem;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.js .rubric-nav__button { display: inline-flex; }
.rubric-nav__chevron { transition: transform 0.2s ease; }
.js .rubric-nav__button[aria-expanded="true"] .rubric-nav__chevron { transform: rotate(180deg); }

.rubric-nav__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
}
/* Con JS: pannello collassato in dropdown ancorato (absolute → no CLS) */
.js .rubric-nav__panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.js .rubric-nav__button[aria-expanded="true"] + .rubric-nav__panel { display: flex; }
.js .rubric-nav__panel a {
  display: block;
  padding: 0.6rem 0.75rem;
  min-height: 44px;
  box-sizing: border-box;
}
/* Su mobile il dropdown si ancora all'header (non al bottone), così non sfora
   il bordo sinistro del viewport (no overflow-x del body). */
@media (max-width: 600px) {
  .js .rubric-nav { position: static; }
  .js .rubric-nav__panel { left: 1rem; right: 1rem; min-width: 0; }
}

/* ============================================================
   Menu rubriche — barra scrollabile (magazine / tech)
   Scroll orizzontale nativo (zero JS richiesto). Le fade ai bordi e
   l'affordance "is-overflow-*" sono attivate da cn-nav.js via
   IntersectionObserver (nessuno scroll listener, impatto INP nullo).
   ============================================================ */
.rubric-bar { position: relative; }
.rubric-bar__track {
  display: flex;
  align-items: center;
  gap: 0 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-gutter: stable;        /* evita lo shift al primo scroll su scrollbar classiche */
  overscroll-behavior-x: contain;  /* non sfonda nella navigazione di sistema (swipe-back) */
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 1.5rem;
}
.rubric-bar__track::-webkit-scrollbar { height: 6px; }
.rubric-bar__track::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
/* Sentinelle inerti per l'IntersectionObserver (0 impatto layout) */
.rubric-bar__edge { flex: 0 0 1px; width: 1px; align-self: stretch; }
.rubric-bar__track a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}

/* Fade ai bordi: overlay opacizzati (compositor-only, cheap). Default invisibili
   → no-JS = nessun fade ma scroll nativo comunque funzionante. */
.rubric-bar::before,
.rubric-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}
.rubric-bar::before { left: 0; background: linear-gradient(to right, var(--color-bg), transparent); }
.rubric-bar::after { right: 0; background: linear-gradient(to left, var(--color-bg), transparent); }
.rubric-bar.is-overflow-start::before { opacity: 1; }
.rubric-bar.is-overflow-end::after { opacity: 1; }

/* Focus visibile su tutti gli elementi nav (taglio della fade escluso: lo
   scroll-into-view nativo porta la voce in vista prima di mostrare l'outline) */
.rubric-nav__button:focus-visible,
.rubric-nav__panel a:focus-visible,
.rubric-bar__track a:focus-visible {
  outline: 2px solid var(--rubric-color, var(--color-primary));
  outline-offset: 2px;
  border-radius: 2px;
}

/* prefers-reduced-motion: azzera le micro-transizioni di nav */
@media (prefers-reduced-motion: reduce) {
  .rubric-nav__chevron,
  .rubric-bar::before,
  .rubric-bar::after { transition: none; }
}

/* ============================================================
   Corpo articolo — robustezza responsive (CSS-only, no wrapper HTML)
   Il contenuto vive in .post-body.gh-content (generato da {{content}}).
   img/figure/pre/kg-width-* sono già gestiti nei main.css per-tema.
   ============================================================ */

/* Tabelle larghe → scroll orizzontale CONTENUTO (niente overflow di pagina).
   display:block sul <table> crea il box scrollabile senza wrapper HTML (che
   non possiamo aggiungere: è dentro {{content}}); le righe restano tabellari
   via box anonimo. */
.post-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  font-size: 0.95em;
}
.post-body table th,
.post-body table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}
.post-body table th { font-weight: 600; background: var(--color-surface); }

/* Embed/iframe: mai più larghi del contenuto */
.post-body iframe { max-width: 100%; border: 0; }
/* Video Koenig (YouTube/Vimeo): responsive, niente altezza fissa che sfora */
.post-body iframe[src*="youtube.com"],
.post-body iframe[src*="youtube-nocookie.com"],
.post-body iframe[src*="youtu.be"],
.post-body iframe[src*="player.vimeo.com"] {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Safety-net: card Koenig e gallery non sforano (card_assets copre il grosso) */
.post-body .kg-card,
.post-body .kg-gallery-container { max-width: 100%; }
.post-body .kg-embed-card { max-width: 100%; overflow-x: auto; }

/* ============================================================
   Touch target — area tap comoda CROSS-VIEWPORT (WCAG 2.5.5/2.5.8)
   Prima erano garantiti solo entro @media 820: qui valgono anche su desktop.
   ============================================================ */
.pagination a,
.tags-cloud a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.theme-toggle {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.breadcrumb a { display: inline-flex; align-items: center; min-height: 24px; }

/* ============================================================
   Breakpoint tablet — graduazione della spaziatura barra rubriche
   (colma il salto fra i breakpoint feed 900/600; il riflow del feed è in fase 4)
   ============================================================ */
@media (max-width: 768px) {
  .rubric-bar__track { gap: 0 1rem; padding-block: 0.4rem; }
}

/* ============================================================
   Author card → impila su mobile stretto.
   La variante compatta in .post-byline (avatar + nome) resta in riga.
   ============================================================ */
@media (max-width: 480px) {
  .cn-author-card { flex-direction: column; align-items: flex-start; }
  .post-byline .cn-author-card { flex-direction: row; align-items: center; }
}

/* contentnest-branding:start — auto-generated, do not edit */
:root{--color-primary: #198539;--color-accent: #1e8532;--default-theme-mode: light;}[data-theme="dark"]{--color-primary: #1c923f;--color-accent: #59d972;}body.tag-fondamenti-e-definizioni{--rubric-color:#d759d9;}
/* contentnest-branding:end */
