/* ==========================================================================
   WESTERN COUNTRY CLUB - DESIGN SYSTEM "THE REVOLUTIONARY ARCHIVE"
   ASSOCIATION LOI 1901 - SAINT-QUENTIN (AISNE) - RNA W023000004
   ========================================================================== */

:root {
  --color-slate: #0F172A;
  --color-slate-light: #1E293B;
  --color-terracotta: #C2593F;
  --color-terracotta-dark: #A5432B;
  --color-parchment: #F8F5EE;
  --color-white: #FFFFFF;
  --color-sandstone: #E2D9CC;
  --color-sandstone-light: #EFE9DF;
  --color-charcoal: #1E293B;
  --color-muted: #526071;
  
  --font-serif: "Playfair Display", "Georgia", "Cambria", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  --header-height: 125px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  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);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Reading Progress Indicator */
#reading-progress {
  position: fixed;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background: rgba(15, 23, 42, 0.08);
  z-index: 100001;
}

#reading-progress-bar {
  width: 100%;
  height: 0%;
  background: var(--color-terracotta);
  transition: height 0.05s ease-out;
}

/* Header Architecture */
.portal-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10000;
  background: var(--color-white);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

/* Level 1: Civic Ledger Utility Strip */
.civic-ledger-strip {
  background-color: var(--color-slate);
  color: #CBD5E1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 24px;
  border-bottom: 1px solid rgba(226, 217, 204, 0.15);
}

.ledger-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.ledger-left, .ledger-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ledger-badge {
  display: inline-block;
  background: rgba(194, 89, 63, 0.25);
  color: #F8A590;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ledger-link {
  color: #CBD5E1;
  text-decoration: none;
  transition: color 0.2s;
}

.ledger-link:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

/* Level 2: Split Navigation Bar */
.main-nav-bar {
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-sandstone);
  padding: 0 24px;
}

.nav-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 82px;
}

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

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

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.1;
  color: #FFFFFF;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-top: 3px;
  color: #F8F5EE;
}

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

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-slate);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  min-height: 44px;
}

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

.nav-link-cta {
  background: var(--color-slate);
  color: #FFFFFF !important;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
}

.nav-link-cta:hover {
  background: var(--color-terracotta) !important;
  color: #FFFFFF !important;
}

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

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

.dropdown-link {
  display: block;
  padding: 10px 18px;
  font-size: 0.86rem;
  color: var(--color-slate);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  min-height: 44px;
  line-height: 24px;
}

.dropdown-link:hover {
  background-color: var(--color-parchment);
  color: var(--color-terracotta);
  font-weight: 600;
}

/* Mobile Toggle */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.2rem;
  color: var(--color-slate);
}

/* Layout Framework: Asymmetric Structural Canvas */
.main-wrapper {
  max-width: 1380px;
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
}

.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-radius: var(--radius-md);
  padding: 24px;
  position: sticky;
  top: 145px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.side-rail-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-terracotta);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-sandstone);
  font-weight: 700;
}

.ledger-meta-group {
  margin-bottom: 20px;
}

.ledger-meta-label {
  color: var(--color-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.ledger-meta-value {
  color: var(--color-slate);
  font-weight: 600;
  font-size: 0.88rem;
  word-break: break-word;
}

.ledger-quote-callout {
  background: var(--color-parchment);
  border-left: 3px solid var(--color-terracotta);
  padding: 14px;
  margin: 20px 0;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  color: var(--color-slate-light);
  line-height: 1.5;
  font-style: italic;
}

.side-nav-anchors {
  list-style: none;
  margin-top: 18px;
  border-top: 1px solid var(--color-sandstone);
  padding-top: 16px;
}

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

.side-nav-anchors a {
  color: var(--color-slate);
  text-decoration: none;
  font-size: 0.8rem;
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.side-nav-anchors a:hover {
  background: var(--color-parchment);
  color: var(--color-terracotta);
  padding-left: 12px;
}

/* Right Column: Primary Analytical Canvas */
.primary-analytical-canvas {
  background: var(--color-white);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-md);
  padding: 44px;
  min-width: 0;
}

/* Typography Hierarchy */
h1, .h1 {
  font-family: var(--font-serif);
  font-size: 2.35rem;
  line-height: 1.25;
  color: var(--color-slate);
  font-weight: 800;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

h2, .h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  line-height: 1.35;
  color: var(--color-slate);
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-sandstone);
}

h3, .h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--color-slate-light);
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 12px;
}

h4, .h4 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--color-terracotta);
  font-weight: 700;
  margin-top: 18px;
  margin-bottom: 8px;
}

p {
  margin-bottom: 20px;
  color: var(--color-charcoal);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* Lead & Summary Blocks */
.headline-summary-block {
  background: var(--color-parchment);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 32px;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--color-slate);
  font-weight: 500;
}

.reinvestment-statement-callout {
  background: #FFF8F6;
  border: 1px solid #F5C6BA;
  border-left: 4px solid var(--color-terracotta);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 28px 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--color-terracotta-dark);
  font-weight: 600;
}

