/* ==========================================================================
   SIAB 2027 - GALERIE PHOTOS EDITION 2026 (Style Pinterest & Modern Masonry)
   Palette : Vert #1AA45A | Rouge #D5373A | Sombre #07111f / #0f172a | Blanc #ffffff
   ========================================================================== */

:root {
    --green:        #1AA45A;
    --green-dk:     #138f4a;
    --green-glow:   rgba(26, 164, 90, 0.35);
    --dark:         #07111f;
    --dark-card:    #0f172a;
    --text-main:    #334155;
    --text-muted:   #64748b;
    --border:       #e2e8f0;
    --bg-light:     #f8fafc;
    --radius-card:  16px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    font-size: 15px;
    line-height: 1.6;
}

/* ========================================================
   1. HERO SECTION (Style Exposer / A Propos)
   ======================================================== */
.galerie-hero {
    position: relative;
    background: linear-gradient(135deg, #000000 0%, #082416 45%, #1AA45A 100%);
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 130px 20px 70px;
    overflow: hidden;
    text-align: center;
}

.galerie-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect fill="rgba(255,255,255,0.05)" width="50" height="50"/></svg>');
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
}

.galerie-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(26, 164, 90, 0.35) 0%, transparent 60%);
    pointer-events: none;
}

.galerie-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--green);
}

.galerie-hero .container {
    position: relative;
    z-index: 2;
    max-width: 860px;
}

.galerie-badge-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(26, 164, 90, 0.18);
    border: 1px solid rgba(26, 164, 90, 0.5);
    color: #4ade80;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 8px 18px;
    border-radius: 50px;
    margin-bottom: 20px;
    backdrop-filter: blur(8px);
}

.galerie-hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

.galerie-hero-title-green {
    color: #22c55e;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.galerie-hero-sub {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 680px;
    margin: 0 auto 26px;
    line-height: 1.6;
}

.galerie-hero-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.galerie-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 600;
}

.galerie-stat-pill i {
    color: #4ade80;
}

/* ========================================================
   2. FILTER TABS (Responsive Horizontal Carousel / Centered Wrap)
   ======================================================== */
.galerie-section {
    padding: 50px 0 90px;
}

.galerie-filter-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
}

.galerie-filter-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 auto;
    max-width: 100%;
}

.galerie-filter-btn {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.galerie-filter-btn:hover {
    border-color: var(--green);
    color: var(--green-dk);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(26, 164, 90, 0.15);
}

.galerie-filter-btn.active {
    background: var(--green);
    border-color: var(--green);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(26, 164, 90, 0.35);
}

.galerie-filter-btn .filter-count {
    display: inline-block;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}

.galerie-filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Fluid Horizontal Carousel on Tablet and Mobile */
@media (max-width: 860px) {
    .galerie-filter-wrapper {
        margin-left: -15px;
        margin-right: -15px;
        padding: 0 15px;
        overflow: hidden;
        margin-bottom: 25px;
    }

    .galerie-filter-bar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        justify-content: flex-start;
        gap: 8px;
        padding: 4px 6px 14px 6px;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .galerie-filter-bar::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .galerie-filter-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* ========================================================
   3. PINTEREST MASONRY GRID (CSS Columns)
   ======================================================== */
.pinterest-grid {
    column-count: 4;
    column-gap: 24px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .pinterest-grid {
        column-count: 3;
        column-gap: 20px;
    }
}

@media (max-width: 768px) {
    .pinterest-grid {
        column-count: 2;
        column-gap: 16px;
    }
}

@media (max-width: 480px) {
    .pinterest-grid {
        column-count: 1;
        column-gap: 0;
    }
}

.pinterest-item {
    break-inside: avoid;
    margin-bottom: 24px;
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.35s ease, opacity 0.35s ease;
    cursor: pointer;
}

.pinterest-item.hidden {
    display: none !important;
}

.pinterest-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15);
}

