/* ==========================================================================
   livre.css : feuille de style du Petit Manuel de Météo Montagne

   SOMMAIRE
    1. Base (page, liens, titres)
    2. Mise en page générale
    3. Bandeau du haut
    4. Menu
    5. Recherche
    6. Anecdotes (popups de texte)
    7. Glossaire (info-bulles)
    8. Images et blocs texte + image
    9. Styles de texte et couleurs
   10. Outils (convertisseurs, radiosondage, tableaux)
   11. Divers
   12. Impression
   ========================================================================== */


/* ==========================================================================
   1. BASE
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Verdana;
  background: #ffffee;
  font-size: .85rem;
}

a {
  text-decoration: none;
  color: rgb(85, 107, 47);
  cursor: pointer;
}

/* évite que les titres ciblés par une ancre passent sous le bandeau fixe */
section,
[id] {
  scroll-margin-top: 100px;
}

/* ----- Titres ----- */
h1 {
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1.8rem;
  margin: 0;
}

h2 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #666666;
  line-height: 1.2rem;
  margin: 0;
}

h3 {
  font-size: 1.3rem;
  font-weight: bold;
  line-height: 1.1rem;
  color: green;
  margin: 1.05em 0 0;
}

h4 {
  font-size: 1.1em;
  font-weight: bold;
  line-height: 1.05em;
  color: #804000;
  margin: 1.05em 0 0;
}


/* ==========================================================================
   2. MISE EN PAGE GÉNÉRALE
   ========================================================================== */

/* marge haute de 99px : place du bandeau fixe */
main {
  max-width: 1200px;
  margin: 130px auto 0;
  padding: 0 20px;
}
section,
[id] {
  scroll-margin-top: 130px; /* était 100px */
}
@media (max-width: 768px) {
  #bandeau {
    width: 100%;
    border-left: none;
    border-right: none;
  }

  .nav-site {
    width: 100%;
    border-left: none;
    border-right: none;
    border-radius: 0;
    font-size: clamp(9px, calc(100vw / 80), 15px);  /* pas de marge de 40px ici */
  }
}

/* ==========================================================================
   3. BANDEAU DU HAUT
   ========================================================================== */

#bandeau {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;                      /* centré comme le texte */
  width: min(1200px, calc(100% - 40px)); /* = largeur du texte de <main> */
  box-sizing: border-box;
  height: 98px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 10px;
  background: #e0ffff;
  z-index: 1000;
  border-bottom: 1px solid #3156c0;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  border-radius: 0;
}

/* ----- Barre de navigation entre les 6 pages ----- */
.nav-site {
  position: fixed;
  top: 98px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: min(1200px, calc(100% - 40px));
  height: 30px;
  box-sizing: border-box;
  z-index: 999;

  display: flex;
  align-items: center;
  justify-content: flex-start;   /* centrage assuré par les marges auto ci-dessous */
  white-space: nowrap;
  overflow-x: auto;              /* filet de sécurité si vraiment trop étroit */

  /* police proportionnelle à la largeur, entre 9px et 15px */
  font-size: clamp(9px, calc((100vw - 40px) / 80), 15px);

  background: #fff;
  border: 1px solid #000;
  border-top: none;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.35);
}
.nav-site a:first-child { margin-left: auto; }
.nav-site a:last-child  { margin-right: auto; }

.nav-site .sep {
  color: #999;
  margin: 0 .3em;
}

.nav-site a {
  padding: 1px .5em;
  border-radius: 12px;
  color: var(--c);
}

