/**
 * CORE DESIGN SYSTEM : reset, html/body roots & framework layout
 * MCO V4 2026 — Région Réunion (DEVL)
 * Version : 4.4.0 (Correction d'autorité de la spécificité des sections)
 */
* { box-sizing: border-box; }

html { 
  scroll-behavior: smooth; 
  scroll-padding-top: 112px; 
  -webkit-text-size-adjust: 100%; 
}

html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 8% 0%, rgba(9,105,218,0.08), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 42rem);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  font-feature-settings: "kern", "liga", "ss01";
  text-rendering: optimizeLegibility;
}

a { color: var(--bleu-clair); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.editorial p, .sec-block-body p { hyphens: auto; -webkit-hyphens: auto; }

/* Structures fixes de l'application */
main.site-main { max-width: 1240px; margin: 0 auto; padding: 42px 20px 64px; }
.wrap { max-width: 1280px; margin: 0 auto; }
section.section { margin-bottom: 52px; padding: var(--section-spacing, 35px) 0 !important; }
section.section h2 { font-size: 28px; color: var(--bleu-profond); margin: 0 0 10px; font-weight: 800; letter-spacing: 0; }
section.section .sec-intro { font-size: 15.5px; line-height: 1.65; color: var(--fg-soft); max-width: 860px; margin: 0 0 26px; }

/* Surcharges Capsulaires des bannières hauts de page */
.home-hero, .page-header, .category-header, .formation-header {
  border: 4px solid var(--orange-soleil) !important;
  border-radius: 24px !important;
  overflow: hidden !important;
}

/* En-tête institutionnel */
header.site-top { background: linear-gradient(135deg, var(--bleu-profond) 0%, #002a5c 100%); color: white; padding: 14px 20px; }
header.site-top .top-wrap { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
header.site-top .brand { display: flex; align-items: center; flex-shrink: 0; width: 260px; height: 52px; text-decoration: none; }
header.site-top .logo-wrapper { background: #ffffff; padding: 6px 12px; border-radius: 8px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); width: 100%; height: 44px; box-sizing: border-box; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
header.site-top .brand:hover .logo-wrapper { transform: scale(1.03); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
header.site-top .logo-svg-bg { width: 100%; height: 100%; background-image: url('/assets/img/logo-orient-a-nou.svg'); background-repeat: no-repeat; background-position: center center; background-size: contain; }

/* Barre de navigation standard */
nav.site-nav { position: sticky; top: 0; z-index: 100; width: 100%; background: white; border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
nav.site-nav .nav-wrap { max-width: 1280px; margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; padding: 0 8px; }
nav.site-nav a { padding: 14px 14px; font-size: 14px; color: var(--fg-soft); font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; transition: all 0.15s; text-decoration: none; }
nav.site-nav a:hover { color: var(--bleu-profond); background: var(--bleu-pale); border-bottom-color: var(--bleu-clair); }
nav.site-nav a.active { color: var(--bleu-profond); border-bottom-color: var(--orange-soleil); font-weight: 600; }
nav.site-nav .nav-toggle { display: none; align-items: center; gap: 8px; padding: 12px 16px; background: white; border: none; font-size: 14px; font-weight: 600; color: var(--bleu-profond); cursor: pointer; }
.burger-bars { display: flex; flex-direction: column; gap: 4px; }
nav.site-nav .nav-toggle-bar { display: block; width: 22px; height: 2px; background: var(--bleu-profond); }

/* Pied de page régional */
footer.site-foot { background: var(--bleu-profond); color: white; padding: 36px 20px 24px; margin-top: 48px; }
footer.site-foot .wrap { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
footer.site-foot h4 { margin: 0 0 12px; font-size: 14px; color: var(--jaune-soleil); }
footer.site-foot ul { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
footer.site-foot li { margin-bottom: 6px; }
footer.site-foot a { color: rgba(255,255,255,0.85); }
footer.site-foot a:hover { color: var(--jaune-soleil); }
footer.site-foot .credit { font-size: 12px; opacity: 0.7; margin-top: 8px; line-height: 1.5; }
footer.site-foot .bottom { max-width: 1280px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 12px; opacity: 0.7; text-align: center; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 999; padding: 8px 14px; background: var(--bleu-profond); color: white; border-radius: 0 0 8px 0; font-size: 14px; font-weight: 600; }
.skip-link:focus { left: 0; }

/* ==========================================================================
   STRUCTURES DES EN-TÊTES DE PAGES GLOBAUX (page-header, breadcrumb, etc.)
   ========================================================================== */
.page-header {
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--bleu-profond) 0%, #002a5c 100%);
  color: #ffffff !important;
  text-align: left;
  margin-bottom: 32px;
  border-radius: 12px;
  box-shadow: var(--shadow-premium);
}

.page-header h1 {
  margin: 8px 0 6px 0 !important;
  font-size: 32px !important;
  font-weight: 850 !important;
  color: #ffffff !important;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-header .subtitle {
  margin: 0 !important;
  font-size: 16px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 400;
  line-height: 1.4;
}

/* ==========================================================================
   FIL D'ARIANE ADAPTATIF UNIQUE 
   ========================================================================== */
.breadcrumb {
  font-size: 13px !important;
  font-weight: 600;
  color: #475569 !important;
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--bleu-profond, #003e7e) !important; text-decoration: none; transition: color 0.15s ease; }
.breadcrumb a:hover { color: var(--orange-soleil, #f77f00) !important; text-decoration: underline; }
.breadcrumb span { color: #64748b !important; }
.page-header .breadcrumb { color: rgba(255, 255, 255, 0.8) !important; }
.page-header .breadcrumb a { color: #ffffff !important; }
.page-header .breadcrumb a:hover { color: var(--orange-soleil) !important; }

main.site-main > header { margin-bottom: 32px; border-bottom: 1px solid var(--line-soft); padding-bottom: 20px; }
main.site-main > header h1 { font-size: 32px !important; margin-top: 0; margin-bottom: 14px !important; color: var(--bleu-profond); font-weight: 800; line-height: 1.2; }

/* ==========================================================================
   UTILITIES & PACK DE STYLE PREMIUM — BOUTON-ANCRE NOULÉKAP (INDEX)
   ========================================================================== */
.capitalize-first::first-letter { text-transform: uppercase !important; }
.text-justify { text-align: justify; text-justify: inter-word; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }

.brand { display: inline-flex; align-items: center; text-decoration: none !important; }
.logo-wrapper { width: 140px; height: 40px; display: flex; align-items: center; position: relative; }
.logo-svg-bg { width: 100%; height: 100%; background-image: url('/assets/img/logo-orient-a-nou.svg'); background-repeat: no-repeat; background-position: center center; background-size: contain; }

.top-actions-pwa { display: inline-flex !important; align-items: center !important; gap: 10px !important; }

.app-brand-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  height: 38px !important; 
  padding: 0 16px !important;
  box-sizing: border-box !important;
  background: var(--bleu-profond) !important;
  color: white !important;
  border: 1px solid var(--bleu-profond) !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.2s ease-in-out !important;
}
.app-brand-badge:hover { background: #025a87 !important; border-color: #025a87 !important; color: white !important; box-shadow: 0 4px 12px rgba(3, 105, 161, 0.25) !important; transform: translateY(-1px) !important; }
.app-brand-badge:active { transform: translateY(0) !important; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important; }

/* ==========================================================================
   📱 SYSTEM MEDIA QUERIES : RESPONSIVE INTERMÉDIAIRE & BASES
   ========================================================================== */
@media (max-width: 860px) {
  nav.site-nav .nav-toggle { display: flex; }
  nav.site-nav .nav-wrap { display: none; flex-direction: column; padding: 8px 0 12px; }
  nav.site-nav.open .nav-wrap { display: flex; }
  nav.site-nav a { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
  nav.site-nav a.active { border-left: 3px solid var(--orange-soleil); border-bottom-color: var(--line-soft); padding-left: 15px; }
}

@media (max-width: 720px) { 
  footer.site-foot .wrap { grid-template-columns: 1fr; } 
}

/* 🔒 SÉCURITÉ RESPONSIVE GLOBALE (SMARTPHONES STANDARD) */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        overflow-x: hidden; 
        position: relative;
        -webkit-text-size-adjust: 100%; 
    }

    /* 🎯 FIX SPÉCIFICITÉ DURCI : Aligne l'ensemble des conteneurs métiers pour la PWA */
    .container, main.site-main, section.section, .wrap {
        padding-left: var(--global-padding, 16px) !important;
        padding-right: var(--global-padding, 16px) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    section.section {
        padding-top: var(--section-spacing, 24px) !important;
        padding-bottom: var(--section-spacing, 24px) !important;
    }
}

@media (max-width: 576px) {
  .page-header { padding: 24px var(--global-padding, 16px); }
  .page-header h1 { font-size: 24px !important; }
  footer.site-foot .bottom { padding-bottom: 44px !important; display: flex; flex-direction: column; gap: 8px; align-items: center; }
}