/* ════════════════════════════════════════
   PROTISTA — encyclopedie.css
   La boîte de lames · la cellule de comptage · le registre d'observation
   S'appuie sur les variables de style.css (Protista).
════════════════════════════════════════ */

/* ══════════════════════════════════
   NIVEAU 1 — EN-TÊTE
══════════════════════════════════ */
.en-hero { max-width: 820px; margin: 0 auto; text-align: center; padding: clamp(2.2rem,5vw,4rem) clamp(1rem,4vw,2rem) 1rem; }
.en-hero h1 { font-family: var(--fd); font-weight: 300; font-size: clamp(2.3rem,5.6vw,4.2rem); letter-spacing: -.02em; line-height: 1.05; }
.en-hero h1 em { font-style: normal; color: var(--accent); text-shadow: 0 0 24px rgba(53,230,211,.45); }
.en-hero .lead { margin: 1.1rem auto 1.2rem; max-width: 52ch; }
.en-total { font-family: var(--fd); font-weight: 300; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }

/* ══════════════════════════════════
   NIVEAU 1 — LA BOÎTE DE LAMES
══════════════════════════════════ */
.en-paillasse { position: relative; max-width: 1080px; margin: 0 auto; padding: clamp(1.6rem,4vw,2.6rem) clamp(1rem,4vw,2rem) clamp(3rem,6vw,5rem); }

