/* ===================================================
   STYLE.CSS - PRIPS Site Web (version corrigée)
   =================================================== */

:root {
  --primary-dark: #1e3a5f;
  --primary: #2c7da0;
  --primary-light: #61a5c2;
  --accent: #2e9c4a;
  --gray-bg: #f8fafc;
  --gray-light: #e9ecef;
  --text-dark: #0b2545;
  --text-muted: #4a5b6e;
  --white: #ffffff;
  --shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.02);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: var(--white);
  color: var(--text-dark);
  line-height: 1.5;
  scroll-behavior: smooth;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== TYPOGRAPHIE ===== */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: 2.8rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

/* ===== NAVIGATION ===== */
.navbar {
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.96);
  transition: var(--transition);
}

.nav-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 24px;
}

.nav-left, .nav-center, .nav-right {
  display: flex;
  align-items: center;
}
.nav-left { flex: 1; justify-content: flex-start; }
.nav-center { flex: 2; text-align: center; justify-content: center; }
.nav-right { flex: 1; justify-content: flex-end; }

/* Logos avec images réelles */
.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-mpce, .logo-gouv {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.logo-mpce-img {
  order: 1; /* image à gauche */
}
.mpce-text {
  order: 2;
}

.logo-gouv {
  flex-direction: row-reverse; /* image à droite du texte */
  gap: 8px;
}
.logo-armoiries-img {
  height: 40px;
}

.plan-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--primary-dark);
}
.plan-title small {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-muted);
}

/* Wrapper des liens de navigation */
.nav-links-wrapper {
  width: 100%;
  order: 3;
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
}
.nav-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}
.nav-links a {
  text-decoration: none;
  font-weight: 500;
  color: var(--text-dark);
  transition: var(--transition);
}
.nav-links a:hover { color: var(--primary); }

.menu-toggle {
  display: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--primary-dark);
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, #eef2f5 0%, #ffffff 100%);
  padding: 4rem 0;
  border-bottom: 1px solid var(--gray-light);
}
.hero-content { text-align: center; }
.subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 2.5rem 0;
}
.stat-card {
  background: var(--white);
  padding: 1rem 1.8rem;
  border-radius: 32px;
  box-shadow: var(--shadow);
  min-width: 150px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.stat-card i {
  font-size: 2rem;
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  display: block;
  color: var(--primary-dark);
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  padding: 12px 32px;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  margin-top: 1rem;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ===== SECTIONS GÉNÉRALES ===== */
.section { padding: 5rem 0; }
.bg-light { background-color: var(--gray-bg); }
.bg-cta {
  background: linear-gradient(110deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
}
.bg-cta h2, .bg-cta p { color: white; }
.bg-cta .btn-pdf { background: white; color: var(--primary-dark); border: none; }

/* Deux colonnes */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2rem;
}
.text-block p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}
.chart-container {
  background: white;
  padding: 1rem;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.chart-caption {
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.impact-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}
.impact-item {
  background: white;
  flex: 1;
  padding: 1.2rem;
  border-radius: 20px;
  text-align: center;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.impact-item i {
  font-size: 1.8rem;
  color: var(--primary);
  display: block;
  margin-bottom: 0.5rem;
}

/* Vision & axes */
.vision-box {
  background: var(--primary-light);
  padding: 2rem;
  border-radius: 40px;
  text-align: center;
  margin-bottom: 3rem;
  color: white;
}
.vision-text {
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 500;
}
.axes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}
.axe-card {
  background: white;
  padding: 1.8rem;
  border-radius: 24px;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.axe-card:hover { transform: translateY(-8px); }
.axe-card i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Secteurs (onglets) */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  justify-content: center;
  border-bottom: 1px solid var(--gray-light);
  padding-bottom: 1rem;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  border-radius: 40px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}
.tab-btn.active {
  background: var(--primary);
  color: white;
}
.sector-panel {
  background: white;
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
  min-height: 350px;
}
.sector-card {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.sector-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--gray-light);
  padding-bottom: 0.8rem;
}
.sector-budget {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.sector-budget small {
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-muted);
}
.sector-deficit {
  background: #ffeee5;
  padding: 0.3rem 1rem;
  border-radius: 40px;
  color: #c2410c;
  font-weight: 600;
}
.interventions-list {
  list-style: none;
  margin-top: 1rem;
}
.interventions-list li {
  margin-bottom: 0.5rem;
  padding-left: 1.2rem;
  position: relative;
}
.interventions-list li::before {
  content: "✓";
  color: var(--accent);
  position: absolute;
  left: 0;
}

/* Financement */
.finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}
.table-responsive {
  overflow-x: auto;
  margin: 2rem 0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table caption {
  margin-bottom: 0.8rem;
  font-weight: 600;
  text-align: left;
}
.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-light);
}
.data-table th {
  background-color: var(--primary-dark);
  color: white;
  font-weight: 600;
}
.data-table tr:hover { background-color: #f1f5f9; }
.footnote {
  font-size: 0.85rem;
  margin-top: 1rem;
  color: var(--text-muted);
  text-align: center;
}

/* Coordination */
.coord-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}
.coord-card {
  background: white;
  padding: 1.8rem;
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.coord-card i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Bouton PDF */
.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #dc2626;
  color: white;
  padding: 14px 32px;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 700;
  margin-top: 1rem;
  transition: var(--transition);
}
.btn-pdf:hover {
  background: #b91c1c;
  transform: scale(1.02);
}
.text-center { text-align: center; }
.pdf-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Footer */
footer {
  background: var(--primary-dark);
  color: white;
  padding: 2rem 0;
  text-align: center;
}
.footer-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
}
.footer-logos i, .footer-logos span { margin-right: 6px; }
.footer-copy p {
  font-size: 0.8rem;
  opacity: 0.8;
  margin: 0.3rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .two-columns, .finance-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1rem; }
  .stat-card { min-width: 130px; padding: 0.6rem 1rem; }

  .nav-container {
    flex-wrap: wrap;
    position: relative;
  }
  .nav-left, .nav-center, .nav-right {
    flex: auto;
    width: auto;
  }
  .nav-center {
    order: 1;
    flex: 1;
    text-align: left;
    justify-content: flex-start;
    margin-left: 0.5rem;
  }
  .nav-left { order: 0; }
  .nav-right { order: 2; }
  .menu-toggle {
    display: block;
    order: 3;
    margin-left: auto;
  }
  .nav-links-wrapper {
    display: none;
    width: 100%;
    order: 4;
  }
  .nav-links-wrapper.active {
    display: block;
  }
  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
  }
  /* Cacher le texte des logos sur mobile, ne garder que les images */
  .logo-mpce .mpce-text, .logo-gouv .gouv-text {
    display: none;
  }
  .logo-mpce, .logo-gouv {
    gap: 4px;
  }
  .logo-img {
    height: 32px;
  }
  .plan-title {
    font-size: 0.7rem;
  }
  .tabs { gap: 0.3rem; }
  .tab-btn { padding: 0.4rem 1rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .axes-grid { grid-template-columns: 1fr; }
  .impact-cards { flex-direction: column; }
  .sector-header { flex-direction: column; gap: 0.5rem; }
}