/* ==========================================================================
   RANDONNEES PEDESTRES DU BUECH - FEUILLE DE STYLE OFFICIELLE (LOI 1901)
   Architecture CSS Moderne, Fluide et Accessible - Aucune dépendance externe
   Palette : Marine (#0E2335), Sarcelle (#00A3E0), Corail (#E54838), Écru (#F4F6F8)
   ========================================================================== */

:root {
  --navy: #0E2335;
  --navy-dark: #071520;
  --navy-light: #163753;
  --teal: #00A3E0;
  --teal-dark: #0084B5;
  --coral: #E54838;
  --coral-hover: #C9392B;
  --canvas: #F4F6F8;
  --white: #FFFFFF;
  --slate: #1A1A1A;
  --slate-muted: #4A5568;
  --slate-light: #718096;
  --border-color: #E2E8F0;
  --border-light: #EDF2F7;
  --shadow-sm: 0 1px 3px rgba(14, 35, 53, 0.08);
  --shadow-md: 0 4px 12px rgba(14, 35, 53, 0.08);
  --shadow-lg: 0 10px 25px rgba(14, 35, 53, 0.12);
  --radius-card: 2px;
  --radius-pill: 9999px;
  --transition: all 0.25s ease-in-out;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Open Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.0625rem; /* ~17px */
  line-height: 1.65;
  color: var(--slate);
  background-color: var(--canvas);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TYPOGRAPHIE INSTITUTIONNELLE
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', 'Oswald', Arial, sans-serif;
  text-transform: uppercase;
  font-weight: 800;
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: 0.02em;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.85rem; }
h3 { font-size: 1.45rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.2rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--slate);
  max-width: 80ch;
}

p.lead {
  font-size: 1.25rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--navy);
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ==========================================================================
   STRUCTURES ET CONTENEURS
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding: 64px 0;
}

.section-alt {
  background-color: var(--white);
}

.section-dark {
  background-color: var(--navy);
  color: var(--white);
}

.section-dark h1, .section-dark h2, .section-dark h3, .section-dark p {
  color: var(--white);
}

/* ==========================================================================
   BANDEAU ADMINISTRATIF SUPÉRIEUR (UTILITY STRIP)
   ========================================================================== */

.top-utility-strip {
  background-color: var(--navy);
  color: var(--white);
  font-size: 0.8125rem;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.top-utility-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.top-utility-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.top-utility-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.top-utility-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-utility-right a {
  color: #CBD5E1;
  text-decoration: none;
  font-size: 0.8125rem;
}

.top-utility-right a:hover {
  color: var(--white);
  text-decoration: underline;
}

.btn-donate-strip {
  background-color: var(--coral);
  color: var(--white) !important;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: var(--transition);
  min-height: 32px;
}

.btn-donate-strip:hover {
  background-color: var(--coral-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   BARRE DE NAVIGATION PRINCIPALE & MENUS DÉROULANTS
   ========================================================================== */

.main-navbar {
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid var(--border-color);
}

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
}

.navbar-brand {
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
}

.brand-title {
  font-family: 'Montserrat', 'Oswald', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  color: var(--navy);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none !important;
  border-radius: 2px;
  min-height: 44px;
  min-width: 44px;
  transition: var(--transition);
}

.nav-link:hover, .nav-item:hover > .nav-link {
  color: var(--teal);
  background-color: var(--canvas);
}

.nav-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}

.nav-item:hover .nav-arrow {
  transform: translateY(2px);
}

/* Menus déroulants */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background-color: var(--white);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--teal);
  border-radius: 0 0 2px 2px;
  list-style: none;
  padding: 8px 0;
  display: none;
  z-index: 1001;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  display: block;
}

.dropdown-item a {
  display: block;
  padding: 10px 18px;
  color: var(--slate);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.dropdown-item a:hover {
  background-color: var(--canvas);
  color: var(--teal);
  padding-left: 22px;
}

/* Bouton mobile hamburger */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--navy);
  font-size: 1.25rem;
  padding: 8px 12px;
  border-radius: 2px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   COMPOSANTS ET BOUTONS D'ACTION (CTA)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9375rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none !important;
  transition: var(--transition);
  min-height: 44px;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--teal);
  color: var(--white) !important;
}

