:root {
  --blue-bg: #e6f2fa;
}

@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap');


body {
  padding-top: 20px;
  margin: 0;
  overflow-x: hidden;
  font-family: 'Montserrat', 'Lato', sans-serif;
  font-size: 1.1rem; /* base size for small screens */
  line-height: 1.6;
  text-align: justify;
  background-color: #fffcee;
}

/* Medium devices (tablets, 600px and up) */
@media (min-width: 600px) {
  body {
    font-size: 1.1rem;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  body {
    font-size: 1.5rem;
  }
}

#main-div{
  position:absolute;
  top:0;
  margin:0;
}

#main-page{
  padding:0;
}

/* HEADER */

#hero {
  height: 90vh;
  max-height: 550px;
  background: url('../img/lacs/LSP03554_lr.jpg');
  background-position: center;
  background-size: cover;
  width: 100%;
  top: 0;
  position:relative;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 0 1000px rgba(0,0,0,.3);
}

#main-title-author{
  top:40%;
  position:absolute;
  max-width: 600px;
}

#main-title{
  color: white;
  font-size: 36px;
  font-weight: bold;
  text-align: center;
}

#author{
  color: #ddd;
  font-size: 16px;
  opacity: 0.85;
  text-align: center;
}


/* NAVIGATION */

#nav-bar {
  background-color: #f2f2f2;
  padding: 20px 30px;   /* padding uniforme */
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  display: flex;
  justify-content: center;  
  align-items: center;
   position: relative;
  z-index: 9999; 
}

/* Remove bullets and spacing */
#menu-items {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  display: none; /* hidden by default */
}

/* Hamburger button */
#menu-toggle {
  font-size: 1.8em;
  cursor: pointer;
  padding: 8px 12px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-left: auto; /* push hamburger to the right */
}

/* Show menu when active (small screens) */
#nav-bar.active #menu-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* Small screens: show hamburger */
@media (max-width: 768px) {
  #menu-toggle { display: block; }
}

/* Large screens: show menu inline, hide hamburger */
@media (min-width: 769px) {
  #menu-items {
    display: flex;
    flex-direction: row;
    gap: 20px;
  }
  #menu-toggle { display: none; }
  #nav-bar.active #menu-items { flex-direction: row; }
}

/* Button styles */
#nav-bar li a {
  text-decoration: none;
  color: #a6612d;
  font-weight: 600;
  font-size: 1em;
  background-color: white;
  padding: 10px 18px;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#nav-bar li a:hover {
  background-color: #f5dca0;
  color: #a6612d;
}

/* Scroll top */
#scroll-top {
  position: fixed;
  right: 40px;
  top: 120px;               /* visible près du header */
  width: 60px;
  height: 60px;
  background: #e0b658;
  color: white;
  font-size: 30px;
  font-weight: bold;

  display: flex;
  justify-content: center;
  align-items: center;

  border-radius: 50%;
  cursor: pointer;

  box-shadow: 0 8px 25px rgba(0,0,0,0.25);

  opacity: 0;
  pointer-events: none;     /* inactif quand invisible */
  transition: opacity 0.3s ease, transform 0.2s ease;
  z-index: 10000;           /* au-dessus de la map */
}

#scroll-top.show {
  opacity: 1;
  pointer-events: auto;     /* activé */
}

#scroll-top:hover {
  transform: scale(1.1);
}



/* HOME */

#section-home {
  background: #fbf8ee;
  margin-top: 0;
}

/* Sampling section */
.sampling_section {
  min-height: 100vh;
  background: #fbf8ee;
  margin-top: 0;
}

/* Cycle section */

.cycle_section {
  min-height: 100vh;
  background: #fbf8ee;
  margin-top: 0;
}

/* ESPECES */
.espece {
  height: 100vh;
  background: #fbf8ee;
  margin-top: 0;
}



