/**
 * CSS pour le bloc Grid Prestations Levrard
 */

/* Variables couleurs */
:root {
    --levrard-red: #E73331;
    --levrard-dark-red: #E73331;
    --levrard-white: #ffffff;
    --levrard-gray: #f5f5f5;
    --levrard-light-gray: #f8f8f8;
    --levrard-dark-gray: #333333;
    --levrard-text: #363636;
    --levrard-border: #e0e0e0;
}

/**
 * Structure principale
 */
.levrard-grid-prestations-section {
    padding: 80px 0;
    background-color: var(--levrard-white);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    border-radius: 50px;
}

.levrard-grid-prestations-container {
    display: flex;
    flex-direction: column;
}

/**
 * Partie texte - au-dessus du grid, alignée sur la première colonne
 */
.levrard-grid-prestations-left {
    margin-bottom: 60px;
    padding-left: 0; /* Aligné sur la première colonne du grid */
}

.levrard-grid-prestations-text {
    line-height: 1.6;
    color: var(--levrard-text);
    margin-bottom: 30px;
}

.levrard-grid-prestations-title {
    font-weight: 700;
    color: var(--levrard-red);
    line-height: 1.3;
    margin: 0;
    font-family:var(--font-alternate);
}

/**
 * Partie grid - centré
 */
.levrard-grid-prestations-right {
    width: 100%;
    position: relative;
}

.levrard-grid-prestations-grid {
    display: flex;
    position: relative;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/**
 * Items du grid
 */
.grid-prestation-item {
    background-color: var(--levrard-white);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
}

/* -- reponsive de la grille -- */
.levrard-grid-prestations-grid{gap:60px;}
.levrard-grid-prestations-left,
.grid-prestation-item{width: calc((100% - 120px) / 3);}
.grid-prestation-item:nth-child(3n+2){transform: translateY(-120px);}
.grid-prestation-item:nth-child(3n){transform: translateY(-240px);}
.grid-prestation-item:nth-child(7){transform: translateY(-240px);}
/* ---------------------------- */
@media (max-width:80em){
    .levrard-grid-prestations-grid{gap:40px;}
    .levrard-grid-prestations-left,
    .grid-prestation-item{width: calc((100% - 80px) / 3);}
}
@media (max-width:60em){
    .levrard-grid-prestations-grid{gap:30px;}
    .levrard-grid-prestations-left,
    .grid-prestation-item{width: calc((100% - 60px) / 3);}
}
@media (max-width:50em){
    .levrard-grid-prestations-grid{justify-content:flex-start;}
    .levrard-grid-prestations-left{width:100%;text-align:center;padding-inline:30px}
    .grid-prestation-item{width: calc((100% - 30px) / 2);}
    .grid-prestation-item:nth-child(3n+2),
    .grid-prestation-item:nth-child(3n),
    .grid-prestation-item:nth-child(7){transform: translateY(0);}
}
@media (max-width:38em){
    .grid-prestation-item{width:100%}
}
/* ---------------------------- */

/**
 * Image de la prestation
 */
.grid-prestation-image {
    flex: 1;
    position: relative;
    overflow: hidden;
    border:10px #fff solid;border-radius:30px 30px 0 0;
}

.grid-prestation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-prestation-item:hover .grid-prestation-image img {
    transform: scale(1.05);
}

/**
 * Contenu de la prestation
 */
.grid-prestation-content {
    padding: 15px 40px 25px;
    background-color: var(--levrard-white);
    position: relative;
    z-index: 2;
}

.grid-prestation-title {
    font-weight: 700;
    color: var(--levrard-text);
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid-prestation-arrow {
    color: var(--levrard-red);
    transition: transform 0.3s ease;
}

.grid-prestation-item:hover .grid-prestation-arrow {
    transform: translateX(5px);
    color: var(--levrard-dark-red);
}

/**
 * Image par défaut si pas d'image
 */
.grid-prestation-default-image {
    background: linear-gradient(135deg, var(--levrard-gray) 0%, var(--levrard-light-gray) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--levrard-text);
    font-size: 48px;
    opacity: 0.5;
}

/**
 * Preview dans l'éditeur
 */
.levrard-grid-prestations-preview {
    background: #f5f5f5;
    border: 2px dashed #ddd;
    padding: 40px;
    text-align: center;
    border-radius: 10px;
}

.levrard-grid-prestations-preview h3 {
    margin-bottom: 10px;
    color: var(--levrard-text);
}

.levrard-grid-prestations-preview p {
    color: #666;
    margin: 0;
}

/**
 * Responsive Design
 */
@media screen and (max-width: 1200px) {
    .levrard-grid-prestations-text,
    .levrard-grid-prestations-title {
        max-width: 100%;
    }
}

/**
 * STYLES SPÉCIFIQUES À L'ÉDITEUR GUTENBERG
 */

/* Améliorer la sélectabilité dans l'éditeur */
.block-editor-block-list__block .levrard-grid-prestations-section {
    position: relative;
    z-index: 1;
}

.block-editor-block-list__block .levrard-grid-prestations-section * {
    position: relative;
}

/* Bordure pour identifier le bloc dans l'éditeur */
.block-editor-block-list__block .levrard-grid-prestations-section {
    border: 2px dashed rgba(233, 57, 52, 0.3);
    margin: 10px 0;
}

/* Forcer certains styles si Gutenberg les écrase */
.block-editor-block-list__block .levrard-grid-prestations-title {
    font-size: 24px !important;
    font-weight: 600 !important;
    color: var(--levrard-red) !important;
}
