/* ============================================
   OPTIMA INGÉNIERIE - Page Réalisations
   ============================================ */

/* ---------- PAGE HERO ---------- */
.page-hero {
    background: var(--blue-dark);
    padding: 140px 0 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--blue-dark), var(--green), var(--blue-dark));
}

.page-hero__container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.page-hero__title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    color: var(--white);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.page-hero__subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

/* ---------- FILTRES ---------- */
.realisations-page {
    background: var(--gray-50);
    padding: 60px 0 100px;
}

.realisations-page__container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.realisations-page__filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.realisations-page__filter {
    background: var(--white);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: var(--transition);
}

.realisations-page__filter:hover {
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

.realisations-page__filter.active {
    background: var(--blue-primary);
    color: var(--white);
    border-color: var(--blue-primary);
}

/* ---------- GRILLE PROJETS ---------- */
.realisations-page__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.realisations-page__card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.realisations-page__card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.realisations-page__card.hidden {
    display: none;
}

.realisations-page__image {
    height: 240px;
    overflow: hidden;
}

.realisations-page__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.realisations-page__card:hover .realisations-page__img {
    transform: scale(1.05);
}

.realisations-page__info {
    padding: 24px;
}

.realisations-page__project-name {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.realisations-page__tag {
    display: inline-block;
    background: rgba(4, 45, 55, 0.08);
    color: var(--blue-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 3px;
    margin-bottom: 12px;
}

.realisations-page__info h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--blue-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.realisations-page__location {
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 12px;
    font-weight: 500;
}

.realisations-page__desc {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 20px;
}

/* ---------- GALERIE OVERLAY ---------- */
.realisations-page__image {
    position: relative;
    cursor: pointer;
}

.realisations-page__gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 45, 55, 0);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 14px;
    transition: background 0.3s ease;
}

.realisations-page__card:hover .realisations-page__gallery-overlay {
    background: rgba(4, 45, 55, 0.35);
}

.realisations-page__gallery-badge {
    background: rgba(255,255,255,0.92);
    color: var(--blue-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.realisations-page__card:hover .realisations-page__gallery-badge {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- BOUTON GALERIE ---------- */
.realisations-page__gallery-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--blue-primary);
    border: 1.5px solid var(--blue-primary);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.realisations-page__gallery-btn:hover {
    background: var(--blue-primary);
    color: var(--white);
}

.realisations-page__gallery-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox.active {
    display: flex;
    animation: lightbox-in 0.3s ease;
}

@keyframes lightbox-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox__content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    animation: lightbox-content-in 0.35s ease;
}

@keyframes lightbox-content-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.lightbox__img,
.lightbox__video {
    max-width: 100%;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.lightbox__video {
    background: #000;
    width: 80vw;
    max-width: 960px;
}

.lightbox__footer {
    margin-top: 16px;
    text-align: center;
    color: rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lightbox__caption {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.lightbox__counter {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.lightbox__close {
    position: fixed;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lightbox__close:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

.lightbox__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.75);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lightbox__nav:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.05);
}

.lightbox__nav:active {
    transform: translateY(-50%) scale(0.95);
}

.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

/* ---------- ÉTAT VIDE ---------- */
.realisations-page__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
    font-size: 15px;
    font-style: italic;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .realisations-page__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .page-hero {
        padding: 110px 0 50px;
    }

    .page-hero__subtitle {
        font-size: 15.5px;
        padding: 0 20px;
    }

    .realisations-page {
        padding: 36px 0 72px;
    }

    .realisations-page__container {
        padding: 0 20px;
    }

    /* Filtres : barre scrollable horizontale */
    .realisations-page__filters {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 10px;
        margin-bottom: 32px;
        padding: 4px 20px 12px;
        margin-left: -20px;
        margin-right: -20px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
    }

    .realisations-page__filters::-webkit-scrollbar {
        display: none;
    }

    .realisations-page__filter {
        flex: 0 0 auto;
        scroll-snap-align: start;
        font-size: 12.5px;
        padding: 10px 18px;
        min-height: 40px;
        white-space: nowrap;
    }

    .realisations-page__grid {
        grid-template-columns: 1fr;
        gap: 22px;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .realisations-page__image {
        height: 220px;
    }

    .realisations-page__info {
        padding: 20px;
    }

    .realisations-page__gallery-btn {
        min-height: 44px;
        padding: 10px 20px;
    }

    /* Lightbox mobile */
    .lightbox {
        padding: 0;
    }

    .lightbox__img,
    .lightbox__video {
        max-height: 72vh;
        border-radius: 0;
    }

    .lightbox__nav {
        width: 36px;
        height: 36px;
        top: auto;
        bottom: 80px;
        transform: none;
        background: rgba(255,255,255,0.1);
        border: 1px solid rgba(255,255,255,0.08);
    }

    .lightbox__nav:hover {
        transform: scale(1.05);
    }

    .lightbox__nav:active {
        transform: scale(0.95);
    }

    .lightbox__nav svg {
        width: 16px;
        height: 16px;
    }

    .lightbox__nav--prev { left: 16px; }
    .lightbox__nav--next { right: 16px; }

    .lightbox__close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .lightbox__close svg {
        width: 18px;
        height: 18px;
    }

    .lightbox__footer {
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .page-hero {
        padding: 86px 0 40px;
    }

    .page-hero__title {
        font-size: 24px;
        letter-spacing: 1.2px;
    }

    .page-hero__subtitle {
        font-size: 14.5px;
    }

    .realisations-page__container {
        padding: 0 16px;
    }

    .realisations-page__filters {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .realisations-page__image {
        height: 200px;
    }

    .realisations-page__info h3 {
        font-size: 16px;
    }

    .realisations-page__desc {
        font-size: 13.5px;
    }

    .lightbox__caption {
        font-size: 13px;
    }
}
