/* ==========================================================================
   CAP NATURE 09 - CHARTE GRAPHIQUE & ARCHITECTURE CSS INSTITUTIONNELLE
   Association Loi 1901 - Sports de montagne adaptés & Inclusion en Ariège
   Année d'exercice : 2026
   ========================================================================== */

:root {
  --color-spruce-header: #005A36;
  --color-spruce-footer: #02472B;
  --color-spruce-dark: #013721;
  --color-spruce-light: #0d7348;
  --color-gold-metallic: #A68244;
  --color-gold-hover: #9E7D3B;
  --color-gold-bright: #D97706;
  --color-gold-bright-hover: #C87A00;
  --color-bg-light: #F4F5F4;
  --color-bg-alt: #EFEFEF;
  --color-white: #FFFFFF;
  --color-charcoal-body: #1C1A17;
  --color-charcoal-sub: #333333;
  --color-border: #D1D5DB;
  --color-border-dark: #0e4c31;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", "Cambria", serif;
  --header-height: 75px;
  --progress-height: 4px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color: var(--color-charcoal-body);
  background-color: var(--color-white);
  font-family: var(--font-main);
  line-height: 1.65;
}

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

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-spruce-dark);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.8rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; border-bottom: 2px solid var(--color-gold-metallic); padding-bottom: 0.4rem; margin-top: 2rem; margin-bottom: 1.2rem; }
h3 { font-size: 1.35rem; margin-top: 1.4rem; }
p { margin-bottom: 1.2rem; }
ul, ol { margin-bottom: 1.2rem; padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; }

/* Dynamic Reading Progress Bar */
#reading-progress {
  background: var(--color-gold-metallic);
  height: var(--progress-height);
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 0%;
  z-index: 999;
  transition: width 0.1s linear;
}

/* Header Architecture */
.top-header {
  background: var(--color-spruce-header);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-left {
  display: flex;
  align-items: center;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-white);
  text-decoration: none;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--color-gold-metallic);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -1px;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--color-white);
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: #E2E8F0;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Analog & Dual Digital Clock Widget */
.clock-widget-badge {
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  padding-left: 15px;
  margin-left: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.analog-clock-container {
  width: 44px;
  height: 44px;
  position: relative;
  background: #013721;
  border: 2px solid var(--color-gold-metallic);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analog-clock-svg {
  width: 40px;
  height: 40px;
}

.clock-hand {
  transform-origin: 20px 20px;
  stroke-linecap: round;
}

.hand-hour { stroke: var(--color-white); stroke-width: 2.2; }
.hand-minute { stroke: #D9D9D9; stroke-width: 1.6; }
.hand-second { stroke: var(--color-gold-bright); stroke-width: 1; }

.dual-digital-stack {
  display: flex;
  flex-direction: column;
  font-family: monospace;
  font-size: 0.72rem;
  line-height: 1.2;
}

.clock-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.clock-row-label {
  color: #A3BFB0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

.clock-row-time {
  color: var(--color-white);
  font-weight: 700;
}

/* Navigation Bar */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.main-nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--color-white);
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.nav-link:hover, .nav-item:focus-within > .nav-link {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
}

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

/* Dropdown Sub-menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #013721;
  min-width: 260px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  list-style: none;
  padding: 8px 0;
  display: none;
  border: 1px solid rgba(166, 130, 68, 0.4);
  z-index: 1010;
}

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

.dropdown-link {
  color: #F1F5F9;
  display: block;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 0.15s, color 0.15s;
}

.dropdown-link:hover {
  background: #005A36;
  color: var(--color-white);
  padding-left: 22px;
}

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

/* Gold Header CTA Button */
.btn-header-cta {
  background: var(--color-gold-bright);
  color: var(--color-white);
  padding: 12px 24px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: inline-block;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-header-cta:hover {
  background: var(--color-gold-bright-hover);
  color: var(--color-white);
  transform: translateY(-1px);
}

/* Mobile Hamburger Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 1.8rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

/* Main Layout Grid */
.site-main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 24px 60px 24px;
  width: 100%;
  flex: 1;
}

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 36px;
  align-items: start;
}

.page-content-area {
  min-width: 0;
}

/* Standard Hero / Banner section */
.page-hero-banner {
  background: linear-gradient(135deg, var(--color-spruce-header), var(--color-spruce-dark));
  color: var(--color-white);
  padding: 40px 32px;
  border-radius: 8px;
  margin-bottom: 30px;
  border-left: 6px solid var(--color-gold-metallic);
}

.page-hero-banner h1 {
  color: var(--color-white);
  margin-bottom: 12px;
}

.page-hero-banner .hero-lead {
  font-size: 1.15rem;
  color: #E2E8F0;
  line-height: 1.6;
  max-width: 900px;
  margin-bottom: 0;
}

/* Institutional Mission Box */
.mission-highlight-box {
  background: var(--color-bg-light);
  border: 1px solid #CBD5E1;
  border-left: 5px solid var(--color-spruce-header);
  padding: 24px 28px;
  border-radius: 6px;
  margin: 28px 0;
}

.mission-highlight-box h3 {
  color: var(--color-spruce-header);
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.mission-highlight-box p {
  margin-bottom: 0.8rem;
  color: var(--color-charcoal-body);
}

.mission-highlight-box p:last-child {
  margin-bottom: 0;
}

/* Solidarity Metrics Panel */
.metrics-panel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 30px 0;
}

.metric-card {
  background: var(--color-spruce-dark);
  color: var(--color-white);
  padding: 22px 18px;
  border-radius: 6px;
  text-align: center;
  border-bottom: 4px solid var(--color-gold-metallic);
}

.metric-number {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--color-gold-bright);
  line-height: 1.1;
  margin-bottom: 6px;
}

.metric-label {
  font-size: 0.88rem;
  color: #E2E8F0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Cards & Grids */
.cards-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 28px 0;
}

.cards-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 28px 0;
}

