/* ============================================================
 * ecriVOSGES — Fresque des générations
 * Complément autonome à basiclayout.css — 27/08/2026
 * ============================================================ */

.fresque-page {
  margin: 0 !important;
  padding: 0 34px 42px;
  color: #302d2a;
}

.fresque-page * { box-sizing: border-box; }
.fresque-page .container { max-width: 100%; }
.fresque-page button,
.fresque-page input,
.fresque-page select { font: inherit; }
.fresque-page button { cursor: pointer; }
.fresque-page [hidden] { display: none !important; }

.fresque-retour {
  padding: 16px 0 8px;
  font-size: 0.9rem;
}

.fresque-retour a { font-weight: 600; }

.fresque-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.9fr);
  gap: 30px;
  align-items: end;
  margin: 4px 0 22px;
  padding: 28px 30px;
  border: 1px solid #d8c8aa;
  border-radius: 8px;
  background:
    radial-gradient(circle at 92% 12%, rgba(122, 21, 18, 0.11) 0 4px, transparent 5px),
    radial-gradient(circle at 88% 24%, rgba(122, 21, 18, 0.08) 0 3px, transparent 4px),
    linear-gradient(135deg, #fbf7ee 0%, #efe3cb 100%);
}

.fresque-hero::after {
  content: "";
  position: absolute;
  right: -74px;
  top: -78px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(122, 21, 18, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(122, 21, 18, 0.025), 0 0 0 50px rgba(122, 21, 18, 0.02);
  pointer-events: none;
}

.fresque-surtitre,
.fresque-mini-titre,
.generation-numero {
  margin: 0 0 5px;
  color: #7a1512;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fresque-hero h1 {
  margin: 0 0 8px;
  padding: 0;
  font-size: clamp(2.25rem, 5vw, 3.65rem);
  line-height: 0.96;
}

.fresque-chapo {
  max-width: 610px;
  margin: 0;
  color: #514a43;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.42;
}

.fresque-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(122, 21, 18, 0.16);
  border-radius: 6px;
  background: rgba(122, 21, 18, 0.15);
}

.fresque-stats div {
  min-height: 82px;
  padding: 13px 10px;
  background: rgba(255, 252, 246, 0.89);
  text-align: center;
}

.fresque-stats dt {
  color: #7a1512;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
}