/* une couleur par page */
.nav-site .n1 { --c: #000000; }  /* Accueil */
.nav-site .n2 { --c: #0044cc; }  /* Paramètres */
.nav-site .n3 { --c: #009900; }  /* Phénomènes */
.nav-site .n4 { --c: #d00000; }  /* Perturbations */
.nav-site .n5 { --c: #83A697; }  /* Types de temps */
.nav-site .n6 { --c: #804000; }  /* Prévisions */
.nav-site .n7 { --c: #7F00FF; }  /* Evolution climat */
/* page en cours : blanc, gras, fond de la couleur du lien, coins arrondis */
.nav-site a.actif {
  background: var(--c);
  color: #fff;
  font-weight: bold;
}

/* ----- Trois zones : gauche / centre / droite ----- */
.zone-gauche,
.zone-droite {
  width: 25%;
  display: flex;
  align-items: center;
}

.zone-droite {
  justify-content: flex-end;
}

.zone-centre {
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* image centrée de taille fixe */
.zone-centre img {
  width: 351px;
  height: 98px;
  object-fit: cover;
}

/*
   Règle d'origine jamais appliquée (écrasée par « .zone-centre img » ci-dessus,
   qui était déclarée plus bas). Je la laisse en commentaire pour ne pas changer
   l'affichage. Pour une image pleine largeur sur petit écran : la placer ici,
   sans commentaire.
   @media (max-width: 800px) { .zone-centre img { width: 100%; } }
*/

/* texte « format numérique gratuit... » à gauche */
.auteur {
  font-size: .8em;
  line-height: .9em;
}

.bleue {
  color: #3156C0;
}

/* ----- Bouton « retour en haut » ----- */
.retour-haut {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.retour-haut img {
  width: 26px;
  height: auto;
  display: block;
  cursor: pointer;
}

.retour-haut:hover {
  transform: translateY(-1px);
}

/* ----- Ligne sous le bandeau : avant-propos / navigation / livre d'or ----- */
.bandeau-haut {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  width: 100%;
}

.bandeau-haut > div:first-child {
  justify-self: start;
  margin-left: -5px;
  margin-top: -1px;
}

.bandeau-haut > div:nth-child(2) {
  justify-self: center;
  margin-top: -10px;
}

.bandeau-haut > div:last-child {
  justify-self: end;
  margin-top: -15px;
}

/* image du livre d'or */
.c {
  width: 70px;
  height: auto;
  margin-top: -30px;
}


/* ==========================================================================
   4. MENU
   ========================================================================== */

#menu {
  text-decoration: none;
  position: relative;
  right: 15px;
  top: 0;
}

/* ----- Bouton « Menu » en forme de nuage ----- */
#toggleMenu {
  position: relative;
  display: inline-block;
  font-size: 1.4em;
  padding: 12px 24px;
  background: #4F81BD;
  color: white;
  border: none;
  cursor: pointer;
  min-height: 48px;
  border-radius: 28px;
  z-index: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* 1re bosse (+ 2e et 3e via box-shadow) */
#toggleMenu::before {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  left: 6px;
  top: -9px;
  background: #4F81BD;
  border-radius: 50%;
  z-index: -1;
  box-shadow:
    18px -10px 0 4px #4F81BD,
    44px -4px 0 8px #4F81BD;
}

/* 4e bosse */
#toggleMenu::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  right: 8px;
  top: -7px;
  background: #4F81BD;
  border-radius: 50%;
  z-index: -1;
}

#toggleMenu:hover {
  filter: brightness(1.06);
}

/* ----- Liste déroulante ----- */
#menuContent {
  position: absolute;
  top: 45px;
  right: 0;
  width: 300px;
  max-width: 95vw;
  display: none;
  background: #e0ffff;
  padding: 10px;
  border: 1px solid #ccc;
  font-size: .95em;
  line-height: 1.00em;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  z-index: 2000;
}

#menuContent.open {
  display: block;
}

#menuContent ul {
  list-style: none;
  padding-left: 0;
}

#menuContent li {
  margin: 2px 0;
  position: relative;
}

#menuContent li ul li {
  padding-left: 20px;
  border-left: 2px solid #ddd;
}

#menuContent li ul li ul li {
  padding-left: 35px;
  border-left: 2px solid #ccc;
}

#menuContent a {
  text-decoration: none;
  color: black;
}

#menuContent a:hover {
  color: blue;
}

#menuContent a.active {
  color: red;
  font-weight: bold;
}

/* sous-menus repliés / dépliés */
.toggle-arrow {
  cursor: pointer;
  margin-right: 5px;
  font-size: 2px;
}

