/* Articoli blog — layout pulito, allineato a index e blog */

.blog-article {
  --ba-bg: var(--color-bg, #fffcf5);
  --ba-ink: var(--color-text, #141a18);
  --ba-muted: #5a6863;
  --ba-body: #3d4743;
  --ba-line: rgba(20, 26, 24, 0.12);
  --ba-primary: var(--color-primary, #ccff66);
  --ba-secondary: var(--color-secondary, #053021);
  --ba-read: 42rem;
  --ba-aside: 17.5rem;
  --ba-ease: var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
  --ba-font: "Geist", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ba-bg);
  color: var(--ba-ink);
  font-family: var(--ba-font);
}

.blog-article ::selection {
  background-color: var(--ba-primary);
  color: var(--ba-secondary);
}

.ba-main {
  flex: 1;
}

.ba-wrap {
  max-width: 72rem;
  margin: 0 auto;
}

/* Hero */
.ba-hero {
  grid-area: hero;
  margin-bottom: 0;
  max-width: var(--ba-read);
}

.ba-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  font-family: var(--ba-font);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ba-muted);
}

.ba-crumb a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ba-crumb a:hover {
  color: var(--ba-ink);
}

.ba-eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--ba-font);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--ba-muted);
}

.ba-title {
  margin: 0 0 1rem;
  font-family: var(--ba-font);
  font-size: clamp(1.9rem, 4.5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ba-ink);
  max-width: 22ch;
}

.ba-hero__cover {
  margin: 0 0 1.25rem;
}

.ba-hero__cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid var(--ba-line);
  background: #edf2ef;
}

.ba-hero__cover figcaption,
.ba-figure figcaption {
  margin-top: 0.65rem;
  font-family: var(--ba-font);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ba-muted);
}

.ba-lead {
  margin: 0;
  max-width: 32rem;
  font-family: var(--ba-font);
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.6;
  color: var(--ba-body);
}

/* Layout articolo + sidebar */
.ba-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "hero"
    "aside"
    "content";
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .ba-layout {
    grid-template-columns: minmax(0, 1fr) var(--ba-aside);
    grid-template-areas:
      "hero aside"
      "content aside";
    gap: clamp(2rem, 4vw, 3.5rem);
  }
}

.ba-prose-col {
  grid-area: content;
  min-width: 0;
  max-width: var(--ba-read);
}

/* Prosa — Geist per testi lunghi */
.ba-prose {
  font-family: var(--ba-font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ba-body);
}

.ba-prose p {
  margin: 0 0 1.5rem;
}

.ba-prose h2 {
  margin: 3rem 0 1rem;
  font-family: var(--ba-font);
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ba-ink);
  scroll-margin-top: 5.5rem;
}

.ba-prose > h2:first-of-type,
.ba-prose > nav + h2 {
  margin-top: 0;
}

.ba-prose h3 {
  margin: 2rem 0 0.65rem;
  font-family: var(--ba-font);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.28;
  color: var(--ba-ink);
}

.ba-prose a:not(.btn-primary):not(.btn-secondary):not(.btn-light) {
  color: var(--ba-secondary);
  text-decoration: underline;
  text-decoration-color: rgba(5, 48, 33, 0.35);
  text-underline-offset: 0.15em;
}

.ba-prose a:not(.btn-primary):not(.btn-secondary):not(.btn-light):hover {
  text-decoration-color: rgba(5, 48, 33, 0.75);
}

.ba-prose strong {
  font-weight: 600;
  color: var(--ba-ink);
}

.ba-prose ul,
.ba-prose ol {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
}

.ba-prose li {
  margin-bottom: 0.55rem;
}

.ba-prose blockquote {
  margin: 2rem 0;
  padding: 0;
  font-family: var(--ba-font);
  font-size: clamp(1.08rem, 2.4vw, 1.28rem);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--ba-ink);
}

.ba-prose .btn-primary,
.ba-prose .btn-secondary {
  text-decoration: none;
}

.ba-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 2.25rem 0 0;
}

.ba-prose .btn-primary,
.ba-prose .btn-secondary,
.ba-aside .btn-primary {
  font-family: var(--ba-font);
  font-weight: 600;
}

/* Indice — link semplici, senza numeri né riquadri */
.ba-toc {
  margin-bottom: 2.25rem;
}

.ba-toc__label,
.ba-callout__label,
.ba-faq__label,
.ba-summary__title,
.ba-related__title {
  font-family: var(--ba-font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ba-ink);
}

.ba-toc__label {
  margin: 0 0 0.65rem;
}

.ba-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ba-toc li + li {
  margin-top: 0.4rem;
}

.ba-toc a {
  font-family: var(--ba-font);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ba-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.ba-toc a:hover {
  color: var(--ba-secondary);
}

/* Callout — solo tipografia */
.ba-callout {
  margin: 2rem 0;
}

.ba-callout__label {
  display: block;
  margin: 0 0 0.5rem;
}

.ba-callout p {
  margin: 0;
  font-family: var(--ba-font);
}

.ba-callout p + p {
  margin-top: 0.75rem;
}

/* Media in articolo */
.ba-figure {
  margin: 2rem 0 2.25rem;
}

.ba-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid var(--ba-line);
  background: #edf2ef;
}

