:root {
  --ink: #F4EEFF;
  --brand: #9A32D4;
  --brand-core: #7305BD;
  --lime: #9B5CFF;
  --lime-ink: #FFFFFF;
  --sage: #A86BFF;
  --heading: #FFFFFF;
  --muted: rgba(244, 238, 255, 0.72);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --white: #FFFFFF;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --mesh: url("../../assets/backgrounds/purple-mesh.png");
  --shell-gradient:
    radial-gradient(120% 140% at 8% 0%, #7B4BB8 0%, transparent 50%),
    radial-gradient(100% 120% at 100% 40%, #3A1768 0%, transparent 55%),
    radial-gradient(120% 100% at 50% 100%, #4A2A7A 0%, transparent 45%),
    linear-gradient(160deg, #2A1050 0%, #14061F 55%, #0E0418 100%);
  --max: 1160px;
  --radius: 14px;
  --font: "Average Sans", system-ui, sans-serif;
  --display: "Average Sans", system-ui, sans-serif;
  --mono: "Space Grotesk", system-ui, sans-serif;
  --shadow-2: 0px 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  color: var(--ink);
  background-color: #14061F;
  background-image: var(--mesh), var(--shell-gradient);
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed, fixed;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
main { flex: 1; }

/* Header — allineato a home */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(20, 6, 31, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0;
}
.site-header .logo { flex-shrink: 0; }
.logo img { height: 34px; width: auto; }
nav { display: flex; gap: 1.5rem; font-size: 1rem; font-weight: 600; }
.site-header .header-end {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  margin-left: auto;
  flex-shrink: 0;
}
nav a { text-decoration: none; color: var(--muted); transition: color 0.15s ease; }
nav a:hover, nav a[aria-current="page"] { color: var(--lime); }
.nav-admin-link { color: #B57AFF; }
.nav-admin-link:hover { color: #C9A0FF; }
.nav-admin-link[hidden],
.nav-admin-link.is-hidden { display: none !important; }
.header-actions { display: flex; gap: 0.6rem; align-items: center; }
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.1); }
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
html.nav-open .nav-toggle__bars,
body.nav-open .nav-toggle__bars { background: transparent; }
html.nav-open .nav-toggle__bars::before,
body.nav-open .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
html.nav-open .nav-toggle__bars::after,
body.nav-open .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }
.nav-drawer-cta { display: none !important; }
.nav-drawer { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 9px 20px; border-radius: 999px; font-family: var(--font); font-weight: 700;
  font-size: 0.95rem; text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn-primary { background: var(--lime); color: var(--lime-ink); }
.btn-primary:hover { background: #A86BFF; box-shadow: 0 0 24px rgba(155, 92, 255, 0.35); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: var(--white); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--white); }

.section-label {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--lime);
  margin: 0 0 0.75rem;
}

/* Listing */
.blog-page { padding: 3.5rem 0 5rem; }
.blog-page__head {
  text-align: center;
  max-width: 34rem;
  margin: 0 auto 2.25rem;
}
.blog-page__head h1 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--heading);
}
.blog-page__head .lede {
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 36rem;
}

.blog-filters {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.45rem; margin: 0 0 2rem;
}
.blog-filters__btn {
  appearance: none; border: 1px solid var(--line); background: var(--glass);
  color: var(--muted); font: inherit; font-weight: 700; font-size: 0.85rem;
  padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.blog-filters__btn:hover { color: var(--white); border-color: rgba(255,255,255,0.35); }
.blog-filters__btn.is-active {
  background: var(--brand-core); color: #fff; border-color: transparent;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.blog-card {
  border: 1px solid var(--line);
  background: var(--glass);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-2);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.blog-card:hover {
  border-color: rgba(155, 92, 255, 0.45);
  transform: translateY(-2px);
}
.blog-card__link { display: flex; flex-direction: column; text-decoration: none; color: inherit; height: 100%; }
.blog-card__link:hover h3 { color: var(--lime); }
.blog-card__cover {
  aspect-ratio: 16 / 10; background: rgba(0,0,0,0.28);
  border-bottom: 1px solid var(--line); overflow: hidden; position: relative;
}
.blog-card__cover-img { width: 100%; height: 100%; object-fit: cover; }
.blog-card__cover-fallback {
  height: 100%; min-height: 10rem; display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
  background:
    radial-gradient(80% 80% at 20% 20%, rgba(154, 50, 212, 0.35), transparent 60%),
    rgba(0,0,0,0.2);
}
.blog-card .body {
  padding: 1.25rem 1.35rem 1.4rem;
  display: flex; flex-direction: column; gap: 0.45rem; flex: 1;
}
.blog-card .meta {
  font-family: var(--mono); font-size: 0.7rem; color: var(--sage);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 0;
}
.blog-card h3 {
  font-size: 1.12rem; margin: 0; color: var(--heading);
  line-height: 1.3; font-weight: 700; transition: color 0.15s ease;
}
.blog-card .body > p:not(.meta):not(.blog-card__author) {
  font-size: 0.95rem; color: var(--muted); margin: 0; flex: 1;
}
.blog-card__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink);
}
.blog-card__author-avatar {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
}
.blog-card__more {
  margin-top: 0.55rem;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 700;
  color: var(--lime); letter-spacing: 0.02em;
}

/* Featured first card */
.blog-card--featured {
  grid-column: 1 / -1;
}
.blog-card--featured .blog-card__link {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 280px;
}
.blog-card--featured .blog-card__cover {
  aspect-ratio: auto; height: 100%; min-height: 260px; border-bottom: 0;
  border-right: 1px solid var(--line);
}
.blog-card--featured .body {
  padding: 1.75rem 1.85rem;
  justify-content: center;
}
.blog-card--featured h3 { font-size: clamp(1.4rem, 2.8vw, 1.85rem); }
.blog-card--featured .body > p:not(.meta):not(.blog-card__author) { font-size: 1.05rem; }
.blog-card--featured .blog-card__author {
  margin-top: 0.55rem;
  font-size: 0.95rem;
}
.blog-card--featured .blog-card__author-avatar {
  width: 1.85rem;
  height: 1.85rem;
}

.blog-newsletter {
  position: relative;
  margin-top: 3.5rem;
  padding: 2.25rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass-strong);
  text-align: center;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-2);
}
.blog-newsletter::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--lime), var(--brand), var(--sage));
}
.blog-newsletter h2 {
  margin: 0 0 0.45rem; font-size: clamp(1.3rem, 3vw, 1.6rem);
  color: var(--heading);
}
.blog-newsletter p { margin: 0 0 1.15rem; color: var(--muted); max-width: 28rem; margin-inline: auto; }

