/* ═══════════════════════════════════════════════════════════════
   Page d'accueil (index.php) — charte OESSMS, maquette « OESSMS V2 premium »
   Toutes les règles sont limitées à body.oe : aucune autre page n'est concernée.
   En-tête et pied de page : composants partagés de themes.php.
   ═══════════════════════════════════════════════════════════════ */

body.oe {
    /* Palette de la maquette */
    --navy: #073B5C;
    --navy2: #052D45;
    --blue: #0D6B9D;
    --teal: #16A6A0;
    --teal-texte: #0E7F7A;
    --green: #55B97A;
    --orange: #E9A23B;
    --ink: #173B50;
    --muted: #60798A;
    --line: #DCE7ED;
    --bg: #F5F9FB;
    --shadow: 0 12px 34px rgba(7, 59, 92, 0.08);
    --r: 16px;
    --serif: Georgia, 'Times New Roman', serif;

    /* Variables de themes.php utilisées par la recherche (recherche.css / recherche.js) */
    --primary: #073B5C;
    --primary-dark: #052D45;
    --primary-rgb: 7, 59, 92;
    --bg-card: #FFFFFF;
    --bg-section-alt: #F5F9FB;
    --bg-hover: #F5F9FB;
    --bg-highlight: #EDF6FA;
    --bg-input: #FFFFFF;
    --text-primary: #173B50;
    --text-secondary: #60798A;
    --text-muted: #6A8292;
    --border-color: #DCE7ED;
    --border-light: #E8EFF3;
    --border-input: #CFDDE5;
    --spinner-track: #E3EDF2;
    --shadow-light: rgba(7, 59, 92, 0.06);

    margin: 0;
    padding: 0;
    background: #FFFFFF;
    color: var(--ink);
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}
body.oe *, body.oe *::before, body.oe *::after { box-sizing: border-box; }
body.oe a { color: inherit; text-decoration: none; }
body.oe svg { flex: 0 0 auto; }
body.oe :focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* Même largeur que l'en-tête partagé (1080 px) ; les publicités latérales sont à ±550 px du centre */
.oe-container { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ── Boutons ── */
body.oe .oe-account,
body.oe .oe-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--navy); color: #FFFFFF; border: 0; border-radius: 9px;
    padding: 12px 18px; font: 700 13.5px/1.2 inherit; font-family: inherit; cursor: pointer; white-space: nowrap;
}
body.oe .oe-account:hover,
body.oe .oe-primary:hover { background: var(--navy2); }
.oe-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--blue) !important; font-weight: 700; white-space: nowrap; }
.oe-link:hover { text-decoration: underline !important; }
.oe-arrow { color: var(--navy); display: inline-flex; }

