/* ===== Couleurs du site ===== */
:root {
  --orange: #D85A30;
  --bleu-nuit: #1E3A4C;
  --creme: #FBF6EF;
  --peche: #F7E4D8;
  --texte: #2E2E2E;
  --vert: #2F9E6B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--creme);
  color: var(--texte);
  line-height: 1.6;
}

/* ===== Bannière ===== */
header {
  background: var(--bleu-nuit);
  padding: 32px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: fixed;   /* le bandeau flotte au-dessus de la page */
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}
.logo svg {
  height: 120px;
  width: auto;
  display: block;
  transition: height 0.3s ease;
}
.logo:hover { opacity: 0.85; }
header.reduit {
  padding: 14px 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
header.reduit .logo svg { height: 60px; }

nav a {
  color: white;
  text-decoration: none;
  margin-left: 20px;
  font-weight: 600;
}
nav a:hover, nav a.actif { color: var(--orange); }

/* ===== Accroche ===== */
.hero { text-align: center; padding: 60px 20px; }
.hero h1 { color: var(--bleu-nuit); font-size: 2.4rem; margin-bottom: 12px; }
.hero p { font-size: 1.15rem; max-width: 600px; margin: 0 auto 28px; }

.bouton {
  display: inline-block;
  background: var(--orange);
  color: white;
  padding: 14px 28px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.bouton:hover { background: #b9481f; }

/* ===== Sections ===== */
section { padding: 50px 20px; scroll-margin-top: 100px; }
.conteneur { max-width: 1000px; margin: 0 auto; }
h2 { color: var(--bleu-nuit); font-size: 1.8rem; margin-bottom: 8px; text-align: center; }
.sous-titre { text-align: center; margin-bottom: 36px; }
.fond-peche { background: var(--peche); }

/* ===== Cartes ===== */
.grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.carte {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  scroll-margin-top: 100px;
}
a.carte { text-decoration: none; color: inherit; transition: transform 0.2s; }
a.carte:hover { transform: translateY(-4px); }
.carte .icone { font-size: 2.5rem; padding: 20px 16px 0; }
.carte h3 { color: var(--orange); padding: 14px 16px 4px; }
.carte p { padding: 0 16px 16px; font-size: 0.95rem; }

.video-vide {
  background: var(--bleu-nuit);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
}
.carte:target { outline: 4px solid var(--orange); }

/* ===== Questions (accordéon) ===== */
.categorie { margin-bottom: 40px; }
.categorie h3 { color: var(--bleu-nuit); margin-bottom: 14px; font-size: 1.3rem; }
details {
  background: white;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}
summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--orange); font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details[open] summary { border-bottom: 1px solid var(--peche); }
.reponse { padding: 16px 20px; }
.reponse p { margin-bottom: 10px; }
.qser {
  background: var(--peche);
  border-left: 4px solid var(--orange);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
}
.lien-video {
  display: inline-block;
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
}
.lien-video:hover { text-decoration: underline; }

/* ===== Chatbot ===== */
.chat {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  overflow: hidden;
}
.chat-entete { background: var(--bleu-nuit); color: white; padding: 14px 18px; font-weight: bold; }
.chat-messages {
  height: 300px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.message { padding: 10px 14px; border-radius: 14px; max-width: 80%; }
.bot { background: var(--peche); align-self: flex-start; }
.utilisateur { background: var(--orange); color: white; align-self: flex-end; }
.chat-saisie { display: flex; border-top: 1px solid #eee; }
.chat-saisie input { flex: 1; border: none; padding: 14px; font-size: 1rem; outline: none; }
.chat-saisie button { border-radius: 0; }

/* ===== Pied de page ===== */
footer {
  background: var(--bleu-nuit);
  color: white;
  text-align: center;
  padding: 24px;
  font-size: 0.9rem;
}

/* ===== Page Questions : filtres et fiches ===== */
.outils {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.filtres { display: flex; flex-wrap: wrap; gap: 8px; }
.filtre {
  background: white;
  color: var(--bleu-nuit);
  border: 2px solid var(--bleu-nuit);
  border-radius: 30px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}
.filtre.actif, .filtre:hover { background: var(--bleu-nuit); color: white; }
#recherche {
  flex: 1;
  min-width: 220px;
  max-width: 360px;
  padding: 10px 16px;
  border: 2px solid var(--peche);
  border-radius: 30px;
  font-size: 1rem;
  outline: none;
}
#recherche:focus { border-color: var(--orange); }
.aucun { text-align: center; padding: 30px; }

.fiche summary { align-items: center; justify-content: flex-start; }
.fiche summary::after { margin-left: auto; }
.num {
  flex-shrink: 0;
  background: var(--orange);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.etiquette { font-size: 0.85rem; color: #777; }
.note { font-size: 0.9rem; font-style: italic; color: #666; }
.bloc-reponse { margin: 6px 0 10px; }
.reponse ul { margin: 0 0 10px 22px; }
.qser { margin-top: 14px; }
.qser.ps { border-left-color: var(--bleu-nuit); background: #EAF0F3; }
.titre-bloc { font-weight: bold; color: var(--bleu-nuit); margin-bottom: 4px !important; }
.badge-ajout {
  display: inline-block;
  background: #FFF3CD;
  color: #8a6d00;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.num-ps { background: var(--bleu-nuit); font-size: 1.1rem; }
/* Pastille à deux numéros (ex : 1 et 65) */
.num { width: auto; min-width: 38px; padding: 0 10px; border-radius: 19px; gap: 4px; }
.num .et { font-size: 0.7rem; font-weight: normal; opacity: 0.85; }
/* Toutes les pastilles numérotées à la même taille */
.fiche .num { width: 84px; min-width: 84px; height: 38px; padding: 0; }
.fiche .num-ps { width: 84px; min-width: 84px; }

/* ===== Questions en petits menus déroulants, 3 par ligne ===== */
#liste-fiches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;           /* une carte ouverte n'agrandit pas ses voisines */
}
#liste-fiches .fiche { margin-bottom: 0; }
#liste-fiches .fiche[hidden] { display: none; }
#liste-fiches summary { padding: 12px 14px; font-size: 0.9rem; gap: 10px; }
#liste-fiches .reponse { padding: 12px 14px; font-size: 0.9rem; }
#liste-fiches .fiche .num,
#liste-fiches .fiche .num-ps { width: 64px; min-width: 64px; height: 32px; font-size: 0.85rem; }
#liste-fiches .fiche[open] { box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

@media (max-width: 900px) { #liste-fiches { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { #liste-fiches { grid-template-columns: 1fr; } }
.question-complete { font-weight: 700; color: var(--bleu-nuit); }
#liste-fiches summary { font-weight: 700; }
/* Cases courtes : 3 par ligne même sur écran moyen */
@media (max-width: 900px) { #liste-fiches { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { #liste-fiches { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #liste-fiches summary { flex-direction: column; align-items: flex-start; padding: 10px; }
  #liste-fiches summary::after { display: none; } }
@media (max-width: 380px) { #liste-fiches { grid-template-columns: repeat(2, 1fr); } }
/* Une case ouverte prend toute la ligne pour bien lire la réponse */
#liste-fiches .fiche[open] { grid-column: 1 / -1; }

/* ===== Volant fixe sur le côté ===== */
.volant-fixe {
  position: fixed;
  right: 20px;
  top: 50%;
  width: 64px;
  height: 64px;
  margin-top: -32px;
  z-index: 90;
  cursor: pointer;
  background: var(--bleu-nuit);
  border-radius: 50%;
  padding: 8px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
  border: none;
  transition: transform 0.2s;
}
.volant-fixe:hover { transform: scale(1.1); }
.volant-fixe svg { width: 100%; height: 100%; display: block; }
@media (max-width: 600px) {
  .volant-fixe { width: 48px; height: 48px; margin-top: -24px; right: 10px; padding: 6px; }
}

/* ===== Page Conseils : même grille que les questions ===== */
.liste-conseils {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;
}
.liste-conseils .fiche { margin-bottom: 0; }
.liste-conseils summary { padding: 12px 14px; font-size: 0.95rem; font-weight: 700; }
.liste-conseils .reponse { padding: 12px 14px; font-size: 0.92rem; }
.liste-conseils .fiche[open] { grid-column: 1 / -1; box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
@media (max-width: 600px) { .liste-conseils { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
@media (max-width: 380px) { .liste-conseils { grid-template-columns: 1fr; } }

/* ===== Menu du bandeau plus gros sur ordinateur ===== */
@media (min-width: 900px) {
  nav a { font-size: 1.3rem; margin-left: 32px; transition: font-size 0.3s ease; }
  header.reduit nav a { font-size: 1.1rem; }
}

/* ===== Fenêtre « Pose ta question » flottante ===== */
.chat-flottant {
  position: fixed;
  right: 100px;
  top: 50%;
  transform: translateY(-50%);
  width: 360px;
  max-width: calc(100vw - 32px);
  z-index: 95;
  margin: 0;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.chat-flottant[hidden] { display: none; }
.chat-flottant .chat-messages { height: 320px; }
.chat-entete { display: flex; justify-content: space-between; align-items: center; }
.chat-fermer {
  background: none; border: none; color: white;
  font-size: 1.1rem; cursor: pointer; padding: 0 4px;
}
.volant-fixe.ouvert { background: var(--orange); }
.volant-fixe.ouvert #roue { stroke: white; }
.volant-fixe.ouvert #roue circle[fill] { fill: white; }
@media (max-width: 600px) {
  .chat-flottant { right: 16px; left: 16px; width: auto; top: auto; bottom: 16px; transform: none; }
  .chat-flottant .chat-messages { height: 45vh; }
}