/* Article */
.article-page { padding: 2rem 0 4.5rem; }
.article-wrap { width: min(740px, calc(100% - 2rem)); margin-inline: auto; }
.article-crumb {
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
  margin: 0 0 1.35rem; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center;
}
.article-crumb a { color: var(--sage); text-decoration: none; }
.article-crumb a:hover { color: var(--lime); }
.article-crumb__sep { opacity: 0.45; }

.article-meta {
  font-family: var(--mono); font-size: 0.75rem; color: var(--sage);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 0.85rem;
}
.article-title {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-size: clamp(1.85rem, 4.8vw, 2.65rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--heading);
}
.article-excerpt {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.5;
}

.article-byline {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.95rem 1.05rem;
  margin-bottom: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(10px);
}
.article-byline__media {
  flex-shrink: 0;
  display: block;
  text-decoration: none;
  border-radius: 50%;
}
.article-byline__avatar {
  width: 3.1rem; height: 3.1rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, #9A32D4, #7305BD);
}
.article-byline__photo {
  width: 3.1rem; height: 3.1rem; border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 2px solid rgba(155, 92, 255, 0.45);
  display: block;
}
.article-byline__text { display: grid; gap: 0.12rem; min-width: 0; }
.article-byline__text strong { color: var(--white); font-size: 1rem; font-weight: 700; }
.article-byline__text strong a {
  color: inherit; text-decoration: none;
}
.article-byline__text strong a:hover { color: var(--lime); }
.article-byline__text span { color: var(--muted); font-size: 0.88rem; }
.article-byline--footer {
  margin-top: 2.5rem;
  margin-bottom: 0;
  align-items: flex-start;
}
.article-byline--footer .article-byline__photo,
.article-byline--footer .article-byline__avatar {
  width: 4rem; height: 4rem;
}
.article-byline__bio {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Author page */
.author-page { padding: 3rem 0 4.5rem; }
.author-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem 1.75rem;
  align-items: center;
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-2);
}
.author-hero__photo {
  width: 8.5rem; height: 8.5rem; border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 3px solid rgba(155, 92, 255, 0.5);
  box-shadow: 0 8px 28px rgba(115, 5, 189, 0.35);
}
.author-hero__label {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--lime);
  margin: 0 0 0.4rem;
}
.author-hero h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--heading); line-height: 1.15;
}
.author-hero__role {
  margin: 0 0 0.75rem; color: var(--sage); font-weight: 700; font-size: 1rem;
}
.author-hero__bio {
  margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 36rem;
}
.author-posts h2 {
  margin: 0 0 1.15rem; font-size: 1.3rem; color: var(--heading);
}

