/* ================================================= */
/* FEATURED IMAGE – VERSION OPTIMISÉE NETTETÉ */
/* Desktop : hero rogné / Mobile : image naturelle */
/* N'affecte PAS les galeries */
/* ================================================= */

/* ===== Base : uniquement image mise en avant ===== */
.single-post
:is(
  .post-thumbnail,
  .wp-block-post-featured-image
) {
  margin: 0;
  width: 100%;
}

/* Image */
.single-post
:is(
  .post-thumbnail,
  .wp-block-post-featured-image
)
img {
  display: block;
  width: 100%;
  height: auto;
}

/* ================= DESKTOP ================= */
@media (min-width: 769px) {
  .single-post
  :is(
    .post-thumbnail,
    .wp-block-post-featured-image
  ) {
    height: auto;          /* 🔥 supprime le crop */
    max-height: none;
    overflow: visible;
  }

  .single-post
  :is(
    .post-thumbnail,
    .wp-block-post-featured-image
  )
  img {
    width: 100%;
    height: auto;          /* garde proportions */
    object-fit: initial;   /* 🔥 enlève le zoom */
    object-position: center;
  }
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  .single-post
  :is(
    .post-thumbnail,
    .wp-block-post-featured-image
  ) {
    height: auto !important;
    overflow: visible !important;
  }

  .single-post
  :is(
    .post-thumbnail,
    .wp-block-post-featured-image
  )
  img {
    height: auto !important;
    max-height: none !important;
    object-fit: initial !important;
  }
}
//* =========================
   PAGE SOMMAIRE – GRILLE
   ========================= */

/* Conteneur principal */
.page-sommaire {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;                 /* espace entre les images */
  max-width: 1000px;         /* LARGEUR TOTALE */
  margin: 40px auto;         /* centre la grille */
  padding: 0 20px;           /* respiration sur petits écrans */
}

/* Images */
.page-sommaire img {
  width: 100%;
  height: 300px;             /* images plus présentes */
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

/* Texte sous les images */
.page-sommaire p {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 0;
  line-height: 1.4;
}

/* Liens */
.page-sommaire a {
  text-decoration: none;
  font-weight: 600;
  color: #222;
}

/* Effet discret */
.page-sommaire img:hover {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

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

/* Tablette */
@media (max-width: 900px) {
  .page-sommaire {
    grid-template-columns: repeat(2, 1fr);
    max-width: 700px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .page-sommaire {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}
/* Centrer les titres */
.wp-block-latest-posts li {
    text-align: center;
}

/* Petit espace entre l’image et le titre */
.wp-block-latest-posts__featured-image {
    margin-bottom: 3px; /* ajuste 6px, 10px si besoin */
}
/* Justifier le texte (extrait) sous le titre */
.wp-block-latest-posts__post-excerpt {
    text-align: justify;
}

/* Style global des légendes d’images */
.wp-block-image figcaption,
.wp-block-gallery figcaption,
.blocks-gallery-caption,
.wp-caption-text {
    font-family: "Source Serif4", sans-serif;
    font-size: 13px; /* ajuste 12px si tu veux plus petit */
    color: #967E7E;
}
/* Garder l’espace entre l’image et le titre */
.wp-block-latest-posts__featured-image {
    margin-bottom: 8px;
}

/* Réserver l’espace pour 2 lignes de titre */
.wp-block-latest-posts__list li a {
    display: block;
    line-height: 1.4;
    min-height: 2.8em; /* correspond à 2 lignes */
    margin-bottom: 6px; /* recrée un petit espace sous le titre */
}
/* Forcer un équilibrage sur 2 lignes */
.wp-block-latest-posts__list li a {
    display: block;
    text-wrap: balance;
}
/* ajustement navigation */
header .wp-block-navigation {
    justify-content: center;
    transform: translateX(-40px);
}
.wp-block-navigation .wp-block-navigation-item:hover > .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
    left: 100% !important;
    right: auto !important;
}
.home-card {
    position: relative;
    overflow: hidden;
}

.home-card .wp-block-post-title {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    margin: 0;
}

.home-card .wp-block-post-title a {
    color: white;
    text-decoration: none;
    font-size: 28px;
    font-weight: bold;
}

.home-card img {
    display: block;
    width: 100%;
}

.home-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.65),
        rgba(0,0,0,0.1)
    );
}