/* ==========================================================================
   HISPANOTHEQUE - SYSTÈME DE DESIGN INSTITUTIONNEL & NEO-BRUTALISTE
   Plateforme Documentaire & Patrimoine Hispanique - Loi 1901
   ========================================================================== */

:root {
  --primary: #2F4F4F;       /* Slate Gray institutionnel */
  --accent: #CC5500;        /* Burnt Orange d'action et jalon */
  --bg: #FFFDD0;            /* Fond Cream haute lisibilité */
  --card-bg: #FFFFFF;       /* Fond cartes données blanc pur */
  --card-alt: #FBF8EA;      /* Fond secondaire nuancé */
  --text: #1C1A17;          /* Charcoal textuel soutenu */
  --text-muted: #4F5D59;    /* Gris ardoise atténué pour métadonnées */
  --border: #2F4F4F;        /* Bordures franches néo-brutalistes */
  --border-light: #D4CDAC;  /* Filets techniques discrets */
  --shadow: 4px 4px 0px #2F4F4F; /* Ombre franche néo-brutaliste */
  --shadow-sm: 2px 2px 0px #2F4F4F;
  --shadow-hover: 6px 6px 0px #CC5500;
  --font-display: 'Cinzel', 'Georgia', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

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

html {
  font-size: 16px;
  line-height: 1.65;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   PROGRESS BAR
   -------------------------------------------------------------------------- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background-color: var(--accent);
  width: 0%;
  z-index: 10001;
  transition: width 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   STICKY LOGBOOK HEADER
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--primary);
  color: var(--bg);
  border-bottom: 3px solid var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--bg);
}

.brand-badge {
  background-color: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--bg);
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: #E2DEBE;
  font-family: var(--font-mono);
  display: block;
}

/* Navigation & Dropdowns */
.main-nav {
  display: flex;
  align-items: center;
}

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

.nav-item {
  position: relative;
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.95rem;
  color: var(--bg);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s ease;
  min-height: 44px;
  white-space: nowrap;
}

.nav-link-btn:hover,
.nav-item:hover > .nav-link-btn,
.nav-link-btn:focus {
  background-color: rgba(255, 253, 208, 0.12);
  border-color: var(--accent);
  color: #FFFFFF;
}

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

.nav-item:hover .dropdown-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background-color: var(--card-bg);
  color: var(--text);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  list-style: none;
  padding: 0.5rem 0;
  display: none;
  z-index: 1001;
}

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

