/* =========================================================
   Internat des Ardennes — Feuille de styles
   ========================================================= */

/* --- RESET & VARIABLES GLOBALES --- */
:root {
    --primary: #0f766e;
    --primary-hover: #115e59;
    --primary-light: #f0fdfa;
    --accent: #d97706;
    --bg-light: #f8fafc;
    --surface: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;

    --available-bg: #ecfdf5;
    --available-text: #065f46;
    --available-border: #a7f3d0;

    --partial-bg: #fef3c7;
    --partial-text: #92400e;
    --partial-border: #fde68a;

    --booked-bg: #fee2e2;
    --booked-text: #991b1b;
    --booked-border: #fecaca;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--surface);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Blocage du scroll quand une modale est ouverte (sécurité lightbox) */
body.no-scroll {
    overflow: hidden !important;
    /* évite aussi les sauts de mise en page dus à la scrollbar */
    padding-right: var(--scrollbar-width, 0px);
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section { padding: 4.5rem 0; }
.section.bg-light { background-color: var(--bg-light); }

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem auto;
}
.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.8rem;
    color: var(--text-dark);
}
.section-header p {
    font-size: 1.05rem;
    color: var(--text-muted);
}

/* --- BOUTONS & BADGES --- */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.85rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}
.btn-primary { background-color: var(--primary); color: #ffffff; }
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
}
.btn-secondary {
    background-color: #ffffff;
    color: var(--text-dark);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background-color: var(--bg-light);
    border-color: #cbd5e1;
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 50px;
    margin-bottom: 1rem;
    border: 1px solid #ccfbf1;
}

/* --- NAVIGATION --- */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}
.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -0.5px;
}
.logo span { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 1.8rem; list-style: none; }
.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }
.nav-btn {
    background-color: var(--primary-light);
    color: var(--primary) !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600 !important;
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem;
    background: linear-gradient(rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.75)),
                url('https://images.unsplash.com/photo-1542273917363-3b1817f69a2d?auto=format&fit=crop&w=2000&q=80') center/cover no-repeat;
    color: #ffffff;
}
.hero-content { max-width: 850px; margin: 0 auto; z-index: 2; }
.hero .badge {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}
.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto 2rem auto;
    color: rgba(255,255,255,0.9);
}
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.hero .btn-secondary {
    background-color: rgba(255,255,255,0.1);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(4px);
}
.hero .btn-secondary:hover {
    background-color: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

/* --- STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}
.stat-card {
    background: var(--surface);
    padding: 2rem 1rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.stat-num {
    display: block;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.3rem;
}
.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- CARTES (Espaces) --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.07);
}
.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.card p { color: var(--text-muted); font-size: 0.95rem; }

/* --- TARIFS --- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 850px;
    margin: 0 auto;
}
.pricing-card {
    background: var(--surface);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
}
.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(15, 118, 110, 0.15);
}
.featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #ffffff;
    padding: 0.3rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pricing-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.pricing-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}
.price {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.5rem;
}
.price span { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: 1.8rem;
}
.pricing-features li {
    padding: 0.4rem 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    position: relative;
    padding-left: 1.4rem;
}
.pricing-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* =========================================================
   RÉSERVATION : calendrier + formulaire
   ========================================================= */
.reservation-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2rem;
    align-items: start;
    max-width: 1050px;
    margin: 0 auto;
}
.calendar-wrapper, .form-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}
.form-wrapper h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Calendrier */
.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.cal-header strong { font-size: 1.15rem; font-weight: 700; }
.cal-header button {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.2s;
}
.cal-header button:hover { background: var(--border); }

.cal-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

/* ===== Cellule de jour ===== */
.cal-day {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    transition: transform 0.1s, box-shadow 0.1s, border-color 0.15s;
    padding: 4px 2px;
}
.cal-day.empty { cursor: default; background: transparent; }

/* Numéro du jour : GRAND */
.day-number {
    font-size: 1.45rem;        /* ← plus grand */
    font-weight: 800;
    line-height: 1;
    display: block;
}
/* Texte "places restantes" : petit, sous le numéro */
.day-remaining {
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 4px;
    opacity: 0.85;
    line-height: 1.1;
    white-space: nowrap;
}

