/* ============================================================
   EBM BLOG — Foglio di stile condiviso
   Dipende da: css/ebm.css (design system base)
   Usato da:   blog.html · ecorner/*.html
   ============================================================ */


/* ================================================================
   UTILITÀ GLOBALI
   ================================================================ */

/* Accessibilità — WCAG 2.4.7: focus-visible su tutti i componenti blog */
.blog-page :focus-visible,
.article-page :focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 3px;
  border-radius: inherit;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ================================================================
   ARCHIVIO BLOG — blog.html
   ================================================================ */

/* ── Hero ── */
.blog-hero {
  padding-top: calc(68px + 48px);
  padding-bottom: clamp(24px, 3vw, 40px);
  background: var(--white);
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 55%; height: 100%;
  background: radial-gradient(ellipse at 75% 50%, var(--green-50) 0%, transparent 65%);
  pointer-events: none;
}
.blog-hero .container { position: relative; z-index: 1; }

.blog-hero-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-600);
  margin-bottom: 16px;
}
.blog-hero-title {
  font-family: var(--ff-serif);
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.1;
  color: var(--navy-700);
  font-weight: 400;
  letter-spacing: -0.025em;
  max-width: 640px;
  margin-bottom: 20px;
}
.blog-hero-title em {
  font-style: italic;
  color: var(--green-600);
}
.blog-hero-desc {
  font-size: clamp(16px, 1.8vw, 18px);
  color: var(--gray-600);
  max-width: 520px;
  line-height: 1.65;
}


/* ── Sezione griglia — mobile-first ── */
.blog-section {
  padding: clamp(28px, 4vw, 48px) 0 clamp(40px, 7vw, 88px);
  background: var(--gray-50);
  min-height: 60vh;
}

/* 1 col → 2 → 3 */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 600px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}
@media (min-width: 960px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }
}


/* ── Card articolo ── */
.blog-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(28, 46, 74, .1);
  border-color: var(--green-100);
}

/* Articolo pillar — occupa 2 colonne da tablet in su */
.blog-card.cornerstone { grid-column: span 1; }
@media (min-width: 600px) {
  .blog-card.cornerstone { grid-column: span 2; }
  .blog-card.cornerstone .card-img { aspect-ratio: 16/6; }
}

.card-img {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--gray-50);
  flex-shrink: 0;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.blog-card:hover .card-img img { transform: scale(1.04); }

.card-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-600); /* contrasto 5.3:1 — WCAG AA */
  font-weight: 500;
}

.card-cornerstone-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--warning);
  background: #FEF3C7;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Link solo sul titolo — stretched link estende il click all'intera card */
.card-title-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.card-title-link:hover .card-title { color: var(--green-600); }

/* Stretched link: estende il tap/click area all'intera card */
.card-title-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.card-title {
  font-family: var(--ff-serif);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.25;
  color: var(--navy-700);
  font-weight: 400;
  letter-spacing: -.015em;
  margin: 0;
  transition: color var(--transition);
}

.card-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--gray-600);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-keyword {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--green-600);
  margin-top: auto;
  padding-top: 4px;
}

.card-arrow {
  position: absolute;
  bottom: 20px; right: 20px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--green-50);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(-6px);
  transition: all var(--transition);
  pointer-events: none;
}
/* Visibile anche con navigazione a tastiera */
.blog-card:hover .card-arrow,
.blog-card:focus-within .card-arrow {
  opacity: 1;
  transform: translateX(0);
}


/* ── Testo info e stato vuoto ── */
.blog-results-info {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 24px;
}
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-600);
  font-size: 16px;
}


/* ── Paginazione ── */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 48px;
  flex-wrap: wrap;
}

/* Touch target 44×44px — WCAG 2.5.8 */
.page-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1.5px solid var(--gray-100);
  background: var(--white);
  font-family: var(--ff-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--green-600); color: var(--green-600); }
.page-btn.active { background: var(--green-600); border-color: var(--green-600); color: var(--white); }
.page-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.page-btn.wide { padding: 0 20px; }


/* ================================================================
   ARTICOLO — ecorner/*.html
   ================================================================ */

/* ── Breadcrumb WAI-ARIA ── */
.breadcrumb {
  padding: 14px 0;
  font-size: 13px;
  color: var(--gray-600);
}
.breadcrumb ol {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 4px;
}
.breadcrumb a {
  color: var(--gray-600);
  text-decoration: none;
  transition: color var(--transition);
}
.breadcrumb a:hover { color: var(--green-600); }
.breadcrumb-sep { color: var(--gray-400); }
.breadcrumb li[aria-current="page"] { color: var(--gray-400); }


/* ── Hero articolo ── */
.article-hero {
  padding-top: calc(68px + 40px);
  padding-bottom: clamp(40px, 6vw, 64px);
  background: var(--white);
  position: relative;
  overflow: hidden;
}
.article-hero::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 50%; height: 100%;
  background: radial-gradient(ellipse at 80% 40%, var(--green-50) 0%, transparent 65%);
  pointer-events: none;
}
.article-hero .container { position: relative; z-index: 1; }
.article-hero-inner { max-width: 780px; }

.article-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.article-keyword {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--green-600);
}
.article-reading-time {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 500;
}

