/* ===== Reset propre ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #f7f5e9;
    font-size: 16px;
    height: 100%;
}

/* ✅ Global anti-débordement images (corrige les logos trop grands) */
img{
    max-width: 100%;
    height: auto;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== Contenu ===== */
.containers {
    width: 1100px;
    margin: 0 auto;
    font-size: 18px;
    padding: 20px;
}

@media (max-width: 1150px) {
    .containers {
        width: 100%;
        padding: 20px;
    }
}

/* ===== Navbar ===== */
.navbar {
    background-color: #6BBBAE;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1050px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.nav-logo img {
    height: 50px;
    width: 46px;
    object-fit: contain;
}

/* Menu desktop */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
    align-items: center;
}

.nav-item .nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.2);
}

/* ===== Hamburger button ===== */
.nav-toggle {
    display: none;               /* visible seulement en mobile */
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
}

.nav-toggle:focus-visible {
    outline: 2px solid rgba(255,255,255,0.9);
    outline-offset: 2px;
}

.nav-toggle .bar {
    display: block;
    width: 26px;
    height: 3px;
    margin: 5px 0;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animation hamburger -> croix */
.nav-toggle.is-open .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.nav-toggle.is-open .bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle.is-open .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== Responsive menu (mobile) ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-container {
        position: relative;
    }

    /* menu caché par défaut */
    .nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        right: 1rem;
        left: 1rem;
        background: #6BBBAE;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.75rem;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
        z-index: 9999;
    }

    /* menu visible quand ouvert */
    .nav-menu.is-open {
        display: flex;
    }

    .nav-item .nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
    }
}

/* ===== Header image ===== */
.header {
    flex: 0 0 auto;
    height: 400px;
    background-image: url('tetiere.webp');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
}

.content {
    flex: 1;
    padding: 20px;
    text-align: center;
}

/* ===== Carousel (tes styles) ===== */
:root{
    --gap: 14px;
    --carousel-w: 1000px;
    --carousel-h: 380px;
}

.wrap{
    width: 100%;
    max-width: var(--carousel-w);
    margin: 0 auto;
}

.carousel{
    width: 100%;
    height: var(--carousel-h);
    position: relative;
    touch-action: pan-y;
}

.viewport{
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.track{
    height: 100%;
    display: flex;
    gap: var(--gap);
    padding: 0;
    align-items: center;
    will-change: transform;
    transform: translate3d(0,0,0);
}

.slide{
    flex: 0 0 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: #000;
}

.slide img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

@media (max-width: 1000px){
    .wrap{ max-width: 100%; }
    .carousel{ height: auto; }
    .slide{ height: auto; aspect-ratio: 1000 / 380; }
}

/* ===== Footer ajustement (optionnel) ===== */
.footer-menu {
    gap: 1rem;
}

.footer-text {
    color: #fff;
    font-weight: bold;
}

.container{
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

.msg{
    color: #8a1f1f;
    padding: 10px 12px;
    background: #fee;
    border-radius: 10px;
    border: 1px solid rgba(255,0,0,.15);
    margin: 12px 0;
}

form{
    margin: 16px 0 10px;
}
label{ font-size: 14px; }
select{
    padding:10px 12px;
    border-radius:10px;
    border:1px solid #d7d7e2;
    background:#fff;
    font-size:14px;
    width: min(520px, 100%);
    outline:none;
}

/* Article */
.article{
    margin-top: 14px;
    border-radius:16px;
    box-shadow: 0 10px 24px rgba(0,0,0,.06);
    border: 1px solid rgba(0,0,0,.09);
    overflow:hidden;
}
.article-header{
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}
.article-header h2{
    margin: 0;
    font-size: 18px;
}
.article-content{
    padding: 0 16px 16px;
}

/* Grille de cartes (doit apparaître SOUS l'article) */
.grid{
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr; /* mobile: 1 carte */
    gap: 14px;
    justify-items: center; /* centrage */
}
@media (min-width: 600px){
    .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: stretch; }
}
@media (min-width: 900px){
    .grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px){
    .grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card{
    width: 100%;
    background:rgba(255,255,255,.05);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
    overflow: hidden;
    text-decoration: none;
    color:inherit;
    border: 1px solid rgba(0,0,0,.04);
    transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover{
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0,0,0,.10);
}
.thumb{
    width: 100%;
    aspect-ratio: 16 / 10;
    display:block;
    object-fit: cover;
    background:#eee;
}
.card-body{
    padding: 12px 12px 14px;
}
.card-title{
    font-weight: 700;
    font-size: 14px;
    line-height: 1.25;
    margin: 0;
}

.selected{
    outline: 3px solid rgba(0, 120, 255, .25);
}

.lightbox{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}
.lightbox.active{ display:flex; }

.lightbox-content{
    position: relative;
    max-width: min(1100px, 95vw);
    max-height: 90vh;
    background:#111;
    border-radius: 14px;
    overflow: hidden;
}
#lightbox-img{
display:block;
max-width: 95vw;
max-height: 90vh;
}
.lightbox .close{
    position:absolute;
    top:10px;
    right:12px;
    font-size:34px;
    color:#fff;
    cursor:pointer;
    user-select:none;
}

.lightbox{ z-index: 999999 !important; }
.lightbox-content{ z-index: 1000000 !important; }
.navbar{ z-index: 10; } /* ou supprime le z-index trop grand si tu en as */
.lightbox.active{ display:flex !important; }

/* ==========================================================
 *  ✅ PARTENAIRES / LOGOS (corrige les logos trop grands)
 *  Scoppé dans .sonar pour éviter les conflits avec .grid/.card
 *  ========================================================== */

.sonar .logo-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 900px){
    .sonar .logo-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
    .sonar .logo-grid{ grid-template-columns: 1fr; }
}

.sonar .logo-card{
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(31,41,55,.12);
    border-radius: 10px;
    background: rgba(255,255,255,.65);
    text-decoration: none;
    color: inherit;
}

.sonar .logo-box{
    width: 96px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 10px;
    background: rgba(31,41,55,.03);
    border: 1px solid rgba(31,41,55,.10);
    overflow: hidden; /* clé */
}

.sonar .logo-box img{
    max-width: 100%;
    max-height: 52px; /* ✅ limite réelle : empêche “trop grand” */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.sonar .logo-meta .logo-name{
    font-weight: 700;
    color: #1f2937;
}

.sonar .logo-meta .note{
    margin-top: 2px;
    color: #4b5563;
    font-size: 0.92rem;
}