.pinterest-card-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #e2e8f0;
}

.pinterest-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-card);
    transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1), filter 0.35s ease;
    object-fit: cover;
}

/* Pinterest aspect ratio variations */
.pinterest-item.tall .pinterest-img {
    aspect-ratio: 3 / 4;
    object-position: center;
}

.pinterest-item.square .pinterest-img {
    aspect-ratio: 1 / 1;
    object-position: center;
}

.pinterest-item.wide .pinterest-img {
    aspect-ratio: 16 / 9;
    object-position: center;
}

.pinterest-item.panoramic .pinterest-img {
    aspect-ratio: 16 / 10;
    object-position: center;
}

.pinterest-item:hover .pinterest-img {
    transform: scale(1.06);
}

/* Overlay & Hover Details */
.pinterest-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(7, 17, 31, 0.90) 0%, rgba(7, 17, 31, 0.35) 45%, rgba(7, 17, 31, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    border-radius: var(--radius-card);
    z-index: 2;
}

.pinterest-item:hover .pinterest-overlay {
    opacity: 1;
}

.pinterest-top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pinterest-badge {
    background: rgba(26, 164, 90, 0.9);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 20px;
}

.pinterest-zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pinterest-zoom-btn:hover {
    transform: scale(1.15);
    background: #ffffff;
    color: var(--green-dk);
}

.pinterest-bottom-info {
    color: #ffffff;
}

.pinterest-photo-title {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #ffffff;
    line-height: 1.3;
}

.pinterest-photo-desc {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    margin: 0;
}

/* ========================================================
   4. LIGHTBOX MODAL
   ======================================================== */
.galerie-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 10, 20, 0.95);
    backdrop-filter: blur(16px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.galerie-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content-box {
    position: relative;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-img-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-main-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.25s ease;
}

.lightbox-caption-bar {
    width: 100%;
    max-width: 800px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    padding: 0 10px;
}

.lightbox-caption-title {
    font-family: 'Poppins', sans-serif;
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.lightbox-caption-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.lightbox-counter {
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #4ade80;
    white-space: nowrap;
}

/* Lightbox Controls */
.lightbox-btn-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox-btn-close:hover {
    background: var(--red);
    border-color: var(--red);
    transform: rotate(90deg) scale(1.1);
}

.lightbox-btn-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox-btn-prev { left: 24px; }
.lightbox-btn-next { right: 24px; }

.lightbox-btn-nav:hover {
    background: var(--green);
    border-color: var(--green);
    transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
    .lightbox-btn-prev { left: 10px; width: 40px; height: 40px; font-size: 16px; }
    .lightbox-btn-next { right: 10px; width: 40px; height: 40px; font-size: 16px; }
    .lightbox-btn-close { top: 15px; right: 15px; width: 38px; height: 38px; }
    .lightbox-caption-bar { flex-direction: column; gap: 8px; text-align: center; }
}

/* ========================================================
   5. CTA BANNER (2027)
   ======================================================== */
.galerie-cta-section {
    background: linear-gradient(135deg, #07111f 0%, #0d2818 100%);
    padding: 70px 20px;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    text-align: center;
}

.galerie-cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(26, 164, 90, 0.25) 0%, transparent 70%);
}

.galerie-cta-box {
    position: relative;
    z-index: 2;
    max-width: 750px;
    margin: 0 auto;
}

.galerie-cta-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    margin-bottom: 14px;
    color: #ffffff;
}

.galerie-cta-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 28px;
    line-height: 1.6;
}

.galerie-cta-btns {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.btn-galerie-cta-primary {
    background: var(--green);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(26, 164, 90, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-galerie-cta-primary:hover {
    background: var(--green-dk);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(26, 164, 90, 0.55);
}

.btn-galerie-cta-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-galerie-cta-secondary:hover {
    background: #ffffff;
    color: var(--dark);
    border-color: #ffffff;
    transform: translateY(-3px);
}