.article-cover {
  border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 2rem;
  aspect-ratio: 16 / 9;
  background: rgba(0,0,0,0.25);
  box-shadow: var(--shadow-2);
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

.article-body {
  font-size: 1.08rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.article-body h2 {
  margin: 2rem 0 0.7rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.01em;
}
.article-body p { margin: 0 0 1.1rem; color: var(--ink); }
.article-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
}
.article-body pre,
.article-body .article-html {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.25rem;
}
.article-body iframe,
.article-body video {
  max-width: 100%;
}
.article-body .article-text {
  margin: 0 0 1.25rem;
}
.article-body .article-text > :last-child {
  margin-bottom: 0;
}
.article-body .article-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
  margin: 0 0 1.5rem;
}
.article-body .article-columns__col {
  min-width: 0;
}
.article-body .article-columns__col > :first-child {
  margin-top: 0;
}
.article-body .article-columns__col > :last-child {
  margin-bottom: 0;
}
.article-body strong { color: var(--white); }
.article-body em { color: var(--ink); }
.article-body span { color: inherit; }
.article-body u {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.article-body ul, .article-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--ink);
}
.article-body li { margin: 0.35rem 0; }
.article-body li::marker { color: var(--lime); }
.article-body > p:first-child,
.article-body .article-sintesi {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(155, 92, 255, 0.35);
  background: linear-gradient(135deg, rgba(154, 50, 212, 0.18), rgba(115, 5, 189, 0.08));
  margin-bottom: 1.6rem;
  white-space: pre-wrap;
}
.article-figure {
  margin: 1.5rem auto 1.75rem;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: var(--shadow-2);
}
.article-image {
  margin: 1.5rem auto 1.75rem;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: var(--shadow-2);
}
.article-separator {
  display: block;
  width: min(12rem, 55%);
  height: 2px;
  margin: 2rem auto;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(155, 92, 255, 0.7), transparent);
}
.article-figure img,
.article-image img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.2);
}
.article-figure figcaption {
  margin: 0;
  padding: 0.65rem 1rem 0.7rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  border-top: 1px solid var(--line);
  background: var(--glass);
}
.article-figure figcaption ul,
.article-figure figcaption ol {
  margin: 0.1rem 0 0;
  padding-left: 1.2rem;
}
.article-figure figcaption li {
  margin: 0.12rem 0;
}
.article-figure figcaption p {
  margin: 0 0 0.25rem;
}
.article-figure figcaption p:last-child,
.article-figure figcaption ul:last-child,
.article-figure figcaption ol:last-child {
  margin-bottom: 0;
}
.article-figure figcaption .article-deeplink {
  display: inline-block;
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--lime);
  text-decoration: none;
}
.article-figure figcaption .article-deeplink:hover { text-decoration: underline; }
.article-body a:not(.btn) {
  color: var(--lime);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body a:not(.btn):hover { color: #C9A6FF; }
.article-body .btn-primary,
.article-cta .btn-primary,
.article-cta-btn .btn-primary {
  color: var(--lime-ink);
  text-decoration: none;
}
.article-body .btn-primary:hover,
.article-cta .btn-primary:hover,
.article-cta-btn .btn-primary:hover {
  color: var(--lime-ink);
  text-decoration: none;
}

.article-faq {
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.article-faq h2 {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  color: var(--heading);
}
.article-faq details,
.article-body details.article-faq-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 0.65rem;
  background: var(--glass);
  backdrop-filter: blur(10px);
}
.article-faq summary,
.article-body details.article-faq-item > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--heading);
  list-style: none;
  padding-right: 1.75rem;
}
.article-faq summary::-webkit-details-marker,
.article-body details.article-faq-item > summary::-webkit-details-marker { display: none; }
.article-faq summary::after,
.article-body details.article-faq-item > summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 0.9rem;
  color: var(--lime);
  font-family: var(--mono);
  font-weight: 700;
}
.article-faq details[open] summary::after,
.article-body details.article-faq-item[open] > summary::after { content: "–"; }
.article-faq p,
.article-body details.article-faq-item > p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  clear: both;
}

