/**
 * Bloc : Grille Projets Dynamique (Slider) du fichier blocks/project-grid-slider.php
 */

/* Écraser les contraintes du parent WordPress */
.full-carousel {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.is-layout-constrained > .project-grid-slider-block {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.project-grid-slider-block {
    position: relative;
    padding: 20px 0;
    max-width: none !important;
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

.project-grid-slider-block .slider-projets-container {
    width: 75vw;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

/* La diapositive elle-même devient une colonne flexible */
.project-grid-slider-block .slide-colonne-double {
    display: flex;
    flex-direction: column; /* Empile les éléments verticalement */
    gap: 20px; /* Espace entre l'image du haut et l'image du bas */
    height: auto;
}

/* --- Layout Alterné --- */

/* Layout 1: Grande image en haut (Pair) */
.project-grid-slider-block .slide-colonne-double.layout-large-top .projet-item-grille.item-top .img-wrapper,
.project-grid-slider-block .slide-colonne-double.layout-large-top .projet-item-grille.item-top img,
.project-grid-slider-block .slide-colonne-double.layout-large-top .projet-item-grille.item-top .img-placeholder {
    height: 44vh;
}
.project-grid-slider-block .slide-colonne-double.layout-large-top .projet-item-grille.item-bottom .img-wrapper,
.project-grid-slider-block .slide-colonne-double.layout-large-top .projet-item-grille.item-bottom img,
.project-grid-slider-block .slide-colonne-double.layout-large-top .projet-item-grille.item-bottom .img-placeholder {
    height: 23vh;
}

/* Layout 2: Petite image en haut (Impair) */
.project-grid-slider-block .slide-colonne-double.layout-small-top .projet-item-grille.item-top .img-wrapper,
.project-grid-slider-block .slide-colonne-double.layout-small-top .projet-item-grille.item-top img,
.project-grid-slider-block .slide-colonne-double.layout-small-top .projet-item-grille.item-top .img-placeholder {
    height: 23vh;
}
.project-grid-slider-block .slide-colonne-double.layout-small-top .projet-item-grille.item-bottom .img-wrapper,
.project-grid-slider-block .slide-colonne-double.layout-small-top .projet-item-grille.item-bottom img,
.project-grid-slider-block .slide-colonne-double.layout-small-top .projet-item-grille.item-bottom .img-placeholder {
    height: 44vh;
}


/* Le conteneur de chaque projet */
.project-grid-slider-block .projet-item-grille {
    /* flex: 1; on enlève le flex:1 pour laisser la hauteur définir la taille */
    position: relative;
    overflow: hidden;
    border-radius: 0; /* Pas d'arrondi selon le style du site */
}

/* Lien global */
.project-grid-slider-block .projet-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.project-grid-slider-block .img-wrapper {
    position: relative;
    width: 100%;
    /* height: 100%; Removed to allow image height to dictate */
    overflow: hidden;
}

.project-grid-slider-block .projet-item-grille img {
    width: 100%;
    /* height: 300px; Removed fixed height */
    object-fit: cover; /* Coupe l'image proprement sans déformer */
    object-position: center center; /* Centre l'image pour éviter de couper le bas */
    display: block;
    transition: transform 0.5s ease;
}

/* Placeholder si pas d'image */
.project-grid-slider-block .img-placeholder {
    width: 100%;
    /* height: 300px; Removed fixed height */
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-weight: bold;
    text-transform: uppercase;
}

/* Petit effet au survol */
.project-grid-slider-block .projet-item-grille:hover img {
    transform: scale(1.05);
}

/* Overlay info (Titre) - TOUJOURS VISIBLE */
.project-grid-slider-block .overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 90%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent); /* Ombre plus légère */
    color: #fff;
    opacity: 1; /* Toujours visible */
    transition: opacity 0.3s ease;
    pointer-events: none; /* Laisse passer le clic */
}

/* Title positioning - bottom-left (default) */
.project-grid-slider-block .overlay-info.pos-bottom-left {
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: auto !important;
    text-align: left !important;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent) !important;
}

/* Title positioning - bottom-right */
.project-grid-slider-block .overlay-info.pos-bottom-right {
    bottom: 0 !important;
    top: auto !important;
    left: auto !important;
    right: 0 !important;
    text-align: right !important;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent) !important;
}

/* Title positioning - top-left */
.project-grid-slider-block .overlay-info.pos-top-left {
    top: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    right: auto !important;
    text-align: left !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent) !important;
}

/* Title positioning - top-right */
.project-grid-slider-block .overlay-info.pos-top-right {
    top: 0 !important;
    bottom: auto !important;
    left: auto !important;
    right: 0 !important;
    text-align: right !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent) !important;
}

.project-grid-slider-block .projet-titre {
    font-weight: 600;
    font-size: clamp(22px, 1.5vw, 34px) !important; /* Force override */
    line-height: 1.2;
    text-transform: none; /* Pas forcément uppercase */
    display: block;
}

/* Couleur verte pour le dernier mot */
.project-grid-slider-block .projet-titre .text-green {
    color: #41FF55; /* Vert spécifique demandé */
}

/* Ajustements Swiper Navigation - Arrows positioned OUTSIDE images */
.project-grid-slider-block .swiper-button-next,
.project-grid-slider-block .swiper-button-prev {
    color: #004F3B !important;
    background: transparent !important;
    width: 50px !important;
    height: 50px !important;
    transition: all 0.3s ease !important;
    z-index: 100 !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

/* Position arrows OUTSIDE the slider images */
.project-grid-slider-block .swiper-button-prev {
    left: -70px !important;
}

.project-grid-slider-block .swiper-button-next {
    right: -70px !important;
}

.project-grid-slider-block .swiper-button-next:hover,
.project-grid-slider-block .swiper-button-prev:hover {
    color: #41FF55 !important;
    filter: drop-shadow(0 0 8px rgba(65, 255, 85, 0.8)) !important;
}

.project-grid-slider-block .swiper-button-next::after,
.project-grid-slider-block .swiper-button-prev::after {
    font-size: 1.5rem !important;
    font-weight: bold !important;
}

/* Ajustements Swiper */
.project-grid-slider-block .swiper-pagination {
    position: relative;
    bottom: 0;
    margin-top: 20px;
}
