/* =====================================================================
   Les guides Manor Lords — v4 : améliorations du thème « arbre de vie doré »
   (le thème v3 est gardé tel quel ; ce fichier ajoute seulement).
   1. Pictos dorés gravés à la place des émojis
   2. Lucioles dorées devant l'arbre
   3. L'arbre de la série : une feuille par guide
   4. Cartes « Bientôt » plus compactes
   ===================================================================== */

/* ---------- 1. Pictos dorés ---------- */
.picto{display:inline-block;width:1.2em;height:1.2em;vertical-align:-.22em;flex:none;
  filter:drop-shadow(0 0 5px rgba(217,171,82,.35)) drop-shadow(0 1px 0 rgba(0,0,0,.6))}
.famille-titre h3{display:flex;align-items:center;gap:12px}
.famille-titre h3 .picto{width:34px;height:34px;padding:5px;border-radius:50%;border:1px solid var(--bord-fort);
  background:radial-gradient(circle at 35% 30%,rgba(155,54,34,.55),rgba(20,13,10,.9));box-shadow:0 0 18px rgba(217,171,82,.18)}
.familles-nav .picto{width:22px;height:22px}
.menu .picto{width:17px;height:17px;vertical-align:-.25em}
.idees h2 .picto{width:.95em;height:.95em}
.vie-privee .picto{width:18px;height:18px;vertical-align:-.2em}

/* ---------- 2. Lucioles ---------- */
.lucioles{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none}

/* ---------- 3. L'arbre de la série ---------- */
.serie{margin-top:10px}
.serie .entete{margin-bottom:28px}
.serie-arbre{position:relative;display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:26px 10px;
  padding:34px 24px 28px;border:1px solid var(--bord);border-radius:18px;
  background:radial-gradient(ellipse 70% 90% at 50% 110%,rgba(217,171,82,.10),transparent 70%),linear-gradient(180deg,var(--carte2),var(--noir2));
  box-shadow:0 20px 50px rgba(0,0,0,.5)}