/* POISSONS */
/* ===== Fish section: full-width panel + 3-column grid ===== */
#section-fish{
  /* kill the inline margin-left injected by the lib */
  margin-left: 0 !important;
  min-height: 100vh;
  /* take the full container width */
  width: 100% !important;
  max-width: none !important;

  /* keep comfortable gutters */
  padding-left: var(--section-gutters, 24px) !important;
  padding-right: var(--section-gutters, 24px) !important;
}

/* Some themes limit .story-section width; override just for fish */
#section-fish.story-section{
  width: 100% !important;
  max-width: none !important;
}

/* 3-column grid inside the fish section */
#section-fish .fish-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  justify-items: stretch;
}

/* cards should fill their column */
 .fish-card {
  width: 100%;
/*  max-width: 300px; */
  background-color: #f9f9f9;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.2s;
  text-align: center;
  cursor: pointer;
}

.fish-card:hover {
  transform: scale(1.02);
}

.fish-card img {
  width: 100%;
  height: auto;
}

.fish-card h4 {
  font-size: 1.2em;
  margin: 10px;
}

.fish-description {
  padding: 0 15px 15px 15px;
  font-size: 0.95em;
  text-align: left;
  color: #333;
}

.fish-details {
  display: none;
  margin-top: 10px;
  font-size: 0.95em;
  color: #333;
}

.fish-card.active .fish-details {
  display: block;
}

.fish-cold {
  background-color: #e0f2fd;
}

.fish-temperate {
  background-color: #ffe9cf;
}

.fish-warm {
  background-color: #ffdfe1;
}

@media screen and (max-width: 1024px){
  #section-fish .fish-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media screen and (max-width: 768px){
  #section-fish .fish-grid{ grid-template-columns: 1fr; }
}




/* ======= FINAL OVERRIDES: tighten vertical spacing & header offset ======= */
:root{
  --header-h: 120px;         /* adjust to your real fixed header height */
  --section-gap: 20px;       /* vertical gap between sections */
  --section-gutters: clamp(8px, 2vw, 16px);  /* side gutters for section width calc */
  --section-maxw: min(1600px, 96vw);

}

body{ padding-top: calc(var(--header-h) + 10px) !important; }


.section-panel{
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  margin-left: 0 !important;
  margin-bottom: 20px !important;
  margin-top: 20px !important;
}


.story-section{
  /* largeur et centrage uniformes */
  width: 100%;
  max-width: var(--section-maxw);
  margin: var(--section-gap) auto;
  padding-inline: var(--section-gutters);   /* mêmes gouttières gauche/droite */
  box-sizing: border-box; 
  position: relative;
  z-index: 1;
  scroll-margin-top: var(--header-h); /* pour le scroll du menu */
}

/* Rangée commune */
.section-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: stretch;
  justify-content: center; /* center content horizontally */
}


/* Utilitaires de colonnes - réutilisables selon la section */

.col-25{ flex: 0 0 25%;  min-width: 0; }
.col-33{ flex: 0 0 33.333%; min-width: 0; }
.col-40{ flex: 0 0 40%;  min-width: 0; }
.col-45{ flex: 0 0 45%;  min-width: 0; }
.col-50{ flex: 0 0 calc(50% - 12px);  /* ajuste pour compenser le gap */
  min-width: 0; }

.col-55{ flex: 0 0 55%;  min-width: 0; }
.col-66{ flex: 0 0 66.666%; min-width: 0; }

