/* =========================
   Blog / Index Page
   ========================= */

/* --- Sezione lista articoli --- */
section.blog {
  padding: 22px 0 40px;
}

section.blog h1 {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 700;
  text-align:center;
  padding-top:20px !important;
  padding-bottom:30px !important;
  color:white;
}

/* --- Griglia responsive --- */
.grid.posts {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr; /* Mobile */
}

@media (min-width: 640px) { /* Tablet */
  .grid.posts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) { /* Desktop */
  .grid.posts {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Card post --- */
.card.post {
  background: var(--card-bg, #111);
  border: 1px solid var(--card-border, #1f1f1f);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.card.post a {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* --- Thumbnail 16:9 --- */
.card.post img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0b0b0b;
}

/* --- Titolo --- */
.card.post h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin: 12px 14px 6px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* max 2 righe */
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1em * 1.35 * 2);
}

/* --- Meta --- */
.post-meta {
  font-size: 0.92rem;
  color: #aaa;
  padding: 0 14px 12px;
}

.post-meta .sep {
  margin: 0 4px;
}

/* --- Hover --- */
.card.post:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
  border-color: #2a2a2a;
}

/* --- Paginazione --- */
.pagination {
  margin-top: 24px;
}

.pagination ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.pagination li {
  display: inline-block;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid #333;
  border-radius: 6px;
  color: var(--link-color, #3ea6ff);
  text-decoration: none;
  font-size: 0.9rem;
}

.pagination a:hover {
  background: rgba(255,255,255,0.05);
}

/* --- Stato "vuoto" --- */
.muted {
  opacity: .7;
  font-size: .95rem;
  padding: 10px 0;
}

/* --- Mobile tweaks --- */
@media (max-width: 639.98px) {
  .card.post h3 {
    font-size: .98rem;
    margin: 10px 12px 4px;
  }
}
