/* ============================
 *    MAJ : 2025 04 25 23h50
 * ============================ */
/* ============================
 * 1. VARIABLES GLOBALES
 * ============================ */
:root {
  --primary-color: #2c7a7b;
  --primary-light: #4fd1c5;
  --secondary-color: #718096;
  --light-bg: #f7fafc;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --radius-md: 8px;
}

/* ============================
 * 2. RESET ET BASE
 * ============================ */
body {
  margin: 0;
  padding: 0;
}

h1, h2 {
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* ============================
 * 3. STRUCTURE HEADER
 * ============================ */
header {
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  height: 32px;
  top: 0;
  border-radius: initial;
}

.header-content {
  min-width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  height: 32px;
  top: 0;
}

header .nav {
  left: auto;
  max-width: 1200px;
  width: 100%;
}

.nav {
  top: 0;
  left: 0;
}

.menu {
  width: 100%;
  background-color: #aaa;
  line-height: 100%;
  border-radius: 5px;
  display: inline-block;
}

.on_recherche.search-open {
  top: 2px;
}

/* ============================
 * 4. CONTENEUR PRINCIPAL
 * ============================ */
.on_centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  top: 0;
  padding: 15px 0px 5px 0px;
  margin: 0 auto;
  background: var(--light-bg);
  box-shadow: var(--shadow-sm);
  border-radius: initial;
}

/* ============================
 * 5. ENTÊTE ET TITRES
 * ============================ */
.on_entete {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.on_entete #titre {
  margin: 10px 0 10px 230px;
  width: 100%;
}

.on_entete h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin: 0;
  font-weight: 700;
}

.on_entete h2 {
  color: var(--secondary-color);
  margin: 0;
  font-weight: 500;
}

/* ============================
 * 6. CONTENEURS DE CONTENU
 * ============================ */
.on_espece, 
.on_galerie, 
.on_photos_pays {
  margin: initial;
  padding: initial;
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
  box-sizing: border-box;
}
.on_galerie_ph{
  padding: 0 10px;
  display: block;
}
.on_img_gal {
  display: block;
  position: relative;
  top: -15px;
}

#galerie {
  width: 100%;
  margin:10px 0 40px 0;
}

/* ============================
 * 7. NAVIGATION ALPHABÉTIQUE
 * ============================ */
.on-alphabet, 
.on-alphabet .alpha, 
.on-alphabet .last, 
.on-alphabet .next, 
.alpha .alphabet, 
.alpha .mois,
.alpha:hover .alphabet, 
.alpha:hover .mois {
  all: unset;
}

.on-alphabet {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;  
  gap: 15px;
  margin: 0 20px 0 0;
  padding: 0;
}

.on-alphabet .last, 
.on-alphabet .next {
  width: 30px;
}

.on-icon-alpha, 
.alpha .on-icon-alpha, 
.alpha .on-icon-chrono {
  display: none;
}

.alphabet a, 
.mois a, 
.alphabet span, 
.mois span, 
.on-lettre, 
.on_galerie .crumbs a.on-lettre, 
.on_galerie .crumbs span {
  font-size: 20px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}
.crumbs{
  top: -5px;
}

.alpha .alphabet .on-lettre, 
.alpha .mois .on-lettre, 
.alpha a {
  background-color: transparent;
}

.alpha .alphabet a, .alpha .mois a {
  display: inline-block;
  text-decoration: none;
  border-bottom: 1px solid black;
  padding-bottom: 2px;
  font-weight: normal;
}

.alpha .alphabet a.on-red, .alpha .mois a.on-red  {
  font-weight: bold;
  border-bottom: 2px solid black;
}

.alpha .alphabet span {
  display: inline-block;
  padding-bottom: 2px;
  font-weight: normal;
}

.crumbs a.on-red {
  box-shadow: none;
  font-weight: 900;
  padding: 0 5px;
}

/* ============================
 * 8. CONTENEUR PHOTOS
 * ============================ */
#photos {
  justify-content: space-between;
  gap: 10px;
  width: 1170px;
}

#photo {
  position: relative;
  flex: 1;
  max-width: 1024px;
  width: 100%;
  margin-bottom: 20px;
  display: block;
}

