/* ============================================
   CSS DÉDIÉ PAGE INSPIRATIONS
   ============================================ */

/* H1 visuellement caché mais lu par Google et lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Section principale */
.inspi-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
    background: #f0f0f0;
}

/* ============================================
   BARRE DE FILTRES (onglets)
   ============================================ */
.inspi-filter-bar {
    background: #f0f0f0;
    padding: 0.5rem 1rem;
    border-bottom: none;
    position: relative;
    z-index: 90;
    opacity: 0; /* Caché pour animation GSAP */
}

.inspi-filter-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Onglets catégories */
.inspi-tabs {
    display: flex;
    gap: 0.5rem;
}

.inspi-section .tab-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0; /* Caché pour animation GSAP */
}

.inspi-section .tab-btn:hover {
    color: #333;
}

.inspi-section .tab-btn.active {
    color: #000;
    font-weight: 500;
}

.inspi-section .tab-btn.active .tab-text {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ============================================
   ZONE DE CONTENU
   ============================================ */
.inspi-content {
    flex: 1;
    background: #f0f0f0;
    padding: 2rem 1rem 4rem;
}

/* Boutons matériaux (noirs) */
.inspi-materiaux {
    display: flex;
    gap: 0.75rem;
    max-width: 1600px;
    margin: 0 auto 1.6rem auto;
}

.inspi-section .btn-materiau {
    background: #333;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    opacity: 0; /* Caché pour animation GSAP */
}

.inspi-section .btn-materiau:hover {
    background: #555;
}

.inspi-section .btn-materiau.active {
    background: #1a1a1a;
}

/* ============================================
   GRILLE MASONRY (4 colonnes independantes)
   ============================================ */
.inspi-grid {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    gap: 0.6rem;
}

.inspi-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.inspi-item {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    background: #e8e8e8;
}

/* Ratios pour reserver l'espace */
.inspi-item.ratio-4-3 { aspect-ratio: 4 / 3; }
.inspi-item.ratio-3-4 { aspect-ratio: 3 / 4; }
.inspi-item.ratio-1-1 { aspect-ratio: 1 / 1; }
.inspi-item.ratio-16-9 { aspect-ratio: 16 / 9; }

.inspi-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.4s ease;
    will-change: transform;
    content-visibility: auto;
}

.inspi-item:hover img {
    transform: scale(1.04);
}

/* Overlay sur hover */
.inspi-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.inspi-item:hover::after {
    background: rgba(0, 0, 0, 0.12);
}

/* Items cachés lors du filtrage */
.inspi-item[hidden] {
    display: none !important;
}

/* Loader */
.inspi-loader {
    text-align: center;
    padding: 2rem 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #888;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.inspi-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
}

.inspi-lightbox.open {
    display: flex;
}

.inspi-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: transform 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.15);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
    left: 1.2rem;
}

.lightbox-next {
    right: 1.2rem;
}

body.lightbox-open {
    overflow: hidden;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .inspi-grid {
        gap: 0.5rem;
    }
    .inspi-column:nth-child(4) {
        display: none;
    }
}

@media (max-width: 1024px) {
    .inspi-filter-container {
        justify-content: flex-end;
    }

    .inspi-tabs {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .inspi-section {
        padding-top: 60px;
    }

    .inspi-filter-bar {
        padding: 0.5rem 0.75rem;
    }

    .inspi-tabs {
        gap: 0.25rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .inspi-section .tab-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .inspi-materiaux {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .inspi-section .btn-materiau {
        text-align: center;
        font-size: 0.65rem;
        padding: 0.4rem 0.75rem;
    }

    .inspi-content {
        padding: 1rem 0.75rem 2rem;
    }

    .inspi-grid {
        gap: 0.4rem;
    }

    .inspi-column:nth-child(3),
    .inspi-column:nth-child(4) {
        display: none;
    }
}

@media (max-width: 480px) {
    .inspi-section {
        padding-top: 55px;
    }

    .inspi-tabs {
        justify-content: flex-start;
    }

    .inspi-section .tab-btn {
        padding: 0.3rem 0.4rem;
        font-size: 0.65rem;
    }

    .inspi-content {
        padding: 0.75rem 0.5rem 2rem;
    }

    .inspi-materiaux {
        margin-bottom: 1rem;
    }

    .inspi-section .btn-materiau {
        font-size: 0.6rem;
        padding: 0.35rem 0.5rem;
    }

    .inspi-grid {
        gap: 0.35rem;
    }
}