.boite {
  border-radius: 18px;
  padding: clamp(.9rem,2vw,1.4rem);
  background: linear-gradient(160deg, #0d2238, #071526 60%, #050f1c);
  border: 1px solid rgba(120,200,230,.28);
  box-shadow: 0 0 0 6px #04101c, 0 0 0 7px rgba(53,230,211,.25), 0 30px 60px rgba(0,0,0,.55), 0 0 90px rgba(53,230,211,.08);
}
.boite-entete {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .3rem 1rem;
  padding: .2rem .4rem 1rem; margin-bottom: 1rem;
  border-bottom: 1px dashed rgba(120,200,230,.25);
}
.boite-entete span { font-family: var(--fd); font-weight: 300; font-size: 1.05rem; letter-spacing: .02em; }
.boite-entete b { font-weight: 400; font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }

.lames { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }

/* Une lame de verre : étiquette dépolie à gauche, lamelle ronde au centre */
.lame {
  position: relative;
  display: grid; grid-template-columns: minmax(0,1.15fr) auto minmax(0,.8fr); align-items: center; gap: 1rem;
  min-height: 150px; padding: .9rem 1.1rem .9rem .9rem;
  text-decoration: none; color: var(--ink);
  border-radius: 6px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.14) 0 8%, transparent 22% 70%, rgba(255,255,255,.06) 86%),
    linear-gradient(135deg, rgba(190,235,245,.10), rgba(190,235,245,.03));
  border: 1px solid rgba(160,220,240,.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 18px rgba(0,0,0,.35);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.lame:hover {
  transform: translateY(-4px);
  border-color: var(--c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 26px rgba(0,0,0,.45), 0 0 28px color-mix(in srgb, var(--c) 35%, transparent);
}
.lame.vide { opacity: .45; pointer-events: none; }

.etiq {
  align-self: stretch;
  display: flex; flex-direction: column; justify-content: center;
  padding: .7rem .9rem .7rem 1.1rem;
  background: repeating-linear-gradient(0deg, transparent 0 18px, rgba(51,83,106,.12) 18px 19px), #d9e6ec;   /* verre dépoli réglé */
  border-left: 7px solid var(--c);
  border-radius: 3px;
  color: #06101d;
}
.etiq-num { font-family: var(--fd); font-weight: 500; font-size: .62rem; letter-spacing: .16em; color: #33536a; }
.etiq b { font-family: var(--fd); font-weight: 500; font-size: .98rem; line-height: 1.2; margin: .25rem 0 .2rem; }
.etiq em { font-size: .84rem; color: #33536a; }

.lamelle {
  width: 112px; height: 112px; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #0e405a 0, #07233a 58%, #030f1c 100%);
  box-shadow: 0 0 0 1px rgba(160,220,240,.35), 0 0 22px color-mix(in srgb, var(--c) 28%, transparent), inset 0 0 18px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.lamelle svg { width: 92%; height: 92%; transition: transform .6s cubic-bezier(.2,.9,.3,1); }
.lame:hover .lamelle svg { transform: scale(1.15) rotate(6deg); }

.lame-nb { text-align: right; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.lame-nb strong { display: block; font-family: var(--fd); font-weight: 300; font-size: clamp(1.3rem,2.4vw,1.7rem); letter-spacing: 0; color: var(--c); text-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
.lame-nb i { display: inline-block; margin-top: .45rem; font-style: normal; font-size: .64rem; letter-spacing: .14em; color: #ff4d9d; border: 1px solid rgba(255,77,157,.55); border-radius: 999px; padding: .1rem .55rem; }
.lame.warn { border-color: rgba(255,77,157,.4); }

/* Emplacement vide : complète la dernière rangée */
.lame.libre {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(120,200,230,.05) 10px 11px);
  border: 1px dashed rgba(120,200,230,.25); box-shadow: none;
}
.lame.libre span { font-style: italic; color: var(--ink-muted); opacity: .6; }

/* Décor : microscope (gauche) et boîte de Petri (droite), grand écran uniquement */
.deco {
  display: none; position: absolute; top: 46%;
  width: min(220px, calc((100vw - 1080px) / 2 - 50px)); height: auto;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(53,230,211,.35));
}
.deco-g { left:  calc((100vw - 1080px) / -4); transform: translate(-50%, -50%); }
.deco-d { right: calc((100vw - 1080px) / -4); transform: translate(50%, -50%); }
@media (min-width: 1500px) { .deco { display: block; } }

/* ══════════════════════════════════
   NIVEAUX 2 & 3 — BANDEAU
══════════════════════════════════ */
.en-bandeau { border-bottom: 1px solid var(--border); padding: 1.2rem clamp(1rem,4vw,3rem) clamp(2rem,4vw,3rem); background: linear-gradient(rgba(8,26,44,.6), rgba(6,16,29,0)); }
.en-crumbs { max-width: 1080px; margin: 0 auto 1.6rem; font-size: .9rem; font-style: italic; color: var(--ink-muted); }
.en-crumbs a { color: var(--accent); text-decoration: none; }
.en-crumbs a:hover { text-decoration: underline; }
.en-crumbs span { margin: 0 .3rem; opacity: .6; }

.en-bandeau-in { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: clamp(1.2rem,3vw,2.6rem); align-items: center; }
.en-bandeau h1 { font-family: var(--fd); font-weight: 300; font-size: clamp(1.9rem,4.4vw,3.1rem); letter-spacing: -.02em; line-height: 1.08; }
.en-bandeau h1 em { font-style: normal; color: var(--c); text-shadow: 0 0 20px color-mix(in srgb, var(--c) 50%, transparent); }
.en-bandeau .hero-tag { margin-bottom: .9rem; }
.en-lat  { font-style: italic; color: var(--c); margin-top: .35rem; font-size: 1.05rem; }
.en-desc { color: var(--ink-muted); font-style: italic; margin-top: .5rem; max-width: 54ch; font-size: 1.05rem; }
.en-warn { max-width: 1080px; margin: 1.6rem auto 0; padding: .7rem .9rem; border-left: 3px solid #ff4d9d; background: rgba(255,77,157,.08); color: #ffc4de; font-size: .98rem; }
.en-warn a { color: #ff4d9d; }

/* Champ du microscope avec l'organisme du groupe */
.oculaire {
  width: clamp(120px,15vw,160px); aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, #0e405a 0, #07233a 55%, #030f1c 100%);
  box-shadow: 0 0 0 7px #091b2d, 0 0 0 8px #24566f, 0 0 40px color-mix(in srgb, var(--c) 30%, transparent);
}
.oculaire svg { width: 88%; height: 88%; }

.en-compteur { display: grid; grid-template-columns: auto auto; gap: .1rem .7rem; align-items: baseline; padding-left: clamp(1rem,2vw,2rem); border-left: 1px solid var(--border); }
.en-compteur strong { font-family: var(--fd); font-weight: 300; font-size: clamp(1.5rem,2.8vw,2rem); color: var(--c); text-align: right; }
.en-compteur span { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }

.en-main { max-width: 1080px; margin: 0 auto; padding: clamp(2.2rem,5vw,3.4rem) clamp(1rem,4vw,3rem) 4.5rem; }
.en-titre { font-family: var(--fd); font-weight: 300; font-size: clamp(1.4rem,3vw,1.9rem); text-align: center; margin-bottom: 2rem; }
.en-vide { text-align: center; font-style: italic; color: var(--ink-muted); padding: 3rem 0; }
.en-legende { text-align: center; margin-top: 1rem; font-size: .82rem; letter-spacing: .1em; color: var(--ink-muted); font-style: italic; }

/* ══════════════════════════════════
   NIVEAU 2 — LA CELLULE DE COMPTAGE (grille de Malassez)
══════════════════════════════════ */
.comptage {
  display: grid; grid-template-columns: repeat(9, minmax(0,1fr));
  border: 2px solid color-mix(in srgb, var(--c) 70%, transparent);
  border-radius: 6px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(14,64,90,.55), rgba(3,15,28,.85));
  box-shadow: 0 0 40px color-mix(in srgb, var(--c) 18%, transparent);
}
.case {
  position: relative; aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--ink);
  border-right: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  background-image:                                   /* sous-quadrillage 4 × 4 */
    repeating-linear-gradient(0deg, transparent 0 calc(25% - 1px), rgba(160,220,240,.08) calc(25% - 1px) 25%),
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(160,220,240,.08) calc(25% - 1px) 25%);
  transition: background-color .2s ease;
}
.case::after {                                         /* une « cellule » qui flotte dans certaines cases */
  content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 25%, transparent);
  opacity: 0; top: 18%; left: 20%;
}
.case:nth-child(3n+1)::after { opacity: .6; }
.case:nth-child(4n+2)::after { opacity: .5; top: 70%; left: 72%; width: 5px; height: 5px; }
.case:nth-child(5n)::after   { opacity: .55; top: 22%; left: 74%; }
.case-l { font-family: var(--fd); font-weight: 300; font-size: 1.9rem; line-height: 1; color: var(--ink); transition: color .2s, text-shadow .2s; }
.case-nb { margin-top: .4rem; font-size: .76rem; letter-spacing: .08em; color: var(--ink-muted); }
.case:hover { background-color: color-mix(in srgb, var(--c) 14%, transparent); }

/* Cases vides : complètent la grille, non cliquables */
.case-vide { display: none; pointer-events: none; }
.case-vide::after { opacity: 0 !important; }
@media (min-width: 1000px)                       { .case-vide.pour-9 { display: flex; } }
@media (min-width: 700px) and (max-width: 999px) { .comptage { grid-template-columns: repeat(7, minmax(0,1fr)); } .case-vide.pour-7 { display: flex; } }
@media (min-width: 561px) and (max-width: 699px) { .comptage { grid-template-columns: repeat(5, minmax(0,1fr)); } .case-vide.pour-5 { display: flex; } }
@media (max-width: 560px)                        { .comptage { grid-template-columns: repeat(4, minmax(0,1fr)); } .case-vide.pour-4 { display: flex; } }
.case:hover .case-l { color: var(--c); text-shadow: 0 0 16px var(--c); }

/* ══════════════════════════════════
   NIVEAU 3 — BARRE DES LETTRES
══════════════════════════════════ */
.lettres-bar {
  position: sticky; top: 64px; z-index: 150;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  padding: .55rem 1rem; background: rgba(6,16,29,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.lb {
  width: 30px; height: 30px; line-height: 28px; text-align: center; border-radius: 50%;
  font-family: var(--fd); font-weight: 300; font-size: .82rem; text-decoration: none;
  color: var(--ink-light); border: 1px solid var(--border); background: var(--card);
  transition: border-color .18s, color .18s, box-shadow .18s;
}
.lb:hover { border-color: var(--c); color: var(--c); }
.lb.actif { background: var(--c); border-color: var(--c); color: var(--on); box-shadow: 0 0 14px var(--c); }

/* ══════════════════════════════════
   NIVEAU 3 — LE REGISTRE D'OBSERVATION
══════════════════════════════════ */
.en-bandeau--court .en-bandeau-in { grid-template-columns: auto minmax(0,1fr); }
.grande-lettre { font-family: var(--fd); font-weight: 300; font-size: clamp(4.6rem,10vw,7.4rem); line-height: .85; color: var(--c); text-shadow: 0 0 34px color-mix(in srgb, var(--c) 55%, transparent); }

.registre {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.2rem;
  padding: 1.2rem 1.5rem 1.5rem;
  border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: 0 0 18px 18px;
  background: var(--card);
}
.registre-col { list-style: none; }
.registre-col li { border-bottom: 1px solid rgba(120,200,230,.1); }
.registre-col a {
  display: flex; align-items: center; gap: .6rem;
  padding: .42rem .4rem; border-radius: 4px;
  text-decoration: none; color: var(--ink-light); font-size: .96rem;
  transition: background .15s;
}
.registre-col a:hover { background: color-mix(in srgb, var(--c) 10%, transparent); }
.registre-col a:hover .sci { color: var(--ink); }
.obs { flex: 0 0 auto; font-family: var(--fd); font-weight: 300; font-size: .66rem; color: var(--ink-muted); min-width: 2.4rem; }
.cellule {                                             /* petite cellule avec noyau */
  flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid var(--c);
  background: radial-gradient(circle, var(--c) 0 2px, color-mix(in srgb, var(--c) 18%, transparent) 2.5px);
}
.sci { font-style: italic; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commun { margin-left: auto; font-size: .86rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; text-align: right; }

/* Pagination */
.pages { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-top: 2.2rem; }
.pages a, .pages span {
  min-width: 38px; padding: .45rem .6rem; text-align: center; border-radius: 999px;
  font-family: var(--fd); font-weight: 300; font-size: .82rem; text-decoration: none;
  color: var(--ink-light); background: var(--card); border: 1px solid var(--border);
}
.pages a:hover { border-color: var(--accent); color: var(--accent); }
.pages .actif { background: var(--accent); border-color: var(--accent); color: var(--on); box-shadow: 0 0 12px rgba(53,230,211,.5); }
.pages .etc { background: none; border: none; }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 900px) {
  .lames { grid-template-columns: 1fr; }
  .lame.libre { display: none; }
  .en-bandeau-in { grid-template-columns: auto minmax(0,1fr); }
  .en-compteur { grid-column: 1/-1; border-left: 0; padding-left: 0; grid-template-columns: repeat(4,auto); justify-content: start; }
}
@media (max-width: 760px) {
  .registre { grid-template-columns: 1fr; }
  .commun { display: none; }
}
@media (max-width: 560px) {
  .lame { grid-template-columns: minmax(0,1fr) auto; }
  .lame-nb { grid-column: 1/-1; text-align: left; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
  .lame-nb strong { display: inline; }
  .lamelle { width: 88px; height: 88px; }
  .en-bandeau-in, .en-bandeau--court .en-bandeau-in { grid-template-columns: 1fr; text-align: center; }
  .oculaire { margin: 0 auto; }
  .en-desc { margin-left: auto; margin-right: auto; }
  .case-l { font-size: 1.5rem; }
}