/* Styles pour le conteneur principal de la galerie */
#galerie {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#photo figure,
#galerie figure {
  margin: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  width: 100%;
  /* Ajout pour assurer que le figcaption soit bien positionné */
  display: block;
}

#galerie figure {
  width: auto;
  display: inline-block;
  margin: 5px;
  border: 1px solid #343c43;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  padding: 0; /* S'assure qu'il n'y a pas d'espace interne */
  background-color: transparent; /* Élimine toute couleur de fond qui pourrait créer un espace */
}

#galerie figure > div {
  position: relative;
  overflow: hidden;
  border-bottom: none;
  margin: 0;
  padding: 0;
}

/* Ajuster l'apparence des images dans la galerie */
#galerie figure img.photos {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
  vertical-align: bottom; /* Élimine l'espace sous l'image */
}

/* Assurer que les liens dans les figcaptions sont bien affichés */
#galerie figcaption a {
  display: block;
  padding: 0;
  color: #333;
  text-decoration: none;
}

#galerie figure img.photos {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
}

#photo figure img {
  width: 100%;
  height: auto;
  display: block;
}

#photo figure img.monimage {
  min-width: 100%;
}

#photo figure img.monimage_h {
  height: initial;
  min-width: 100%;
}

#photo figcaption,
#galerie figcaption {
  display: block;
  padding: 0;
  background-color: rgba(250, 250, 250, 0.75);
  color: #333;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  min-height: 20px;
  margin: 0;
  text-align: center;
  font-size: 0.8em;
  border-top: none;
  line-height: 1.7em;
}

.copyright {
  font-size: 0.85rem;
  opacity: 0.95;
  text-align: center;
  margin: 0;
  padding: 5px 0;
  line-height: 1.4;
  width: 100%;
}

/* ============================
 * 9. BARRE DE NAVIGATION
 * ============================ */
.barre-nav {
  position: absolute;
  top: -25px;
  left: 0;
  width: 100%;
  height: 50px;
  z-index: 20;
  background-color: transparent;
  padding: 5px 0;
}

.on-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
}