/* Carte blanche réutilisable */
.card{
  background-color: rgba(255,255,255,0.85);
  padding: 28px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Images uniformes */
.section-img img{
  width: 100%;
  height: auto;          /* pas d'étirement vertical */
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.section-img figure {
  margin: 0;
}

.section-img figcaption {
  text-align: right;
  font-size: 90%;
  margin-top: 5px;
}

/* Légendes uniformes */
.photo-caption{
  text-align: right;
  font-size: 90%;
  margin-top: 10px;
}

/* Responsive - passe en colonnes empilées */
@media (max-width: 900px){
  .section-row{ flex-wrap: wrap; }
  .col-25,.col-33,.col-40,.col-45,.col-50,.col-55,.col-66{ flex: 1 1 100%; }
}

/* Map lacs */

/* Hauteur de carte cohérente, pilotée par une variable */
:root{ --map-h: 52vh; }                 /* hauteur par défaut des cartes */
.map-autoheight .leaflet-container{
  height: var(--map-h) !important;
  min-height: 360px;
  border-radius: 8px;
  box-shadow: none;
}



/* le wrapper de la carte DOIT avoir une hauteur explicite */
.map-frame{
  height: var(--map-h);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* tous les wrappers htmlwidgets/leaflet héritent de 100% */
.map-frame .html-widget,
.map-frame .leaflet,
.map-frame .leaflet-container{
  height: 100% !important;
}

/* rangées en grille */
.section-row.row-2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.section-row.row-3{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}


/* SIMULATIONS */
.sim-app-container {
  background-color: #f6f6f6;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  overflow: hidden;
  max-width: var(--section-maxw);
  margin: var(--section-gap) auto;
  padding-inline: var(--section-gutters);
  box-sizing: border-box;
}

.sim-badge {
  text-align: right;
  font-size: 0.95em;
  font-weight: bold;
  color: #333;
  padding-right: 5px;
  margin-bottom: 5px;
}

.sim-badge::after {
  content: "";
  display: block;
  width: 100%;
  border-bottom: 1px dashed #ccc;
  margin-top: 5px;
}

.sim-app-box {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.sim-panel {
  flex: 1 1 260px;
  min-width: 240px;
}

/* --- deux images côte à côte avec espace --- */
.sim-image {
  flex: 1 1 auto;
  display: flex;                 /* conteneur flex */
  align-items: stretch;
  justify-content: flex-start;
  padding: 10px;
  box-sizing: border-box;
  column-gap: 20px;              /* espace horizontal entre les colonnes */
  row-gap: 0;
}

.sim-image > .img-col {
  flex: 1 1 0;                   /* 50-50, responsive */
  min-width: 0;                  /* évite les débordements */
  display: flex;                 /* permet à l’enfant de prendre toute la largeur */
}

/* s’assure que les sorties Shiny occupent 100% de leur colonne */
.sim-image .shiny-image-output,
.sim-image .shiny-html-output {
  width: 100% !important;
}

/* styles généraux des images */
.sim-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.08);
  object-fit: contain;
}

/* overlay pour les étiquettes */
.img-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.img-wrapper img {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.08);
}

.img-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(255,255,255,0.8);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: bold;
  color: #333;
  pointer-events: none;
}

/* empile sur mobile et réduit l’espace */
@media (max-width: 900px){
  .sim-image { flex-wrap: wrap; column-gap: 0; row-gap:  30px; }
  .sim-image > .img-col { flex: 1 1 90%; }
}


/* responsive */
@media (max-width: 1100px){
  .section-row.row-3{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px){
  .section-row.row-2,
  .section-row.row-3{ grid-template-columns: 1fr; }
}


/* 1. More padding and space between text and image */
.story-section .card {
  padding: 28px;        /* more breathing room inside text card */
}

.story-section .section-row {
  gap: 24px;            /* adds space between text column and image column */
}

/* 3. Caption readability */
.photo-caption {
  font-size: 85%;
  color: #555;          /* softer grey text */
  text-align: right;
  padding: 4px 8px;     /* a little padding so it doesn’t stick to edges */
}


/* radios en style pastille */
#global_results .shiny-options-group label {
  display: inline-block;
  margin-right: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #ccc;
  cursor: pointer;
  user-select: none;
}
#global_results .shiny-options-group input[type="radio"] {
  display: none;
}
#global_results .shiny-options-group input[type="radio"]:checked + span {
  font-weight: 600;
}
#global_results .shiny-options-group label:has(input[type="radio"]:checked) {
  background: #fff;
  border-color: #a6612d;
  box-shadow: 0 0 0 2px rgba(166,97,45,0.15) inset;
  color: #a6612d;
}

.story-section {
  scroll-margin-top: var(--header-height);
  margin-top: var(--section-gap);
}

.spacer {
  height: 0px !important;
  display: none !important;
}