.dropdown-item a {
  display: block;
  padding: 0.65rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.dropdown-item a:hover,
.dropdown-item a:focus {
  background-color: var(--bg);
  color: var(--accent);
  border-left-color: var(--accent);
  padding-left: 1.5rem;
}

.nav-cta-btn {
  background-color: var(--accent);
  color: #FFFFFF !important;
  font-weight: 800 !important;
  border: 1px solid #9E4000 !important;
  box-shadow: 2px 2px 0px #1C1A17;
}

.nav-cta-btn:hover {
  background-color: #B24700 !important;
  transform: translateY(-1px);
  box-shadow: 3px 3px 0px #1C1A17;
}

/* Mobile Toggle */
.mobile-nav-toggle {
  display: none;
  background: var(--accent);
  color: #FFFFFF;
  border: 2px solid var(--bg);
  padding: 0.5rem 0.8rem;
  font-size: 1.1rem;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

/* --------------------------------------------------------------------------
   LAYOUT CONTAINERS & GRIDS
   -------------------------------------------------------------------------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

.container-narrow {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}

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

/* --------------------------------------------------------------------------
   TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 { font-size: 2.35rem; letter-spacing: -0.01em; }
h2 { font-size: 1.75rem; border-bottom: 2px solid var(--border-light); padding-bottom: 0.5rem; margin-top: 2rem; }
h3 { font-size: 1.35rem; margin-top: 1.5rem; }
h4 { font-size: 1.1rem; }

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

.lead {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

strong {
  font-weight: 700;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   NEO-BRUTALIST DATA CARDS & PANELS
   -------------------------------------------------------------------------- */
.data-card {
  background-color: var(--card-bg);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 2rem;
  position: relative;
}

.data-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.data-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  background-color: var(--bg);
  border: 1px solid var(--border);
  color: var(--primary);
  text-transform: uppercase;
}

.data-tag-accent {
  background-color: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

/* Hero Section */
.hero-section {
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
  background-color: var(--card-bg);
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.hero-image-wrap {
  position: relative;
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  border-bottom: 3px solid var(--border);
}

.hero-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-content {
  padding: 2.25rem;
  background-color: var(--card-bg);
}

.hero-summary-box {
  background-color: var(--bg);
  border-left: 6px solid var(--accent);
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.6;
}

/* Solidarity Metrics Panel */
.metrics-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  background-color: var(--primary);
  color: var(--bg);
  border: 3px solid var(--border);
  padding: 2rem 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}

.metric-item {
  text-align: center;
  border-right: 1px solid rgba(255, 253, 208, 0.25);
  padding: 0 1rem;
}

.metric-item:last-child {
  border-right: none;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #E2DEBE;
}

/* Activity Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.activity-card {
  background-color: var(--card-bg);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
}

.activity-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 2px solid var(--border);
}

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

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

.activity-card-body p {
  font-size: 0.95rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

/* Buttons and CTAs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  min-height: 44px;
}

.btn-primary {
  background-color: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: #B24700;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background-color: var(--primary);
  color: var(--bg);
}

.btn-secondary:hover {
  background-color: #223838;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background-color: var(--card-bg);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--bg);
  color: var(--accent);
}

/* Transparency & Reinvestment Boxes */
.transparency-box {
  background-color: var(--card-alt);
  border: 2px solid var(--border);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  position: relative;
}

.transparency-box::before {
  content: "TRANSPARENCE FINANCIÈRE & STATUTAIRE";
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background-color: var(--primary);
  color: #FFFFFF;
  padding: 0.2rem 0.6rem;
  margin-bottom: 1rem;
}

.reinvestment-guarantee {
  background-color: #FFF2E6;
  border-left: 5px solid var(--accent);
  padding: 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #803300;
  margin: 1.5rem 0;
}

/* Sidebar "Journal de Bord 2026" */
.sidebar-widget {
  background-color: var(--card-bg);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-list {
  list-style: none;
  position: relative;
  padding-left: 1.25rem;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background-color: var(--border-light);
}

.timeline-node {
  position: relative;
  margin-bottom: 1.25rem;
  padding-left: 0.75rem;
}

.timeline-node::before {
  content: "";
  position: absolute;
  left: -1.35rem;
  top: 5px;
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border: 2px solid var(--primary);
  border-radius: 50%;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.timeline-text {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 0;
}

/* Image Galleries & Figures */
.content-figure {
  margin: 2rem 0;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  background-color: var(--card-bg);
  overflow: hidden;
}

.content-figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* Tables & Specifications */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
  background-color: var(--card-bg);
  border: 2px solid var(--border);
}

.data-table th,
.data-table td {
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--border-light);
  text-align: left;
}

.data-table th {
  background-color: var(--primary);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 2px solid var(--border);
  background-color: #FFFFFF;
  color: var(--text);
  min-height: 44px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(204, 85, 0, 0.2);
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--primary);
  color: var(--bg);
  border-top: 4px solid var(--text);
  margin-top: auto;
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  color: var(--bg);
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid rgba(255, 253, 208, 0.25);
  padding-bottom: 0.4rem;
}

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

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

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

.footer-links a {
  color: #E2DEBE;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

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

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 0;
  border-top: 1px solid rgba(255, 253, 208, 0.2);
  font-size: 0.85rem;
  color: #D4CDAC;
  line-height: 1.6;
}

.legal-compliance-block {
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 253, 208, 0.2);
  padding: 1.25rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #FFFDD0;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

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

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

  .metric-item:nth-child(2) {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

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

  .main-nav {
    display: none;
    width: 100%;
    margin-top: 1rem;
  }

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

  .nav-menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 253, 208, 0.1);
  }

  .nav-link-btn {
    width: 100%;
    justify-content: space-between;
    padding: 0.85rem 1rem;
  }

  .dropdown-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--accent);
    background-color: rgba(0, 0, 0, 0.15);
    width: 100%;
  }

  .nav-item.mobile-expanded .dropdown-menu {
    display: block;
  }

  .dropdown-item a {
    color: var(--bg);
    padding: 0.65rem 1.25rem;
  }

  .dropdown-item a:hover {
    background-color: rgba(255, 253, 208, 0.1);
    color: #FFFFFF;
  }

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

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

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

  .metric-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 253, 208, 0.2);
    padding: 1rem 0;
  }

  .metric-item:last-child {
    border-bottom: none;
  }

  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.45rem; }
}