.article-body details.article-bibliography {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin: 1.75rem 0 1.25rem;
  background: var(--glass);
  backdrop-filter: blur(10px);
}
.article-body details.article-bibliography > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--heading);
  list-style: none;
  padding-right: 1.75rem;
}
.article-body details.article-bibliography > summary::-webkit-details-marker { display: none; }
.article-body details.article-bibliography > summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 0.9rem;
  color: var(--lime);
  font-family: var(--mono);
  font-weight: 700;
}
.article-body details.article-bibliography[open] > summary::after { content: "–"; }
.article-bibliography__list {
  margin: 0.85rem 0 0;
  padding: 0 0 0 1.25rem;
  color: var(--muted);
}
.article-bibliography__list li {
  margin: 0.45rem 0;
  padding-left: 0.15rem;
  line-height: 1.45;
}
.article-bibliography__list li::marker {
  color: var(--lime);
  font-weight: 700;
}

.article-cta {
  position: relative;
  margin: 2rem auto 1.75rem;
  max-width: 100%;
  padding: 2rem 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  text-align: center;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-2);
}
.article-cta::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--lime), var(--brand), var(--sage));
}
.article-cta h2 { margin: 0 0 0.4rem; font-size: 1.35rem; color: var(--heading); }
.article-cta__body {
  margin: 0 0 1.15rem;
  color: var(--muted);
}
.article-cta__body p {
  margin: 0 0 0.65rem;
  color: inherit;
}
.article-cta__body p:last-child { margin-bottom: 0; }
.article-cta > p { margin: 0 0 1.15rem; color: var(--muted); }
.article-cta .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
}
.article-cta .cta-row .btn {
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
}
.article-cta-btn {
  position: relative;
  margin: 1.5rem auto;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.article-cta-btn .btn {
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
}

.article-related { margin-top: 3rem; }
.article-related h2 {
  font-size: 1.3rem; margin: 0 0 1.15rem; color: var(--heading);
}
.article-related .blog-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.article-error {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.article-error a { color: var(--lime); font-weight: 700; }

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem;
  align-items: center; justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.85rem 1.25rem; font-size: 0.92rem; }
.site-footer a { color: rgba(255, 255, 255, 0.92); text-decoration: none; font-weight: 500; }
.site-footer a:hover { color: var(--lime); }

/* ——— Responsive: tablet + phone ——— */
@media (max-width: 900px) {
  body {
    background-attachment: scroll, scroll;
  }

  .wrap { width: min(var(--max), calc(100% - 1.35rem)); }

  .nav-toggle { display: inline-flex; }
  .site-header .bar { gap: 0.65rem; padding: 0.65rem 0; }
  .site-header .header-end { gap: 0.45rem; min-width: 0; }
  .site-header .header-actions { gap: 0.4rem; min-width: 0; }
  .site-header .header-actions .btn-ghost { display: none; }
  .site-header .header-actions .btn-primary {
    padding: 7px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }
  .logo img { height: 30px; }
  .site-header nav.main-nav,
  .site-header nav.main-nav--bar { display: none !important; }

  .nav-drawer {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--site-header-h, 64px);
    bottom: 0;
    z-index: 38;
    margin: 0;
    padding: 1.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: rgba(14, 4, 24, 0.97);
    border-top: 1px solid var(--line);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  html.nav-open .nav-drawer,
  body.nav-open .nav-drawer { display: flex; }
  .nav-drawer a {
    display: block;
    padding: 0.95rem 0.35rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-drawer a:hover,
  .nav-drawer a[aria-current="page"] { color: var(--lime); }
  .nav-drawer .nav-drawer-cta {
    display: flex !important;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1.25rem;
  }
  .nav-drawer .nav-drawer-cta .btn { width: 100%; text-align: center; }

  .blog-page { padding: 1.75rem 0 3rem; }
  .blog-page__head { margin-bottom: 1.5rem; }
  .blog-page__head .lede { font-size: 1.05rem; }

  .blog-filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
    margin: 0 0 1.35rem;
    padding: 0.15rem 0 0.45rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .blog-filters::-webkit-scrollbar { display: none; }
  .blog-filters__btn {
    flex: 0 0 auto;
    min-height: 2.5rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.82rem;
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.95rem;
  }
  .blog-card--featured { grid-column: 1 / -1; }
  .blog-card--featured .blog-card__link { grid-template-columns: 1fr; min-height: 0; }
  .blog-card--featured .blog-card__cover {
    min-height: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    aspect-ratio: 16 / 9;
  }
  .blog-card--featured .body { padding: 1.25rem 1.2rem 1.35rem; }
  .blog-card .body { padding: 1.05rem 1.1rem 1.15rem; }
  .blog-card h3 { font-size: 1.05rem; }
  .blog-card .body > p:not(.meta):not(.blog-card__author) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }

  .blog-newsletter {
    margin-top: 2.5rem;
    padding: 1.65rem 1.15rem;
    border-radius: 16px;
  }

  .article-page { padding: 1.35rem 0 3.25rem; }
  .article-wrap { width: min(740px, calc(100% - 1.35rem)); }
  .article-excerpt { font-size: 1.08rem; }
  .article-cover {
    border-radius: 14px;
    margin-bottom: 1.35rem;
  }
  .article-byline {
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    margin-bottom: 1.35rem;
  }
  .article-body { font-size: 1.02rem; }
  .article-body h2 { font-size: 1.25rem; margin-top: 1.65rem; }
  .article-cta {
    margin: 1.5rem auto 1.35rem;
    padding: 1.5rem 1.15rem;
    border-radius: 16px;
  }
  .article-cta h2 { font-size: 1.2rem; }
  .article-faq,
  .article-related { margin-top: 2.25rem; }
  .article-related .blog-grid { grid-template-columns: 1fr; }

  .author-page { padding: 1.75rem 0 3.25rem; }
  .author-hero {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    gap: 1rem;
    padding: 1.25rem 1.1rem;
    margin-bottom: 1.75rem;
  }
  .author-hero__photo {
    width: 6.5rem;
    height: 6.5rem;
  }
  .author-hero__bio {
    margin-inline: auto;
    font-size: 0.98rem;
  }

  .site-footer {
    padding: 1.75rem 0 calc(5.75rem + env(safe-area-inset-bottom, 0px));
  }
  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .site-footer nav {
    gap: 0.65rem 1rem;
  }
  .site-footer a {
    padding: 0.2rem 0;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
  }

  main {
    padding-bottom: 0.5rem;
  }
}

@media (max-width: 700px) {
  .blog-grid { grid-template-columns: 1fr; }
  .article-body .article-columns {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 560px) {
  .site-header .header-actions .btn-primary {
    padding: 7px 10px;
    font-size: 0.78rem;
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-toggle {
    width: 40px;
    height: 40px;
  }

  .blog-page { padding: 1.35rem 0 2.5rem; }
  .blog-page__head h1 { font-size: clamp(1.65rem, 7.2vw, 2.1rem); }
  .blog-page__head .lede { font-size: 0.98rem; }
  .blog-card--featured h3 { font-size: 1.25rem; }
  .blog-card--featured .body > p:not(.meta):not(.blog-card__author) {
    font-size: 0.95rem;
    -webkit-line-clamp: 4;
  }

  .article-page { padding: 1.1rem 0 2.75rem; }
  .article-title { font-size: clamp(1.55rem, 7vw, 1.95rem); }
  .article-excerpt { font-size: 1.02rem; margin-bottom: 1.1rem; }
  .article-body { font-size: 1rem; }
  .article-body h2 { font-size: 1.18rem; }
  .article-body > p:first-child,
  .article-body .article-sintesi {
    padding: 0.95rem 1rem;
    margin-bottom: 1.25rem;
  }
  .article-figure,
  .article-image { margin: 1.2rem auto 1.35rem; border-radius: 12px; }
  .article-byline--footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .article-byline--footer .article-byline__bio { text-align: center; }
  .article-faq details,
  .article-body details.article-faq-item,
  .article-body details.article-bibliography {
    padding: 0.8rem 0.95rem;
  }
  .article-faq summary,
  .article-body details.article-faq-item > summary,
  .article-body details.article-bibliography > summary {
    padding-right: 1.5rem;
    font-size: 0.98rem;
  }

  .author-page { padding: 1.35rem 0 2.75rem; }
  .author-hero__photo {
    width: 5.75rem;
    height: 5.75rem;
  }
  .author-hero h1 { font-size: clamp(1.45rem, 6.5vw, 1.85rem); }

  .article-error { padding: 2.5rem 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card, .btn { transition: none; }
  .blog-card:hover, .btn-primary:hover { transform: none; }
}