.btn-primary:hover {
  background-color: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-coral {
  background-color: var(--coral);
  color: var(--white) !important;
}

.btn-coral:hover {
  background-color: var(--coral-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--navy);
  color: var(--navy) !important;
}

.btn-outline:hover {
  background-color: var(--navy);
  color: var(--white) !important;
}

.btn-outline-white {
  background-color: transparent;
  border-color: var(--white);
  color: var(--white) !important;
}

.btn-outline-white:hover {
  background-color: var(--white);
  color: var(--navy) !important;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

/* ==========================================================================
   CARTES INSTITUTIONNELLES ET BLOCS
   ========================================================================== */

.card {
  background-color: var(--white);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--teal);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.card.card-coral {
  border-top-color: var(--coral);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.card-image-wrap {
  margin: -28px -28px 20px -28px;
  overflow: hidden;
  height: 200px;
  background-color: var(--canvas);
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-image-wrap img {
  transform: scale(1.04);
}

.card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 2px;
  background-color: var(--canvas);
  color: var(--teal-dark);
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--navy);
}

.card-text {
  font-size: 0.95rem;
  color: var(--slate-muted);
  flex-grow: 1;
  margin-bottom: 16px;
}

/* ==========================================================================
   GRILLES CSS FLUIDES SANS FRAMEWORK
   ========================================================================== */

.grid {
  display: grid;
  gap: 28px;
}

.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-5 {
  grid-template-columns: repeat(5, 1fr);
}

/* Split grids */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.split-grid.split-60-40 {
  grid-template-columns: 3fr 2fr;
}

.split-grid.split-40-60 {
  grid-template-columns: 2fr 3fr;
}

/* ==========================================================================
   SECTION HÉRO (PAGE ACCUEIL ET PAGES INTÉRIEURES)
   ========================================================================== */

.hero-banner {
  position: relative;
  min-height: 480px;
  background-color: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  filter: saturate(1.1);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 64px 0;
  max-width: 820px;
}

.hero-title {
  color: var(--white);
  font-size: 2.75rem;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.hero-summary-box {
  background: rgba(14, 35, 53, 0.85);
  border-left: 4px solid var(--teal);
  padding: 18px 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(4px);
  border-radius: 0 2px 2px 0;
}

.hero-summary-text {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #F8FAFC;
  margin-bottom: 0;
}

/* Bannière intérieure de page */
.page-header {
  background-color: var(--navy);
  color: var(--white);
  padding: 56px 0;
  position: relative;
  border-bottom: 4px solid var(--teal);
}

.page-header h1 {
  color: var(--white);
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: #CBD5E1;
  font-size: 1.15rem;
  max-width: 800px;
  margin-bottom: 0;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--teal);
  margin-bottom: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.breadcrumbs a {
  color: #94A3B8;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--white);
}

/* ==========================================================================
   BANDEAU INSTITUTIONNEL SARCELLE & CALLOUTS D'ENGAGEMENT
   ========================================================================== */

.teal-intake-banner {
  background-color: var(--teal);
  color: var(--white);
  padding: 44px 0;
}

.teal-intake-banner h2, .teal-intake-banner p {
  color: var(--white);
}

.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.inline-form input {
  flex: 1 1 240px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  font-size: 1rem;
  background-color: var(--white);
  color: var(--slate);
  min-height: 44px;
}

/* Encadré d'engagement institutionnel */
.commitment-block {
  background-color: var(--white);
  border-left: 6px solid var(--navy);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin: 36px 0;
  border-radius: 0 2px 2px 0;
}

.commitment-block h3 {
  color: var(--navy);
  margin-bottom: 12px;
}

.commitment-block p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--slate);
  margin-bottom: 0;
}

/* Citation statutaire obligatoire */
.statutory-quote {
  background-color: #EBF8FF;
  border: 1px solid #BEE3F8;
  border-left: 4px solid var(--teal);
  padding: 20px 24px;
  margin: 28px 0;
  border-radius: 2px;
  font-style: italic;
  font-weight: 600;
  color: var(--navy);
}

/* ==========================================================================
   MODULES SPÉCIFIQUES (CIRCULAIRES, TABLEAUX, FORMULAIRES)
   ========================================================================== */

/* Section des 5 piliers circulaires */
.circular-pillar {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.circular-icon-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background-color: var(--white);
  border: 3px solid var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.circular-pillar:hover .circular-icon-wrap {
  background-color: var(--teal);
  color: var(--white);
  transform: scale(1.08);
}

.circular-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--navy);
}

