﻿
/* ═══════════════════════════════════════════════════════════════
   BLOG
   ═══════════════════════════════════════════════════════════════ */

/* Index blog */
.blog-index { padding: 2rem 0; }

.blog-category { margin-bottom: 3rem; }

.blog-cat-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding-bottom: .4rem;
  margin-bottom: .5rem;
  text-transform: capitalize;
}
.blog-cat-title a {
  color: inherit;
  text-decoration: none;
}
.blog-cat-title a:hover { text-decoration: underline; }

/* Descrizione categoria — opzionale, mostrata sotto il titolo categoria */
.blog-cat-desc {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.blog-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  transition: box-shadow .2s var(--ease-out), transform .2s var(--ease-out);
}
.blog-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

.blog-card-thumb {
  flex: 0 0 220px;
  display: block;
  align-self: stretch;
}
.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 140px;
}
.blog-card-thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 140px;
  background: var(--border);
}

.blog-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.4rem 1.6rem;
  min-width: 0;
}

.blog-date {
  font-size: .78rem;
  color: var(--text-muted);
  letter-spacing: .03em;
}

.blog-card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.3;
}
.blog-card-title a { color: var(--text); text-decoration: none; }
.blog-card-title a:hover { color: var(--accent); }

.blog-card-desc {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.blog-read-more {
  font-size: .85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  margin-top: .25rem;
}
.blog-read-more:hover { text-decoration: underline; }

.blog-empty { color: var(--text-muted); font-style: italic; }

/* Riga unica sotto il titolo articolo: data · minuti lettura · breadcrumb categoria */
.post-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .82rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.post-meta-row .post-date,
.post-meta-row .post-read-time {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.post-meta-row .post-breadcrumb {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.post-meta-row .post-breadcrumb a {
  color: var(--text);
  text-decoration: none;
}
.post-meta-row .post-breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.post-meta-row .post-breadcrumb span { opacity: .7; }

/* Hero immagine articolo */
.post-hero-img {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 2rem;
}
.post-hero-img img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

/* Articolo singolo */
.post { max-width: 720px; margin: 0 auto; }

.post-header { margin-bottom: 2rem; }

.post-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: .5rem;
}

/* nota: .post-meta generico rimosso — sostituito da .post-meta-row sopra */

.post h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin: 2rem 0 .75rem;
  color: var(--text);
}

.post pre {
  background: #f4f4f6;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.post code {
  font-family: 'Courier New', monospace;
  font-size: .85rem;
  color: #333;
}

@media (max-width: 600px) {
  .blog-card { flex-direction: column; }
  .blog-card-thumb { flex: none; width: 100%; height: 160px; }
  .post-header h1 { font-size: 1.5rem; }
  /* Su mobile: gap più stretto, font leggermente più piccolo per
     restare su una riga più spesso */
  .post-meta-row {
    gap: .6rem;
    font-size: .76rem;
  }
}

/* ── Post header (categoria, titolo, meta) ────────────────── */
.post-header { margin-bottom: 2rem; }
.post-category {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--color-accent, #c0392b);
    text-decoration: none;
    margin-bottom: .5rem;
}
.post-category:hover { text-decoration: underline; }
.post-title { font-size: 2rem; margin: .25rem 0 .75rem; line-height: 1.25; }
/* nota: .post-meta (seconda definizione) rimossa — sostituita da .post-meta-row in alto */

/* ── Commenti ─────────────────────────────────────────────── */
.post-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e5e5;
}
.comments-title { font-size: 1.2rem; margin-bottom: 1.5rem; }
.comment {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}
.comment-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--color-accent, #c0392b);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem;
    flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author { font-weight: 600; margin-right: .5rem; }
.comment-date { font-size: .8rem; color: #888; }
.comment-body p { margin: .5rem 0 0; font-size: .95rem; }
.comment-form-placeholder { color: #888; font-size: .9rem; margin-top: 1rem; }