.blog-hero {
  padding: 70px 0 30px;
  text-align: center;
}

.blog-category {
  width: min(1200px, 92%);
  margin: 0 auto 54px;
}

.blog-category-head {
  margin: 0 auto 100px;
  text-align: center;
}

.blog-category-head.has-bg {
  position: relative;
  overflow: hidden;
  width: 100vw;
  min-height: 50vh;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 42px;
  color: #fff;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.blog-category-head.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 49, 66, 0.58);
}

.blog-category-head.has-bg h2,
.blog-category-head.has-bg p {
  position: relative;
  color: #fff;
}

.blog-category-head h2 {
  margin: 0 0 8px;
  color: #0b3142;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.blog-category-head p {
  margin: 0 auto;
  max-width: 760px;
  color: #475569;
  line-height: 1.6;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 20px;
}

.blog-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.blog-card-content {
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blog-card h3 {
  font-family: var(--font-titolo);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-s);
  color: var(--grigio-500);
  margin: 0px;
  line-height: 1.4;
}

.blog-card p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.blog-card a {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0b3142;
  font-weight: 600;
  text-decoration: none;
}

.blog-card a:hover {
  text-decoration: underline;
}

.blog-date {
  font-size: 0.85rem;
  color: #64748b;
}

.pagination {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  color: #0b3142;
  text-decoration: none;
  font-size: 0.85rem;
}

.pagination-link.is-active {
  background: #0b3142;
  color: #fff;
  border-color: #0b3142;
  cursor: default;
}

.blog-detail {
  width: min(980px, 92%);
  margin: 0 auto 60px;
}

.blog-detail .blog-hero {
  padding: 60px 0 20px;
}

.blog-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.blog-meta {
  margin-top: 16px;
  color: #64748b;
  font-size: 0.9rem;
}

.blog-body {
  margin-top: 30px;
  color: #1f2933;
  line-height: 1.7;
  font-size: 1rem;
}

.blog-external {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0b3142;
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.blog-external:hover {
  background: #08212d;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0b3142;
  font-weight: 600;
  text-decoration: none;
  margin-top: 24px;
}

.blog-back:hover {
  text-decoration: underline;
}

.blog-detail .gallery-grid {
  justify-items: start;
  justify-content: start;
}

@media (max-width: 920px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}