.fresque-stats dd {
  margin: 6px 0 0;
  color: #6f655b;
  font-size: 0.76rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.fresque-commandes {
  margin: 0 0 22px;
  padding: 20px;
  border: 1px solid #ded6c8;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(65, 49, 32, 0.07);
}

.fresque-commandes-tete,
.fresque-resultat,
.fresque-outils-vue {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.fresque-commandes-tete p:not(.fresque-mini-titre),
.fresque-reperes-intro p:not(.fresque-mini-titre),
.fresque-outils-vue > p,
.lignes-intro > p:not(.fresque-mini-titre) {
  margin: 0;
  color: #716b64;
  font-size: 0.88rem;
  line-height: 1.4;
}

.fresque-effacer {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 0;
  background: transparent;
  color: #7a1512;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fresque-filtres {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.fresque-champ,
.fresque-case {
  display: flex;
  gap: 6px;
  color: #4d4842;
  font-size: 0.82rem;
  font-weight: 700;
}

.fresque-champ { flex-direction: column; }

.fresque-champ input,
.fresque-champ select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #bdb2a2;
  border-radius: 4px;
  background: #fffdf8;
  color: #302d2a;
  font-size: 0.94rem;
}

.fresque-case {
  min-height: 42px;
  padding: 9px 11px;
  align-items: center;
  border: 1px solid #d3c9ba;
  border-radius: 4px;
  background: #f8f3e9;
  white-space: nowrap;
}

.fresque-case input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: #7a1512;
}

.fresque-resultat {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eee7dc;
}

.fresque-resultat p { margin: 0; color: #5f5851; }
.fresque-resultat strong { color: #7a1512; font-size: 1.25rem; }

.fresque-hasard {
  padding: 9px 13px;
  border: 1px solid #7a1512;
  border-radius: 4px;
  background: #7a1512;
  color: #fff8e9;
  font-weight: 700;
}

.fresque-reperes {
  margin: 0 0 24px;
  padding: 18px 20px;
  border-top: 1px solid #cdbb9b;
  border-bottom: 1px solid #cdbb9b;
  background: #f6efe2;
}

.fresque-reperes-liste {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.fresque-repere {
  min-height: 72px;
  padding: 9px 6px;
  border: 1px solid #cdbb9b;
  border-radius: 4px;
  background: #fffdf8;
  color: #514a43;
  text-align: center;
}

.fresque-repere strong {
  display: block;
  color: #7a1512;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  line-height: 1;
}

.fresque-repere span {
  display: block;
  margin-top: 5px;
  font-size: 0.68rem;
  line-height: 1.15;
}

.fresque-repere:hover,
.fresque-repere.is-active {
  border-color: #7a1512;
  background: #7a1512;
  color: #fff5e5;
  text-decoration: none;
}

.fresque-repere:hover strong,
.fresque-repere.is-active strong { color: #fff5e5; }

.fresque-repere-actif {
  min-height: 1.1em;
  margin: 10px 0 0;
  color: #7a1512;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.fresque-outils-vue {
  margin: 0 0 18px;
}

.fresque-vues {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #c8bba8;
  border-radius: 5px;
  background: #eee5d5;
}

.fresque-vues button {
  padding: 9px 13px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #5c544c;
  font-size: 0.85rem;
  font-weight: 700;
}

.fresque-vues button.is-active {
  background: #fff;
  color: #7a1512;
  box-shadow: 0 1px 5px rgba(55, 40, 25, 0.15);
}

.generation {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid #d9d0c3;
}

.generation:first-child { border-top: 0; }

.generation-tete {
  position: sticky;
  top: 10px;
  align-self: start;
  padding: 4px 12px 12px 0;
  border-right: 3px solid #7a1512;
}

.generation-tete h2 {
  display: block;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #7a1512;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.95;
  text-transform: none;
}

.generation-tete h2 span { display: block; color: #c7aa7c; font-size: 0.7em; line-height: 0.5; }

.generation-tete > p {
  margin: 14px 0 0;
  color: #766e65;
  font-size: 0.77rem;
  line-height: 1.35;
}

.generation-grille {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.fresque-carte {
  min-width: 0;
  border: 1px solid #ddd3c4;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 3px 11px rgba(65, 50, 34, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.fresque-carte:hover,
.fresque-carte:focus-within {
  z-index: 1;
  border-color: #ae7c65;
  transform: translateY(-3px);
  box-shadow: 0 9px 20px rgba(65, 50, 34, 0.14);
}

.fresque-carte-lien {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 122px;
  color: inherit !important;
  text-decoration: none !important;
}

.fresque-image {
  position: relative;
  display: flex;
  min-height: 122px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(145deg, #eadcc5, #cdb58f);
}

.fresque-image img {
  width: 100%;
  height: 100%;
  min-height: 122px;
  object-fit: cover;
  filter: sepia(12%);
  transition: filter 180ms ease, transform 250ms ease;
}

.fresque-carte:hover .fresque-image img { filter: sepia(0); transform: scale(1.035); }

.fresque-initiale {
  color: rgba(122, 21, 18, 0.58);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 3.15rem;
  font-weight: 700;
}

.fresque-vivant {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  padding: 3px 2px;
  border-radius: 2px;
  background: rgba(57, 104, 65, 0.92);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.fresque-carte-corps {
  display: flex;
  min-width: 0;
  padding: 11px 10px 9px;
  flex-direction: column;
}

.fresque-nom {
  overflow: hidden;
  color: #7a1512;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.05;
  text-overflow: ellipsis;
}

.fresque-dates {
  margin-top: 3px;
  color: #72675d;
  font-size: 0.75rem;
  font-weight: 700;
}

.fresque-metier,
.fresque-lieu {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #5c5650;
  font-size: 0.71rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fresque-metier { color: #89622b; font-weight: 700; }

.fresque-duree {
  display: grid;
  grid-template-columns: minmax(25px, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-top: auto;
  padding-top: 7px;
}

.fresque-duree > span {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #e7ded0;
}

.fresque-duree i { display: block; height: 100%; background: #7a1512; }
.fresque-duree em { color: #8a837b; font-size: 0.61rem; font-style: normal; white-space: nowrap; }

.fresque-carte.est-decouverte {
  animation: fresque-decouverte 2.1s ease;
}

@keyframes fresque-decouverte {
  0%, 100% { box-shadow: 0 3px 11px rgba(65, 50, 34, 0.07); }
  20%, 75% { border-color: #7a1512; box-shadow: 0 0 0 4px rgba(122, 21, 18, 0.16), 0 12px 26px rgba(65, 50, 34, 0.18); transform: translateY(-4px); }
}

.lignes-intro {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-left: 4px solid #7a1512;
  background: #f6efe2;
}

.lignes-defilement {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #d5cbbd;
  border-radius: 5px;
  background: #fff;
  box-shadow: inset -12px 0 20px rgba(75, 55, 35, 0.035);
  scrollbar-color: #9b725c #eee5d8;
}

.lignes-surface { min-width: 1160px; }

.ligne-axe,
.ligne-personne {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
}

.ligne-axe {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 54px;
  border-bottom: 1px solid #cbbda9;
  background: #f3eadb;
}

.ligne-axe-titre {
  display: flex;
  padding-left: 14px;
  align-items: center;
  border-right: 1px solid #cbbda9;
  color: #7a1512;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.ligne-axe-temps,
.ligne-temps { position: relative; }

.ligne-axe-temps > span {
  position: absolute;
  bottom: 7px;
  color: #6b6258;
  font-size: 0.68rem;
  transform: translateX(-50%);
}

.ligne-axe-temps > span i {
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 1px;
  height: 7px;
  background: #9e8c72;
}

.ligne-personne { min-height: 38px; border-bottom: 1px solid #eee9e2; }
.ligne-personne:nth-child(even) { background: #fcfaf6; }

.ligne-personne > a {
  display: flex;
  min-width: 0;
  padding: 5px 10px 5px 14px;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid #e2d8ca;
  color: #4d4640;
  line-height: 1.05;
  text-decoration: none;
}

.ligne-personne > a strong {
  overflow: hidden;
  color: #7a1512;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ligne-personne > a span { margin-top: 2px; color: #8a8178; font-size: 0.64rem; }
.ligne-personne > a:hover strong { text-decoration: underline; }

.ligne-grille {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #eee7dc;
}

.ligne-vie {
  position: absolute;
  top: 17px;
  min-width: 5px;
  height: 5px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, #7a1512, #b26d5e);
}

.ligne-vie.est-vivant { background: linear-gradient(90deg, #426f49, #76a27c); }

.ligne-naissance {
  position: absolute;
  top: 13px;
  width: 13px;
  height: 13px;
  border: 3px solid #7a1512;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-6px);
}

.lignes-legende {
  display: flex;
  gap: 18px;
  margin: 10px 0 28px;
  flex-wrap: wrap;
  color: #746c64;
  font-size: 0.75rem;
}

.lignes-legende span { display: inline-flex; gap: 6px; align-items: center; }
.lignes-legende i { display: inline-block; width: 25px; height: 5px; border-radius: 3px; }
.legende-vie { background: #8e342d; }
.legende-vivant { background: #4f8057; }

.fresque-aucun,
.fresque-vide {
  margin: 24px 0;
  padding: 28px;
  border: 1px dashed #b99e80;
  background: #faf5eb;
  text-align: center;
}

.fresque-aucun p { margin: 0 0 12px; }
.fresque-aucun button {
  padding: 9px 13px;
  border: 1px solid #7a1512;
  border-radius: 4px;
  background: #fff;
  color: #7a1512;
  font-weight: 700;
}

.fresque-page :focus-visible {
  outline: 3px solid #d59b42;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .fresque-page { padding-right: 22px; padding-left: 22px; }
  .fresque-hero { grid-template-columns: 1fr; }
  .fresque-stats { max-width: 460px; }
  .fresque-filtres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fresque-reperes-liste { grid-template-columns: repeat(4, 1fr); }
  .generation-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .fresque-page { margin: 0 !important; padding: 0 12px 30px; }
  .fresque-page .container { padding-right: 0; padding-left: 0; }
  .fresque-hero { padding: 23px 20px; }
  .fresque-hero h1 { font-size: 2.55rem; }
  .fresque-chapo { font-size: 1.08rem; }
  .fresque-commandes-tete,
  .fresque-resultat,
  .fresque-outils-vue { align-items: flex-start; flex-direction: column; }
  .fresque-resultat { align-items: stretch; }
  .fresque-hasard { width: 100%; }
  .fresque-outils-vue > p { display: none; }
  .generation { grid-template-columns: 1fr; gap: 12px; }
  .generation-tete {
    position: static;
    display: flex;
    padding: 0 0 10px;
    align-items: end;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 3px solid #7a1512;
  }
  .generation-tete h2 span { display: inline; padding: 0 3px; }
  .generation-tete > p { max-width: 145px; margin: 0; text-align: right; }
}

@media (max-width: 540px) {
  .fresque-stats { grid-template-columns: repeat(2, 1fr); }
  .fresque-filtres { grid-template-columns: 1fr; }
  .fresque-reperes { padding-right: 12px; padding-left: 12px; }
  .fresque-reperes-liste { grid-template-columns: repeat(2, 1fr); }
  .fresque-repere { min-height: 66px; }
  .fresque-vues { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
  .fresque-vues button { padding-right: 8px; padding-left: 8px; font-size: 0.78rem; }
  .generation-grille { grid-template-columns: 1fr; }
  .fresque-carte-lien { grid-template-columns: 86px minmax(0, 1fr); }
  .fresque-image { min-height: 132px; }
  .fresque-image img { min-height: 132px; }
}

@media print {
  .fresque-retour,
  .fresque-commandes,
  .fresque-reperes,
  .fresque-outils-vue,
  #vue-lignes { display: none !important; }
  .fresque-page { padding: 0; }
  .fresque-hero { display: block; background: #fff; }
  .fresque-stats { margin-top: 14px; }
  .generation { break-inside: avoid; }
  .fresque-carte { box-shadow: none; }
}