#menuContent li ul {
  display: none;
}

#menuContent li.open > ul {
  display: block;
}


/* ==========================================================================
   5. RECHERCHE
   ========================================================================== */

.recherche-livre {
  margin: 5px 0 5px 0;
  padding: 2px;
  background: #e0ffff;
  border: 1px solid #ccc;
  border-radius: 12px;
}

.recherche-livre.closed {
  height: 15px;
  overflow: hidden;
}

.zone-recherche {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 15px;
}

/* image à gauche de la recherche */
.bloc-image {
  margin-top: -18px;
  margin-right: 30px;
}

/* champ + boutons */
.bloc-recherche {
  margin-top: -10px;
  white-space: nowrap;
}

#searchBook {
  width: 320px;
  padding: 1px;
  font-size: 0.80rem;
}

#searchBtn {
  padding: 2px 2px;
  cursor: pointer;
}

#closeSearch {
  margin-left: 10px;
  cursor: pointer;
}

/* ----- Résultats ----- */
#searchResults {
  margin-top: 2px;
}

.result-item {
  margin: 8px 0;
  padding: 2px;
  background: #e0ffff;
  border-left: 4px solid #668;
}

.result-item a {
  font-weight: bold;
  color: #334;
}

.result-extrait {
  font-size: 0.85rem;
  margin-top: 2px;
}

.search-highlight {
  background: #ffeb3b;
  padding: 0 3px;
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(255, 235, 59, 0.8);
}


/* ==========================================================================
   6. ANECDOTES (popups de texte)
   ========================================================================== */

/* ----- Fenêtre ----- */
#textPopup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#textPopupContent {
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 16px;
  box-sizing: border-box;
  line-height: 1.2;
  font-size: .8rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  cursor: default;
  text-align: justify;
  hyphens: auto;
}

.popup-logo {
  height: 36px;
  width: auto;
  display: block;
  margin-bottom: 12px;
}

/* ----- Déclencheur : petit encadré logo + titre ----- */
.bloc-popup {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background-color: #e0ffff !important;
  border: 1px solid #b7cfe6;
  margin: 0 auto;
}

.bloc-popup .open-text-popup {
  background: transparent !important;
}

.titre-popup {
  cursor: pointer;
  color: #163a5f !important;
  font-weight: bold;
  text-decoration: none;
  background: transparent !important;
}

.image-popup {
  height: 20px;
  width: auto;
  display: inline-block;
  cursor: pointer;
  vertical-align: middle;
}

/* tout le contenu du déclencheur : fond transparent, texte bleu foncé */
div.bloc-popup * {
  background: transparent !important;
  color: #163a5f !important;
}

/* taille finale du logo du déclencheur */
div.bloc-popup img.image-popup {
  display: inline-block !important;
  text-align: center;
  height: 25px !important;
  width: auto !important;
  vertical-align: middle;
  cursor: pointer;
}


/* ==========================================================================
   7. GLOSSAIRE (info-bulles)
   ========================================================================== */

/* mot cliquable */
.def {
  color: purple;
  text-decoration: underline;
  cursor: pointer;
}

/* position fixe centrée (le reste du style est dans glossaire3.css) */
.tooltip-def {
  position: fixed !important;
  z-index: 99999 !important;
  top: 50% !important;
  left: 50% !important;
  max-width: 400px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
}

/* voile sombre derrière l'info-bulle */
.overlay-def {
  position: fixed !important;
  inset: 0;
}


/* ==========================================================================
   8. IMAGES ET BLOCS TEXTE + IMAGE
   ========================================================================== */

/* cadre blanc ombré autour des schémas et photos */
.cadre-img {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 4px;
  background: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ----- Agrandissement d'une image au clic ----- 
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100000 !important;
}

#overlay img {
  max-width: 90%;
  max-height: 90%;
  cursor: pointer;
}*/

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
 
  display: none;            /* le JS passe en flex à l'ouverture */
  justify-content: center;
  align-items: center;
  z-index: 100000 !important;
  cursor: zoom-out;
  background: rgba(0, 0, 0, 0.6);
  /*backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(5px);*/
}

