.hero {
  background-color: #1a0f0a;
  background-image: url('/images/home-hero.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 520px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-content h1 {
  color: #fff;
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  margin-bottom: 16px;
}

.hero-content p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 28px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.categories-bar {
  background-color: #fff;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  list-style: none;
}

.categories-list li {
  font-size: 15px;
}

.categories-list a {
  color: var(--color-brand);
  font-weight: 400;
  padding: 6px 0;
  display: inline-block;
  transition: color 0.2s;
  text-decoration: none;
}

.categories-list a:hover {
  color: var(--color-cta);
}

.articles-section {
  padding: 50px 0 60px;
}

.articles-section h2 {
  text-align: center;
  margin-bottom: 32px;
}

.masonry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  align-items: start;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.masonry-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-top: 3px solid var(--color-brand);
}

.masonry-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

.masonry-card-img {
  width: 100%;
  height: 200px;
  overflow: hidden;
  flex-shrink: 0;
}

.masonry-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}

.masonry-card:hover .masonry-card-img img {
  transform: scale(1.04);
}

.masonry-card-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.masonry-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.masonry-card-meta svg {
  flex-shrink: 0;
}

.masonry-card-body h3 {
  margin-bottom: 10px;
  line-height: 1.5;
}

.masonry-card-body h3 a {
  text-decoration: none;
}

.masonry-card-body p {
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.6;
  flex: 1;
}

.masonry-card-body p:last-child {
  margin-bottom: 0;
}

.masonry-card.featured {
  border-top-width: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.masonry-card.featured:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.newsletter-section {
  background-color: var(--color-brand);
  padding: 56px 0;
  text-align: center;
}

.newsletter-section h2 {
  color: #fff;
  margin-bottom: 10px;
}

.newsletter-section p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  margin-bottom: 28px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
  justify-content: center;
  flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--color-cta);
}

.newsletter-form button {
  padding: 14px 28px;
}

.newsletter-message {
  margin-top: 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.stats-section {
  background-color: #fff;
  padding: 50px 0 56px;
}

.stats-section h2 {
  text-align: center;
  margin-bottom: 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.stat-item {
  text-align: center;
  padding: 24px 12px;
}

.stat-icon {
  margin-bottom: 12px;
}

.stat-icon svg {
  display: inline-block;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-brand);
  line-height: 1.3;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .hero {
    min-height: 400px;
    padding: 60px 16px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero-ctas .btn-cta,
  .hero-ctas .btn-cta-outline {
    width: 100%;
    max-width: 280px;
  }

  .categories-list {
    justify-content: flex-start;
    padding: 0 16px;
  }

  .masonry-grid {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 16px;
    grid-auto-rows: auto;
  }

  .masonry-card {
    grid-column: 1;
    grid-row: auto;
  }

  .masonry-card-img {
    height: 200px;
  }

  .newsletter-form {
    flex-direction: column;
    padding: 0 16px;
  }

  .newsletter-form input[type="email"] {
    min-width: 0;
    width: 100%;
  }

  .newsletter-form button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 16px;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .articles-section {
    padding: 36px 0 40px;
  }
}

@media (min-width: 768px) {
  /* Cartes dimensionnées par leur contenu (hauteurs auto). Les anciens
     grid-row: span N codés en dur supposaient une grille pleine d'articles
     et rendaient une carte unique démesurément haute. */
  .masonry-card {
    grid-row: auto;
  }
}