/* =====================================================================
   STYLES GLOBAUX & CONFIGURATION DE BASE
   ================================================================     */
html {
    scroll-padding-top: 110px;
}

body {
    text-rendering: optimizeLegibility;
}

:focus-visible {
    outline: 3px solid #a02b2b;
    outline-offset: 2px;
}

#site-header.is-scrolled {
    box-shadow: 0 6px 24px -10px rgba(15, 44, 89, 0.25);
}

/* Héros : zoom lent + fondu entre diapositives */
@keyframes kenburns {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.12);
    }
}

.ken-burns {
    animation: kenburns 10s ease-out infinite alternate;
}

.hero-slide {
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    pointer-events: none;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hero-text {
    transition: opacity 0.35s ease;
}

/* Cartes */
.card-clean {
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 44, 89, 0.05);
    transition:
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.card-clean:hover {
    box-shadow: 0 14px 32px -8px rgba(15, 44, 89, 0.16);
    border-color: #cbd5e1;
}

/* Texte d'article (rendu du contenu saisi dans le back office) */
.article-body {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #334155;
    max-width: 70ch;
}

.article-body > * + * {
    margin-top: 1.1em;
}

.article-body h2 {
    font-family: "Cinzel", serif;
    font-weight: 600;
    font-size: 1.55rem;
    color: #0f2c59;
    margin-top: 1.8em;
    line-height: 1.3;
}

.article-body h3 {
    font-family: "Cinzel", serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #0f2c59;
    margin-top: 1.6em;
}

.article-body h4 {
    font-weight: 700;
    color: #0f2c59;
}

.article-body ul {
    list-style: disc;
    padding-left: 1.4em;
}

.article-body ol {
    list-style: decimal;
    padding-left: 1.4em;
}

.article-body li + li {
    margin-top: 0.4em;
}

.article-body a {
    color: #8b2626;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-body blockquote {
    border-left: 3px solid #a02b2b;
    padding-left: 1.1em;
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 1.35rem;
    color: #0f2c59;
}

.article-body hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 2em 0;
}

/* Éditeur du back office */
.editor-area {
    min-height: 320px;
}

.editor-area:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

.editor-area:focus {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .ken-burns {
        animation: none;
    }
    .hero-slide,
    .hero-text {
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Liste déroulante ouverte au clic / toucher */
.dd.force-open {
    display: block;
}

/* =====================================================================
   EN-TÊTE — CSS dédié : une seule ligne, jamais de chevauchement.
   < 1280 px : menu burger · ≥ 1280 px : barre complète
   ===================================================================== */

/* --- Barre d'informations (topbar) --- */
.topbar {
    display: none;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .topbar {
        display: block;
    }
}

.topbar-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 8px 32px;
}

.topbar a {
    color: inherit;
    text-decoration: none;
}

.topbar a:hover {
    color: #0f2c59;
}

.topbar-l,
.topbar-r {
    display: flex;
    align-items: center;
    gap: 28px;
}

.topbar i {
    margin-right: 8px;
}

.topbar .t-addr,
.topbar .t-mail {
    display: none;
}

@media (min-width: 1280px) {
    .topbar .t-addr {
        display: inline-flex;
    }
}

@media (min-width: 1536px) {
    .topbar .t-mail {
        display: inline-flex;
    }
}

/* --- En-tête principal (header) --- */
#site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
}

.hd-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    height: 64px;
    padding: 0 12px;
    overflow: hidden;
}

@media (min-width: 640px) {
    .hd-in {
        padding: 0 20px;
    }
}

@media (min-width: 1024px) {
    .hd-in {
        height: 80px;
        padding: 0 32px;
        gap: 24px;
    }
}

/* --- Marque / logo (MIS À JOUR pour clarté et lisibilité) --- */
.hd-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 0 1 auto;
    min-width: 0; /* Empêche le débordement flex */
}

/* === À COLLER dans style.css : remplace tout le bloc .hd-brand img et ses media queries === */
.hd-brand img {
    height: 44px;
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    display: block;
    image-rendering: auto;
}

@media (min-width: 640px) {
    .hd-brand img {
        height: 56px;
    }
}

@media (min-width: 1024px) {
    .hd-in {
        height: 88px;
    }
    .hd-brand img {
        height: 68px;
    }
}

/* Très petits mobiles : remplace .hd-brand img { height: 34px; } par : */
@media (max-width: 480px) {
    .hd-brand img {
        height: 40px;
    }
}

/* Hauteur du menu mobile avec le header à 88px */
@media (min-width: 1024px) {
    #site-header .hd-menu {
        max-height: calc(100vh - 88px);
        max-height: calc(100dvh - 88px);
    }
}

