/* ==========================================================================
   LES AMIS DE MICHEL SIMA - PORTAIL D'UTILITÉ PUBLIQUE (LOI 1901)
   DESIGN SYSTEM : THE REVOLUTIONARY ARCHIVE
   Palette :
   - Imperial Deep Slate   : #0F172A
   - Terracotta Rust       : #C2593F
   - Warm Paper Parchment  : #F8F5EE
   - Pure Alabaster White  : #FFFFFF
   - Muted Sandstone       : #E2D9CC
   - Deep Charcoal         : #1E293B
   ========================================================================== */

:root {
  --color-slate: #0F172A;
  --color-terracotta: #C2593F;
  --color-terracotta-dark: #A3452E;
  --color-parchment: #F8F5EE;
  --color-white: #FFFFFF;
  --color-sandstone: #E2D9CC;
  --color-sandstone-light: #F1ECE3;
  --color-charcoal: #1E293B;
  --color-charcoal-muted: #475569;
  --font-serif: "Cinzel", "Playfair Display", "Georgia", "Cambria", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Courier New", Courier, monospace;
  --header-height: 125px;
  --max-width: 1380px;
  --border-radius: 4px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--color-parchment);
  color: var(--color-charcoal);
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  background-color: var(--color-parchment);
  color: var(--color-charcoal);
  padding-top: var(--header-height);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Dynamic Vertical Reading Progress Tracker */
#reading-progress-bar {
  position: fixed;
  top: 0;
  right: 0;
  width: 5px;
  height: 0%;
  background: var(--color-terracotta);
  z-index: 100000;
  transition: height 0.1s ease-out;
}

/* ==========================================================================
   DOUBLE-DECKER STICKY HEADER
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 10000;
  background: var(--color-white);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

/* Level 1: Civic Ledger Utility Strip */
.header-utility-strip {
  background-color: var(--color-slate);
  color: #94A3B8;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  height: 40px;
  line-height: 40px;
  border-bottom: 1px solid rgba(226, 217, 204, 0.15);
}

.utility-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.utility-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

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

.utility-right a {
  color: #CBD5E1;
  text-decoration: none;
  transition: color 0.2s;
}

.utility-right a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Level 2: Split Navigation Bar */
.header-main-bar {
  height: 85px;
  background-color: var(--color-white);
  border-bottom: 2px solid var(--color-sandstone);
}

.main-bar-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-badge {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  text-decoration: none;
  padding: 10px 18px;
  display: inline-flex;
  flex-direction: column;
  border-radius: var(--border-radius);
  transition: background-color 0.2s ease;
}

.brand-badge:hover {
  background-color: var(--color-terracotta-dark);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-top: 2px;
}

/* Desktop Navigation Menu */
.main-nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-block;
  padding: 10px 14px;
  color: var(--color-slate);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-item.active > .nav-link {
  background-color: var(--color-sandstone-light);
  color: var(--color-terracotta);
}

.nav-link.nav-cta {
  background-color: var(--color-slate);
  color: var(--color-white);
  margin-left: 10px;
}

.nav-link.nav-cta:hover {
  background-color: var(--color-terracotta);
  color: var(--color-white);
}

/* Dropdown styling */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-white);
  min-width: 250px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  border: 1px solid var(--color-sandstone);
  border-top: 3px solid var(--color-terracotta);
  list-style: none;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 1000;
}

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

.nav-dropdown li a {
  display: block;
  padding: 10px 18px;
  color: var(--color-charcoal);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(226, 217, 204, 0.4);
  transition: all 0.15s ease;
}

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

.nav-dropdown li a:hover {
  background-color: var(--color-sandstone-light);
  color: var(--color-terracotta);
  padding-left: 22px;
}

/* Mobile Hamburger Toggle */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--color-slate);
  padding: 8px 12px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-slate);
  border-radius: var(--border-radius);
  min-width: 44px;
  min-height: 44px;
}

/* ==========================================================================
   PRIMARY STRUCTURAL CANVAS & ASYMMETRIC GRID
   ========================================================================== */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
  width: 100%;
  flex: 1;
}

.asymmetric-canvas {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 36px;
  align-items: start;
}

