@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Roboto+Slab:wght@400;600;700&display=swap');

:root {
  --rouge:  #e63036;
  --dark:   #1c1e24;
  --slate:  #525761;
  --taupe:  #a6958a;
  --beige:  #d9cfc9;
  --bg:     #f5f2ef;
  --white:  #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.65;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

/* ── NAVBAR ── */
.navbar {
  background: var(--white);
  border-bottom: 3px solid var(--rouge);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  /* needed so the mobile dropdown is positioned relative to the navbar */
  position: -webkit-sticky;
  position: sticky;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 84px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo { flex-shrink: 0; display: flex; align-items: center; }
.nav-logo img { height: 68px; width: auto; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  flex: 1;
}

.nav-links a {
  text-decoration: none;
  color: var(--slate);
  font-size: 0.92rem;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--rouge); border-bottom-color: var(--rouge); }

.nav-lang {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--taupe);
}

.nav-lang a {
  text-decoration: none;
  color: var(--slate);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  transition: all .2s;
}

.nav-lang a.active { color: var(--white); background: var(--rouge); }
.nav-lang a:hover:not(.active) { color: var(--rouge); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: all .3s;
}

/* ── HERO (page À propos) ── */
.hero {
  background: var(--rouge);
  color: var(--white);
  padding: 5rem 1.5rem;
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-family: 'Roboto Slab', serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.1rem;
  opacity: .9;
  max-width: 680px;
  margin: 0 auto 2rem;
}

.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── HERO COMPACT (homepage avec carte) ── */
.hero-compact {
  background: var(--rouge);
  color: var(--white);
  padding: 2rem 1.5rem;
  border-bottom: 4px solid #c9272d;
}

.hero-compact-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-compact h1 {
  font-family: 'Roboto Slab', serif;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  min-width: 200px;
}

.hero-compact p {
  font-size: .9rem;
  opacity: .85;
  max-width: 420px;
  flex: 1;
  min-width: 200px;
}

.hero-compact-ref {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.hero-compact-ref a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: rgba(255,255,255,.85);
  font-size: .82rem;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.4);
  padding: .4rem .9rem;
  border-radius: 4px;
  transition: all .2s;
  white-space: nowrap;
}

.hero-compact-ref a:hover {
  background: rgba(255,255,255,.15);
  color: var(--white);
}

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  padding: .75rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all .2s;
  font-family: 'Roboto', sans-serif;
}

.btn-white { background: var(--white); color: var(--rouge); }
.btn-white:hover { background: var(--beige); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,.65);
}
.btn-outline:hover { background: rgba(255,255,255,.15); }

.btn-red { background: var(--rouge); color: var(--white); }
.btn-red:hover { background: #c9272d; transform: translateY(-1px); }

.btn-gray { background: var(--slate); color: var(--white); font-size: .88rem; padding: .55rem 1.2rem; }
.btn-gray:hover { background: var(--dark); }

/* ── CONTENT SECTIONS ── */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-title {
  font-family: 'Roboto Slab', serif;
  font-size: 1.6rem;
  color: var(--rouge);
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--beige);
}

.lead {
  font-size: 1.05rem;
  color: var(--slate);
  margin-bottom: 1.5rem;
  max-width: 820px;
  line-height: 1.7;
}

/* ── CARDS ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--white);
  border-radius: 6px;
  padding: 1.75rem;
  border-top: 4px solid var(--rouge);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: box-shadow .2s, transform .2s;
}

.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }

.card-icon { font-size: 2rem; margin-bottom: .75rem; }

.card h3 {
  color: var(--rouge);
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.card p { color: var(--slate); font-size: .92rem; line-height: 1.6; }

/* ── HIGHLIGHT BOX ── */
.highlight-box {
  background: var(--white);
  border-left: 5px solid var(--rouge);
  padding: 1.5rem 2rem;
  border-radius: 0 6px 6px 0;
  margin: 2rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.highlight-box p { color: var(--slate); margin: 0; line-height: 1.7; }
.highlight-box a { color: var(--rouge); font-weight: 600; }

/* ── PAGE HEADER (non-hero) ── */
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--beige);
  padding: 2.5rem 1.5rem;
}

.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.page-header h1 {
  font-family: 'Roboto Slab', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--dark);
  margin-bottom: .5rem;
}

.page-header p { color: var(--slate); font-size: 1rem; max-width: 700px; }

/* ── CARTE PAGE ── */
.carte-controls {
  background: var(--white);
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.carte-controls label { font-weight: 600; color: var(--dark); white-space: nowrap; }

#indicator {
  flex: 0 0 auto;
  width: 200px;
  padding: .6rem 1rem;
  border: 2px solid var(--beige);
  border-radius: 4px;
  font-family: 'Roboto', sans-serif;
  font-size: .92rem;
  color: var(--dark);
  background: var(--bg);
  cursor: pointer;
  transition: border-color .2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23525761' fill='none' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.5rem;
}

#indicator:focus { outline: none; border-color: var(--rouge); }

.export-btns { display: flex; gap: .75rem; flex-wrap: wrap; margin-left: auto; }

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

#map-container {
  background: var(--white);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

#map { width: 100%; height: 540px; }

.table-panel {
  background: var(--white);
  border-radius: 6px;
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  max-height: 572px;
  overflow-y: auto;
}

.table-panel h3 {
  font-size: .82rem;
  color: var(--rouge);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 1rem;
  font-weight: 700;
}

#data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }

#data-table thead th {
  background: var(--rouge);
  color: var(--white);
  padding: .55rem .75rem;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

#data-table tbody tr { cursor: pointer; transition: background .15s; }
#data-table tbody tr:nth-child(even) { background: var(--bg); }
#data-table tbody tr:hover { background: var(--beige); }