#overlay img {
  width: auto !important;
  height: auto !important;   /* taille naturelle de l'image */
  max-width: 90vw;
  max-height: 75vh;
  cursor: zoom-out;
   background: white;
  padding: 4px;
  border-radius: 10px;
   box-shadow: 0 12px 20px rgba(0, 0, 0, 0.6);
}




/* ----- Image / texte / image (bloc-3) ----- */
.bloc-3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.bloc-3 img {
  height: 150px;
  cursor: pointer;
}

.texte-centre {
  max-width: 500px;
  text-align: justify;
  font-size: .85em;
}

.texte-centre1 {
  max-width: 800px;
  text-align: justify;
  font-size: .85rem;
}

.bloc-type {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

.bloc-type .cadre-img {
  flex: 0 0 auto;
  width: auto;
}

.bloc-type .texte-type {
  flex: 1 1 0;
  min-width: 0;
  text-align: justify;
  font-size: .85em;
}

@media (max-width: 700px) {
  .bloc-type { flex-direction: column; }
  .bloc-type .cadre-img { height: auto !important; max-width: 100%; }
}





/* ----- Texte à côté d'une image (bloc-img-droite / gauche) ----- */
.bloc-img-droite,
.bloc-img-gauche {
  display: flex;
  align-items: center;
  gap: 20px;
}

.bloc-img-droite img,
.bloc-img-gauche img {
  height: 200px;
  cursor: pointer;
}

.bloc-img-droite .texte,
.bloc-img-gauche .texte {
  flex: 1;
  text-align: justify;
}

/* ----- Image + texte (bloc-4) ----- */
.bloc-4 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.bloc-4 img {
  height: 150px;
  cursor: pointer;
}

.bloc-4 .texte {
  max-width: 440px;
  text-align: justify;
  font-size: .85rem;
}

/* ----- Petits écrans : tout passe en colonne ----- */
@media (max-width: 768px) {
  .bloc-4 {
    flex-direction: column;
    align-items: center;
  }

  .bloc-4 .texte {
    max-width: 100%;
  }

  .bloc-img-droite,
  .bloc-img-gauche {
    flex-direction: column;
  }
}


/* ==========================================================================
   9. STYLES DE TEXTE ET COULEURS
   ========================================================================== */

/* ----- Titres de blocs et textes ----- */
.titre,
.titre1 {
  font-size: 1.0em;
  font-weight: bold;
  line-height: 1.1em;
  margin: 1.1em 0 0;
}

.titre1 {
  background-color: #cc00ff;
  color: #fff;
}

.titre_marron {
  font-size: 1.00rem;
  font-weight: bold;
  color: #804000;
}

.texte {
  font-size: .85rem;
  line-height: .85rem;
}

.small {
  font-size: .7rem;
}

.gras {
  font-weight: bold;
}

.texte-just {
  text-align: justify;
}

.left {
  text-align: left;
}

.hr {
  text-align: center;
}

.marginr {
  margin-right: 15px;
}

/* ----- Encadrés ----- */
.encadre {
  color: #0099CC;
  font-weight: bold;
}

.encadre_text_ital {
  font-style: italic;
  color: #0099CC;
}

.encadre_text {
  color: #0099CC;
}

/* ----- Traits horizontaux ----- */
hr.new1 {
  border-top: 1px solid red;
}

hr.memo {
  border-top: 4px dashed;
  color: #cc00ff;
}

/* ----- Couleurs de texte ----- */
.noir        { color: black; }
.blanc       { color: #ffffff; }
.rouge       { color: red; }
.orange      { color: #ff8000; }
.marron      { color: #ce8413; }
.bistre      { color: brown; }
.vert        { color: green; }
.bleu        { color: blue; }
.neige       { color: #3366ff; }
.violet      { color: #a82ba8; }
.jaune       { color: black; background: yellow; }

/* couleur de fond de page : texte invisible */
.cache,
.fond_jaune  { color: #ffffee; }

/* ----- Couleurs en gras ----- */
.marron_jaune { color: #b37604; font-weight: bold; }
.vert_gras    { color: #336600; }
.neige_gras   { color: #3366ff; font-weight: bold; }
.rouge_gras   { color: #ff0000; font-weight: bold; }

/* ----- Fonds colorés ----- */
.rouge1  { background: red;   color: white; }
.vert1   { background: green; color: white; }
.violet1 { background: blue;  color: white; }

.Style1 { background-color: #FF9900; font-weight: bold; }
.Style2 { background-color: #FFFF00; font-weight: bold; }
.Style3 { background-color: #669900; font-weight: bold; }

/* ----- Éléments « actifs » (lien du menu, explication surlignée) ----- */
.explication.active {
  padding: 4px 6px;
  margin-bottom: 4px;
  border: 1px solid #444;
  font-weight: bold;
  border-radius: 20px;
}

.active {
  background: #fff3a0;
  outline: 1px solid #888;
}


/* ==========================================================================
   10. OUTILS (convertisseurs, radiosondage, tableaux)
   ========================================================================== */

/* ----- Champs des convertisseurs (température, pression, vent) ----- */
.ligne-unite {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* ----- Image interactive avec points cliquables ----- */
.radio-zone {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.radio-wrapper {
  position: relative;
  display: inline-block;
}

.popup-explication {
  position: absolute;
  z-index: 100;
  width: 280px;
  max-width: 90%;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #888;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer; /* indique qu'un clic ferme la bulle */
}

/* petite flèche pointant vers la pastille (bulle sous la pastille) */
.popup-explication::before {
  content: "";
  position: absolute;
  left: var(--arrow-left, 50%);
  top: -7px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top: 0;
  border-bottom: 7px solid #888;
}

/* flèche inversée quand la bulle est affichée au-dessus */
.popup-explication.au-dessus::before {
  top: auto;
  bottom: -7px;
  border-bottom: 0;
  border-top: 7px solid #888;
}

.popup-explication .explication {
  margin: 0;
  padding: 0;
}

.popup-explication .numero {
  display: inline-block;
  min-width: 18px;
  margin-right: 4px;
  padding: 0 4px;
  border-radius: 9px;
  background: #000;
  color: #fff;
  font-weight: bold;
  text-align: center;
}

/* optionnel : masquer la légende de droite, la bulle la remplace */
/* #legende { display: none; } */

.point {
  position: absolute;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
  z-index: 10;
}

#legende {
  width: 480px;
  line-height: 1.1;
  font-size: 0.80rem;
}

.numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 7px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  vertical-align: middle;
}

/* ----- Tableau à 3 colonnes ----- */
.ssp-container {
  max-width: 320px;
  font-family: Arial, sans-serif;
}

.ssp-row {
  display: flex;
  padding: 2px 0;
}

.col1,
.col2,
.col3 {
  width: 100px;
  text-align: left;
}

.ssp-header {
  font-weight: bold;
}


/* ==========================================================================
   11. DIVERS
   ========================================================================== */

/* liens de navigation vers les autres parties du manuel */
.liens-chapitres a {
  font-size: 1.0em;
}

/* anciens éléments, à vérifier avant de les supprimer */
#search {
  position: fixed;
  top: 10px;
  left: 10px;
}

.navlinks {
  text-decoration: none;
  margin: 20px 0;
}

.container {
  float: right;
  margin: 5px 5px 5px 5px;
  padding: 30px;
}

.containel {
  float: left;
  margin: 5px 5px 5px 5px;
  padding: 30px;
}


/* ==========================================================================
   12. IMPRESSION
   ========================================================================== */

@media print {
  header,
  nav,
  .bandeau {
    position: static !important;
  }
}

/* Mise en page d'impression envisagée (désactivée)
#titre-impression { display: none; }
@media print {
  #bandeau, #menu, .retour-haut, .recherche-livre, #toggleMenu { display: none !important; }
  #titre-impression { display: block !important; text-align: center; font-size: 22pt; font-weight: bold; margin: 35mm 0 20mm 0; }
}
*/