/* ============================================================
   Layout — structure globale du site front
   Header, nav, footer, conteneur, grilles, sidebar, hero…
   ============================================================ */

/* ── Conteneur ────────────────────────────────────────────── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 64px;
}

.site-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}

/* ── Navigation ───────────────────────────────────────────── */
.site-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-left: auto;
}

.site-nav a {
    padding: .4rem .75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-size: .9rem;
    transition: background var(--transition), color var(--transition);
}

.site-nav a:hover {
    background: var(--bg-alt);
    color: var(--text);
}

/* Lien de menu vers l'ancre de la section visible (site onepage, js/menu-anchors.js) */
.site-nav a.is-current {
    background: var(--bg-alt);
    color: var(--text);
}

.site-nav a.btn-nav {
    background: var(--primary);
    color: #fff;
}

.site-nav a.btn-nav:hover {
    background: var(--primary-dark);
    color: #fff;
}

/* ── Sélecteur de langue ──────────────────────────────────── */
.lang-switcher {
    display: flex;
    flex-shrink: 0; /* sans lui, un menu long l'écrase à la largeur de sa flèche */
    align-items: center;
    margin-left: var(--space-sm);
}

.lang-select {
    padding: .2rem 1.4rem .2rem .45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .04em;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}

.lang-select:hover,
.lang-select:focus {
    border-color: var(--primary);
    color: var(--text);
}

@media (max-width: 768px) {
    .lang-switcher { margin-left: 0; margin-top: var(--space-sm); }
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    color: var(--text);
}

/* ── Dropdown nav ─────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 180px;
    box-shadow: var(--shadow-md);
    z-index: 200;
    padding: .5rem 0;
}

.nav-dropdown-menu a {
    display: block;
    padding: .5rem var(--space-md);
    color: var(--text);
    text-decoration: none;
    font-size: .9rem;
}

.nav-dropdown-menu a:hover {
    background: var(--bg-alt);
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

/* ── Pastille utilisateur (menu "Mon compte" / déconnexion) ────
   Sélecteur `.site-nav a.nav-user-pastille` : la règle générique
   `.site-nav a` (couleur, padding) a la même spécificité qu'une classe
   seule et l'emporterait sinon selon l'ordre des règles — vécu (couleur
   remplacée par le gris de texte des liens, cercle à peine visible). */
.site-nav a.nav-user-pastille {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 50%;
    background: var(--text-muted);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
}

.site-nav a.nav-user-pastille:hover {
    background: var(--text);
    color: #fff;
}

.nav-user .nav-dropdown-menu {
    right: 0;
    left: auto;
}

