/* === MISE EN PAGE DES VOYAGES === */

/* Augmenter la largeur du contenu */
body.post-type-archive-voyage {
    --wp--style--global--content-size: 1400px !important;
}

/* Styling des métadonnées */
.voyage-meta {
    background-color: #f9f9f9;
    border-left: 4px solid var(--wp--preset--color--contrast, #121212);
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
}

.voyage-meta p {
    margin: 0.3rem 0 !important;
    font-size: 0.95rem;
}

.voyage-meta strong {
    color: var(--wp--preset--color--contrast, #121212);
}

/* Grille 4 colonnes, même hauteur */
body.post-type-archive-voyage .wp-block-post-template {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
    align-items: stretch !important;
}

/* Tous les éléments : même taille */
body.post-type-archive-voyage .wp-block-post-template > li {
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Groupe interne : hauteur complète, padding réduit */
body.post-type-archive-voyage .wp-block-post-template > li .wp-block-group {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 1.2rem !important;
    margin-bottom: 0 !important;
}

/* Images de même hauteur */
body.post-type-archive-voyage .wp-block-post-template > li .wp-block-post-featured-image img {
    height: 200px !important;
    object-fit: cover !important;
    width: 100% !important;
}

/* Titres de même taille */
body.post-type-archive-voyage .wp-block-post-template > li .wp-block-post-title {
    font-size: 1.2rem !important;
}

/* Contenu tronqué avec dégradé */
body.post-type-archive-voyage .wp-block-post-template > li .wp-block-post-content {
    position: relative !important;
    max-height: 200px !important;
    overflow: hidden !important;
}

body.post-type-archive-voyage .wp-block-post-template > li .wp-block-post-content::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1)) !important;
    pointer-events: none !important;
}

/* Bouton Voir plus masqué */
body.post-type-archive-voyage .mecenat-read-more {
    display: none !important;
}

/* Responsive : tablette 2 colonnes */
@media (max-width: 1024px) {
    body.post-type-archive-voyage .wp-block-post-template {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Responsive : mobile colonne unique */
@media (max-width: 600px) {
    body.post-type-archive-voyage .wp-block-post-template {
        grid-template-columns: 1fr !important;
    }
}

/* ── Carrousel voyage ── */
.voyage-carrousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    background: #111;
}

.voyage-slides {
    position: relative;
    width: 100%;
}

.voyage-slide {
    display: none;
}

.voyage-slide.active {
    display: block;
}

.voyage-slide img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* Flèches */
.voyage-prev,
.voyage-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    font-size: 2rem;
    line-height: 1;
    padding: 0.2em 0.5em;
    cursor: pointer;
    z-index: 10;
    border-radius: 2px;
    transition: background 0.2s;
}

.voyage-prev:hover,
.voyage-next:hover {
    background: rgba(0, 0, 0, 0.75);
}

.voyage-prev { left: 0.5rem; }
.voyage-next { right: 0.5rem; }

/* Compteur */
.voyage-counter {
    position: absolute;
    bottom: 0.5rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.15em 0.5em;
    border-radius: 2px;
}

/* Curseur zoom sur les slides du diaporama */
.voyage-slide {
  cursor: zoom-in;
}

/* Lightbox responsive */
#voyage-lightbox {
  display: none;
}
#voyage-lightbox #lb-img {
  max-width: 90vw;
  max-height: 88vh;
}
@media (max-width: 600px) {
  #voyage-lightbox #lb-prev,
  #voyage-lightbox #lb-next {
    font-size: 1.8rem;
    padding: 4px 12px;
  }
}
