/* ==========================================================================
   PORTAIL INSTITUTIONNEL - LOI 1901
   ASSOCIATION DES AMIS DE SAINT-PIERRE DE BROUSSON (BÉDARIEUX)
   Direction Artistique : Royal Blue (#002366), Deep Gold (#FFD700), Dark Slate (#1A202C)
   Performance & Accessibilité : Pure CSS Fluid Grid / Flexbox - Sans Dépendance Externe
   ========================================================================== */

:root {
  --royal-blue: #002366;
  --royal-blue-hover: #001744;
  --royal-blue-light: #eef3fb;
  --deep-gold: #FFD700;
  --gold-dark: #b89600;
  --gold-subtle: #fff9db;
  --canvas-white: #ffffff;
  --bg-slate-50: #f8fafc;
  --bg-strip: #F4F6F9;
  --text-main: #1e293b;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  --footer-dark: #1A202C;
  --footer-border: #2d3748;
  --font-serif: "Georgia", "Cambria", "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 35, 102, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 35, 102, 0.08);
  --shadow-lg: 0 10px 24px rgba(0, 35, 102, 0.12);
  --transition: all 0.2s ease-in-out;
}

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

html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  color: var(--text-main);
  background-color: var(--canvas-white);
  font-family: var(--font-sans);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--canvas-white);
}

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

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

a:hover {
  color: var(--gold-dark);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--royal-blue);
  font-family: var(--font-serif);
  line-height: 1.25;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-main);
}

.lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   HEADER SYSTEM (Row 1 & Row 2)
   ========================================================================== */

.top-utility-strip {
  background-color: var(--bg-strip);
  color: #333333;
  height: 42px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-utility-strip .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.rna-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--royal-blue);
}

.rna-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
}

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

.search-box-sim {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  height: 28px;
}

.search-box-sim input {
  border: none;
  background: transparent;
  font-size: 0.75rem;
  color: #333333;
  outline: none;
  width: 160px;
}

.search-box-sim button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--royal-blue);
  font-size: 0.75rem;
  padding: 0 2px;
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.75rem;
}

.lang-selector span.active {
  color: var(--royal-blue);
  border-bottom: 2px solid var(--deep-gold);
}

/* Main Navigation Bar */
.main-nav-bar {
  background-color: var(--canvas-white);
  border-bottom: 2px solid var(--royal-blue-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-nav-bar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.brand-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--royal-blue);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Nav Menu & Mega Menu */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  height: 100%;
}

.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--royal-blue);
  border-bottom: 3px solid transparent;
  min-height: 44px;
}

.nav-link:hover,
.nav-item:hover > .nav-link {
  color: var(--gold-dark);
  border-bottom-color: var(--deep-gold);
}

/* Mega Menu Dropdown */
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 440px;
  background-color: var(--canvas-white);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--royal-blue);
  box-shadow: var(--shadow-lg);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 200;
  padding: 16px;
}

.nav-item:hover .mega-dropdown,
.nav-item:focus-within .mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.dropdown-link {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid transparent;
  min-height: 44px;
  justify-content: center;
}

.dropdown-link:hover {
  background-color: var(--royal-blue-light);
  border-color: #cbd5e1;
}

.dropdown-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--royal-blue);
}

.dropdown-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Header Contact CTA Button */
.btn-header-contact {
  background-color: var(--royal-blue);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.875rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 2px solid var(--royal-blue);
}

.btn-header-contact:hover {
  background-color: var(--deep-gold);
  color: var(--royal-blue);
  border-color: var(--deep-gold);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--royal-blue);
}

/* ==========================================================================
   BUTTONS & CTAS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--royal-blue);
  color: #ffffff;
  border-color: var(--royal-blue);
}

.btn-primary:hover {
  background-color: var(--royal-blue-hover);
  border-color: var(--royal-blue-hover);
  color: #ffffff;
}

.btn-gold {
  background-color: var(--deep-gold);
  color: var(--royal-blue);
  border-color: var(--deep-gold);
}

.btn-gold:hover {
  background-color: #e6c200;
  border-color: #e6c200;
  color: var(--royal-blue);
}

.btn-outline {
  background-color: transparent;
  color: var(--royal-blue);
  border-color: var(--royal-blue);
}

.btn-outline:hover {
  background-color: var(--royal-blue-light);
  color: var(--royal-blue-hover);
}

/* ==========================================================================
   HERO BANNER & TRANSPARENCY NOTICE
   ========================================================================== */

.hero-banner-section {
  position: relative;
  background-color: var(--royal-blue);
  color: #ffffff;
  overflow: hidden;
}

.hero-banner-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
}

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

.hero-tag {
  display: inline-block;
  background-color: var(--deep-gold);
  color: var(--royal-blue);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 2.75rem;
  color: #ffffff;
  line-height: 1.18;
  margin-bottom: 16px;
}

.hero-summary-statement {
  background: rgba(0, 23, 68, 0.75);
  border-left: 4px solid var(--deep-gold);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 1.125rem;
  line-height: 1.65;
  color: #ffffff;
  margin-bottom: 24px;
}

