/* ============================================
   Biblò — Blog (indice + articoli)
   Componenti in stile v2: chip filtro, card
   articolo, schede libro, tabelle comparative.
   ============================================ */

/* --- Indice blog --- */
.blog-header { padding: 44px 0 10px; text-align: center; }
.blog-header h1 { margin-bottom: 12px; }
.blog-header .sub { color: var(--ink-soft); max-width: 560px; margin: 0 auto; }

.blog-filters {
  max-width: 760px; margin: 26px auto 8px;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.blog-search {
  width: 100%; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border: 1.5px solid var(--line);
  border-radius: var(--radius-pill); padding: 11px 18px;
  box-shadow: var(--shadow-soft);
}
.blog-search:focus-within { border-color: var(--sky); box-shadow: var(--glow-sky); }
.blog-search svg { flex: none; color: var(--ink-faint); }
.blog-search input {
  border: none; outline: none; background: transparent;
  font-family: var(--body); font-size: 16px; color: var(--ink);
  width: 100%;
}
.blog-search input::placeholder { color: var(--ink-faint); }

.chip-row {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  list-style: none; margin: 0; padding: 0;
}
.chip {
  font-family: var(--body); font-weight: 700; font-size: 14px;
  color: var(--ink-soft); background: var(--bg-soft);
  border: 1.5px solid var(--line); border-radius: var(--radius-pill);
  padding: 8px 16px; cursor: pointer;
  transition: all 160ms;
}
.chip:hover { border-color: var(--sky); color: var(--sky-text); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[data-emo="nanna"].active    { background: var(--lilac); border-color: var(--lilac); color: var(--lilac-text); }
.chip[data-emo="calma"].active    { background: var(--sky-bg); border-color: var(--sky); color: var(--sky-text); }
.chip[data-emo="tenerezza"].active{ background: var(--coral-bg); border-color: var(--coral-soft); color: var(--coral-text); }
.chip[data-emo="allegria"].active { background: var(--sun-bg); border-color: var(--sun); color: var(--sun-text); }
.chip[data-emo="coraggio"].active { background: var(--leaf-bg); border-color: var(--leaf); color: var(--leaf-text); }
.chip[data-emo="curiosita"].active{ background: var(--sky-bg); border-color: var(--sky); color: var(--sky-text); }

.blog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px; padding: 30px 0 80px;
}
.blog-card {
  display: flex; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-soft); text-decoration: none !important;
  transition: transform 200ms, box-shadow 200ms;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.blog-card-cover {
  height: 130px; display: flex; align-items: center; justify-content: center;
  font-size: 46px; background: var(--grad-soft);
}
.blog-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-card h2 {
  font-size: 20px; line-height: 1.25; color: var(--ink);
  border: none; margin: 0; padding: 0;
}
.blog-card p { color: var(--ink-soft); font-size: 15px; margin: 0; }
.blog-card .card-meta {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-faint);
}
.tag-emo {
  font-size: 12.5px; font-weight: 700; border-radius: var(--radius-pill);
  padding: 3px 10px; background: var(--bg-alt); color: var(--ink-soft);
}
.tag-emo.nanna     { background: var(--lilac-bg); color: var(--lilac-text); }
.tag-emo.calma     { background: var(--sky-bg); color: var(--sky-text); }
.tag-emo.tenerezza { background: var(--coral-bg); color: var(--coral-text); }
.tag-emo.allegria  { background: var(--sun-bg); color: var(--sun-text); }
.tag-emo.coraggio  { background: var(--leaf-bg); color: var(--leaf-text); }
.tag-emo.curiosita { background: var(--sky-bg); color: var(--sky-text); }

.blog-empty {
  text-align: center; color: var(--ink-soft); padding: 40px 0 80px;
  display: none;
}

/* --- Articolo --- */
.post-meta {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  flex-wrap: wrap; font-size: 14px; color: var(--ink-faint);
  margin-top: 10px;
}
.post-body { max-width: 720px; margin: 0 auto; padding: 6px 0 80px; }
.post-body > p { color: var(--ink-soft); margin-bottom: 16px; }
.post-body h2 {
  margin: 44px 0 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); color: var(--ink);
}
.post-body h3 {
  font-size: 19px; margin: 34px 0 6px; color: var(--ink);
  font-family: var(--display);
}
.post-body strong { color: var(--ink); }
.post-lead {
  background: var(--grad-soft);
  border-radius: var(--radius-lg);
  padding: 22px 26px; margin-bottom: 28px;
}
.post-lead p { color: var(--ink); margin: 0; font-size: 17.5px; }

.disclosure {
  font-size: 13.5px; color: var(--ink-faint);
  background: var(--bg-alt); border-radius: var(--radius);
  padding: 12px 16px; margin: 22px 0;
}