/* Disponible (entièrement) */
.cal-day.available {
    background: var(--available-bg);
    color: var(--available-text);
    border-color: var(--available-border);
}
.cal-day.available:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

/* Disponible partiellement */
.cal-day.available.partial {
    background: var(--partial-bg);
    color: var(--partial-text);
    border-color: var(--partial-border);
}
.cal-day.available.partial:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-color: var(--accent);
}

/* Sélection utilisateur */
.cal-day.selected,
.cal-day.selected:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    transform: scale(1.05);
}

/* Complet */
.cal-day.booked {
    background: var(--booked-bg);
    color: var(--booked-text);
    border-color: var(--booked-border);
    cursor: not-allowed;
    opacity: 0.65;
}
.cal-day.booked .day-remaining { font-weight: 700; }

/* Légende */
.cal-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 0.5rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.free    { background: #10b981; }
.dot.partial { background: #f59e0b; }
.dot.busy    { background: #ef4444; }

/* =========================================================
   FORMULAIRE
   ========================================================= */
.booking-form .form-group { margin-bottom: 1.1rem; }
.booking-form label,
.booking-form legend {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
}
.booking-form label small {
    color: var(--text-muted);
    font-weight: 500;
}
.form-hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.booking-form input,
.booking-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.booking-form input:focus,
.booking-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
.booking-form input[readonly] {
    background-color: var(--bg-light);
    cursor: not-allowed;
}

/* ====== Cases à cocher "Équipements" ====== */
.facilities-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1rem 0.8rem 1rem;
    background: var(--bg-light);
}
.facilities-group legend {
    padding: 0 0.4rem;
    background: var(--surface);
    border-radius: 4px;
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem 1rem;
    margin-top: 0.4rem;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.92rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    transition: border-color 0.15s, background 0.15s;
}
.checkbox-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.checkbox-item input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: var(--primary);
}

/* =========================================================
   GALERIE 4x4 + LIGHTBOX (corrigée)
   ========================================================= */
.lightbox-gallery-4x4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-thumb {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    background-color: #0f172a;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.gallery-thumb .zoom-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.25s ease;
}
.gallery-thumb:hover img {
    transform: scale(1.08);
    opacity: 0.9;
}
.gallery-thumb:hover .zoom-icon {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   LIGHTBOX MODAL — Version robuste
   - Cachée via display:none (pas de pointer-events)
   - Pleine page (fixed inset:0)
   - z-index 9999 pour passer au-dessus de la navbar (1000)
   - Animation douce à l'ouverture / fermeture
   ========================================================= */
.lightbox-modal {
    /* Caché par défaut — fiable, aucun risque de débordement */
    display: none;
    position: fixed;
    inset: 0;                              /* top/right/bottom/left = 0 */
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;                         /* > navbar (1000) */
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: lightboxFadeIn 0.25s ease-out;
}

.lightbox-modal.active {
    display: flex;                         /* affichage plein écran */
}

/* Empêche l'arrière-plan de scroller derrière la modale */
.lightbox-modal.active ~ *,
body.no-scroll * {
    /* Rien à faire ici — géré par body.no-scroll */
}

.lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.97);
    transition: transform 0.3s ease;
}
.lightbox-modal.active .lightbox-img {
    transform: scale(1);
}

.lightbox-caption {
    color: #e2e8f0;
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    max-width: 90vw;
}

.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.footer a {
    color: var(--primary);
    text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
    .stats-grid    { grid-template-columns: repeat(2, 1fr); }
    .cards-grid    { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid  { grid-template-columns: 1fr; max-width: 500px; }
}

@media (max-width: 860px) {
    .reservation-layout { grid-template-columns: 1fr; }
    .lightbox-gallery-4x4 { grid-template-columns: repeat(2, 1fr); }
    .checkbox-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .nav-links { gap: 1rem; }
}

@media (max-width: 540px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero { padding: 4rem 1rem; min-height: 70vh; }
    .hero h1 { font-size: 1.9rem; }
    .nav-container { flex-direction: column; gap: 0.75rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .day-number { font-size: 1.2rem; }
    .day-remaining { font-size: 0.6rem; }
}