.on-nav a {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  top: 5px;
  cursor: pointer;
  z-index: 99;
  background-color: rgba(0, 0, 0, 0.25);
  color: white;
  text-decoration: none;
  border-radius: 50%;
  opacity: 0.5;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.on-nav a:hover {
  opacity: 0.8;
  background-color: rgba(0, 0, 0, 0.4);
}

/* Position des boutons */
.on-nav [class$=_mini] {
  left: 10px;
}

.on-nav [class$=_prec] {
  left: 35px;
}

.on-nav [class$=_suiv] {
  right: 35px;
}

.on-nav [class$=_maxi] {
  right: 10px;
}

.on-nav [class^=on-nav-] {
  display: none;
}

/* ============================
 * 10. ICÔNES DE NAVIGATION
 * ============================ */
/* Centrage des icônes */
.on-nav [class$=_mini]::before,
.on-nav [class$=_maxi]::before,
.on-nav [class$=_prec]::before,
.on-nav [class$=_suiv]::before {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

/* Icônes spécifiques */
.on-nav [class$=_mini]::before {
  content: "⏮";
  font-size: 24px;
}

.on-nav [class$=_maxi]::before {
  content: "⏭";
  font-size: 24px;
}

.on-nav [class$=_prec]::before {
  content: "◀";
  font-size: 24px;
}

.on-nav [class$=_suiv]::before {
  content: "▶";
  font-size: 24px;
}

.on_photos_pays [class$=_prec]::before,
.on_galerie [class$=_prec]::before {
  content: "◀";
  font-size: 24px;
}

.on_photos_pays [class$=_suiv]::before,
.on_galerie [class$=_suiv]::before {
  content: "▶";
  font-size: 24px;
}

/* Supprimer les icônes background-image */
.icon-down::before,
.icon-up::before,
.on_head_down::before,
.on-nav [class$=_mini], 
.on-nav [class$=_maxi], 
.on-nav [class$=_prec], 
.on-nav [class$=_suiv], 
.icon-nav_suiv_2, 
.on_photos_pays [class$=_suiv], 
.on_galerie [class$=_suiv], 
.icon-nav_prec_2, 
.on_photos_pays [class$=_prec], 
.on_galerie [class$=_prec], 
.on_espece [class$=on-f], 
#galerie [class$=on-f] {
  background-image: none;
}

/* ============================
 * 11. AUTRES ICÔNES
 * ============================ */
.icon-up::before {
  content: "▲";
  font-size: 14px;
}

.icon-down::before,.icon-up::before,.on_head_down::before {
  content: "▼";
  font-size: 18px;
  color:#a3a3a3;
}
.icon-down,.icon-up,.on_head_down {
    width: 10px;
    height: 0;
}

.on_head_up::before {
  content: "▲";
  font-size: 14px;
}

.loupe::before, 
.on-zoom::before {
  content: "🔍";
  font-size: 20px;
}

.search::before, 
.icon-ok::before {
  content: "🔍";
  font-size: 14px;
}

.coch::before {
  content: "✓";
  font-size: 14px;
}

.fich::before, 
.on-f::before {
  content: "📄";
  font-size: 16px;
  padding: 0;
}
.infos_espece .on-f {
  padding: 0;
}

/* ============================
 * 12. TAGS
 * ============================ */
.tags {
  margin-top: 20px;
  border: none;
  background: #edf2f7;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tags ul {
  display: flex;
  flex-wrap: wrap;
  padding: 10px;
  justify-content: center;
  gap: 8px;
  background: transparent;
}

.tags li {
  background: white;
  padding: 5px 12px;
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* ============================
 * 13. INFOS ESPÈCE
 * ============================ */
.on_infos {
  flex: 0 0 auto;
  width: 220px !important;
  margin-top: -10px;
  padding: 10px;
}

.infos_espece, 
.infos_photo {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 0 0 20px 0;
  overflow: hidden;
  border: none;
  width: 100%;
}

.infos_espece h3, 
.infos_photo h3 {
  background-color: #aaa;
  color: white;
  padding: 4px 15px;
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

.infos_espece h4, 
.infos_photo h4 {
  color: var(--primary-color);
  margin: 5px 0 5px;
  padding: 0  0 0 5px;
  font-size: 0.9rem;
}

.infos_espece p, 
.infos_photo p {
  padding: 0 0 0 10px;
  margin: 0;
  font-size: 0.9rem;
}

.infos_espece a, 
.infos_photo a {
  color: var(--primary-color);
  text-decoration: none;
}

.infos_espece a:hover, 
.infos_photo a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* ============================
 * 14. CARTE
 * ============================ */
#mapquest {
  height: auto;
  margin: 10px 0 5px 0;
  box-shadow: none;
  border-radius: 0;
}

.coordonnees {
  margin-top: -5px;
  font-size: 0.7em;
  letter-spacing: -0.04em;
  display: block;
}

/* ============================
 * 15. DONNÉES EXIF
 * ============================ */
#exif {
  background: #edf2f7;
  border-radius: var(--radius-md);
  padding: 10px;
  margin-top: 10px;
  cursor: pointer;
}

#exif h4 {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9em;
}

#exif p {
  padding: 10px 0 0;
  font-size: 0.85em;
  line-height: 1.4em;
}



/* ============================
 *  RESPONSIVE
 * ============================ */
@media (max-width: 1000px) {
  .on_espece, 
  .on_galerie, 
  .on_galerie_index, 
  .on_photos_pays, 
  .on_infos {
    padding: 0 10px;
    display: block;
  }

  .on_espece {
    display: flex;
  }
 
  .on_galerie .crumbs {
    display: contents;
    margin-left: 0px;
    width: 95%;
    line-height: 30px;
  }
  
  .on_galerie .on-alphabet {
    display: block;
  }
  
  .on_recherche.search-open {
    left: 0;
  }
  
  .on_search {
    width: 150px;
    margin: 1px 0 0 0;
    padding: 0;
  }
  
  #term {
    width: 120px;
  }
  #familles table {
    margin-top: 20px;
  }
  #familles td a {
    color: #5a5a95;
  }
}

