/* Styles pour la page des réalisations */

/* --- Hero de Page Standard --- */
.page-hero {
    position: relative;
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: 50% 22%;
    color: var(--color-text-light);
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--color-tertiary-rgb), 0.7); /* Utiliser la variable RGB pour la transparence */
    z-index: 1;
}

.page-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.page-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.page-hero__title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
}

.page-hero__subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.7;
}

/* Section principale des réalisations */
.realisations-main {
    padding: 4rem 0;
    background-color: var(--color-primary);
    position: relative;
}

/* Section I: Image + Explications */
.realisation-item {
    display: flex;
    align-items: center;
    margin: 4rem;
    gap: 3rem;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-light);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.realisation-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.realisation-item:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-5px);
}

.realisation-item:nth-child(even) {
    flex-direction: row-reverse;
}

.realisation-item__image {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-medium);
}

.realisation-item__image img {
    width: 100%;
    height: clamp(220px, 32vh, 400px);
    object-fit: cover;
    transition: transform 0.5s ease;
    transform: scale(1.1);
}

.realisation-item:hover .realisation-item__image img {
    transform: scale(1.15);
}

.realisation-item__content {
    flex: 1;
    padding: 2rem;
}

.realisation-item__title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--color-tertiary);
    position: relative;
    padding-bottom: 0.75rem;
}

.realisation-item__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--color-detail);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.realisation-item:hover .realisation-item__title::after {
    width: 70px;
}

.realisation-item__description {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--color-text-subtle);
    margin-bottom: 2.5rem;
    text-align: justify;
}

.realisation-item__services {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.service-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--color-secondary) 0%, #f8f9fa 100%);
    border: 1px solid rgba(var(--color-detail-rgb), 0.2);
    border-radius: var(--border-radius-base);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-tertiary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.service-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--color-detail-rgb), 0.15);
    border-color: var(--color-detail);
}

.service-badge i {
    color: var(--color-detail);
    font-size: 1rem;
}

/* Section II: Galerie */
.realisations-gallery {
    margin-top: 4rem;
    padding: 0 2rem;
    border-top: 1px solid var(--color-secondary);
    background-color: var(--color-secondary);
    position: relative;
}

.realisations-gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" fill="%230b40e0" opacity="0.02"/></svg>');
    opacity: 1;
    z-index: 1;
}

.realisations-gallery > * {
    position: relative;
    z-index: 2;
}

.realisations-section-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--color-tertiary);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1.5rem;
    padding-top: 4rem;
}

.realisations-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-detail) 0%, var(--color-detail-darker) 100%);
    border-radius: 2px;
}

.realisations-section-title::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-detail-darker) 0%, var(--color-detail) 100%);
    border-radius: 2px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    padding-bottom: 3rem;
}

/* Style pour le titre central qui occupe 2 colonnes */
.gallery-title {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-detail) 0%, var(--color-detail-darker) 100%);
    border-radius: var(--border-radius-base);
    position: relative;
    overflow: hidden;
}

.gallery-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></svg>');
    opacity: 1;
}

.gallery-title__text {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    color: white;
    text-align: center;
    margin: 0;
    padding: 2rem 1rem;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gallery-item {
    position: relative;
    border-radius: var(--border-radius-base);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

/* Styles pour le lazy loading */
.lazy-image {
    opacity: 0;
    background-color: var(--color-secondary);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21,15 16,10 5,21"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 48px;
}

.lazy-image.loaded {
    opacity: 1;
    background-image: none;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-item__overlay {
    opacity: 1;
}

.gallery-item__info {
    color: white;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item__info {
    transform: translateY(0);
}

.gallery-item__title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.gallery-item__description {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Modal pour l'image agrandie */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal__content {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    position: relative;
}

.modal__image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }
    
    .gallery-title {
        grid-column: span 2;
    }
    
    .gallery-title__text {
        font-size: clamp(1.3rem, 2.5vw, 1.8rem);
        padding: 1.5rem 0.8rem;
    }
}

@media (max-width: 992px) {
    .realisation-item {
        flex-direction: column !important;
        text-align: center;
    }

    .realisation-item__services {
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }
    
    .gallery-title {
        grid-column: span 3;
    }
    
    .gallery-title__text {
        font-size: clamp(1.2rem, 2vw, 1.6rem);
        padding: 1.2rem 0.6rem;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .gallery-title {
        grid-column: span 2;
    }
    
    .gallery-title__text {
        font-size: clamp(1rem, 1.8vw, 1.4rem);
        padding: 1rem 0.5rem;
    }
    
    .gallery-item__title {
        font-size: 1rem;
    }
    
    .gallery-item__description {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .realisation-item__title {
        font-size: 1.5rem;
    }

    .realisation-item__description {
        font-size: 1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
    
    .gallery-title {
        grid-column: span 1;
    }
    
    .gallery-title__text {
        font-size: 1.2rem;
        padding: 0.8rem 0.4rem;
    }
        /* Marges et paddings plus doux sur mobile */
        .realisation-item {
                margin: 1.5rem 1rem;
                padding: 1.25rem;
        }
        .realisation-item__content {
                padding: 1rem 0;
        }
} 

/* Désactiver les effets de hover trop marqués pour les écrans tactiles */
@media (pointer: coarse) {
    .gallery-item:hover img,
    .realisation-item:hover .realisation-item__image img { transform: none; }
    .service-badge:hover { transform: none; box-shadow: var(--shadow-light); }
}

/* Accessibilité: réduire les animations si l’utilisateur préfère moins de mouvement */
@media (prefers-reduced-motion: reduce) {
    .realisation-item, .gallery-item img {
        transition: none !important;
    }
}