/* ==========================================================================
   BLOG (archive-blog.php, single-blog.php)
   Palette tema: #333 testo, #e30613 rosso, #f0f0f0 grigio, #7c7c7c secondario
   ========================================================================== */

.blog-archive,
.blog-single,
.blog-correlati {
  --blog-red: #e30613;
  --blog-dark: #333;
  --blog-grey: #f0f0f0;
  --blog-muted: #7c7c7c;
  --blog-line: #dcdcdc;
}

/* ---------- Elementi comuni ---------- */

.blog-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blog-red);
  margin-bottom: 12px;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--blog-muted);
  margin-bottom: 14px;
}

.blog-cat {
  display: inline-block;
  background: var(--blog-red);
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 10px;
  text-decoration: none !important;
  line-height: 1;
}

.blog-archive .link_news,
.blog-correlati .link_news {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  color: var(--blog-dark) !important;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
}

.blog-archive .link_news .btn-arrow,
.blog-correlati .link_news .btn-arrow {
  transition: transform 0.3s;
}

.blog-archive .link_news:hover .btn-arrow,
.blog-correlati .link_news:hover .btn-arrow,
.blog-card:hover .link_news .btn-arrow {
  transform: translateX(5px);
}

/* ---------- Archivio: hero ---------- */

.blog-hero {
  background: var(--blog-grey);
  padding: 140px 0 60px;
  text-align: center;
  border-bottom: 5px solid var(--blog-red);
}

.blog-hero h1 {
  font-size: 56px;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.blog-hero-sub p:last-child {
  margin-bottom: 0;
}

.blog-hero-sub {
  font-size: 20px;
  line-height: 32px;
  font-weight: 300;
  max-width: 560px;
  margin: 0 auto;
}

.blog-filtri {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 35px;
}

.blog-filtri a {
  border: 1px solid var(--blog-dark);
  border-radius: 30px;
  padding: 6px 20px;
  font-size: 14px;
  color: var(--blog-dark);
  text-decoration: none;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.blog-filtri a:hover,
.blog-filtri a.is-active {
  background: var(--blog-red);
  border-color: var(--blog-red);
  color: #fff;
}

/* ---------- Archivio: lista ---------- */

.blog-lista {
  padding: 70px 15px 90px;
}

.blog-featured {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: #fff;
  border: 1px solid var(--blog-line);
  margin-bottom: 60px;
  overflow: hidden;
}

.blog-featured-img {
  display: block;
  overflow: hidden;
  background: var(--blog-grey);
  height: 320px;
}

.blog-featured-img img,
.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s;
}

.blog-featured:hover .blog-featured-img img,
.blog-card:hover .blog-card-img img {
  transform: scale(1.06);
}

.blog-featured-text {
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blog-featured h2 {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.blog-featured h2 a,
.blog-card h3 a {
  text-decoration: none;
  color: var(--blog-dark);
  background-image: linear-gradient(var(--blog-red), var(--blog-red));
  background-size: 0 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s;
}

.blog-featured h2 a:hover,
.blog-card h3 a:hover {
  background-size: 100% 2px;
}

.blog-excerpt {
  font-size: 16px;
  line-height: 26px;
  font-weight: 300;
  margin-bottom: 18px;
}

.blog-grid > div {
  margin-bottom: 30px;
}

.blog-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--blog-line);
  transition: box-shadow 0.4s, transform 0.4s;
}

.blog-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.blog-card-img {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--blog-grey);
}

.blog-card-img .blog-cat {
  position: absolute;
  top: 15px;
  left: 15px;
}

.blog-card-text {
  padding: 25px 25px 30px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card h3 {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.blog-card p {
  font-size: 15px;
  line-height: 24px;
  font-weight: 300;
  margin-bottom: 20px;
}

.blog-card .link_news {
  margin-top: auto;
}

.blog-vuoto {
  text-align: center;
  padding: 60px 0;
}

.blog-vuoto h2 {
  font-weight: 700;
  text-transform: uppercase;
}

/* Paginazione */

.blog-paginazione .nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

.blog-paginazione .page-numbers {
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blog-line);
  color: var(--blog-dark);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}

.blog-paginazione .page-numbers .fas {
  color: inherit;
}

.blog-paginazione .page-numbers.current,
.blog-paginazione a.page-numbers:hover {
  background: var(--blog-red);
  border-color: var(--blog-red);
  color: #fff;
}

.blog-paginazione .screen-reader-text {
  position: absolute;
  left: -9999px;
}

/* ---------- Singolo articolo ---------- */

.blog-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 9999;
}

.blog-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: #e30613;
}

.blog-single-hero {
  background: var(--blog-grey);
  padding: 140px 0 140px;
}

/* Hero, immagine e testo allineati sulla stessa larghezza */
.blog-single .container {
  max-width: 960px;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blog-muted) !important;
  text-decoration: none !important;
  margin-bottom: 30px;
}