@media (max-width: 768px) {
  header .nav {
    width: 120px;
    display: block;
    left: 0;
    z-index: 0;
    transform: translateX(-120px);
  }
  
  .header__icon {
    position: absolute;
    display: block;
    top: -11px;
    left: 0;
    z-index: 10;
    width: 40px;
    height: 40px;
    cursor: pointer;
  }
  
  .with--sidebar .menu {
    display: block;
    position: fixed;
    top: 30px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    overflow-y: auto;
    transform: translateX(0);
  }
  
  .on-alphabet .last {
    margin-right: 30px;
  }
  
  #photos {
    display: block;
    min-width: initial;
    max-width: 94vw;
    box-sizing: border-box;
  }
  
  .on_infos {
    width: 100% !important;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: space-between;
    padding: 0;
    gap:5px;
  }
  
  .infos_espece, 
  .infos_photo {
    width: 48%;
    margin-bottom: 0;
  }
  
  .on_galerie #galerie {
    top: 0;
  }
  
  #mapquest {
    width: 80%;
  }
  
  .barre-nav {
    top: -28px;
  }
  
  .on-nav {
    top: 0;
    height: 35px;
  }
  
  .on-nav [class$=_mini], 
  .on-nav [class$=_maxi], 
  .on-nav [class$=_prec], 
  .on-nav [class$=_suiv] {
    top: 0;
  }
  
  .on-nav [class$=_mini] {
    left: 5px;
  }
  
  .on-nav [class$=_prec] {
    left: 50px;
  }
  
  .on-nav [class$=_suiv] {
    right: 50px;
  }
  
  .on-nav [class$=_maxi] {
    right: 5px;
  }
  
  .on-nav a {
    width: 35px;
    height: 35px;
    background-color: rgba(0, 0, 0, 0.4);
  }
  
  .crumbs {
    line-height: 1em;
    top: -5px;
    margin: 0;
  } 
  .crumbs li {
    margin: 0;
    padding: 0;
    margin-right: 10px;
    display: inline-flex;
  }
  .crumbs li:after {
    margin: 0;
    padding: 0;
    content: '|';
  }
 
  .crumbs [class^='crumb-'] {
    display: none;
  }
  
  .on_entete #titre {
    margin: 20px 0;
  }
  

  .titre i {
    display: block;
  }
  
  .on_entete #titre h1::first-letter {
    display: none; 
  }
   
  .on_galerie .alphabet .on-alphabet a, 
  .on_galerie .alphabet .on-alphabet span {
    letter-spacing: -0.25em;
  }
  #familles {
    overflow-x: hidden;
  }
  
  #familles table, 
  #familles thead, 
  #familles tbody {
    display: block;
    width: 100%;
  }
  
  #familles thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  #familles tbody {
    display: flex;
    flex-wrap: wrap;
  }
  
  #familles tbody tr {
    display: block;
    width: 50%; /* Deux lignes par rangée */
    box-sizing: border-box;
    padding: 0 5px;
    margin-bottom: 1px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  
  #familles tbody td {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0 5px;
    box-sizing: border-box;
    border: none;
    border-bottom: 1px solid #eee;
  }
  
  #familles tbody td:last-child {
    border-bottom: none;
  }
}




@media (max-width: 600px) {
  .copyright {
    font-size: 0.8rem;
  }
}

@media screen and (max-width: 599px) {
    .item2, .item3, .item4 {
        display: block !important;
    }
}

@media (max-width: 480px) {
  /* Rendre la navigation alphabétique plus accessible sur mobile */
  .alphabet a, 
  .alphabet span {
    font-size: 18px;
    padding: 4px 3px; /* Réduit le padding */
    margin: 0 2px 3px 2px; /* Réduit la marge verticale */
    display: inline-block;
    min-width: 24px; /* Réduit légèrement la largeur minimale */
    background-color: #f5f5f5;
    border-radius: 3px;
    line-height: 1.1; /* Réduit l'interlignage */
  }
  
  /* Optimiser les images et leurs légendes */
  #galerie figure {
    margin: 8px auto; /* Réduit les marges verticales */
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    padding: 0; /* Élimine tout padding interne */
  }
  
  #galerie figure img {
    width: 100%;
    display: block;
    border: none;
    margin: 0;
    padding: 0;
  }
  
  #galerie figcaption {
    background-color: rgba(245, 245, 245, 0.95);
    border-top: 1px solid #e0e0e0;
    padding: 4px 0;
    margin: 0; /* Élimine toute marge */
  }
}
