/*
  ╔══════════════════════════════════════════════════════════════════════════╗
  ║                      pages.css — Page Specific Styles                    ║
  ║         Refactored for Modern Responsive Design & Clean Code             ║
  ╚══════════════════════════════════════════════════════════════════════════╝
*/

/* 
  NOTE: La plupart des styles de section (arrière-plan, hauteur, etc.) sont gérés 
  globalement par la classe `.section` dans `layout.css`. Ce fichier contient 
  uniquement les styles spécifiques au *contenu* de chaque section.
*/

/* ══════════════════════════════════════════════════════════════════════════ */
/* HERO SECTION                                                               */
/* ══════════════════════════════════════════════════════════════════════════ */

.hero-content {
  /* Mobile-first: Le contenu est centré par défaut */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 7vw, 4.5rem); /* Taille de police responsive */
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  text-wrap: balance; /* Améliore le rendu des titres sur plusieurs lignes */
  margin: 0;
}

.word-wrapper {
  display: inline-block;
  white-space: nowrap; /* Empêche le mot de se couper */
}

/* Animation pour les lettres du titre */
.letter-animate {
  display: inline-block;
  opacity: 0;
  animation: fadeSlideUp 0.5s var(--easing-premium) forwards;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(1em); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-divider {
  width: 75px;
  height: 6px;
  background-color: var(--color-text-primary);
  border: none;
  border-radius: var(--radius-md);
  /* Utilise clamp() pour des marges fluides et responsives */
  margin: clamp(var(--spacing-md), 5vh, var(--spacing-lg)) auto;
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-base);
  max-width: 65ch; /* Limite la largeur des lignes pour une meilleure lisibilité */
  margin: 0 0 var(--spacing-lg);
}

.hero-actions {
  display: flex;
  justify-content: center; /* Centré sur mobile */
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: var(--spacing-md);
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* STYLES GÉNÉRIQUES DU CONTENU DES SECTIONS                                   */
/* ══════════════════════════════════════════════════════════════════════════ */

/* Centre les en-têtes de section et les titres */
.parcours-header,
.section h2 {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  font-family: var(--font-heading);
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Style pour les sous-titres (ex: "Mon parcours") */
.parcours-header .subtitle {
  display: block;
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

/* Style commun pour les paragraphes des sections */
.section p {
  text-align: center;
  max-width: 70ch; /* Largeur optimale pour la lecture */
  margin-left: auto;
  margin-right: auto;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

#about.section {
  padding-top: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  min-height: 400px;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* SKILLS SECTION                                                             */
/* ══════════════════════════════════════════════════════════════════════════ */

#skills {
  text-align: center;
}

.skills-columns {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: var(--spacing-sm, 1rem);
  margin-top: var(--spacing-lg, 2rem);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.skills-col {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md, 1rem);
  flex: 1;
  min-width: 0; /* Ensures columns can shrink on very small screens */
}

.skills-col h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-base, 1rem);
  font-weight: 600;
  margin-bottom: var(--spacing-md, 1rem);
  color: var(--color-accent);
  text-align: center;
  word-wrap: break-word;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md, 1rem);
  align-items: center;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm, 0.5rem);
  padding: var(--spacing-sm, 0.75rem) var(--spacing-md, 1rem);
  border-radius: var(--radius-md, 8px);
  background: var(--color-bg-card, #2D3139);
  border: 1px solid var(--color-border, #383E47);
  text-decoration: none;
  color: var(--color-text-primary, #FFFFFF);
  width: 100%;
  max-width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  
  /* Initial state for scroll animation */
  opacity: 0;
  transform: translateY(20px);
}

.skills-list.visible .skill-item {
  animation: fadeUpSkill 0.6s ease forwards;
}

/* Staggered animation */
.skills-list.visible .skill-item:nth-child(1) { animation-delay: 0.1s; }
.skills-list.visible .skill-item:nth-child(2) { animation-delay: 0.2s; }
.skills-list.visible .skill-item:nth-child(3) { animation-delay: 0.3s; }
.skills-list.visible .skill-item:nth-child(4) { animation-delay: 0.4s; }
.skills-list.visible .skill-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeUpSkill {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skill-item:hover,
.skill-item:focus {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  border-color: var(--color-accent, #7DB3FF);
  outline: none;
}

.skill-item img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
}

.skill-item span {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 500;
  color: var(--color-text-primary);
  word-break: break-word; /* Prevents overflow */
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* CONTACT SECTION                                                            */
/* ══════════════════════════════════════════════════════════════════════════ */

#contact.section {
  min-height: auto; /* Supprime le minimum de 500px global */
  padding-top: var(--spacing-lg); /* Réduit l'espacement en haut */
  padding-bottom: var(--spacing-xl); /* Garde un peu d'espace en bas avant le footer */
}

.contact-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-lg, 2rem);
  margin: var(--spacing-lg) auto 0;
  width: 100%;
  flex-wrap: wrap; /* responsive */
}

.contact-icon {
  display: inline-flex;
  transition: transform var(--transition-normal, 0.3s ease), opacity var(--transition-normal, 0.3s ease);
}

.contact-icon img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.contact-icon:hover,
.contact-icon:focus {
  transform: translateY(-5px) scale(1.1);
  opacity: 0.8;
  outline: none;
}

.contact-email {
  margin-top: var(--spacing-lg);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: var(--font-size-md); /* Taille volontairement plus petite (0.875rem = 14px) */
  color: var(--color-text-primary);
  user-select: all; /* Permet de sélectionner tout le texte en un clic pour le copier facilement */
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* BREAKPOINTS RESPONSIVES                                                    */
/* ══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
  .hero-divider {
    margin-left: 0;
    margin-right: 0;
  }

  .hero-actions {
    justify-content: flex-start; /* Aligne les boutons à gauche */
  }

  .skills-columns {
    gap: var(--spacing-xl, 3rem);
  }

  .skills-col h3 {
    font-size: var(--font-size-lg, 1.25rem);
  }

  .skill-item {
    gap: var(--spacing-md, 1rem);
    padding: var(--spacing-md, 1rem) var(--spacing-lg, 1.5rem);
    max-width: 350px;
  }

  .skill-item img {
    width: 48px;
    height: 48px;
  }

  .skill-item span {
    font-size: var(--font-size-base, 1rem);
  }
}