.blog-back .fas {
  color: var(--blog-red);
  padding: 0 10px 0 0;
  transition: transform 0.3s;
}

.blog-back:hover .fas {
  transform: translateX(-4px);
}

.blog-single-hero h1 {
  font-size: 44px;
  line-height: 1.2;
  margin-bottom: 20px;
}

.blog-single-lead {
  font-size: 20px;
  line-height: 32px;
  font-weight: 300;
  margin: 0;
}

.blog-single-cover {
  margin: -100px 0 0;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: #ddd;
}

.blog-single-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-single-body {
  padding-top: 60px;
  padding-bottom: 90px;
}

/* Indice */

.blog-toc {
  position: sticky;
  top: 120px;
  border-left: 3px solid var(--blog-red);
  padding: 5px 0 5px 20px;
  margin-bottom: 40px;
}

.blog-toc-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.blog-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.blog-toc li {
  counter-increment: toc;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 20px;
}

.blog-toc li a {
  display: flex;
  gap: 10px;
  color: var(--blog-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.blog-toc li a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--blog-red);
  font-weight: 700;
}

.blog-toc li a:hover {
  color: var(--blog-dark);
}

/* Contenuto */

.blog-content {
  font-size: 18px;
  line-height: 32px;
  font-weight: 300;
}

.blog-content p {
  margin-bottom: 24px;
}

.blog-content strong {
  font-weight: 700;
}

.blog-content h2 {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  margin: 55px 0 20px;
  padding-top: 25px;
  border-top: 1px solid var(--blog-line);
  scroll-margin-top: 120px;
}

.blog-content h3 {
  font-size: 21px;
  font-weight: 700;
  margin: 35px 0 15px;
}

.blog-content a {
  color: var(--blog-red);
  text-decoration: underline;
}

.blog-content ul,
.blog-content ol {
  padding-left: 0;
  margin-bottom: 28px;
}

.blog-content ul li {
  list-style: none;
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
}

.blog-content ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blog-red);
}

.blog-content ol {
  padding-left: 22px;
}

.blog-content ol li {
  margin-bottom: 12px;
}

.blog-content ol li::marker {
  color: var(--blog-red);
  font-weight: 700;
}

.blog-content blockquote {
  border-left: 4px solid var(--blog-red);
  background: var(--blog-grey);
  padding: 25px 30px;
  margin: 35px 0;
  font-size: 21px;
  line-height: 34px;
  font-weight: 700;
}

.blog-content img {
  margin: 20px 0;
}

.blog-content table {
  width: 100%;
  margin: 30px 0;
  font-size: 15px;
  line-height: 22px;
  border-collapse: collapse;
}

.blog-content th {
  background: var(--blog-dark);
  color: #fff;
  font-weight: 700;
  text-align: left;
}

.blog-content th,
.blog-content td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--blog-line);
}

/* CTA */

.blog-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  background: var(--blog-dark);
  color: #fff;
  padding: 40px;
  margin-top: 60px;
  border-top: 5px solid var(--blog-red);
}

.blog-cta h3 {
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 22px;
  margin-bottom: 8px;
}

.blog-cta p {
  margin: 0;
  font-weight: 300;
  color: #ddd;
}

.blog-cta .btn_red {
  flex-shrink: 0;
  display: inline-block;
  text-decoration: none;
  padding: 12px 30px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 1px;
}

/* Correlati */

.blog-correlati {
  background: var(--blog-grey);
  padding: 80px 0 60px;
}

.blog-correlati h2 {
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 45px;
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 991px) {
  .blog-featured {
    grid-template-columns: 1fr;
  }

  .blog-featured-img {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .blog-featured-text {
    padding: 35px 30px;
  }

  .blog-toc {
    position: static;
  }
}

@media screen and (max-width: 767px) {
  .blog-hero {
    padding: 140px 0 45px;
  }

  .blog-hero h1 {
    font-size: 38px;
  }

  .blog-hero-sub {
    font-size: 17px;
    line-height: 28px;
  }

  .blog-lista {
    padding: 45px 15px 60px;
  }

  .blog-featured h2 {
    font-size: 23px;
  }

  .blog-single-hero {
    padding: 140px 0 80px;
  }

  .blog-single-hero h1 {
    font-size: 28px;
  }

  .blog-single-lead {
    font-size: 17px;
    line-height: 28px;
  }

  .blog-single-cover {
    margin-top: -50px;
    aspect-ratio: 4 / 3;
  }

  .blog-single-body {
    padding-top: 40px;
    padding-bottom: 60px;
  }

  .blog-content {
    font-size: 17px;
    line-height: 29px;
  }

  .blog-content h2 {
    font-size: 22px;
  }

  .blog-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 30px;
  }
}

.blog-single-hero:not(.has-cover) {
  padding-bottom: 70px;
}