.ba-figure figcaption {
  margin-top: 0.65rem;
}

/* FAQ — come homepage */
.ba-faq {
  margin-top: 3.5rem;
}

.ba-faq__label {
  margin: 0 0 0.5rem;
}

.ba-faq__title {
  margin: 0 0 1.5rem;
  font-family: var(--ba-font);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ba-ink);
}

.ba-faq details {
  border-top: 1px solid var(--ba-line);
  padding: 1.15rem 0;
}

.ba-faq details:last-of-type {
  border-bottom: 1px solid var(--ba-line);
}

.ba-faq summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--ba-font);
  font-size: clamp(1rem, 2.2vw, 1.08rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ba-ink);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  transition: color 0.35s ease;
}

.ba-faq summary:hover {
  color: var(--ba-secondary);
}

.ba-faq summary::-webkit-details-marker {
  display: none;
}

.ba-faq summary::after {
  content: "+";
  flex-shrink: 0;
  font-family: var(--ba-font);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ba-muted);
  transition: transform 0.45s var(--ba-ease), color 0.35s ease;
}

.ba-faq details[open] summary::after {
  transform: rotate(45deg);
  color: var(--ba-ink);
}

.ba-faq details p {
  margin: 0.85rem 0 0;
  padding-right: 1.5rem;
  font-family: var(--ba-font);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ba-body);
}

/* Chiusura */
.ba-summary {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ba-line);
}

.ba-summary__title {
  margin: 0 0 0.85rem;
  font-size: 1.0625rem;
}

.ba-summary p {
  margin: 0;
  font-family: var(--ba-font);
  font-size: 0.95rem;
  line-height: 1.62;
}

/* Sidebar */
.ba-aside {
  grid-area: aside;
  min-width: 0;
  position: relative;
  z-index: 1;
}

@media (max-width: 1023px) {
  .ba-aside {
    max-width: var(--ba-read);
  }
}

@media (min-width: 1024px) {
  .ba-aside {
    position: sticky;
    top: 6.5rem;
    align-self: start;
  }
}

.ba-aside__inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ba-aside__title {
  margin: 0 0 0.45rem;
  font-family: var(--ba-font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.28;
  color: var(--ba-ink);
}

.ba-aside__text {
  margin: 0 0 1rem;
  font-family: var(--ba-font);
  font-size: 0.875rem;
  line-height: 1.58;
  color: var(--ba-body);
}

.ba-aside__inner .btn-primary {
  width: 100%;
  justify-content: center;
}

.ba-aside__author {
  font-family: var(--ba-font);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ba-muted);
}

.ba-aside__author strong {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--ba-font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ba-ink);
}

@media (min-width: 1024px) {
  .ba-aside__author {
    padding-top: 0.25rem;
  }
}

/* Correlati — card come blog.html */
.ba-related {
  margin-top: 3.5rem;
}

.ba-related__title {
  margin: 0 0 1.1rem;
  font-size: clamp(1.2rem, 2.5vw, 1.35rem);
}

.ba-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .ba-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ba-card {
  border: 1px solid var(--ba-line);
  border-radius: 1rem;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 12px 32px -28px rgba(20, 26, 24, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ba-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -24px rgba(18, 21, 23, 0.45);
  border-color: rgba(20, 26, 24, 0.2);
}

.ba-card:hover .ba-card__title {
  color: var(--ba-secondary);
}

.ba-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--ba-line);
  object-fit: cover;
  display: block;
}

.ba-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ba-font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ba-muted);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.9), rgba(243, 241, 236, 0.95));
}

.ba-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.5rem;
  padding: 1.5rem 1.75rem 1.75rem;
  box-sizing: border-box;
}

.ba-card__meta {
  margin: 0;
  font-family: var(--ba-font);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ba-muted);
}

.ba-card__title {
  margin: 0;
  padding-top: 0.125rem;
  font-family: var(--ba-font);
  font-size: 1.0625rem;
  line-height: 1.38;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ba-ink);
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ba-card__lead {
  margin: 0.25rem 0 0;
  font-family: var(--ba-font);
  font-size: 0.875rem;
  line-height: 1.62;
  color: var(--ba-body);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer — full width */
.ba-footer {
  margin-top: 4rem;
  width: 100%;
  border-top: 1px solid var(--ba-line);
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.ba-footer__inner {
  width: 100%;
  max-width: 106.25rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .ba-footer__inner {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
  }
}

.ba-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ba-footer__logo-link {
  display: inline-block;
  border-radius: 0.25rem;
  line-height: 0;
}

.ba-footer__logo-link:focus-visible {
  outline: 2px solid var(--ba-ink);
  outline-offset: 3px;
}

.ba-footer__logo {
  display: block;
  height: 2.5rem;
  width: auto;
}

.ba-footer__copy {
  margin: 0;
  font-family: var(--ba-font);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ba-muted);
}

.ba-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.5rem;
  font-family: var(--ba-font);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ba-muted);
}

@media (min-width: 768px) {
  .ba-footer__links {
    justify-content: flex-end;
    max-width: 28rem;
  }
}

.ba-footer__links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ba-footer__links a:hover {
  color: var(--ba-ink);
}

@media (prefers-reduced-motion: reduce) {
  .ba-faq summary::after {
    transition: none;
  }
}