.hd-txt {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.hd-top {
    display: block;
    font-family: Cinzel, serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #475569;
    white-space: nowrap;
    margin-bottom: 3px;
}

@media (min-width: 1536px) {
    .hd-top {
        display: block;
    }
}

.hd-name {
    font-family: Cinzel, serif;
    font-weight: 700;
    color: #8b2626;
    letter-spacing: 0.02em;
    white-space: nowrap;
    font-size: 13px;
}

.hd-name b {
    color: #0f2c59;
    font-weight: 700;
}

.hd-name .n2 {
    display: inline;
}

@media (min-width: 640px) {
    .hd-name {
        font-size: 17px;
    }
}

@media (min-width: 1280px) {
    .hd-name {
        font-size: 18px;
    }
}

.hd-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    white-space: nowrap;
}

.hd-sub span {
    font-family: Cinzel, serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.25em;
    color: #0f2c59;
}

.hd-sub i {
    display: block;
    height: 1px;
    width: 16px;
    background: #0f2c59;
}

@media (min-width: 640px) {
    .hd-sub {
        display: flex;
    }
}

/* --- Navigation principale --- */
.hd-nav {
    display: none;
    align-items: center;
    gap: clamp(16px, 1.7vw, 40px);
    flex: none;
}

@media (min-width: 1280px) {
    .hd-nav {
        display: flex;
    }
}

.hd-nav a {
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #334155;
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.2s;
}

@media (min-width: 1536px) {
    .hd-nav a {
        font-size: 13px;
        letter-spacing: 0.12em;
    }
}

.hd-nav a:hover {
    color: #8b2626;
}

.hd-nav a[aria-current] {
    color: #8b2626;
    border-bottom-color: #8b2626;
}

/* --- Actions (CTA + burger) --- */
.hd-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.hd-cta {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: #0f2c59;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.hd-cta:hover {
    background: #8b2626;
}

@media (min-width: 640px) {
    .hd-cta {
        display: inline-flex;
    }
}

@media (min-width: 1280px) and (max-width: 1535px) {
    .hd-cta .lbl {
        display: none;
    }
    .hd-cta {
        padding: 11px 14px;
    }
}

.hd-burger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #0f2c59;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    -webkit-tap-highlight-color: transparent;
}

.hd-burger:hover {
    background: #f1f5f9;
}

.hd-burger i {
    pointer-events: none;
}

@media (min-width: 1280px) {
    .hd-burger {
        display: none;
    }
}

/* --- Repli automatique (garde-fou JS) --- */
#site-header.is-collapsed .hd-nav {
    display: none !important;
}

#site-header.is-collapsed .hd-burger {
    display: flex !important;
}

#site-header.is-collapsed .hd-cta .lbl {
    display: inline !important;
}

#site-header.is-collapsed .hd-cta {
    padding: 11px 20px !important;
}

/* --- Menu mobile : pleine largeur, compact --- */
.hd-menu {
    display: none;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 18px 30px -12px rgba(15, 44, 89, 0.25);
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hd-menu.open {
    display: block;
}

@media (min-width: 1280px) {
    .hd-menu.open {
        display: none;
    }
    #site-header.is-collapsed .hd-menu.open {
        display: block;
    }
}

@media (min-width: 1024px) {
    #site-header .hd-menu {
        max-height: calc(100vh - 80px);
        max-height: calc(100dvh - 80px);
    }
}

.hd-menu a.m-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1e293b;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
}

.hd-menu a.m-link i {
    font-size: 10px;
    color: #cbd5e1;
}

.hd-menu a.m-link[aria-current] {
    color: #8b2626;
    background: #fdf3f3;
}

.hd-menu .m-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-top: 1px solid #e2e8f0;
}

.hd-menu .m-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 4px;
    background: #fff;
    color: #0f2c59;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.hd-menu .m-actions a:first-child {
    background: #0f2c59;
    color: #fff;
    font-weight: 700;
}

/* --- L'en-tête ne dépend d'aucun reset externe --- */
.topbar,
.topbar *,
#site-header,
#site-header * {
    box-sizing: border-box;
}

#site-header ul,
#site-header li {
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 640px) and (max-width: 767px) {
    .hd-cta .lbl {
        display: none;
    }
    .hd-cta {
        padding: 11px 14px;
    }
    .hd-name {
        font-size: 16px;
    }
}

#site-header.hide-cta .hd-cta {
    display: none !important;
}

html.menu-open,
html.menu-open body {
    overflow: hidden;
}

/* --- Ajustements spécifiques pour très petits mobiles --- */
@media (max-width: 480px) {
    .hd-top {
        display: none;
    }
    .hd-sub {
        display: none;
    }
    .hd-name {
        font-size: 12px;
    }
    .hd-brand img {
        height: 34px;
    }
    .hd-in {
        padding: 0 8px;
        gap: 8px;
    }
}