/* Left Column: Monospace Side-rail Logbook */
.side-rail-logbook {
  background: var(--color-white);
  border: 1px solid var(--color-sandstone);
  border-top: 4px solid var(--color-slate);
  border-radius: var(--border-radius);
  padding: 24px 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-charcoal);
  position: sticky;
  top: 145px;
}

.side-rail-header {
  border-bottom: 2px solid var(--color-sandstone);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.side-rail-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-slate);
  font-weight: 700;
}

.ledger-item {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--color-sandstone);
}

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

.ledger-label {
  color: var(--color-charcoal-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

.ledger-value {
  color: var(--color-slate);
  font-weight: 600;
}

.side-rail-quote {
  background: var(--color-sandstone-light);
  border-left: 3px solid var(--color-terracotta);
  padding: 14px;
  margin: 20px 0;
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-charcoal);
}

.side-rail-nav {
  margin-top: 20px;
  list-style: none;
}

.side-rail-nav li {
  margin-bottom: 8px;
}

.side-rail-nav a {
  color: var(--color-slate);
  text-decoration: none;
  display: block;
  padding: 6px 10px;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.side-rail-nav a:hover {
  background-color: var(--color-parchment);
  color: var(--color-terracotta);
}

/* Right Column: Primary Analytical Canvas */
.analytical-canvas {
  background: transparent;
  min-width: 0;
}

/* ==========================================================================
   TYPOGRAPHY & HEADINGS
   ========================================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-slate);
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.3rem;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid var(--color-sandstone);
  padding-bottom: 1rem;
}

h2 {
  font-size: 1.7rem;
  margin-top: 2.2rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-sandstone);
}

h3 {
  font-size: 1.3rem;
  margin-top: 1.6rem;
  margin-bottom: 0.7rem;
  color: var(--color-terracotta);
}

h4 {
  font-size: 1.1rem;
  margin-top: 1.2rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--color-charcoal);
  font-size: 1.05rem;
  line-height: 1.75;
}

strong {
  color: var(--color-slate);
}

/* Hero Section Component */
.hero-frame {
  background: var(--color-white);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 36px;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--color-slate);
  overflow: hidden;
}

.hero-image-wrapper img,
.content-card-image img,
.media-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-body {
  padding: 32px;
}

.hero-headline-summary {
  background-color: var(--color-sandstone-light);
  border-left: 4px solid var(--color-terracotta);
  padding: 18px 24px;
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--color-slate);
  font-weight: 500;
  margin-bottom: 24px;
}

/* Mandatory 'Notre Mission' Dedicated Frame */
.mission-callout-frame {
  background-color: var(--color-slate);
  color: #F8FAFC;
  border-radius: var(--border-radius);
  padding: 32px 36px;
  margin: 36px 0;
  position: relative;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.mission-callout-frame h2,
.mission-callout-frame h3 {
  color: #F8FAFC;
  border-bottom-color: rgba(226, 217, 204, 0.25);
  font-size: 1.5rem;
  margin-top: 0;
}

.mission-callout-frame p {
  color: #E2E8F0;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 0;
}

.mission-reinvestment-quote {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #CBD5E1;
  font-style: italic;
}

/* Content Cards & Analytical Grids */
.content-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 30px 0;
}

.content-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 30px 0;
}

.content-card {
  background: var(--color-white);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.content-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 18px;
  border: 1px solid var(--color-sandstone);
}

.content-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

.content-card p {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--color-charcoal-muted);
  flex: 1;
}

/* Non-commercial Action Buttons & CTAs */
.cta-button {
  display: inline-block;
  background-color: var(--color-terracotta);
  color: var(--color-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.03em;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  margin-top: 12px;
  min-height: 44px;
}

.cta-button:hover {
  background-color: var(--color-terracotta-dark);
  color: var(--color-white);
}

.cta-button.cta-secondary {
  background-color: var(--color-slate);
}

.cta-button.cta-secondary:hover {
  background-color: #1E293B;
}

.cta-button.cta-outline {
  background-color: transparent;
  color: var(--color-slate);
  border: 1px solid var(--color-slate);
}

.cta-button.cta-outline:hover {
  background-color: var(--color-slate);
  color: var(--color-white);
}

.cta-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin: 28px 0;
}

