/* ==========================================================================
   PORTAIL INSTITUTIONNEL C.I.M.E.S. - ASSOCIATION LOI 1901
   Direction Artistique & Système de Design Responsive
   Couleurs Principales : Bordeaux (#800000 / #7A0016), Bleu Marine (#0B2545),
   Gris Neutre (#F9F8F6), Charbon (#222222)
   ========================================================================== */

:root {
  --maroon-primary: #800000;
  --maroon-dark: #7a0016;
  --navy-accent: #0b2545;
  --text-dark: #222222;
  --text-muted: #555555;
  --bg-white: #ffffff;
  --bg-light: #f9f8f6;
  --bg-charcoal: #222222;
  --bg-charcoal-dark: #1a1a1a;
  --border-subtle: #e5e0d8;
  --border-maroon: #800000;
  --font-serif: "Georgia", "Garamond", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background-color: var(--bg-white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--navy-accent);
  line-height: 1.3;
  margin-bottom: 1rem;
  font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.2rem; }

p {
  margin-bottom: 1.25rem;
  color: #333333;
}

a {
  color: var(--maroon-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover, a:focus {
  color: var(--maroon-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Utilitaires Boutons (Min 44x44px pour conformité tactile) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-maroon {
  background-color: var(--maroon-primary);
  color: #ffffff !important;
}

.btn-maroon:hover {
  background-color: var(--maroon-dark);
  color: #ffffff !important;
}

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

.btn-outline:hover {
  background-color: var(--maroon-primary);
  color: #ffffff !important;
}

.btn-navy {
  background-color: var(--navy-accent);
  color: #ffffff !important;
}

.btn-navy:hover {
  background-color: #06162a;
}

/* ==========================================================================
   EN-TÊTE MULTI-NIVEAUX ACADÉMIQUE / INSTITUTIONNEL
   ========================================================================== */

/* Barre Utilitaires Supérieure */
.top-utility-bar {
  background-color: #f4f4f4;
  height: 36px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.8rem;
  color: #555555;
}

.top-utility-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.utility-left, .utility-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.utility-left a, .utility-right a {
  color: #555555;
  text-decoration: none;
  font-size: 0.8rem;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.utility-left a:hover, .utility-right a:hover {
  color: var(--maroon-primary);
}

.rna-badge {
  background-color: #e8e8e8;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
  font-family: monospace;
  color: var(--navy-accent);
}

.utility-search-box input[type="search"] {
  height: 26px;
  padding: 2px 8px;
  font-size: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  outline: none;
}

/* En-tête de Marque Central */
.branding-header {
  background-color: #ffffff;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
}

.branding-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none !important;
}

.emblem-svg {
  width: 52px;
  height: 52px;
  margin-bottom: 0.5rem;
  fill: var(--maroon-primary);
}

.brand-acronym {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 800;
  color: var(--maroon-primary);
  letter-spacing: 2px;
  line-height: 1.1;
}

.brand-fullname {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--navy-accent);
  margin-top: 0.25rem;
  font-weight: 600;
}

.brand-tagline {
  font-size: 0.85rem;
  color: #666666;
  margin-top: 0.2rem;
  font-style: italic;
}

/* Barre de Navigation Principale */
.main-nav-bar {
  background-color: var(--maroon-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.nav-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  padding: 0.5rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

.primary-menu {
  list-style: none;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  width: 100%;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  min-width: 44px;
  padding: 0 1.25rem;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none !important;
  transition: background-color 0.2s ease;
}

.nav-link:hover, .nav-link:focus, .nav-item.active .nav-link {
  background-color: var(--maroon-dark);
}

/* Tier 2 Sous-menu Mega-Dropdown */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ffffff;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  border-top: 3px solid var(--maroon-primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 1001;
  padding: 0.5rem 0;
  list-style: none;
}

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

.dropdown-menu li a {
  display: block;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  color: var(--text-dark) !important;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-menu li:last-child a {
  border-bottom: none;
}

.dropdown-menu li a:hover {
  background-color: var(--bg-light);
  color: var(--maroon-primary) !important;
  padding-left: 1.5rem;
}

/* Barre de Fil d'Ariane / Sous-Bannière Contextuelle */
.context-breadcrumb {
  background-color: #f1ede8;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #e0dbd3;
}

.breadcrumb-list {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumb-list li::after {
  content: "›";
  margin-left: 0.5rem;
  color: #888;
}

.breadcrumb-list li:last-child::after {
  content: "";
}

.breadcrumb-list a {
  color: var(--navy-accent);
}

/* ==========================================================================
   MODULES DE PAGE & COMPOSANTS UI
   ========================================================================== */

/* Bandeau Hero */
.hero-section {
  position: relative;
  background-color: var(--navy-accent);
  color: #ffffff;
  padding: 3.5rem 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-content h1 {
  color: #ffffff;
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.hero-slogan {
  font-size: 1.25rem;
  font-style: italic;
  color: #f4c28b;
  margin-bottom: 1.25rem;
}

.hero-summary-box {
  background-color: rgba(255, 255, 255, 0.12);
  border-left: 4px solid #f4c28b;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 3px solid rgba(255, 255, 255, 0.15);
}

/* Bandeau Pleine Largeur Marron */
.maroon-strip {
  background-color: var(--maroon-primary);
  color: #ffffff;
  padding: 2.5rem 0;
}

.maroon-strip h2, .maroon-strip h3 {
  color: #ffffff;
}

.maroon-strip p {
  color: #fce8e8;
}

/* Blocs & Sections Standards */
.section-standard {
  padding: 4rem 0;
}

.bg-neutral {
  background-color: var(--bg-light);
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem auto;
}

.section-header .section-tag {
  color: var(--maroon-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Bloc "Notre mission" Statutaire */
.mission-callout-block {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-left: 6px solid var(--maroon-primary);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
  margin: 2.5rem 0;
}

.mission-callout-block h3 {
  color: var(--maroon-primary);
  margin-bottom: 1rem;
}

.mission-continuous-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2b2b2b;
}

/* Cartes d'Aperçu Activités (4 colonnes) */
.cards-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.activity-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.activity-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.activity-card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.activity-card-summary {
  font-size: 0.9rem;
  color: #444444;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 1rem;
}

/* Panneaux Récit / Média Alternés (Split Panels) */
.split-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3.5rem;
}

.split-panel.reverse {
  direction: rtl;
}

.split-panel.reverse > * {
  direction: ltr;
}

.split-media img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.split-narrative h3 {
  font-size: 1.65rem;
  margin-bottom: 1rem;
}

/* Grille Événements (4 colonnes) avec Badges Date */
.events-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.event-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.event-date-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background-color: var(--maroon-primary);
  color: #ffffff;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 700;
  text-align: center;
  line-height: 1;
}

.event-date-badge .event-day {
  font-size: 1.4rem;
}

.event-date-badge .event-month {
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-top: 2px;
}

.event-title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.event-location {
  font-size: 0.85rem;
  color: #666666;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.event-desc {
  font-size: 0.9rem;
  color: #444444;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

/* Chiffres Clés (Key Statistics Panel) */
.stats-banner {
  background: linear-gradient(135deg, var(--navy-accent) 0%, #153966 100%);
  color: #ffffff;
  padding: 3rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item .stat-number {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  color: #f4c28b;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-item .stat-label {
  font-size: 0.95rem;
  color: #e0e0e0;
  font-weight: 500;
}

/* Badges Statut d'Action */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  background-color: #d1e7dd;
  color: #0f5132;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 3px;
  margin-bottom: 0.75rem;
}

/* Tables Financières Complètes */
.table-responsive {
  overflow-x: auto;
  margin: 1.5rem 0 2.5rem 0;
}

.finance-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  font-size: 0.95rem;
}

.finance-table th, .finance-table td {
  padding: 0.9rem 1.2rem;
  border: 1px solid #e0dbd3;
  text-align: left;
}

.finance-table th {
  background-color: var(--navy-accent);
  color: #ffffff;
  font-family: var(--font-serif);
  font-weight: 600;
}

.finance-table tr:nth-child(even) {
  background-color: #f9f8f6;
}

.finance-table tfoot tr {
  font-weight: 700;
  background-color: #e9e4dc;
}

/* Formulaires Stylisés */
.styled-form {
  background-color: #ffffff;
  padding: 2.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--navy-accent);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1px solid #cccccc;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--maroon-primary);
  box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.15);
}

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

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

.faq-item {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.faq-item h4 {
  color: var(--navy-accent);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   PIED DE PAGE INSTITUTIONNEL (DARK CHARCOAL #222222)
   ========================================================================== */

.site-footer {
  background-color: var(--bg-charcoal);
  color: #dddddd;
  padding: 4rem 0 2rem 0;
  font-size: 0.9rem;
  border-top: 4px solid var(--maroon-primary);
}

.footer-top {
  text-align: center;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #3a3a3a;
  margin-bottom: 2.5rem;
}

.footer-shield-svg {
  width: 48px;
  height: 48px;
  fill: #ffffff;
  margin-bottom: 0.75rem;
}

.footer-org-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 1px;
}

.footer-org-subtitle {
  font-size: 0.85rem;
  color: #aaaaaa;
  margin-top: 0.25rem;
}

.footer-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid var(--maroon-primary);
  display: inline-block;
  padding-bottom: 0.35rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: #bbbbbb;
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-block;
  min-height: 24px;
}

.footer-links a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-legal-block {
  background-color: var(--bg-charcoal-dark);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid #333333;
  margin-bottom: 2rem;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #aaaaaa;
}

.footer-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid #333333;
  font-size: 0.8rem;
  color: #888888;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-bottom-nav a {
  color: #aaaaaa;
}

.footer-bottom-nav a:hover {
  color: #ffffff;
}

/* ==========================================================================
   BREAKPOINTS RESPONSIVES (Strict Mobile Standards)
   ========================================================================== */

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .cards-grid-4, .events-grid-4, .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .split-panel, .split-panel.reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .split-panel.reverse > * {
    direction: ltr;
  }
  
  .footer-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .top-utility-bar {
    height: auto;
    padding: 0.4rem 0;
  }
  
  .top-utility-bar .container {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .utility-left, .utility-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .nav-toggle-btn {
    display: block;
  }
  
  .primary-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background-color: var(--maroon-primary);
    padding: 1rem 0;
    border-top: 1px solid var(--maroon-dark);
  }
  
  .primary-menu.is-open {
    display: flex;
  }
  
  .nav-item {
    width: 100%;
  }
  
  .nav-link {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .dropdown-menu {
    position: static;
    display: block;
    background-color: #5c0000;
    box-shadow: none;
    border-top: none;
    padding: 0;
  }
  
  .dropdown-menu li a {
    color: #f1ede8 !important;
    padding-left: 2.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .cards-grid-4, .events-grid-4, .stats-grid, .footer-grid-4 {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-bottom-nav {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .styled-form {
    padding: 1.5rem;
  }
  
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.5rem; }
}
