/* =========================================================
   WIDGET MÉTÉO — feuille de style (neumorphisme)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600&display=swap');

.meteo-widget{
  --bg: #F3F6FA;
  --text: #303B48;
  --text-light: #93a0ad;
  --accent-dark: #53657C;
  --accent-warm: #BE5D72;
  --radius: 8px;
  --shadow-l: -8px -8px 16px 0 #FFF, 8px 8px 16px 0 #DBE4F0;
  --shadow-s: -4px -4px 4px 0 #FFF, 4px 4px 4px 0 #DBE4F0;
  --font: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  display: flex;
  width: 784px;
  max-width: 100%;
  padding: 16px;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-l);
  margin: 0 auto;
  font-family: var(--font);
  box-sizing: border-box;
}
.meteo-widget *{ box-sizing: border-box; }

/* --- Switch --- */
.meteo-switch{
  position: relative;
  display: flex;
  height: 47px;
  align-items: center;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-s);
  overflow: hidden; /* garde les coins arrondis des boutons enfants */
}

/* Le curseur glissant n'est plus utilisé dans ce design (l'état actif
   est porté directement par le fond des boutons) */
.meteo-switch__thumb{ display: none; }

.meteo-switch__btn{
  display: flex;
  width: 160px;
  height: 100%;
  padding: 12px 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: none;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  font-family: var(--font);
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
  white-space: nowrap;
}
.meteo-switch__btn:first-child{ border-radius: var(--radius) 0 0 var(--radius); }
.meteo-switch__btn:last-child{ border-radius: 0 var(--radius) var(--radius) 0; }

.meteo-switch__btn.is-active{
  background: var(--accent-dark);
  color: var(--bg);
}

/* --- Carrousel --- */
.meteo-carousel{
  display: block;
  width: 100%;
}

.meteo-track-wrap{
  display: flex;
  overflow: hidden;
}
.meteo-track{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  align-self: stretch;
  overflow-x: auto;
  scroll-snap-type: x proximity; /* proximity plutôt que mandatory : plus doux au drag */
  padding: 4px 2px 10px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  /* masquer la scrollbar native mais garder le scroll tactile/drag */
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.meteo-track::-webkit-scrollbar{ display:none; }
.meteo-track.is-dragging{
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}
.meteo-track.is-dragging .meteo-card{
  pointer-events: none; /* évite les clics fantômes pendant le drag uniquement */
}

/* --- Barre de navigation sous les cartes (visible au survol) --- */
.meteo-scrollbar{
  height: 4px;
  border-radius: 999px;
  background: rgba(83, 101, 124, 0.15);
  margin: 2px 4px 0;
  position: relative;
  opacity: 0;
  transition: opacity .25s ease;
  cursor: pointer;
}
.meteo-carousel:hover .meteo-scrollbar,
.meteo-carousel:focus-within .meteo-scrollbar{
  opacity: 1;
}
.meteo-scrollbar__thumb{
  position: absolute;
  top: -3px;
  left: 0;
  height: 10px;
  width: 20%;
  border-radius: 999px;
  background: var(--accent-dark);
  transition: left .1s linear;
  cursor: grab;
}
.meteo-scrollbar__thumb:hover{
  background: var(--text);
}
.meteo-scrollbar__thumb.is-dragging{
  cursor: grabbing;
  transition: none;
}
.meteo-scrollbar__thumb:focus-visible{
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}

/* --- Carte --- */
.meteo-card{
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  width: 128px;
  height: 174px;
  padding: 8px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-s);
  text-align: center;
}
.meteo-card__label{
  color: var(--text);
  text-align: center;
  font-family: var(--font);
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}
.meteo-card__icon{
  width: 62px;
  height: 40px;
  display: block;
  object-fit: contain;
}
.meteo-card__temps{
  display: flex;
  gap: 6px;
}
.meteo-card__min,
.meteo-card__max,
.meteo-card__now{
  text-align: center;
  font-family: var(--font);
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}
.meteo-card__min{ color: var(--accent-dark); }
.meteo-card__max{ color: var(--accent-warm); }
.meteo-card__now{ color: var(--text); }

/* Mobile */
@media (max-width: 480px){
  .meteo-widget{ padding: 12px; gap: 12px; }
  .meteo-switch__btn{ width: 120px; }
  .meteo-card{ width: 108px; height: 160px; padding: 6px; }
  .meteo-card__label{ font-size: 12.5px; }
}