/* testata illustrata articolo */
.post-hero {
  max-width: 720px; margin: 4px auto 30px;
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.post-hero svg { display: block; width: 100%; height: auto; }

/* indice con anchor */
html { scroll-behavior: smooth; }
.post-toc {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 10px 20px;
  margin: 0 0 26px; box-shadow: var(--shadow-soft);
}
.post-toc .toc-title {
  font-size: 12.5px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-faint); flex: none;
}
.post-toc ul { display: flex; gap: 2px 16px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.post-toc a {
  font-size: 14px; font-weight: 700; color: var(--blue-deep);
  text-decoration: none; white-space: nowrap;
}
.post-toc a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 700px) {
  .post-toc { border-radius: var(--radius); padding: 14px 18px; }
  .post-toc ul { gap: 6px 14px; }
}
.post-body h2[id] { scroll-margin-top: 24px; }

/* tabella comparativa - stile editoriale leggero */
.table-wrap { overflow-x: auto; margin: 18px 0 8px; }
.compare { border-collapse: separate; border-spacing: 0 8px; width: 100%; min-width: 660px; font-size: 14.5px; }
.compare th {
  font-size: 12px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; text-align: left;
  color: var(--ink-faint); padding: 0 16px 2px;
  white-space: nowrap; border: none;
}
.compare td {
  background: var(--bg-soft); padding: 13px 16px;
  color: var(--ink-soft); vertical-align: top; border: none;
}
.compare tbody tr td:first-child { border-radius: var(--radius) 0 0 var(--radius); color: var(--ink); font-weight: 700; }
.compare tbody tr td:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.compare .table-link {
  color: var(--ink); font-weight: 700;
  text-decoration: underline; text-decoration-style: dotted;
  text-decoration-color: var(--ink-faint); text-underline-offset: 3px;
}
.compare .table-link:hover { color: var(--blue-deep); text-decoration-color: var(--blue-deep); }
.book-card[id] { scroll-margin-top: 20px; }

/* scheda libro (con copertina dal catalogo) */
.book-card {
  display: flex; gap: 22px; align-items: flex-start;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px 26px;
  margin: 24px 0; box-shadow: var(--shadow-soft);
}
.book-cover {
  flex: none; width: 104px; border-radius: var(--radius-sm);
  box-shadow: 3px 6px 16px -6px rgba(61, 44, 30, 0.35);
  transform: rotate(-1.5deg);
}
img.book-cover { height: auto; }
.book-cover-ph {
  height: 132px; display: flex; align-items: center; justify-content: center;
  font-size: 40px; background: var(--grad-soft);
  border: 1px solid var(--line);
}
.book-main { flex: 1; min-width: 0; }
@media (max-width: 560px) {
  .book-card { flex-direction: row; gap: 16px; }
  .book-cover { width: 78px; }
  .book-cover-ph { height: 100px; font-size: 30px; }
}
.book-card h4 {
  font-family: var(--display); font-weight: 600; font-size: 21px;
  margin: 0 0 6px; color: var(--ink);
}
.book-card .book-facts { font-size: 14.5px; color: var(--ink-faint); margin-bottom: 14px; }
.book-card .book-facts strong { color: var(--ink-soft); font-weight: 700; }
.book-card p { color: var(--ink-soft); margin-bottom: 12px; }
.book-card p:last-of-type { margin-bottom: 0; }
.book-when { font-size: 15px; }
.book-when strong { color: var(--ink); }
.book-buy {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.book-buy .buy-label { font-size: 13.5px; font-weight: 800; color: var(--ink-faint); margin-right: 2px; text-transform: uppercase; letter-spacing: .04em; }
.buy-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; text-decoration: none !important;
  color: var(--sky-text); background: var(--sky-bg);
  border: 1px solid var(--sky-border); border-radius: var(--radius-pill);
  padding: 6px 14px; transition: all 160ms;
}
.buy-link:hover { background: var(--sky); color: #fff; }

/* CTA finale verso l'app */
.post-cta {
  background: var(--grad-warm);
  border-radius: var(--radius-lg); padding: 30px 30px;
  text-align: center; margin: 46px 0 0;
  box-shadow: var(--glow-coral);
}
.post-cta h2 { border: none; margin: 0 0 8px; padding: 0; color: #fff; }
.post-cta p { color: rgba(255,255,255,.92); margin: 0 auto 18px; max-width: 480px; }
.post-cta .cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--ink) !important;
  font-family: var(--display); font-weight: 600; font-size: 17px;
  text-decoration: none !important; border-radius: var(--radius-pill);
  padding: 13px 28px; box-shadow: var(--shadow-card);
  transition: transform 180ms;
}
.post-cta .cta-btn:hover { transform: translateY(-2px); }

.back-to-blog {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; margin: 26px 0 0;
}

@media (max-width: 600px) {
  .blog-card-cover { height: 110px; font-size: 40px; }
  .book-card { padding: 20px 18px; }
  .post-cta { padding: 26px 20px; }
}