.activity-card {
  background: var(--color-white);
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.activity-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.activity-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
}

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

.activity-card-body h3 {
  color: var(--color-spruce-header);
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 10px;
}

.activity-card-body p {
  font-size: 0.94rem;
  color: var(--color-charcoal-sub);
  flex: 1;
  margin-bottom: 16px;
}

/* Buttons & CTAs */
.btn-primary-cta {
  background: var(--color-gold-metallic);
  color: var(--color-white);
  border: none;
  font-weight: bold;
  padding: 12px 24px;
  border-radius: 4px;
  display: inline-block;
  text-align: center;
  cursor: pointer;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-primary-cta:hover {
  background: var(--color-gold-hover);
  color: var(--color-white);
  transform: translateY(-1px);
}

.btn-secondary-cta {
  background: var(--color-spruce-header);
  color: var(--color-white);
  border: none;
  font-weight: bold;
  padding: 12px 24px;
  border-radius: 4px;
  display: inline-block;
  text-align: center;
  cursor: pointer;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: background-color 0.2s;
}

.btn-secondary-cta:hover {
  background: var(--color-spruce-dark);
  color: var(--color-white);
}

/* Sidebar - Journal de Bord 2026 */
.journal-sidebar {
  background: var(--color-bg-light);
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 24px 20px;
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.sidebar-header {
  border-bottom: 3px solid var(--color-gold-metallic);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.sidebar-header h3 {
  color: var(--color-spruce-header);
  font-size: 1.25rem;
  margin: 0;
}

.sidebar-badge {
  display: inline-block;
  background: var(--color-spruce-header);
  color: var(--color-white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 6px;
  text-transform: uppercase;
}

.journal-entry {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #CBD5E1;
}

.journal-entry:last-of-type {
  border-bottom: none;
}

.journal-date {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-gold-metallic);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.journal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-spruce-dark);
  margin-bottom: 6px;
}

.journal-text {
  font-size: 0.85rem;
  color: var(--color-charcoal-sub);
  line-height: 1.45;
  margin-bottom: 0;
}

.sidebar-cta-block {
  background: var(--color-spruce-dark);
  color: var(--color-white);
  padding: 16px;
  border-radius: 6px;
  margin-top: 20px;
  text-align: center;
}

.sidebar-cta-block p {
  font-size: 0.85rem;
  color: #E2E8F0;
  margin-bottom: 12px;
}

/* Institutional Text Section Styling */
.doc-section {
  margin-bottom: 36px;
}

.doc-section p {
  text-align: justify;
}

.data-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
}

.institutional-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--color-white);
  border: 1px solid #CBD5E1;
}

.institutional-table th {
  background: var(--color-spruce-header);
  color: var(--color-white);
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  border: 1px solid #CBD5E1;
}

.institutional-table td {
  padding: 12px 16px;
  border: 1px solid #CBD5E1;
  color: var(--color-charcoal-body);
}

.institutional-table tr:nth-child(even) {
  background: var(--color-bg-light);
}

/* Forms */
.form-container {
  background: var(--color-bg-light);
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 30px;
  margin: 28px 0;
}

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

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-spruce-dark);
  font-size: 0.92rem;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--color-white);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-gold-metallic);
  box-shadow: 0 0 0 3px rgba(166, 130, 68, 0.2);
}

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

/* Footer Architecture */
.site-footer {
  background: var(--color-spruce-footer);
  color: var(--color-white);
  padding: 50px 30px 30px 30px;
  margin-top: auto;
  border-top: 5px solid var(--color-gold-metallic);
}

.footer-top-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-col h4 {
  color: var(--color-gold-bright);
  font-size: 1.05rem;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

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

.footer-nav-list a {
  color: #E2E8F0;
  font-size: 0.88rem;
  transition: color 0.15s, padding-left 0.15s;
}

.footer-nav-list a:hover {
  color: var(--color-gold-bright);
  padding-left: 4px;
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 24px;
}

.compliance-notice {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #A0AEC0;
  text-align: justify;
  background: rgba(0, 0, 0, 0.2);
  padding: 16px 20px;
  border-radius: 4px;
  border-left: 3px solid var(--color-gold-metallic);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
  
  .journal-sidebar {
    position: static;
    margin-top: 30px;
  }

  .metrics-panel-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .top-header {
    padding: 0 16px;
    height: 70px;
  }
  
  :root {
    --header-height: 70px;
  }

  .clock-widget-badge {
    display: none; /* Hidden on compact viewports to prevent overflow */
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .header-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #013721;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 20px;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-bottom: 3px solid var(--color-gold-metallic);
  }

  .header-nav.is-open {
    display: block;
  }

  .main-nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav-link {
    padding: 12px 16px;
    min-height: 44px;
    font-size: 1rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
  }

  .dropdown-menu {
    position: static;
    display: block;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    box-shadow: none;
    padding: 6px 0 12px 14px;
    margin-top: 4px;
  }

  .dropdown-link {
    padding: 10px 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

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

  .metrics-panel-grid {
    grid-template-columns: 1fr;
  }

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

  .site-main-container {
    padding: 20px 16px 40px 16px;
  }

  .page-hero-banner {
    padding: 26px 20px;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
}
