/* ═══════════════════════════════════════════════════════════════════
   🔧 CORRECTIONS DE TEXTE ET D'ADAPTABILITÉ RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */

/* Correction générale des débordements de texte */
* {
  word-wrap: break-word;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}

/* Titres responsifs avec débordement géré */
h1,
h2,
h3,
h4,
h5,
h6 {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  max-width: 100%;
}

/* Paragraphes avec gestion optimisée */
p,
.text-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  text-align: justify;
  text-justify: inter-word;
}

/* Cartes et conteneurs avec gestion du débordement */
.card,
.quick-link,
.stat-card,
.news-card {
  overflow: hidden;
  word-wrap: break-word;
}

.card h3,
.card h4,
.quick-link h3 {
  line-height: 1.3;
}

.card p,
.quick-link p {
  line-height: 1.5;
}

/* Excerpts de news complets */
.news-excerpt,
.report-excerpt {
  line-height: 1.4;
}

/* Titres de news complets */
.news-title,
.report-title {
  line-height: 1.2;
  font-weight: 600;
}

/* Navigation responsive */
.nav-item {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
}

/* Boutons avec texte adaptatif */
.btn,
.cta {
  word-wrap: break-word;
  text-align: center;
  white-space: normal;
  padding: 12px 20px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Stats avec valeurs et labels adaptés */
.stat-value {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1;
  word-wrap: break-word;
}

.stat-label {
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  line-height: 1.3;
  word-wrap: break-word;
  text-align: center;
}

/* Hero content adaptatif */
.hero-content h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.hero-content p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.5;
  margin-bottom: 2rem;
  max-width: 65ch;
}

/* Tables responsives */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  min-width: 600px;
  word-wrap: break-word;
}

.table-responsive td,
.table-responsive th {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
  overflow-wrap: break-word;
  padding: 8px 12px;
}

/* Formulaires adaptatifs */
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  word-wrap: break-word;
  padding: 12px 16px;
  font-size: 1rem;
  line-height: 1.4;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Breadcrumbs responsive */
.breadcrumb {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: break-word;
  max-width: 100%;
}

.breadcrumb-item {
  display: inline;
  word-wrap: break-word;
}

/* Footer adaptatif */
.footer-text {
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  line-height: 1.4;
  word-wrap: break-word;
}

/* ═══════════════════════════════════════════════════════════════════
   📱 RESPONSIVE BREAKPOINTS OPTIMISÉS
   ═══════════════════════════════════════════════════════════════════ */

/* Mobile First - corrections spécifiques */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
    text-align: center;
  }

  .hero-content p {
    font-size: 1rem;
    text-align: center;
    padding: 0 1rem;
  }

  .card h3 {
    font-size: clamp(1rem, 4vw, 1.2rem);
  }

  .card p {
    font-size: clamp(0.9rem, 3vw, 1rem);
  }

  .btn {
    font-size: 0.9rem;
    padding: 14px 20px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .nav-item {
    white-space: normal;
    text-align: center;
    padding: 8px 12px;
  }

  .stat-value {
    font-size: clamp(1.5rem, 6vw, 2.2rem);
  }

  .stat-label {
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  }
}

/* Tablet - optimisations intermédiaires */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 3.2rem);
  }

  .card h3 {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
  }

  .card p {
    line-height: 1.5;
  }
}

/* Desktop - optimisations finales */
@media (min-width: 1025px) {
  .hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
  }

  .card-grid {
    gap: 2rem;
  }

  .card p {
    line-height: 1.5;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   🎨 CORRECTIONS SPÉCIFIQUES AUX COMPOSANTS
   ═══════════════════════════════════════════════════════════════════ */

/* Quick Links - adaptation du contenu */
.quick-links .quick-link h3 {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.quick-links .quick-link p {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: var(--muted, #666);
  line-height: 1.4;
}

/* News Cards - optimisation du contenu */
.news-grid .news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card .news-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-card .news-title {
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.news-card .news-excerpt {
  flex-grow: 1;
  font-size: clamp(0.85rem, 1.8vw, 0.9rem);
  margin-bottom: 1rem;
}

.news-card .news-meta {
  font-size: 0.8rem;
  color: var(--muted, #666);
  flex-shrink: 0;
}

/* Partner logos - adaptation responsive */
.partners-grid .partner-logo {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  filter: grayscale(1) opacity(0.7);
  transition: all 0.3s ease;
}

.partners-grid .partner-logo:hover {
  filter: grayscale(0) opacity(1);
  transform: scale(1.05);
}

/* Contact form - optimisation */
.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .contact-form .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-form .form-field label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
  color: var(--ink, #333);
}

/* Corrections des animations pour le texte */
.animated-text {
  animation-duration: 0.6s;
  animation-fill-mode: both;
  animation-timing-function: ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation-name: fadeInUp;
}

/* Accessibilité - focus et lisibilité */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--gold, #ffc247);
  outline-offset: 2px;
}