.article-hero h1 {
  font-family: var(--ff-serif);
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.12;
  color: var(--navy-700);
  font-weight: 400;
  letter-spacing: -.025em;
  margin-bottom: 20px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.article-hero-meta {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
}


/* ── Immagine in evidenza — boxata nel container ── */
.article-image-wrap {
  padding: 0 0 clamp(32px, 4vw, 48px);
  background: var(--white);
}
.article-image-wrap .container {
  /* usa il container globale per allinearsi al testo */
}
.article-image-wrap img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
}


/* ── Layout articolo — mobile-first ── */
.article-layout {
  padding: clamp(40px, 7vw, 80px) 0;
  background: var(--white);
}
.article-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
}
@media (min-width: 900px) {
  .article-inner {
    grid-template-columns: 1fr 300px;
  }
}


/* ── Prosa ── */
.article-prose {
  font-size: clamp(16px, 1.7vw, 17.5px);
  line-height: 1.78;
  color: var(--gray-600);
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0; /* previene overflow in grid */
}
.article-prose h2 {
  font-family: var(--ff-serif);
  font-size: clamp(20px, 2.5vw, 28px);
  color: var(--navy-700);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.015em;
  margin: 44px 0 16px;
  overflow-wrap: break-word;
}
.article-prose h3 {
  font-family: var(--ff-sans);
  font-size: clamp(16px, 1.8vw, 19px);
  font-weight: 600;
  color: var(--navy-700);
  margin: 32px 0 12px;
}
.article-prose p { margin-bottom: 22px; }
.article-prose p:last-child { margin-bottom: 0; }
.article-prose strong { color: var(--navy-700); font-weight: 600; }
.article-prose em { font-style: italic; }
.article-prose a {
  color: var(--green-600);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article-prose a:hover { color: var(--green-800); }
.article-prose ul,
.article-prose ol {
  padding-left: 24px;
  margin: 0 0 22px;
}
.article-prose li { margin-bottom: 8px; }
.article-prose blockquote {
  border-left: 3px solid var(--green-600);
  padding: 16px 24px;
  margin: 32px 0;
  background: var(--green-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.article-prose blockquote p { margin: 0; color: var(--navy-700); font-style: italic; }
.article-prose code {
  font-size: .9em;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  padding: 1px 5px;
  border-radius: 4px;
  overflow-wrap: break-word;
}
/* Tabelle scrollabili su mobile */
.article-prose .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 22px;
}
.article-prose table {
  width: 100%;
  border-collapse: collapse;
}
.article-prose th,
.article-prose td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}
.article-prose th {
  font-weight: 600;
  color: var(--navy-700);
  background: var(--gray-50);
}


/* ── Immagini inline nell'articolo ── */
/* Box coerente con il container del testo, stessi bordi e raggio del design system */
.article-prose figure.article-img-inline,
figure.article-img-inline {
  margin: 36px 0;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-50);
}
.article-img-inline img,
.article-img-inline video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.article-img-inline figcaption {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
  border-top: 1px solid var(--gray-100);
  background: var(--white);
}


/* ── FAQ ── */
.article-faq { margin-top: 48px; }
.article-faq > h2 {
  font-family: var(--ff-serif);
  font-size: clamp(20px, 2.5vw, 28px);
  color: var(--navy-700);
  font-weight: 400;
  margin-bottom: 24px;
}
.faq-item {
  border-bottom: 1px solid var(--gray-100);
  padding: 20px 0;
}
.faq-item:first-of-type { border-top: 1px solid var(--gray-100); }
.faq-question {
  font-weight: 600;
  color: var(--navy-700);
  font-size: 16px;
  margin-bottom: 8px;
}
.faq-answer {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.7;
}


/* ── Sidebar ── */
/* Mobile: fluisce dopo il contenuto.
   Desktop ≥900px: sticky con guard per viewport corti */
@media (min-width: 900px) {
  .article-sidebar {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
  }
}

.sidebar-cta {
  background: var(--navy-700);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  color: var(--white);
  margin-bottom: 20px;
}
.sidebar-cta-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-400);
  margin-bottom: 12px;
}
.sidebar-cta h3 {
  font-family: var(--ff-serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--white);
}
.sidebar-cta p {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .8);
  margin-bottom: 18px;
}
/* Touch target 44px — WCAG 2.5.8 */
.sidebar-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green-600);
  color: var(--white);
  font-family: var(--ff-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  min-height: 44px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition);
  width: 100%;
}
.sidebar-cta-btn:hover { background: var(--green-800); }

.sidebar-meta {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 20px;
}
/* <dl> semanticamente corretto per coppie label/valore */
.sidebar-meta dl { margin: 0; }
.sidebar-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.sidebar-meta-row:last-child { border-bottom: none; }
.sidebar-meta-label {
  color: var(--gray-600);
  font-weight: 500;
  flex-shrink: 0;
}
.sidebar-meta-value {
  color: var(--navy-700);
  font-weight: 600;
  text-align: right;
  overflow-wrap: break-word;
  min-width: 0;
}


/* ── Link "torna al blog" ── */
.article-back {
  padding: 32px 0;
  border-top: 1px solid var(--gray-100);
  background: var(--white);
}
.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-600);
  text-decoration: none;
  transition: gap var(--transition);
}
.article-back-link:hover { gap: 12px; }