/* ── Fil d'Ariane ─────────────────────────────────────────── */
.breadcrumb-bar {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: .5rem 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

/* ── Contenu principal ────────────────────────────────────── */
.site-main {
    padding: var(--space-2xl) 0;
    min-height: 60vh;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: var(--space-xl) 0;
    text-align: center;
    color: var(--text-muted);
    font-size: .875rem;
}

/* ── Grilles de contenu ───────────────────────────────────── */
.grid   { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ── Layout avec sidebar ──────────────────────────────────── */
.layout-sidebar {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 2.5rem;
    align-items: start;
}

.layout-main { min-width: 0; }

.layout-sidebar-aside {
    position: sticky;
    top: 80px;
}

/* ── Widgets sidebar ──────────────────────────────────────── */
.widget {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: var(--space-lg);
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .75rem;
}

.cat-list { list-style: none; padding: 0; }
.cat-list li { border-bottom: 1px solid var(--border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a {
    display: block;
    padding: .5rem 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .9rem;
}
.cat-list a:hover { color: var(--primary); }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h1 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
}

/* ── Section homepage ─────────────────────────────────────── */
.section { padding: var(--space-2xl) 0; }
.section-alt { background: var(--bg-alt); }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.link-more {
    color: var(--primary);
    text-decoration: none;
    font-size: .9rem;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 5rem var(--space-md);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: var(--space-md);
}

.hero-sub {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

/* ── Contenu riche (pages, articles) ─────────────────────── */
.content-body h1,
.content-body h2,
.content-body h3 { margin: 1.5em 0 .5em; font-weight: 700; }
.content-body p  { margin-bottom: 1em; }
.content-body ul,
.content-body ol { margin: 1em 0 1em 1.5em; }
.content-body li { margin-bottom: .35em; }
.content-body img { border-radius: var(--radius); margin: 1.5em 0; }
.content-body a  { text-decoration: underline; }
.content-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 1.5em 0;
}

/* ── Erreur 404/500 ───────────────────────────────────────── */
.error-page {
    text-align: center;
    padding: 4rem var(--space-md);
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 900;
    color: var(--border);
    line-height: 1;
    margin-bottom: var(--space-md);
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .site-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: var(--space-md);
        gap: .25rem;
        box-shadow: var(--shadow-md);
    }

    .site-header.nav-open .site-nav { display: flex; }

    .grid-2,
    .grid-3,
    .grid-4 { grid-template-columns: 1fr; }

    .layout-sidebar { grid-template-columns: 1fr; }
    .layout-sidebar-aside { position: static; }
}

/* ── Carte interactive ───────────────────────────────────────────────────── */

.map-embed {
    height: 300px;
    position: relative !important; /* requis par Leaflet */
    border-radius: var(--radius);
    border: 0;
    overflow: hidden;
}

/* ── Footer multi-colonnes ───────────────────────────────────────────────── */

.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: .5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.footer-col__title {
    font-weight: 700;
    font-size: .875rem;
    margin: 0;
    color: var(--text);
}

.footer-col a {
    font-size: .85rem;
    color: var(--text-muted);
    text-decoration: none;
}

.footer-col a:hover { color: var(--primary); }

.footer-bottom {
    text-align: center;
}

/* ── Menu items admin ────────────────────────────────────────────────────── */

.menu-items-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.menu-item-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    background: var(--surface-alt, var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: grab;
}

.menu-item-row.dragging { opacity: .4; }

.menu-item-handle {
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: grab;
}

.menu-item-label { font-weight: 600; }

.menu-item-child {
    margin-left: 1.5rem;
    border-left: 3px solid var(--border);
    background: transparent;
    padding: .4rem .75rem;
    box-sizing: border-box;
}

.menu-item-root,
.menu-item-child {
    display: grid;
    grid-template-columns: 1.2rem 1fr auto auto auto;
    align-items: center;
    gap: .5rem .75rem;
    width: 100%;
}

.menu-item-actions {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-shrink: 0;
}

.menu-lang-dots {
    display: flex;
    align-items: center;
    gap: .15rem;
    flex-shrink: 0;
}

.menu-item-url {
    font-size: .8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.child-list {
    list-style: none;
    padding: 0;
    margin: .35rem 0 0 2rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.child-list:empty { display: none; }

.child-handle { font-size: .9rem; }

/* ── Header enrichi ──────────────────────────────────────────────────────── */

.site-logo {
    max-height: 48px;
    width: auto;
    display: block;
}

.site-tagline {
    display: block;
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.2;
}

.header-phone {
    font-size: .85rem;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    margin-right: auto;
}

.header-phone:hover { color: var(--primary); }

.header-search {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-left: .5rem;
}

.header-search input {
    padding: .3rem .6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .85rem;
    background: var(--surface);
    color: var(--text);
    width: 160px;
}

.header-search button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: .2rem;
}

/* ── Footer enrichi ──────────────────────────────────────────────────────── */

.footer-logo {
    max-height: 40px;
    width: auto;
    margin-bottom: .75rem;
    display: block;
}

.footer-text {
    font-size: .85rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.footer-text p { margin: 0 0 .5rem; }
.footer-text :is(h2, h3, h4) { margin: .5rem 0 .25rem; font-size: .95rem; color: var(--text); }
.footer-text :is(ul, ol) { display: block; margin: .25rem 0; padding-left: 1.1rem; list-style: revert; }

/* Colonne « Coordonnées » du footer */
.footer-col ul.footer-contact { gap: .45rem; }
.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: .85rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.footer-contact .ph { flex-shrink: 0; margin-top: .2rem; color: var(--primary); }
.footer-contact__name { font-weight: 600; color: var(--text); }

.footer-socials {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}

.footer-social-link {
    font-size: 1.35rem;
    line-height: 1;
    color: var(--text-muted);
    text-decoration: none;
    transition: transform .15s, color .15s;
    display: inline-block;
}
.footer-social-link:hover { color: var(--primary); }

.footer-social-link:hover { transform: scale(1.2); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
    text-align: center;
    font-size: .8rem;
    color: var(--text-muted);
}

.footer-bottom p { margin: 0; }

@media (max-width: 768px) {
    .header-phone { display: none; }
    .header-search { display: none; }
}

/* ── Slider page d'accueil ────────────────────────────────── */
.home-slider {
    position: relative;
    overflow: hidden;
    max-height: 560px;
    background: #000;
}
.slider-track {
    display: flex;
    transition: transform .5s ease;
    will-change: transform;
}
.slide {
    min-width: 100%;
    position: relative;
}
.slide img {
    width: 100%;
    height: 560px;
    object-fit: cover;
    display: block;
    opacity: .85;
}
.slide-caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 60%, transparent 100%);
    color: #fff;
}
.slide-title {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: .75rem;
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.slide-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
    max-width: 600px;
}
.slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.35);
    color: #fff;
    border: none;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 10;
    line-height: 1;
}
.slide-arrow:hover { background: rgba(0,0,0,.65); }
.slide-prev { left: 1rem; }
.slide-next { right: 1rem; }
.slide-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: .5rem;
    z-index: 10;
}
.slide-dot {
    width: .6rem;
    height: .6rem;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    border: none;
    cursor: pointer;
    transition: background .2s, transform .2s;
    padding: 0;
}
.slide-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ── Intro page d'accueil ─────────────────────────────────── */
.home-intro { max-width: 760px; margin: 0 auto; }
.home-intro-cta { text-align: center; margin-top: 1.5rem; }

/* ── Liste documents accueil ──────────────────────────────── */
.doc-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.doc-item { display: flex; align-items: center; gap: 1rem; padding: .75rem; background: var(--surface); border-radius: var(--radius); }
.doc-icon { font-size: 1.5rem; flex-shrink: 0; }
.doc-info { flex: 1; }
