/* Page « Plan du site » : la carte marine. Repose sur site-panorama.css, site-applis.css et site-faq.css (pied de page).
   Tout est écrit à l'encre sur la feuille ; les tailles sont en --cq (1 % de la largeur de la feuille). */
.page-carte { background: #150d07; }
.table-carte .stage { position: relative; overflow: hidden; }
.table-carte .table { position: absolute; max-width: none; }
.feuille-carte { --encre: #2a1a0e; --sepia: #8a4418; position: absolute; display: grid; grid-template-columns: 43fr 57fr; grid-template-rows: auto minmax(0, 1fr); gap: calc(var(--cq) * 1.6) calc(var(--cq) * 3); padding: calc(var(--cq) * 1.6) calc(var(--cq) * 2) calc(var(--cq) * 1.2); color: var(--encre); font: 500 calc(var(--cq) * 1.42)/1.4 DM, sans-serif; }
.feuille-carte :is(h1, h2, p, ul) { margin: 0; }
.feuille-carte > * { mix-blend-mode: multiply; opacity: 0; transition: opacity 900ms ease 300ms; }
.stage.la .feuille-carte > * { opacity: 1; }
.stage.la .c-legendes { transition-delay: 480ms; } .stage.la .c-carte { transition-delay: 640ms; }

/* le cartouche : titre et phrase */
.c-tete { display: grid; gap: calc(var(--cq) * 0.7); align-content: start; }
.c-sur { font-size: calc(var(--cq) * 1.1); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sepia); }
.feuille-carte h1 { font: 600 calc(var(--cq) * 5.6)/0.95 Bricolage, DM, sans-serif; letter-spacing: -0.04em; }
.feuille-carte :is(h1, h2) em { font-family: "Iowan Old Style", Baskerville, Georgia, serif; font-weight: 400; color: var(--sepia); }
.c-chapeau { max-width: 38ch; font-size: calc(var(--cq) * 1.5); line-height: 1.4; }

/* la légende : les pages du site, par familles */
.c-legendes { grid-column: 1; display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--cq) * 2.4); align-items: start; }
.c-legendes > div { display: grid; gap: calc(var(--cq) * 1.7); }
.legende h2 { padding-bottom: calc(var(--cq) * 0.5); margin-bottom: calc(var(--cq) * 0.5); border-bottom: 1.5px solid var(--encre); font: 700 calc(var(--cq) * 1.06)/1.2 DM, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.legende ul { display: grid; gap: calc(var(--cq) * 0.42); padding: 0; list-style: none; }
.legende li { color: #5c4a3a; font-size: calc(var(--cq) * 1.2); }
.legende a { color: var(--encre); font-size: calc(var(--cq) * 1.32); font-weight: 600; text-decoration: none; background: linear-gradient(var(--sepia), var(--sepia)) 0 100% / 0 1.5px no-repeat; transition: background-size 320ms cubic-bezier(0.16, 1, 0.3, 1), color 200ms ease; }
.legende a + a { display: block; font-size: calc(var(--cq) * 1.1); font-weight: 500; color: var(--sepia); }
.legende a + a::before { content: "↳ "; }
.legende li { line-height: 1.3; }
.legende a:hover { color: var(--sepia); background-size: 100% 1.5px; }
.feuille-carte a:focus-visible, .c-choix button:focus-visible { outline: 2px solid var(--sepia); outline-offset: 2px; }

/* la carte de la Vendée */
.c-carte { grid-column: 2; grid-row: 1 / -1; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: calc(var(--cq) * 1); min-height: 0; }
.c-carte-tete { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: calc(var(--cq) * 0.8) calc(var(--cq) * 2); }
.c-carte h2 { font: 600 calc(var(--cq) * 2.5)/1.05 Bricolage, DM, sans-serif; letter-spacing: -0.03em; }
.c-choix { display: flex; gap: calc(var(--cq) * 0.4); padding: calc(var(--cq) * 0.35); border: 1.5px solid var(--encre); border-radius: 99px; }
.c-choix button { padding: calc(var(--cq) * 0.55) calc(var(--cq) * 1.2); border: 0; border-radius: 99px; background: none; color: var(--encre); font: 600 calc(var(--cq) * 1.25)/1 DM, sans-serif; cursor: pointer; transition: background 220ms ease, color 220ms ease; }
.c-choix button:hover { background: rgba(42, 26, 14, 0.12); }
.c-choix button[aria-checked="true"] { background: var(--encre); color: #f6ecd6; }
.c-plan { position: relative; align-self: center; aspect-ratio: 1340 / 880; width: 100%; max-height: 100%; }
.trace { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trace .terre { fill: rgba(138, 68, 24, 0.09); }
.trace .cote { fill: none; stroke: var(--encre); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 3000; stroke-dashoffset: 3000; transition: stroke-dashoffset 2600ms cubic-bezier(0.3, 0, 0.2, 1) 800ms; }
.trace .ile { fill: rgba(138, 68, 24, 0.09); stroke-width: 2.6; }
.trace .frontiere { fill: none; stroke: var(--encre); stroke-width: 1.6; stroke-dasharray: 3 9; stroke-linecap: round; opacity: 0.55; }
.stage.la .trace .cote { stroke-dashoffset: 0; }
.trace .rhumbs line { stroke: var(--sepia); stroke-width: 0.8; opacity: 0.22; }
.trace .rose circle { fill: none; stroke: var(--sepia); stroke-width: 1.4; opacity: 0.7; }
.trace .rose path { fill: var(--sepia); opacity: 0.75; }
.trace text { fill: var(--sepia); font: italic 400 34px "Iowan Old Style", Baskerville, Georgia, serif; letter-spacing: 0.14em; }
.trace .rose text { font: 700 22px DM, sans-serif; letter-spacing: 0; text-anchor: middle; }
.trace .ile-nom { font-size: 21px; letter-spacing: 0.04em; }
.trace .pays { font-size: 52px; letter-spacing: 0.3em; opacity: 0.3; }
.lieux { position: absolute; inset: 0; padding: 0; list-style: none; }
/* une commune : un point à sa place, le nom à côté ; un seul des trois liens est affiché, selon le service choisi */
.lieu { position: absolute; width: 0; height: 0; opacity: 0; transition: opacity 600ms ease calc(1700ms + var(--n, 0) * 70ms); }
.stage.la .lieu { opacity: 1; }
.lieu::before { content: ""; position: absolute; left: calc(var(--cq) * -0.42); top: calc(var(--cq) * -0.42); width: calc(var(--cq) * 0.84); height: calc(var(--cq) * 0.84); border: 1.5px solid var(--encre); border-radius: 50%; background: var(--sepia); pointer-events: none; }
.lieu a { position: absolute; top: 0; left: calc(var(--cq) * 0.9); translate: 0 -50%; padding: calc(var(--cq) * 0.25) calc(var(--cq) * 0.5); border-radius: 4px; color: var(--encre); font: 700 calc(var(--cq) * 1.36)/1 DM, sans-serif; text-decoration: none; white-space: nowrap; transition: background 200ms ease, color 200ms ease; }
.lieu.g a { left: auto; right: calc(var(--cq) * 0.9); }
/* les longs noms côté mer s'écrivent sur deux lignes, pour ne pas déborder sur la légende */
.lieu.long a { width: max-content; max-width: calc(var(--cq) * 10); white-space: normal; text-align: right; line-height: 1.08; }
.lieu.b a { left: 0; top: calc(var(--cq) * 0.7); translate: -50% 0; }
.lieu.h a { left: 0; top: auto; bottom: calc(var(--cq) * 0.7); translate: -50% 0; }
.lieu a::after { content: ""; position: absolute; inset: calc(var(--cq) * -0.5); }
.lieu a:hover, .lieu a:focus-visible { background: var(--encre); color: #f6ecd6; }
.c-carte :is(.lieu, .toute, .hors-carte, .lieux-liste) a { display: none; }
.lieux-liste { display: none; }
.c-carte[data-service="0"] a[data-s="0"], .c-carte[data-service="1"] a[data-s="1"], .c-carte[data-service="2"] a[data-s="2"] { display: block; }
.lu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.toute { position: absolute; right: 0; bottom: 0; }
.toute a { padding: calc(var(--cq) * 0.7) calc(var(--cq) * 1.3); border: 1.5px solid var(--encre); border-radius: 4px; color: var(--encre); font: 700 calc(var(--cq) * 1.3)/1 DM, sans-serif; text-decoration: none; transition: background 200ms ease, color 200ms ease; }
.toute a::after { content: " →"; }
.toute a:hover { background: var(--encre); color: #f6ecd6; }
.hors-carte { display: flex; flex-wrap: wrap; gap: calc(var(--cq) * 1.2); padding: 0; list-style: none; }
.hors-carte a { color: var(--encre); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .feuille-carte > *, .lieu { opacity: 1 !important; transition: none !important; }
  .trace .cote { stroke-dashoffset: 0; transition: none; }
}

/* ============ Sur téléphone : la carte déroulée en longueur. Une seule colonne : le titre, la carte de la Vendée, puis la légende. ============ */
@media (max-width: 760px) {
  .table-carte .stage { position: relative; display: block; height: auto; min-height: 100vh; padding: 0; overflow: hidden; background: #150d07 url("assets/lockpit-plan/carte-mobile-suite.webp") repeat-y; }
  .feuille-carte { box-sizing: border-box; max-width: none; }
  .feuille-carte { position: relative; display: flex; flex-direction: column; gap: calc(var(--cq) * 5); padding: calc(var(--cq) * 6) calc(var(--cq) * 6) calc(var(--cq) * 14); font-size: max(14px, calc(var(--cq) * 4.2)); }
  .c-tete { gap: calc(var(--cq) * 2); }
  .c-sur { font-size: calc(var(--cq) * 3.2); }
  .feuille-carte h1 { font-size: calc(var(--cq) * 15); }
  .c-chapeau { max-width: none; font-size: max(14px, calc(var(--cq) * 4.3)); }
  .c-carte { order: 2; display: flex; flex-direction: column; gap: calc(var(--cq) * 3); }
  .c-carte-tete { gap: calc(var(--cq) * 2.6); }
  .c-carte h2 { font-size: calc(var(--cq) * 7.4); }
  .c-choix { gap: 4px; padding: 4px; }
  .c-choix button { padding: 9px 12px; font-size: max(13px, calc(var(--cq) * 3.8)); }
  .c-plan { align-self: stretch; margin-top: calc(var(--cq) * 2); }
  .trace text { font-size: 46px; } .trace .ile-nom { font-size: 34px; } .trace .pays { font-size: 70px; } .trace .rose text { font-size: 30px; }
  /* sur un écran étroit, les noms se marcheraient dessus : chaque point porte un numéro, et les noms sont en liste sous la carte */
  .lieux { counter-reset: lieu; }
  .lieu { counter-increment: lieu; }
  .lieu::before { content: counter(lieu); left: -10px; top: -10px; display: grid; place-items: center; width: 20px; height: 20px; border: 0; background: var(--encre); color: #f6ecd6; font: 700 11px/1 DM, sans-serif; }
  .c-carte .lieu a { display: none !important; }
  .lieux-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; margin: 0; padding: 0; list-style: none; counter-reset: nom; }
  .lieux-liste li { counter-increment: nom; display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: baseline; }
  .lieux-liste li::before { content: counter(nom); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--encre); color: #f6ecd6; font: 700 11px/1 DM, sans-serif; translate: 0 2px; }
  .lieux-liste a { color: var(--encre); font: 600 max(15px, calc(var(--cq) * 4.2))/1.25 DM, sans-serif; text-decoration: none; }
  .c-plan .toute { display: none; }
  .lieux-liste li.tout { grid-column: 1 / -1; display: block; counter-increment: none; margin-top: 8px; }
  .lieux-liste li.tout::before { content: none; }
  .lieux-liste li.tout a { padding: 11px 16px; border: 1.5px solid var(--encre); border-radius: 4px; font-weight: 700; width: max-content; }
  .lieux-liste li.tout a::after { content: " →"; }
  .toute a { display: inline-block !important; padding: 11px 16px; font-size: max(14px, calc(var(--cq) * 4)); }
  .c-carte[data-service="0"] .toute a:not([data-s="0"]), .c-carte[data-service="1"] .toute a:not([data-s="1"]), .c-carte[data-service="2"] .toute a:not([data-s="2"]) { display: none !important; }
  .c-legendes { order: 3; grid-template-columns: 1fr; gap: calc(var(--cq) * 6); }
  .c-legendes > div { gap: calc(var(--cq) * 6); }
  .legende h2 { font-size: calc(var(--cq) * 3.3); padding-bottom: 6px; margin-bottom: 8px; }
  .legende ul { gap: 10px; }
  .legende li { font-size: 14px; }
  .legende a { font-size: max(16px, calc(var(--cq) * 4.6)); }
  .legende a + a { font-size: 14px; margin-top: 2px; }
}