/* Civic Data Tables */
.civic-table-wrapper {
  overflow-x: auto;
  margin: 28px 0;
  background: var(--color-white);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--border-radius);
}

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

.civic-table th {
  background-color: var(--color-slate);
  color: var(--color-white);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.civic-table tr:last-child td {
  border-bottom: none;
}

.civic-table tr:nth-child(even) td {
  background-color: var(--color-parchment);
}

/* Forms (Contact, Bénévolat, etc.) */
.civic-form {
  background: var(--color-white);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--border-radius);
  padding: 32px;
  margin: 30px 0;
}

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

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--color-slate);
  font-weight: 700;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--color-sandstone);
  border-radius: var(--border-radius);
  background-color: var(--color-parchment);
  color: var(--color-charcoal);
  transition: border-color 0.2s;
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-terracotta);
  background-color: var(--color-white);
}

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

/* Vanilla JS Slider Component */
.hero-slider-container {
  position: relative;
  background: var(--color-slate);
  color: #F8FAFC;
  border-radius: var(--border-radius);
  overflow: hidden;
  margin: 30px 0;
}

.hero-slide {
  display: none;
  padding: 36px 40px;
  animation: fadeEffect 0.4s ease-in-out;
}

.hero-slide.active {
  display: block;
}

@keyframes fadeEffect {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.hero-slide-badge {
  display: inline-block;
  background: var(--color-terracotta);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-slide-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #FFFFFF;
  margin-bottom: 10px;
}

.hero-slide-text {
  font-size: 1.05rem;
  color: #CBD5E1;
  margin-bottom: 0;
  line-height: 1.65;
}

.slider-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 40px 24px 40px;
}

.slider-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  min-width: 44px;
  min-height: 44px;
  transition: background 0.2s;
}

.slider-btn:hover {
  background: var(--color-terracotta);
}

/* ==========================================================================
   FOOTER ARCHITECTURE
   ========================================================================== */
.site-footer {
  background-color: var(--color-slate);
  color: #CBD5E1;
  border-top: 4px solid var(--color-terracotta);
  padding: 60px 0 30px 0;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

.footer-column h4 {
  color: #FFFFFF;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(226, 217, 204, 0.2);
  padding-bottom: 8px;
}

.footer-column p {
  font-size: 0.9rem;
  color: #94A3B8;
  line-height: 1.6;
}

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

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

.footer-nav a {
  color: #CBD5E1;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s ease;
  display: inline-block;
  padding: 2px 0;
}

.footer-nav a:hover {
  color: var(--color-terracotta);
  text-decoration: underline;
}

/* Mandatory Un-truncated Footer Disclosure */
.footer-disclosure-block {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(226, 217, 204, 0.15);
  border-left: 4px solid var(--color-terracotta);
  padding: 20px 24px;
  margin-top: 30px;
  border-radius: var(--border-radius);
}

.footer-disclosure-text {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #E2E8F0;
  line-height: 1.6;
  margin-bottom: 0;
}

.footer-bottom-bar {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #64748B;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 992px) {
  :root {
    --header-height: 110px;
  }
  
  body {
    padding-top: var(--header-height);
  }

  /* Hide vertical reading tracker on mobile/tablets */
  #reading-progress-bar {
    display: none !important;
  }

  /* Collapse asymmetric grid to single column */
  .asymmetric-canvas {
    grid-template-columns: 1fr;
  }

  .side-rail-logbook {
    position: static;
    margin-bottom: 30px;
  }

  .mobile-nav-toggle {
    display: block;
  }

  .main-nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 0;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }

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

  .nav-item {
    border-bottom: 1px solid var(--color-sandstone);
  }

  .nav-link {
    display: block;
    padding: 14px 16px;
    font-size: 1rem;
  }

  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--color-terracotta);
    padding: 0 0 0 16px;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: var(--color-parchment);
    display: none;
  }

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

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

  .content-grid-2,
  .content-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .utility-left span:nth-child(2),
  .utility-left span:nth-child(3) {
    display: none;
  }

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

  .footer-bottom-bar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }
}