/* Mandatory Notre Mission Callout Frame */
.mission-callout-frame {
  background: #F1F5F9;
  border: 2px solid var(--color-slate);
  border-radius: var(--radius-md);
  padding: 30px;
  margin: 36px 0;
  position: relative;
}

.mission-callout-frame::before {
  content: "MISSION STATUTAIRE D'INTÉRÊT GÉNÉRAL";
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--color-slate);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 1px;
}

.mission-statement-text {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--color-slate);
  font-style: normal;
}

/* Image Wrappers & Grids */
.editorial-image-frame {
  margin: 32px 0;
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #E2E8F0;
}

.editorial-image-frame img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.image-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 32px 0;
}

/* Statistics & Metric Grids */
.stats-civic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 36px 0;
}

.stat-civic-card {
  background: var(--color-parchment);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-terracotta);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-slate);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-desc {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Non-commercial Action Buttons & CTAs */
.cta-block-container {
  background: var(--color-parchment);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-md);
  padding: 28px;
  margin: 36px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.cta-block-text h3 {
  margin-top: 0;
  margin-bottom: 6px;
}

.cta-block-text p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.btn-civic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary-civic {
  background: var(--color-terracotta);
  color: #FFFFFF !important;
}

.btn-primary-civic:hover {
  background: var(--color-terracotta-dark);
}

.btn-secondary-civic {
  background: var(--color-slate);
  color: #FFFFFF !important;
}

.btn-secondary-civic:hover {
  background: #000000;
}

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

.btn-outline-civic:hover {
  background: var(--color-white);
  border-color: var(--color-slate);
}

/* Data Tables */
.civic-data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.92rem;
  background: var(--color-white);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.civic-data-table th, .civic-data-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--color-sandstone);
}

.civic-data-table th {
  background: var(--color-slate);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

/* Form Styling (contact.php & benevolat.php) */
.civic-form-container {
  background: var(--color-parchment);
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-md);
  padding: 32px;
  margin: 32px 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

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

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--color-slate);
  font-weight: 600;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--color-slate);
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(194, 89, 63, 0.15);
}

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

/* Hero Slider (index.php) */
.hero-slider-container {
  position: relative;
  background: var(--color-slate);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 40px;
}

.slider-slide {
  display: none;
  padding: 48px;
  min-height: 280px;
  flex-direction: column;
  justify-content: center;
}

.slider-slide.active {
  display: flex;
}

.slider-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #F8A590;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.slider-title {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  color: #FFFFFF;
  margin-bottom: 14px;
  line-height: 1.3;
}

.slider-desc {
  font-size: 1.05rem;
  color: #CBD5E1;
  max-width: 780px;
  line-height: 1.6;
}

.slider-controls {
  display: flex;
  gap: 10px;
  padding: 18px 48px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  align-items: center;
}

.slider-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFFFFF;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s;
}

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

.slider-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #94A3B8;
  margin-left: 12px;
}

/* FAQ Accordion (ressources.php) */
.civic-faq-item {
  border: 1px solid var(--color-sandstone);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--color-white);
  overflow: hidden;
}

.civic-faq-header {
  padding: 18px 24px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-slate);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-parchment);
}

.civic-faq-header:hover {
  background: #EFE9DF;
}

.civic-faq-body {
  padding: 20px 24px;
  border-top: 1px solid var(--color-sandstone);
  font-size: 0.98rem;
  line-height: 1.65;
}

/* Footer Architecture */
.portal-footer {
  background: var(--color-slate);
  color: #CBD5E1;
  border-top: 4px solid var(--color-terracotta);
  padding: 60px 24px 30px 24px;
  font-size: 0.92rem;
}

.footer-container {
  max-width: 1380px;
  margin: 0 auto;
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(226, 217, 204, 0.2);
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #F8A590;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

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

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

.footer-links a {
  color: #94A3B8;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
  min-height: 30px;
  line-height: 30px;
}

.footer-links a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-disclosure-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 22px;
  margin: 36px 0 24px 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  color: #E2E8F0;
  text-align: center;
}

.footer-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #64748B;
  padding-top: 20px;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 992px) {
  #reading-progress {
    display: none !important;
  }

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

  .side-rail-logbook {
    position: static;
  }

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

  .portal-nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-white);
    flex-direction: column;
    padding: 20px 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-bottom: 2px solid var(--color-terracotta);
    max-height: 80vh;
    overflow-y: auto;
  }

  .portal-nav-list.open {
    display: flex;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--color-sandstone);
    margin-left: 14px;
    width: auto;
    display: none;
  }

  .dropdown-menu.open {
    display: block;
  }

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

  .stats-civic-grid {
    grid-template-columns: 1fr;
  }

  .image-gallery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 135px;
  }

  .ledger-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .primary-analytical-canvas {
    padding: 24px 18px;
  }

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

  .cta-block-container {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

  h1, .h1 {
    font-size: 1.85rem;
  }

  h2, .h2 {
    font-size: 1.45rem;
  }
}