/* ── Hero + recherche ── */
.oe-hero { background: linear-gradient(105deg, #F1F8F9 0%, #FFFFFF 58%, #E8F3F5 100%); padding: 58px 0 50px; border-bottom: 1px solid var(--line); }
.oe-eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; color: var(--teal-texte); font-weight: 800; }
.oe-eyebrow::after { content: ""; display: inline-block; width: 55px; height: 2px; background: var(--orange); margin: 0 0 4px 10px; }
body.oe h1 { font: 700 46px/1.08 var(--serif); color: var(--navy); margin: 16px 0 14px; }
.oe-hero-texte { max-width: 720px; margin: 0; color: #48687B; font-size: 16px; }

.oe-searchbox { margin-top: 28px; }
body.oe .oe-searchbox .search-controls { background: transparent; border: 0; border-radius: 0; padding: 0; gap: 12px; }
body.oe .oe-searchbox .sc-main {
    background: #FFFFFF; padding: 9px; border: 1px solid var(--line); border-radius: 13px;
    box-shadow: var(--shadow); gap: 0;
}
body.oe .oe-searchbox .sc-main .sc-input {
    border: 0; border-radius: 0; background: transparent; padding: 14px; font-size: 14.5px; min-width: 0;
}
body.oe .oe-searchbox .sc-main .sc-autocomplete,
body.oe .oe-searchbox .sc-main > select.sc-input { border-left: 1px solid var(--line); }
body.oe .oe-searchbox .sc-main .sc-input:focus { box-shadow: inset 0 -2px 0 var(--teal); }
body.oe .oe-searchbox .sc-btn { font-family: inherit; }
body.oe .oe-searchbox .sc-main .sc-btn-primary { min-width: 150px; border-radius: 9px; padding: 14px 20px; background: var(--navy); font-weight: 700; }
body.oe .oe-searchbox .sc-main .sc-btn-primary:hover { background: var(--navy2); }

/* Ligne « Plus de critères » / « Réinitialiser » présentée en puces */
body.oe .oe-searchbox .search-controls-secondary { justify-content: flex-start; gap: 8px; }
body.oe .oe-searchbox .sc-more,
body.oe .oe-searchbox .sc-btn-ghost {
    display: inline-flex; align-items: center; gap: 6px; border-radius: 30px; padding: 7px 13px;
    font-size: 12.5px; line-height: 1.2; text-decoration: none;
}
body.oe .oe-searchbox .sc-more { background: #E8F7F4; color: var(--navy); border: 1px solid #C9E9E4; font-weight: 700; }
body.oe .oe-searchbox .sc-more:hover { background: #D9F1EC; }
body.oe .oe-searchbox .sc-more-ico { width: auto; height: auto; background: none; font-size: 1em; }
body.oe .oe-searchbox .sc-btn-ghost { background: #FFFFFF; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
body.oe .oe-searchbox .sc-btn-ghost:hover { color: var(--navy); }

/* Critères avancés (membres) */
body.oe .oe-searchbox .search-advanced.open {
    background: #FFFFFF; border: 1px solid var(--line); border-radius: 13px; padding: 16px; margin-top: 0;
}
body.oe .oe-searchbox .search-advanced .sc-input { border-color: var(--line); border-radius: 8px; }
body.oe .oe-searchbox .sc-toggle { border-radius: 30px; border-color: var(--line); background: #FFFFFF; font-size: 13px; }
body.oe .oe-searchbox .sc-toggle:has(input:checked) { background: #E8F7F4; border-color: #C9E9E4; color: var(--navy); font-weight: 700; }

@media (min-width: 981px) {
    body.oe .oe-searchbox .sc-main { flex-wrap: nowrap; }
    body.oe .oe-searchbox .sc-main .sc-grow { flex: 1 1 auto; }
    body.oe .oe-searchbox .sc-main .sc-autocomplete { flex: 0 1 180px; min-width: 0; }
    body.oe .oe-searchbox .sc-main > select.sc-input { flex: 0 1 180px; }
    body.oe .oe-searchbox .sc-main .sc-btn { flex: 0 0 auto; }
}

/* Résultats (affichés sous le hero après une recherche) */
.oe-resultats { display: none; background: var(--bg); padding: 28px 0 40px; border-bottom: 1px solid var(--line); }
body.oe-avec-resultats .oe-resultats { display: block; }

/* ── Sections ── */
.oe-section { padding: 52px 0; }
.oe-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 23px; }
body.oe .oe-section-head h2 { font: 700 29px/1.15 var(--serif); color: var(--navy); margin: 0; }
.oe-section-head p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* Accès thématiques */
.oe-section-quick { padding: 40px 0 44px; }
.oe-quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.oe-quick { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 20px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.oe-quick:last-child { border-right: 0; }
.oe-quick:hover strong { color: var(--blue); }
.oe-icon { width: 42px; height: 42px; border-radius: 12px; background: #EDF6FA; display: grid; place-items: center; color: var(--navy); margin-bottom: 10px; }
.oe-quick:nth-child(2) .oe-icon { background: #E8F7F4; color: var(--teal-texte); }
.oe-quick:nth-child(3) .oe-icon { background: #E8F7F4; color: var(--teal-texte); }
.oe-quick:nth-child(4) .oe-icon { background: #FFF4E5; color: #B97612; }
.oe-quick strong { font-size: 14.5px; color: var(--ink); }
.oe-quick p { font-size: 12.5px; color: var(--muted); margin: 5px 0 8px; flex: 1; }

/* Chiffres */
.oe-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.oe-stat { padding: 22px 20px; background: #FFFFFF; text-align: center; }
.oe-number { font: 700 34px/1.2 var(--serif); color: var(--navy); }
.oe-label { font-size: 13.5px; color: var(--muted); }
.oe-delta { font-size: 12px; color: var(--teal-texte); margin-top: 8px; }

/* Explorer */
.oe-explore { background: var(--bg); }
.oe-explore-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .9fr); gap: 20px; }
.oe-panel { background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
body.oe .oe-panel h3 { font-size: 16px; color: var(--navy); margin: 0 0 14px; }
.oe-map { height: 400px; border-radius: 12px; background: linear-gradient(135deg, #F8FBFC, #EEF7F6); overflow: hidden; z-index: 0; }
/* Aperçu cliquable : toute la carte mène à la carte interactive */
.oe-map-lien, .oe-map-lien .leaflet-interactive { cursor: pointer; }
.oe-map-lien:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.oe-legend { font-size: 12px; color: var(--muted); margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.oe-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; background: var(--teal); }

.oe-essential { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 15px; margin-bottom: 11px; }
.oe-essential:last-child { margin-bottom: 0; }
.oe-essential:hover { border-color: #BFD6E0; background: #FBFDFE; }
.oe-big { width: 45px; height: 45px; flex: 0 0 45px; border-radius: 11px; background: #EDF6FA; display: grid; place-items: center; color: var(--navy); }
.oe-essential:nth-of-type(2) .oe-big { background: #E8F7F4; color: var(--teal-texte); }
.oe-essential:nth-of-type(3) .oe-big { background: #FFF4E5; color: #B97612; }
.oe-essential strong { font-size: 14px; }
.oe-essential p { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
.oe-essential .oe-arrow { margin-left: auto; }

/* Bandeau accompagnement */
.oe-feature-band { background: #EEF7F8; }
.oe-features { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); }
.oe-intro { padding-right: 30px; }
body.oe .oe-intro h2 { font: 700 23px/1.25 var(--serif); color: var(--navy); margin: 0 0 10px; }
.oe-intro p, .oe-feature p { font-size: 13px; color: var(--muted); }
.oe-intro p { margin: 0 0 18px; }
.oe-feature { padding: 12px 22px; border-left: 1px solid #D0E0E5; }
.oe-feature .oe-icon { background: #FFFFFF; }
.oe-feature strong { font-size: 14px; }
.oe-feature p { margin: 6px 0 0; }

/* À lire */
.oe-news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.oe-news { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.oe-news-img { position: relative; height: 115px; background: #FFFFFF; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: 14px 14px 28px; }
.oe-news-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.oe-badge { position: absolute; left: 10px; bottom: 9px; background: var(--navy); color: #FFFFFF; border-radius: 4px; padding: 3px 7px; font-size: 10px; font-weight: 800; letter-spacing: .5px; }
.oe-news:nth-child(2) .oe-badge { background: var(--teal-texte); }
.oe-news:nth-child(3) .oe-badge { background: var(--blue); }
.oe-news:nth-child(4) .oe-badge { background: #9A6512; }
.oe-news-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.oe-news-meta { font-size: 11px; color: var(--muted); }
body.oe .oe-news h3 { font-size: 15px; line-height: 1.35; color: var(--navy); margin: 6px 0 14px; flex: 1; }
.oe-news h3 a:hover { text-decoration: underline !important; }
.oe-news-lien { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--blue) !important; font-weight: 700; }

/* Appel à l'action */
.oe-cta { background: var(--navy); color: #FFFFFF; padding: 36px 0; }
.oe-cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
body.oe .oe-cta h2 { font: 700 27px/1.2 var(--serif); margin: 0 0 5px; color: #FFFFFF; }
.oe-cta p { font-size: 14px; color: #C8DDE7; margin: 0; }
body.oe .oe-cta .oe-primary { background: #FFFFFF; color: var(--navy); }
body.oe .oe-cta .oe-primary:hover { background: #E8F3F5; }

/* ── Adaptations ── */
@media (max-width: 980px) {
    body.oe .oe-searchbox .sc-main .sc-btn-primary { margin-left: auto; }
}
@media (max-width: 1000px) {
    .oe-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .oe-quick { border-right: 0; padding: 18px 16px; }
    .oe-stats { grid-template-columns: repeat(3, 1fr); }
    .oe-explore-grid, .oe-features { grid-template-columns: 1fr; }
    .oe-intro { padding: 0 0 18px; }
    .oe-feature { border-left: 0; border-top: 1px solid #D0E0E5; padding: 16px 0; }
    .oe-news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
    .oe-container { padding: 0 16px; }
    body.oe h1 { font-size: 34px; }
    .oe-hero { padding: 40px 0; }
    body.oe .oe-searchbox .sc-main { flex-direction: column; align-items: stretch; }
    body.oe .oe-searchbox .sc-main .sc-autocomplete,
    body.oe .oe-searchbox .sc-main > select.sc-input { border-left: 0; border-top: 1px solid var(--line); }
    body.oe .oe-searchbox .sc-main .sc-btn-primary { width: 100%; height: 46px; margin-top: 6px; }
    .oe-section-head { flex-direction: column; align-items: flex-start; }
    .oe-quick-grid, .oe-news-grid { grid-template-columns: 1fr; }
    .oe-stats { grid-template-columns: repeat(2, 1fr); }
    .oe-stat:last-child { grid-column: 1 / -1; }
    .oe-cta-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    body.oe * { transition: none !important; }
}