.serie-arbre:empty{display:none} /* sans le script, la boîte vide ne s'affiche pas */
.rameau{position:relative;display:flex;flex-direction:column;align-items:center;gap:12px;padding:0 6px}
.rameau-feuilles{position:relative;display:flex;align-items:center;gap:2px;padding:10px 8px;list-style:none;margin:0}
/* la branche : un trait doré qui relie les feuilles d'une famille */
.rameau-feuilles::before{content:"";position:absolute;left:0;right:0;top:50%;height:3px;margin-top:-1.5px;border-radius:3px;
  background:linear-gradient(90deg,rgba(116,80,29,.2),#8a5f25 15%,#b6852f 50%,#8a5f25 85%,rgba(116,80,29,.2))}
.feuille{position:relative;display:grid;place-items:center;width:34px;height:44px;text-decoration:none;color:inherit;border-radius:8px}
.feuille svg{width:26px;height:34px;transition:transform .25s ease,filter .25s ease}
.rameau-feuilles li:nth-child(odd) .feuille svg{transform:translateY(-10px) rotate(-28deg)}
.rameau-feuilles li:nth-child(even) .feuille svg{transform:translateY(10px) rotate(152deg)}
.feuille .num{position:absolute;inset:auto 0 -18px 0;text-align:center;font-family:var(--titre);font-size:10.5px;font-weight:700;color:var(--gris);opacity:.75}
.rameau-feuilles li:nth-child(odd) .feuille .num{inset:-18px 0 auto 0}
/* trois états */
.feuille.avenir svg{fill:rgba(60,40,24,.65);stroke:rgba(195,177,153,.45);stroke-width:1.2}
.feuille.bientot svg{fill:rgba(155,54,34,.45);stroke:var(--or);stroke-width:1.3;stroke-dasharray:3 2}
.feuille.prete svg{fill:url(#feuille-or);stroke:#fbe7ae;stroke-width:1;
  filter:drop-shadow(0 0 6px rgba(241,198,107,.85)) drop-shadow(0 0 16px rgba(217,171,82,.45))}
.feuille.prete .num{color:var(--or-vif);opacity:1}
.feuille:hover svg,.feuille:focus-visible svg{filter:drop-shadow(0 0 8px rgba(241,198,107,.95)) drop-shadow(0 0 22px rgba(217,171,82,.6))}
.feuille:focus-visible{outline:2px solid var(--or-pale);outline-offset:2px}
/* la bulle : numéro, titre et état */
.feuille .bulle{position:absolute;z-index:5;left:50%;bottom:calc(100% + 16px);transform:translateX(-50%) translateY(4px);width:max-content;max-width:230px;
  padding:8px 12px;border-radius:8px;background:#120c09;border:1px solid var(--bord-fort);color:var(--texte);font-size:15px;line-height:1.3;text-align:center;
  box-shadow:0 10px 24px rgba(0,0,0,.6);pointer-events:none;display:none}
/* display:none (et pas seulement invisible) : une bulle cachée ne doit pas élargir la page sur petit écran */
.feuille .bulle b{display:block;font-family:var(--titre);font-size:11px;letter-spacing:.14em;color:var(--or);margin-bottom:2px}
.feuille:hover .bulle,.feuille:focus-visible .bulle{display:block;transform:translateX(-50%)}
.rameau-nom{display:flex;align-items:center;gap:7px;font-family:var(--titre);font-size:12px;font-weight:700;letter-spacing:.14em;color:var(--or-pale);
  text-decoration:none;padding:4px 10px;border-radius:999px;margin-top:8px}
.rameau-nom:hover{background:rgba(217,171,82,.12)}
.rameau-nom .picto{width:20px;height:20px}
/* la graine : la liste des guides, au pied de l'arbre */
.graine{display:flex;flex-direction:column;align-items:center;gap:8px;text-decoration:none;align-self:center;margin-right:6px}
.graine span:first-child{width:40px;height:40px;border-radius:50%;
  background:radial-gradient(circle at 38% 32%,#fff3c4,var(--or-vif) 35%,#a2722a 80%);border:1px solid #fbe7ae;
  box-shadow:0 0 14px rgba(241,198,107,.8),0 0 34px rgba(217,171,82,.4)}
.graine span:last-child{font-family:var(--titre);font-size:12px;font-weight:700;letter-spacing:.14em;color:var(--or-pale)}
.serie-compte{margin:18px 0 0;text-align:center;color:var(--gris);font-size:17px}
.serie-compte b{color:var(--or-vif);font-family:var(--titre);font-weight:700}
.serie-legende{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 22px;margin:8px 0 0;padding:0;list-style:none;font-size:15.5px;color:var(--gris)}
.serie-legende li{display:flex;align-items:center;gap:8px}
.serie-legende i{width:12px;height:12px;border-radius:50% 0;transform:rotate(45deg);display:inline-block}
.serie-legende .l-prete{background:var(--or-vif);box-shadow:0 0 8px var(--or)}
.serie-legende .l-bientot{background:rgba(155,54,34,.6);border:1px dashed var(--or)}
.serie-legende .l-avenir{background:rgba(60,40,24,.8);border:1px solid rgba(195,177,153,.5)}

/* ---------- 4. Cartes « Bientôt » compactes ---------- */
.grille:has(> .carte:only-child .badge.bientot){grid-template-columns:minmax(0,720px)}
.carte:has(.badge.bientot){flex-direction:row!important;min-height:0}
/* la couverture entière en vignette, comme un petit livre posé (elle porte déjà son titre et son numéro) */
.carte:has(.badge.bientot) .couv-cadre{flex:0 0 172px!important;aspect-ratio:auto!important;min-height:0!important;overflow:visible;
  display:flex;align-items:center;justify-content:center;padding:18px 0 18px 22px;background:transparent}
.carte:has(.badge.bientot) .couv-cadre img{position:static!important;width:130px!important;height:auto!important;border-radius:4px;
  border:1px solid rgba(243,223,176,.2);box-shadow:0 10px 24px rgba(0,0,0,.55);transform:rotate(-2deg)!important;filter:saturate(.7) brightness(.85)}
.carte:has(.badge.bientot) .couv-cadre::after{display:none}
.carte:has(.badge.bientot) .numero-rond{display:none!important}
.carte:has(.badge.bientot) .badge{bottom:auto;top:12px;left:12px;font-size:10px;padding:5px 9px}
.carte:has(.badge.bientot) .carte-corps{padding:20px 22px;justify-content:center;min-width:0} /* min-width:0 : le texte rétrécit au lieu de pousser la carte hors de l'écran */
.carte:has(.badge.bientot) h4{font-size:19px;padding-right:0}
.carte:has(.badge.bientot) .resume{font-size:16.5px;margin-bottom:10px;flex:none}
.carte:has(.badge.bientot) .infos{margin-bottom:12px;padding-top:8px}
.carte:has(.badge.bientot) .bouton.bientot{width:auto;align-self:flex-start;min-height:40px;padding:8px 18px;font-size:13px}
.carte:has(.badge.bientot):hover .couv-cadre img{transform:rotate(0deg)!important;filter:saturate(.9) brightness(.95)}

@media (max-width:760px){
  .famille-titre h3{white-space:normal;line-height:1.2}  /* les longs titres passent à la ligne au lieu de sortir de l'écran */
  .famille-titre h3 .picto{width:30px;height:30px}
  .serie-arbre{padding:28px 10px 22px;gap:22px 4px}
  .feuille{width:30px}
  .feuille svg{width:23px;height:30px}
  .carte:has(.badge.bientot) .couv-cadre{flex-basis:104px!important;padding:14px 0 14px 14px}
  .carte:has(.badge.bientot) .couv-cadre img{width:86px!important}
  .carte:has(.badge.bientot) .carte-corps{padding:16px}
  .carte:has(.badge.bientot) .resume{display:none}
  .carte:has(.badge.bientot) .badge{top:8px;left:8px}
}
/* très petits écrans (jusqu'à 320 px) : vignette plus petite, le bouton et le titre peuvent passer à la ligne */
@media (max-width:420px){
  .carte:has(.badge.bientot) .couv-cadre{flex-basis:80px!important;padding:12px 0 12px 10px}
  .carte:has(.badge.bientot) .couv-cadre img{width:64px!important}
  .carte:has(.badge.bientot) .badge{font-size:9px;padding:4px 7px;letter-spacing:.12em}
  .carte:has(.badge.bientot) .carte-corps{padding:14px 12px 14px 12px}
  .carte:has(.badge.bientot) h4{font-size:16px;overflow-wrap:anywhere}
  .carte:has(.badge.bientot) .infos{font-size:14px;gap:2px 10px}
  .carte:has(.badge.bientot) .bouton.bientot{white-space:normal;text-align:center;padding:8px 12px;font-size:12px;max-width:100%}
  .rameau-feuilles{flex-wrap:wrap;justify-content:center}
}
@media (prefers-reduced-motion:reduce){ .lucioles{display:none} }
