/* ════════════════════════════════════════
   MONERA — histoire.css
   La boîte de Petri du temps : colonies sur une spirale,
   fiche d'observation à côté, registre en dessous.
   S'appuie sur les variables de style.css (Monera).
════════════════════════════════════════ */

/* ── en-tête sur papier quadrillé (comme le reste du site) ── */
.hp-tete {
  text-align: center;
  padding: clamp(2.4rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem) clamp(1.8rem, 4vw, 2.6rem);
  background-image: linear-gradient(#d5dfda 1px, transparent 1px), linear-gradient(90deg, #d5dfda 1px, transparent 1px);
  background-size: 34px 34px;
  border-bottom: 1px solid var(--border);
}
.hp-tete h1 { font-family: var(--fd); font-weight: 800; letter-spacing: -.04em; font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1.02; }
.hp-tete h1 span { color: var(--accent); }
.hp-chapeau { max-width: 60ch; margin: 1.1rem auto 0; font-size: 1.08rem; font-style: italic; color: var(--ink-muted); line-height: 1.6; }
.hp-compte { margin-top: 1.2rem; font-family: var(--fd); font-size: .8rem; color: var(--ink-muted); }
.hp-compte b { color: var(--accent); font-weight: 800; }
.hp-vide { text-align: center; font-style: italic; color: var(--ink-muted); padding: 3rem 1rem 5rem; }

/* ── filtres ── */
.hp-filtres { max-width: 1180px; margin: 0 auto; padding: 1.6rem clamp(1rem, 4vw, 2rem) .4rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.hp-filtre {
  display: inline-flex; align-items: center; gap: .45rem; cursor: pointer;
  font-family: var(--fd); font-size: .76rem;
  padding: .4rem .9rem; border-radius: 999px;
  background: var(--card); color: var(--ink-light); border: 1px solid var(--border);
  transition: border-color .2s, background .2s;
}
.hp-filtre i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.hp-filtre:hover { border-color: var(--c, var(--accent)); }
.hp-filtre[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.hp-filtre:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── la paillasse : boîte + fiche ── */
.hp-paillasse {
  max-width: 1180px; margin: 0 auto;
  padding: 1.6rem clamp(1rem, 4vw, 2rem) 2rem;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 2.4rem; align-items: center;
}

/* ══════════ LA BOÎTE DE PETRI ══════════ */
.hp-boite { position: relative; width: 100%; max-width: 620px; aspect-ratio: 1; margin: 0 auto; filter: drop-shadow(0 18px 26px rgba(30, 26, 44, .16)); }
.hp-boite svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hp-siecle { font-family: var(--fd); font-size: 11px; fill: #5a2d82; opacity: .55; }
.hp-legende { text-align: center; margin-top: .8rem; font-family: var(--fd); font-size: .72rem; color: var(--ink-muted); }

.colonie {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0;
  border-radius: 50%; border: 0; cursor: pointer;
  /* une colonie bombée, avec son bord plus clair */
  background: radial-gradient(circle at 36% 32%, color-mix(in srgb, var(--c) 35%, #fff) 0 18%, var(--c) 60%, color-mix(in srgb, var(--c) 75%, #000) 100%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, #fff6), 0 2px 4px rgba(30, 26, 44, .25);
  transition: transform .2s, opacity .3s, box-shadow .2s;
  animation: hp-pousse .6s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: var(--d);
}
@keyframes hp-pousse { from { transform: scale(0); } }
.colonie-an {
  position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  font-family: var(--fd); font-size: .66rem; color: var(--ink); background: #fffd; padding: 0 .3rem; border-radius: 3px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.colonie:hover, .colonie:focus-visible { transform: scale(1.35); z-index: 3; outline: none; }
.colonie:hover .colonie-an, .colonie:focus-visible .colonie-an, .colonie[aria-pressed="true"] .colonie-an { opacity: 1; }
.colonie[aria-pressed="true"] { z-index: 4; transform: scale(1.35); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c), 0 4px 10px rgba(30, 26, 44, .3); }
.colonie[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--c);
  animation: hp-onde 1.8s ease-out infinite;
}
@keyframes hp-onde { from { transform: scale(.6); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }
.colonie.eteinte { opacity: .15; transform: scale(.7); pointer-events: none; }

/* ══════════ LA FICHE D'OBSERVATION ══════════ */
.hp-fiches { position: relative; }
.hp-fiche {
  background: var(--card); border: 1px solid var(--border); border-top: 6px solid var(--c);
  border-radius: 6px; padding: 1.6rem 1.6rem 1.4rem;
  box-shadow: 0 14px 30px rgba(30, 26, 44, .1);
  animation: hp-fiche .35s ease;
}
@keyframes hp-fiche { from { opacity: 0; transform: translateY(8px); } }
.hp-fiche-ref { font-family: var(--fd); font-size: .7rem; color: var(--ink-muted); letter-spacing: .02em; }
.hp-fiche-an { font-family: var(--fd); font-weight: 800; font-size: clamp(2.4rem, 5vw, 3.4rem); letter-spacing: -.05em; line-height: 1; color: var(--c); margin: .5rem 0 .3rem; }
.hp-fiche h2 { font-family: var(--fd); font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; line-height: 1.2; }
.hp-fiche-qui { font-style: italic; color: var(--ink-muted); margin-top: .2rem; }
.hp-fiche-resume { margin-top: 1rem; font-size: 1.08rem; line-height: 1.65; color: var(--ink-light); }
.hp-fiche-txt { margin-top: .8rem; line-height: 1.65; color: var(--ink-light); }
.hp-fiche-liens { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.hp-fiche-liens a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-light); }
.hp-source { font-size: .85rem; color: var(--ink-muted) !important; }
.hp-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; font-family: var(--fd); font-size: .76rem; color: var(--ink-muted); }
.hp-nav button { font: inherit; cursor: pointer; padding: .45rem .9rem; border: 1px solid var(--border); background: var(--card); border-radius: 999px; color: var(--ink-light); }
.hp-nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.hp-nav button:disabled { opacity: .4; cursor: default; }

/* ══════════ LE REGISTRE ══════════ */
.hp-registre { max-width: 1000px; margin: 2rem auto 0; padding: 0 clamp(1rem, 4vw, 2rem) 4.5rem; }
.hp-registre h2 { font-family: var(--fd); font-weight: 800; letter-spacing: -.03em; font-size: clamp(1.5rem, 3.4vw, 2.1rem); text-align: center; }
.hp-registre-sous { text-align: center; font-style: italic; color: var(--ink-muted); margin: .4rem 0 1.6rem; }
.hp-lignes { list-style: none; border-top: 2px solid var(--ink); }
.hp-lignes li[hidden] { display: none; }
.hp-ligne {
  width: 100%; display: grid; grid-template-columns: 62px minmax(0, 1.3fr) minmax(0, 1fr) 120px; gap: 1rem; align-items: baseline;
  text-align: left; font: inherit; cursor: pointer;
  padding: .7rem .4rem; background: none; border: 0; border-bottom: 1px solid var(--border); color: var(--ink);
  transition: background .2s;
}
.hp-ligne:hover, .hp-ligne.on { background: color-mix(in srgb, var(--c) 9%, transparent); }
.hp-ligne:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hp-ligne-an { font-family: var(--fd); font-weight: 800; color: var(--c); }
.hp-ligne-titre { font-weight: 500; }
.hp-ligne-qui { font-style: italic; color: var(--ink-muted); font-size: .95rem; }
.hp-ligne-cat { font-family: var(--fd); font-size: .68rem; color: var(--c); text-align: right; }
.hp-fin { text-align: center; font-style: italic; color: var(--ink-muted); margin-top: 2rem; }
.hp-fin a { color: var(--accent); }

@media (min-width: 1500px) {
  .hp-paillasse, .hp-filtres { max-width: 1320px; }
  .hp-boite { max-width: 680px; }
}
@media (max-width: 900px) {
  .hp-paillasse { grid-template-columns: 1fr; gap: 1.4rem; }
  .colonie { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
}
@media (max-width: 600px) {
  .colonie { width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; }
  .hp-siecle { font-size: 16px; }
  .hp-ligne { grid-template-columns: 52px minmax(0, 1fr); }
  .hp-ligne-qui, .hp-ligne-cat { grid-column: 2; text-align: left; }
}