.circular-text {
  font-size: 0.875rem;
  color: var(--slate-muted);
}

/* Badges de statut */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-active {
  background-color: #DEF7EC;
  color: #03543F;
  border: 1px solid #84E1BC;
}

.status-neutral {
  background-color: #E2E8F0;
  color: #334155;
}

/* Tableaux de données institutionnelles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  background-color: var(--white);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

table.data-table th {
  background-color: var(--navy);
  color: var(--white);
  padding: 14px 18px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

table.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--slate);
}

table.data-table tr:nth-child(even) {
  background-color: var(--canvas);
}

table.data-table tr:hover {
  background-color: #EBF8FF;
}

/* Formulaires structurés */
.form-card {
  background-color: var(--white);
  padding: 36px;
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--teal);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--navy);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--slate);
  background-color: var(--white);
  min-height: 44px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.2);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* ==========================================================================
   PIED DE PAGE MAÎTRE (FOOTER)
   ========================================================================== */

.master-footer {
  background-color: var(--navy);
  color: var(--white);
  margin-top: auto;
  border-top: 4px solid var(--teal);
}

.footer-main {
  padding: 64px 0 44px 0;
}

.footer-col h4 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background-color: var(--teal);
}

.footer-col p {
  color: #CBD5E1;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #CBD5E1;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--teal);
  padding-left: 6px;
}

/* Module Newsletter Footer */
.footer-newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.footer-newsletter-form input {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-radius: 2px;
  font-size: 0.875rem;
  min-height: 44px;
}

.footer-newsletter-form input::placeholder {
  color: #94A3B8;
}

.footer-newsletter-form input:focus {
  outline: none;
  border-color: var(--teal);
  background: rgba(255, 255, 255, 0.15);
}

/* Bandeau légal inférieur obligatoire */
.footer-legal-strip {
  background-color: var(--navy-dark);
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #94A3B8;
}

.footer-legal-notice {
  text-align: center;
  max-width: 1080px;
  margin: 0 auto;
}

.footer-legal-notice strong {
  color: #E2E8F0;
}

/* ==========================================================================
   RESPONSIVITÉ ET ADAPTATION MOBILE
   ========================================================================== */

@media (max-width: 992px) {
  .nav-menu {
    gap: 2px;
  }
  
  .nav-link {
    padding: 10px 10px;
    font-size: 0.8125rem;
  }
  
  .grid-4, .grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .split-grid, .split-grid.split-60-40, .split-grid.split-40-60 {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  /* Effondrement obligatoire de toutes les grilles multi-colonnes */
  .grid, .grid-2, .grid-3, .grid-4, .grid-5, .split-grid, .split-grid.split-60-40, .split-grid.split-40-60 {
    grid-template-columns: 1fr !important;
  }

  .top-utility-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .top-utility-right {
    width: 100%;
    justify-content: space-between;
    margin-top: 6px;
  }

  /* Navigation mobile pliable */
  .mobile-nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--white);
    flex-direction: column;
    align-items: stretch;
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 12px 0;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-light);
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background-color: var(--canvas);
    padding: 0;
    border-left: 4px solid var(--teal);
    display: none;
  }

  .nav-item.mobile-open .dropdown-menu {
    display: block;
  }

  .hero-title {
    font-size: 2rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.65rem; }
  h3 { font-size: 1.3rem; }

  .btn-group {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}