#data-table tbody td {
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--beige);
  color: var(--dark);
}

#data-table tbody td:last-child { font-weight: 600; color: var(--rouge); text-align: right; }

/* PDF panel */
.pdf-panel {
  background: var(--white);
  border-radius: 6px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  display: none;
  border-top: 4px solid var(--rouge);
}

.pdf-panel.visible { display: block; }

.pdf-panel h3 {
  font-family: 'Roboto Slab', serif;
  color: var(--dark);
  margin-bottom: .4rem;
  font-size: 1.1rem;
}

.pdf-panel .pdf-subtitle { color: var(--taupe); font-size: .88rem; margin-bottom: 1rem; }

.pdf-links { display: flex; gap: 1rem; flex-wrap: wrap; }

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.2rem;
  background: var(--bg);
  border: 1px solid var(--beige);
  border-radius: 4px;
  text-decoration: none;
  color: var(--dark);
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s;
}

.pdf-link:hover { background: var(--rouge); color: var(--white); border-color: var(--rouge); }
.pdf-link svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── ABOUT — INDICATORS GRID ── */
.indicator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.indicator-item {
  background: var(--white);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--rouge);
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}

.indicator-item code {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: .83rem;
  color: var(--rouge);
  font-weight: 700;
  margin-bottom: .4rem;
  letter-spacing: .3px;
}

.indicator-item p { font-size: .9rem; color: var(--slate); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
  align-items: start;
}

.two-col p { color: var(--slate); line-height: 1.7; font-size: .95rem; }

/* ── FOOTER ── */
footer {
  background: var(--dark);
  color: var(--beige);
  padding: 3rem 1.5rem 2rem;
}

.footer-inner { max-width: 1200px; margin: 0 auto; }

.footer-top {
  display: flex;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-wrap: wrap;
  align-items: flex-start;
}

.footer-brand img {
  height: 70px;
  filter: brightness(0) invert(1);
  opacity: .9;
  display: block;
  margin-bottom: .6rem;
}

.footer-brand p {
  font-size: .78rem;
  color: var(--taupe);
  line-height: 1.5;
  max-width: 200px;
}

.footer-nav { flex: 1; }

.footer-nav h4 {
  color: var(--white);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: .9rem;
  font-weight: 700;
}

.footer-nav ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }

.footer-nav a {
  color: var(--taupe);
  text-decoration: none;
  font-size: .88rem;
  transition: color .2s;
}

.footer-nav a:hover { color: var(--rouge); }

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p { font-size: .8rem; color: var(--taupe); }
.footer-bottom a { color: var(--rouge); text-decoration: none; font-weight: 500; }

/* ── RESPONSIVE ── */

/* Tablette paysage (960px) */
@media (max-width: 960px) {
  .carte-layout { grid-template-columns: 1fr; }
  .table-panel { max-height: 380px; }
  .two-col { grid-template-columns: 1fr; }
  .footer-nav { min-width: 140px; }
}

/* Tablette portrait (768px) */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-lang { display: none; }

  .nav-links {
    display: none;
    position: fixed;
    top: 84px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: .5rem 1.5rem 1.25rem;
    border-bottom: 3px solid var(--rouge);
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
    gap: 0;
    z-index: 999;
  }

  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--beige); }
  .nav-links a { display: block; padding: .8rem 0; border-bottom: none; font-size: 1rem; }

  .nav-mobile-lang {
    display: flex !important;
    gap: .75rem;
    padding: .8rem 0 .25rem;
    border-bottom: none !important;
  }

  .nav-inner { height: 70px; }
  .nav-logo img { height: 54px; }
  .nav-links { top: 70px; }
  .hero { padding: 3rem 1.5rem; }
  .section { padding: 2.5rem 1.5rem; }
  .footer-top { gap: 1.5rem; flex-wrap: wrap; }
  .footer-nav { flex: none; width: calc(50% - .75rem); }
  #map { height: 420px; }

  .carte-controls { flex-direction: column; align-items: stretch; }
  .carte-controls label { margin-bottom: -.25rem; }
  #indicator { min-width: unset; width: 100%; }
  .export-btns { margin-left: 0; justify-content: flex-start; }
}

/* ── CTA BANNER ── */
.cta-banner {
  background: var(--white);
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--beige);
}

.cta-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-banner h2 {
  font-family: 'Roboto Slab', serif;
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: .5rem;
}

.cta-banner p { color: var(--slate); max-width: 540px; }

/* ── ACCORDÉON INDICATEURS ── */
.indicator-details {
  border-top: none;
}

.indicator-details summary {
  font-family: 'Roboto Slab', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate);
  padding: 1.25rem 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .6rem;
  user-select: none;
  transition: color .2s;
}

.indicator-details summary::-webkit-details-marker { display: none; }

.indicator-details summary::before {
  content: '▸';
  font-size: .9rem;
  color: var(--rouge);
  transition: transform .25s;
  display: inline-block;
}

.indicator-details[open] summary::before { transform: rotate(90deg); }
.indicator-details summary:hover { color: var(--rouge); }

/* ── INLINE-SECTION (sections with background) ── */
.bg-section {
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--beige);
  background: var(--white);
}

.bg-section-inner { max-width: 1200px; margin: 0 auto; }

/* Mobile (480px) */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }
  .hero-btns { flex-direction: column; align-items: center; }
  .btn { width: 100%; text-align: center; }
  .cards { grid-template-columns: 1fr; }
  .indicator-grid { grid-template-columns: 1fr; }
  .footer-nav { width: 100%; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: .5rem; }
  #map { height: 320px; }
  .pdf-links { flex-direction: column; }
  .pdf-link { width: 100%; }
}

.nav-mobile-lang { display: none; }
