/* ============================================================
   BLOG.CSS — index du blog IFSMS
   Direction v2 : grille éditoriale, cards claires, sidebar
   ============================================================ */

/* ==================== HERO BLOG ==================== */
.blog-hero {
  background: var(--blanc);
  padding: 80px 0 64px;
  text-align: center;
  position: relative;
}
.blog-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--terracotta);
}
.blog-hero .eyebrow {
  display: inline-block;
  margin-bottom: 20px;
  padding: 6px 16px;
  background: rgba(184, 92, 74, 0.08);
  border-radius: 2px;
}
.blog-hero h1 {
  max-width: 720px;
  margin: 0 auto 24px;
  font-size: clamp(36px, 4.8vw, 54px);
}
.blog-hero-lead {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
  color: var(--gris);
  max-width: 680px;
  margin: 0 auto;
}

/* ==================== LAYOUT BLOG ==================== */
.blog-section {
  background: var(--blanc);
  padding: 72px 0 96px;
}
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  max-width: 1240px;
  margin: 0 auto;
  align-items: start;
}

.blog-main {
  min-width: 0; /* évite débordement flex */
}

/* ==================== CARDS ARTICLES ==================== */
.article-card {
  display: block;
  background: var(--blanc);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid var(--gris-clair);
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(42, 74, 62, 0.10);
  border-color: transparent;
}

.article-card-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--creme);
  position: relative;
}
.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.article-card:hover .article-card-img img {
  transform: scale(1.05);
}

.article-card-body {
  padding: 24px 26px 26px;
}

.article-card-tag {
  font-family: var(--font-body);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--terracotta);
  font-weight: 600;
  margin: 0 0 10px;
}

.article-card-body h2,
.article-card-body h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--sapin);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.article-card-body h2 {
  font-size: clamp(24px, 2.6vw, 30px);
}
.article-card-body h3 {
  font-size: 19px;
}

.article-card-excerpt {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--encre);
  margin: 0 0 16px;
}

.article-card-read {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--terracotta);
  letter-spacing: 0.02em;
  transition: color 0.2s, padding-left 0.2s;
}
.article-card:hover .article-card-read {
  color: var(--bordeaux);
  padding-left: 4px;
}

/* Article à la Une — format horizontal pleine largeur */
.article-card-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 32px;
  border-top: 3px solid var(--terracotta);
  border-radius: 4px;
}
.article-card-featured .article-card-img {
  aspect-ratio: auto;
  height: 100%;
  min-height: 340px;
}
.article-card-featured .article-card-body {
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.article-card-featured .article-card-excerpt {
  font-size: 16px;
  line-height: 1.65;
}

/* Grille 2 colonnes pour les autres articles */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ==================== SIDEBAR ==================== */
.blog-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-block {
  background: var(--creme);
  border-radius: 4px;
  padding: 28px 26px;
  border-left: 3px solid var(--terracotta);
}
.sidebar-block:nth-child(2) {
  border-left-color: var(--sauge);
}
.sidebar-block:nth-child(3) {
  border-left-color: var(--sapin);
}
.sidebar-block:nth-child(4) {
  border-left-color: var(--terracotta);
}

.sidebar-newsletter-label {
  font-family: var(--font-body);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--terracotta);
  font-weight: 600;
  margin: 0 0 10px;
}
.sidebar-block:nth-child(2) .sidebar-newsletter-label {
  color: var(--sauge);
}
.sidebar-block:nth-child(3) .sidebar-newsletter-label {
  color: var(--sapin);
}

.sidebar-block h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--sapin);
  margin: 0 0 14px;
  line-height: 1.3;
}

.sidebar-block p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--encre);
  margin: 0 0 10px;
}
.sidebar-block p:last-of-type {
  margin-bottom: 0;
}

/* Newsletter formulaire */
.sidebar-newsletter-text {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gris) !important;
  margin-bottom: 16px !important;
}
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.newsletter-form input {
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--encre);
  background: var(--blanc);
  border: 1px solid var(--gris-clair);
  border-radius: 2px;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.newsletter-form input:focus {
  outline: none;
  border-color: var(--terracotta);
}
.newsletter-btn {
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  background: var(--terracotta);
  color: var(--creme);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}
.newsletter-btn:hover {
  background: var(--bordeaux);
}

/* Lien "en savoir plus" */
.sidebar-link {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--terracotta);
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
}
.sidebar-link:hover {
  color: var(--bordeaux);
  padding-left: 3px;
}

/* Articles populaires */
.popular-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--gris-clair);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}
.popular-item:last-child {
  border-bottom: none;
}
.popular-item:hover {
  transform: translateX(3px);
}
.popular-img {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 2px;
  background: var(--creme);
}
.popular-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.popular-title {
  font-family: var(--font-display);
  font-size: 13.5px !important;
  font-weight: 500;
  color: var(--sapin) !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}

/* Liens vers sites */
.sidebar-sites {
  background: var(--sapin);
  color: var(--creme);
  border-left-color: var(--terracotta) !important;
}
.sidebar-sites .sidebar-newsletter-label {
  color: var(--terracotta) !important;
}
.sidebar-site-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--creme);
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 212, 197, 0.15);
  transition: padding-left 0.2s;
}
.sidebar-site-link:last-child {
  border-bottom: none;
}
.sidebar-site-link:hover {
  padding-left: 4px;
}
.site-arrow {
  color: var(--eucalyptus);
  font-size: 16px;
  transition: transform 0.2s;
}
.sidebar-site-link:hover .site-arrow {
  transform: translateX(3px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablette large */
@media (max-width: 1100px) {
  .blog-layout {
    grid-template-columns: 1fr 280px;
    gap: 40px;
  }
}

/* Tablette */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 720px;
  }
  .blog-sidebar {
    position: static;
  }
  .article-card-featured {
    grid-template-columns: 1fr;
  }
  .article-card-featured .article-card-img {
    min-height: 280px;
    aspect-ratio: 16 / 9;
  }
  .article-card-featured .article-card-body {
    padding: 28px 28px 32px;
  }
}

@media (max-width: 720px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Mobile */
@media (max-width: 580px) {
  .blog-hero {
    padding: 48px 0 40px;
  }
  .blog-section {
    padding: 48px 0 72px;
  }
  .article-card-body {
    padding: 22px 22px 24px;
  }
  .article-card-featured .article-card-body {
    padding: 24px 22px 28px;
  }
  .article-card-body h2 {
    font-size: 22px;
  }
  .article-card-body h3 {
    font-size: 18px;
  }
  .sidebar-block {
    padding: 24px 22px;
  }
}
