/* Japon 2026-27 — styles de la page. Mobile-first, pas de webfont. */

:root {
  --bg: #EEF1F5; --paper: #FFFFFF; --ink: #1B2233; --muted: #5C6675; --line: #D5DAE2;
  --p1: #2F4A7A; --p2: #3F7A5B; --p3: #C8322B;
  --p1s: #E3E9F4; --p2s: #E1EFE6; --p3s: #F8E2E0;
  --car: #F1EBDD; --car-ink: #7A5A1E;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.45;
}
a { color: inherit; }

/* ---------- En-tête ---------- */
header { background: var(--paper); border-bottom: 1px solid var(--line); }
.wrap { max-width: 1500px; margin: 0 auto; padding-inline: 16px; }
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 24px 0 16px; }
.hero h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.02em; line-height: 1; }
.hero h1 small { display: block; font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 8px; }
.facts { display: flex; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.facts b { display: block; color: var(--ink); font-size: 20px; }
.facts .countdown b { color: var(--p3); }

nav.phases { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 0 16px; }
nav.phases a { text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; }
nav.phases a.p1 { border-color: var(--p1); color: var(--p1); }
nav.phases a.p2 { border-color: var(--p2); color: var(--p2); }
nav.phases a.p3 { border-color: var(--p3); color: var(--p3); }
nav.phases a span { color: var(--muted); margin-left: 6px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 24px 0 60px; align-items: start; }
.mapcol { position: static; }
#map { height: 60vh; min-height: 380px; border-radius: var(--radius); border: 1px solid var(--line); background: #DCE3EC; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.legend i.l1 { background: var(--p1); } .legend i.l2 { background: var(--p2); } .legend i.l3 { background: var(--p3); }
.legend .route { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--p1); vertical-align: 3px; margin-right: 5px; }

@media (min-width: 1000px) {
  .wrap { padding-inline: 24px; }
  .layout { grid-template-columns: minmax(0, 1fr) 540px; }
  .mapcol { position: sticky; top: 16px; }
  #map { height: calc(100vh - 32px); min-height: 520px; }
}

/* ---------- Phases & jours ---------- */
section.phase { margin-bottom: 36px; }
section.phase > h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; padding-left: 14px; border-left: 6px solid; }
section.phase > p { margin: 0 0 14px 20px; color: var(--muted); font-size: 14px; }
#phase1 > h2 { border-color: var(--p1); } #phase2 > h2 { border-color: var(--p2); } #phase3 > h2 { border-color: var(--p3); }

.day {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
}
.day:hover, .day.active { border-color: var(--ink); }
.day:focus-visible { outline: 2px solid var(--p1); outline-offset: 2px; }
.day.today { box-shadow: 0 0 0 3px var(--p3s); border-color: var(--p3); }
.day .date { font-weight: 600; font-size: 14px; line-height: 1.2; }
.day .date small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.day .place { font-weight: 600; margin-bottom: 2px; }
.day .place em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
.day .act { font-size: 14px; }
.day .note { font-size: 13px; color: var(--muted); margin-top: 4px; }
.day .note.warn { color: var(--p3); }
.day.d1 .date { color: var(--p1); } .day.d2 .date { color: var(--p2); } .day.d3 .date { color: var(--p3); }
.day .who { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.day .tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.tag.night { background: var(--p1s); color: var(--p1); }
.tag.bday { background: var(--p3s); color: var(--p3); }
.tag.car { background: var(--car); color: var(--car-ink); }
.day .res { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; display: grid; gap: 3px; }
.day .res span.k { color: var(--muted); display: inline-block; min-width: 72px; }
.day .res a { color: var(--p1); }
@media (min-width: 700px) { .day { grid-template-columns: 78px 1fr; } }

body.only-todo .day:not(.has-todo) { display: none; }

/* ---------- Cartouches (résas, budget, infos, dodos) ---------- */
.board, .lodging { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.board { margin-bottom: 24px; }
.lodging { margin-top: 20px; }
.board h3, .lodging h3 { margin: 0 0 10px; font-size: 16px; }
.board .bar { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.board label { cursor: pointer; user-select: none; }
.dl { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 13px; align-items: baseline; }
.dl > div { padding: 5px 0; border-bottom: 1px solid var(--line); }
.dl > div:nth-child(3n) { grid-column: 2; }
.dl .when { font-weight: 600; white-space: nowrap; }
.dl .when.late { color: var(--p3); }
@media (min-width: 700px) {
  .dl { grid-template-columns: 110px 1fr auto; }
  .dl > div:nth-child(3n) { grid-column: auto; }
}

.st { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.st.todo { background: #F8E2E0; color: #A0261F; }
.st.wip { background: #FBEFD5; color: #7A5A1E; }
.st.booked { background: #E1EFE6; color: #2E5F43; }
.st.paid { background: #E3E9F4; color: #2F4A7A; }
.st.na { background: #EEF1F5; color: var(--muted); }
.ph { color: var(--muted); font-style: italic; }

.grid2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
#infos th { width: 40%; }
tr.total td { font-weight: 600; }

/* ---------- Carte : popups & marqueurs ---------- */
.leaflet-popup-content { font-family: inherit; font-size: 13px; line-height: 1.35; margin: 10px 12px; }
.leaflet-popup-content b { display: block; margin-bottom: 2px; }
.mk { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.mk.m1 { background: var(--p1); } .mk.m2 { background: var(--p2); } .mk.m3 { background: var(--p3); }
.mk.hub { width: 20px; height: 20px; }

/* ---------- Pied de page ---------- */
.colophon { padding-block: 8px 24px; font-size: 11px; color: var(--muted); text-align: right; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .mapcol, nav.phases, .board .bar, .colophon { display: none; }
  .layout { grid-template-columns: 1fr; }
  .day { break-inside: avoid; }
}
