/* ============================================================
   styles-galerie.css — Poséidon Family : Page Galerie
   Reprend la palette et la typographie du site principal.
   ============================================================ */

/* -------------------------------------------------------
   0. VARIABLES & RESET (identiques au site principal)
   ------------------------------------------------------- */
:root {
    --color-deep-blue: #0a1628;
    --color-navy: #0d2137;
    --color-ocean: #0e4d6e;
    --color-turquoise: #17a2b8;
    --color-aqua: #00d2d3;
    --color-white: #ffffff;
    --color-off-white: #f0f4f8;
    --color-text: #1a1a2e;
    --color-text-light: #ccd6e0;
    --color-cta: #f5a623;
    --color-cta-hover: #e8950e;
    --color-card-bg: rgba(255, 255, 255, 0.95);
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --header-height: 72px;
    --border-radius: 12px;
    --transition-fast: 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-off-white);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* -------------------------------------------------------
   1. HEADER (copié du site principal pour cohérence)
   ------------------------------------------------------- */
.site-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
    max-width: 1320px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-white);
    flex-shrink: 0;
}

.logo-icon { font-size: 1.6rem; }
.logo img { height: 48px; width: auto; max-height: calc(var(--header-height) - 16px); object-fit: contain; border-radius: 4px; }

.main-nav ul { display: flex; gap: 8px; }
.main-nav a {
    display: block; padding: 8px 14px; font-size: 0.9rem; font-weight: 500;
    color: var(--color-text-light); border-radius: 8px;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--color-white); background: rgba(255,255,255,0.1); }
.main-nav a.nav-active { color: var(--color-white); background: rgba(255,255,255,0.12); }

.header-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.social-icons { display: flex; gap: 10px; }
.social-link {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    color: var(--color-text-light); background: rgba(255,255,255,0.08);
    transition: color var(--transition-fast), background var(--transition-fast);
}
.social-link:hover { color: var(--color-white); background: var(--color-turquoise); }

.btn {
    display: inline-block; font-family: var(--font-heading); font-weight: 600;
    border: none; cursor: pointer; border-radius: 50px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.btn-cta { background: var(--color-cta); color: var(--color-deep-blue); padding: 12px 28px; font-size: 0.95rem; }
.btn-cta:hover { background: var(--color-cta-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,166,35,0.35); }
.btn-header-cta { padding: 10px 22px; font-size: 0.85rem; }

.burger {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 32px; height: 32px; background: none; border: none; cursor: pointer; z-index: 1001;
}
.burger span { display: block; width: 100%; height: 2.5px; background: var(--color-white); border-radius: 2px; transition: transform var(--transition-fast), opacity var(--transition-fast); }
.burger.active span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* -------------------------------------------------------
   2. HERO GALERIE — bandeau haut
   ------------------------------------------------------- */
.galerie-hero {
    position: relative;
    height: 340px;
    margin-top: var(--header-height);
    /* REMPLACER l'URL par une vraie photo sous-marine */
    background: url('https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?w=1600&q=80') center 40% / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    overflow: hidden;
}

.galerie-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,22,40,0.6) 0%, rgba(10,22,40,0.85) 100%);
}

.galerie-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 24px;
}

.galerie-hero-content h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.galerie-hero-content p {
    font-size: 1.15rem;
    font-weight: 300;
    color: var(--color-aqua);
    text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

/* -------------------------------------------------------
   3. SECTION GALERIE — grille Instagram
   ------------------------------------------------------- */
.galerie-section {
    padding: 48px 24px 80px;
}

.galerie-container {
    max-width: 1200px;
    margin: 0 auto;
}

.galerie-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.galerie-count {
    font-size: 0.9rem;
    color: #666;
}

/* La grille */
.galerie-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

/* Chaque miniature */
.galerie-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    background: var(--color-navy);
}

.galerie-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.35s ease, filter 0.35s ease;
}

/* Overlay au survol */
.galerie-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.galerie-item:hover::after {
    background: rgba(10, 22, 40, 0.25);
}

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

/* Animation d'apparition des items */
.galerie-item {
    opacity: 0;
    transform: translateY(16px);
    animation: gridFadeIn 0.4s ease forwards;
}

@keyframes gridFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Bouton charger plus */
.galerie-load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.btn-load-more {
    padding: 14px 36px;
}

/* Message vide */
.galerie-empty {
    text-align: center;
    padding: 80px 24px;
    color: #888;
    font-size: 1.1rem;
}

/* -------------------------------------------------------
   4. LIGHTBOX
   ------------------------------------------------------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 20, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
}

.lightbox-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 85vh;
    overflow: hidden;
}

.lightbox-img-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-img.loaded {
    opacity: 1;
}

/* Spinner de chargement */
.lightbox-loader {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--color-aqua);
    border-radius: 50%;
    animation: lbSpin 0.8s linear infinite;
}

.lightbox-loader.hidden {
    display: none;
}

@keyframes lbSpin {
    to { transform: rotate(360deg); }
}

/* Infos image */
.lightbox-info {
    text-align: center;
    padding: 16px 24px 8px;
    color: var(--color-white);
    max-width: 700px;
}

.lightbox-date {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-aqua);
    margin-bottom: 6px;
}

.lightbox-desc {
    font-size: 0.95rem;
    opacity: 0.85;
    line-height: 1.6;
}

/* Bouton fermer */
.lightbox-close {
    position: absolute;
    top: -10px;
    right: 0;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    z-index: 10;
}

.lightbox-close:hover { opacity: 1; transform: scale(1.15); }

/* Flèches nav */
.lightbox-nav {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--color-white);
    font-size: 1.4rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.lightbox-nav:hover { background: rgba(255,255,255,0.25); }

/* -------------------------------------------------------
   5. FOOTER
   ------------------------------------------------------- */
.site-footer {
    text-align: center;
    padding: 24px;
    background: var(--color-deep-blue);
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* -------------------------------------------------------
   6. RESPONSIVE
   ------------------------------------------------------- */
@media (max-width: 1024px) {
    .galerie-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    :root { --header-height: 64px; }

    .burger { display: flex; }

    .main-nav {
        position: fixed; top: 0; right: -100%;
        width: 280px; height: 100vh;
        background: var(--color-deep-blue);
        padding: 100px 32px 40px;
        transition: right var(--transition-fast);
        box-shadow: -4px 0 20px rgba(0,0,0,0.3);
        z-index: 999;
    }
    .main-nav.open { right: 0; }
    .main-nav ul { flex-direction: column; gap: 4px; }
    .main-nav a { font-size: 1.1rem; padding: 14px 16px; }
    .header-actions { display: none; }

    .galerie-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }

    .galerie-hero { height: 240px; }
    .galerie-hero-content h1 { font-size: 1.8rem; }

    /* Lightbox mobile */
    .lightbox-wrapper { flex-direction: column; gap: 10px; width: 100%; padding: 16px; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 1.1rem; }
    .lightbox-img { max-height: 55vh; }
    .lightbox-close { top: 4px; right: 8px; }

    .logo img { height: 40px; }
}

@media (max-width: 480px) {
    .galerie-grid { grid-template-columns: repeat(2, 1fr); gap: 3px; }
    .logo-text { font-size: 1rem; }
}