/* Réinitialisation de base */
body {
  margin: 0;
  padding: 0;
}

h1.header-hero__title {
    color: #007ec5;
    font-weight: 900;
    text-transform: uppercase; /* Convertit le texte en majuscules */
}

/* Section Header */
.header-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem; /* Espacement sous l'image */
}

.header-hero__image {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid white;
  background-image: url('/wp-content/uploads/2023/03/tennis_court_placeholder.png'); /* Chemin correct par défaut */
  background-size: cover;
  background-position: center;
  margin-top: 1rem;
}

/* Contenu principal */
.main-page {
  width: 90%;
  margin: auto;
  margin-top: 2rem;
}

.main-page-title {
  display: flex;
  align-items: center;
  font-weight: 900;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.blue-ribbon {
  display: inline-block;
  width: 9px; /* Largeur du liseré */
  margin-right: 15px; /* Espace entre le liseré et le texte */
  height: 30px; /* Hauteur du liseré */
  background-color: #b38e56; /* Couleur marron */
}

/* Blocs bleus */
.player-stats {
  width: 100%;
  margin: auto;
}

.player-stats h3 {
  text-transform: uppercase;
  margin: 0 auto 2rem;
  box-sizing: border-box;
  color: white;
  background-color: #007ec5;
  padding: 1.1rem;
  font-size: 2.3rem;
  text-align: center;
}

/* Grid des blocs statistiques */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 blocs par ligne */
  gap: 1rem; /* Espacement entre les blocs */
  width: 100%;
}

.stat {
  background-color: #007ec5;
  color: white;
  text-align: center;
  padding: 1rem;
  border-radius: 5px;
  box-sizing: border-box;
}

/* Titre des statistiques (ex. "Pays", "Lieu de naissance") */
.stat h4 {
  background-color: #007ec5; /* Couleur de fond bleu */
  color: white; /* Texte en blanc */
  padding: 1rem; /* Espacement interne */
  font-weight: bold; /* Texte en gras */
  text-transform: uppercase; /* Texte en majuscule */
  white-space: nowrap; /* Empêche le retour à la ligne par défaut */
}

.stat span, 
.stat div, 
.stat p { /* Cible span, div et p */
  background-color: white; /* Fond blanc */
  color: #007ec5; /* Couleur du texte */
  display: inline-block; /* Adapte le fond à la largeur du texte */
  padding: 0.2rem 0.5rem; /* Espacement interne */
  border-radius: 4px; /* Coins arrondis pour uniformiser */
  text-align: center; /* Centre le texte si nécessaire */
  font-weight: bold; /* Texte en gras */
}

/* Sidebar : fixe sa position à droite */
#secondary {
  width: 300px;
  margin-left: auto;
  position: relative;
  flex-shrink: 0;
  top: 0;
}

/* Alignement général sur desktop */
@media screen and (min-width: 1024px) {
  .main-page-content {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
  }
}

/* Responsive design spécifique pour mobile */
@media screen and (max-width: 768px) {
  /* Grid des statistiques */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Deux colonnes */
    gap: 1rem; /* Espacement entre les blocs */
    justify-items: center; /* Centre horizontalement chaque bloc */
  }

  /* Bloc des statistiques */
  .stat {
    background-color: #007ec5;
    color: white;
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    box-sizing: border-box;
    width: 100%; /* Chaque bloc occupe toute la largeur disponible */
    max-width: 150px; /* Largeur maximale */
    display: flex;
    flex-direction: column; /* Organisation verticale */
    align-items: center; /* Centre horizontalement */
    justify-content: center; /* Centre verticalement */
    min-height: auto; /* Ajustement automatique de la hauteur */
    word-wrap: break-word; /* Coupe les mots trop longs */
  }

  /* Titre des statistiques (ex. "Pays", "Lieu de naissance") */
  .stat h4 {
    font-size: 1.8rem !important; /* Taille de police légèrement augmentée */
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 0.5rem; /* Espace sous le titre */
    color: white;
    text-align: center;
    line-height: 1.2; /* Évite les débordements */
    white-space: normal; /* Permet le retour à la ligne sur mobile */
    word-break: break-word; /* Coupe les mots trop longs si nécessaire */
  }

  /* Détails des statistiques (ex. "France", "Metz, France", "188 cm") */
  .stat span, 
  .stat div, 
  .stat p, 
  .stat-detail, /* Classe générique pour couvrir plus de cas */
  .stat > * {
    font-size: 1.6rem !important; /* Augmente la taille de police */
    color: #007ec5 ; /* Couleur du texte bleu */
    background-color: white ; /* Fond blanc */
    padding: 0.4rem 0.8rem !important; /* Espacement interne */
    border-radius: 5px !important; /* Coins arrondis */
    font-weight: bold !important; /* Texte en gras */
    text-align: center !important; /* Centre le texte */
    display: inline-block !important; /* Adapte à la largeur du contenu */
    margin: 0 auto !important; /* Centre les détails dans les blocs */
  }

  /* Permet au contenu long de s'adapter */
  .stat {
    min-height: 150px !important; /* Assure une hauteur minimale */
  }
}