.hero-reinvestment-callout {
  font-size: 0.875rem;
  color: #e2e8f0;
  font-style: italic;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Transparent Funding Banner */
.funding-statement-bar {
  background-color: var(--gold-subtle);
  border-top: 1px solid #fef08a;
  border-bottom: 1px solid #fef08a;
  padding: 14px 20px;
  font-size: 0.875rem;
  color: #854d0e;
}

.funding-statement-bar .inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.funding-statement-bar strong {
  color: #713f12;
}

/* ==========================================================================
   MAIN TWO-COLUMN INSTITUTIONAL LAYOUT
   ========================================================================== */

.site-main {
  flex: 1;
  padding: 48px 0;
}

.layout-two-column {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 36px;
  align-items: start;
}

.content-column {
  min-width: 0;
}

.side-rail-column {
  min-width: 0;
}

/* Side Rail Card (Chiffres Clés) */
.side-card {
  background-color: var(--bg-slate-50);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--royal-blue);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.side-card-title {
  font-size: 1.15rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chiffre-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.chiffre-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.chiffre-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--royal-blue);
  line-height: 1;
  font-family: var(--font-serif);
}

.chiffre-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin-fact-list {
  list-style: none;
}

.admin-fact-list li {
  font-size: 0.8125rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.admin-fact-list li:last-child {
  border-bottom: none;
}

.admin-fact-list .fact-label {
  font-weight: 700;
  color: var(--royal-blue);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.admin-fact-list .fact-val {
  color: var(--text-main);
  margin-top: 2px;
}

/* ==========================================================================
   SECTIONS, CARDS & GRIDS
   ========================================================================== */

.section-block {
  margin-bottom: 48px;
}

.section-header {
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  position: relative;
  margin-bottom: 0;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--deep-gold);
}

/* Operational Catalog Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.catalog-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.catalog-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-subtle);
}

.card-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #001744;
  overflow: hidden;
}

.card-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.catalog-card:hover .card-img-box img {
  transform: scale(1.03);
}

.status-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: var(--royal-blue);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.status-tag.active {
  background-color: #047857;
}

.status-tag.gold {
  background-color: #b45309;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

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

.card-footer-action {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* Roadmap Onboarding Steps */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.roadmap-card {
  background: var(--bg-slate-50);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--royal-blue);
  color: var(--deep-gold);
  border-radius: 50%;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 12px;
}

.roadmap-card h4 {
  margin-bottom: 8px;
}

.roadmap-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Callout Box */
.institutional-callout {
  background-color: var(--royal-blue-light);
  border-left: 4px solid var(--royal-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 24px;
  margin: 28px 0;
}

.institutional-callout h3 {
  color: var(--royal-blue);
  margin-bottom: 8px;
}

.institutional-callout p:last-child {
  margin-bottom: 0;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
}

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

.institution-table th {
  background-color: var(--royal-blue);
  color: #ffffff;
  padding: 12px 16px;
  font-weight: 700;
  border-top: none;
}

.institution-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.institution-table tr:nth-child(even) td {
  background-color: var(--bg-slate-50);
}

.institution-table tr:hover td {
  background-color: var(--royal-blue-light);
}

.text-right {
  text-align: right;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-group.full {
  grid-column: span 2;
}

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  transition: var(--transition);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--royal-blue);
  box-shadow: 0 0 0 3px rgba(0, 35, 102, 0.15);
}

/* FAQ Accordion */
.faq-block {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  background: var(--bg-slate-50);
  padding: 16px 20px;
  font-weight: 700;
  color: var(--royal-blue);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.faq-answer {
  padding: 18px 20px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  font-size: 0.9375rem;
}

/* ==========================================================================
   FOOTER ARCHITECTURE (4 COLUMNS & BASE LEGAL TEXT)
   ========================================================================== */

.site-footer {
  background-color: var(--footer-dark);
  color: #e2e8f0;
  padding: 56px 0 24px 0;
  border-top: 4px solid var(--deep-gold);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--deep-gold);
  font-size: 1.05rem;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
  font-weight: 700;
}

.footer-identity-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.footer-admin-badges {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.5;
}

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

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

.footer-links a {
  color: #cbd5e1;
  font-size: 0.875rem;
  display: inline-block;
  min-height: 24px;
}

.footer-links a:hover {
  color: var(--deep-gold);
  padding-left: 4px;
}

.footer-contact-item {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 8px;
  word-break: break-word;
}

.footer-legal-base {
  border-top: 1px solid var(--footer-border);
  padding-top: 24px;
  font-size: 0.75rem;
  line-height: 1.65;
  color: #94a3b8;
  text-align: justify;
}

/* ==========================================================================
   MOBILE-RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 992px) {
  .layout-two-column {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .roadmap-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

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

  .mega-dropdown {
    width: 320px;
  }
}

@media (max-width: 768px) {
  .top-utility-strip {
    height: auto;
    padding: 8px 16px;
  }

  .top-utility-strip .inner {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .search-box-sim {
    width: 100%;
  }

  .search-box-sim input {
    width: 100%;
  }

  .main-nav-bar .inner {
    height: 70px;
    padding: 0 16px;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--canvas-white);
    flex-direction: column;
    height: auto;
    border-top: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: 16px 0;
    z-index: 300;
  }

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

  .nav-item {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    height: auto;
  }

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

  .mega-dropdown {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--royal-blue);
    padding: 8px 16px 12px 24px;
    background-color: var(--bg-slate-50);
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }

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

  .btn-header-contact {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full {
    grid-column: span 1;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .hero-content-wrapper {
    padding: 40px 0 32px 0;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }
}
