/* ============================================================
   Voyage Japon — Design system
   Shippori Mincho + DM Sans · palette washi
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

:root {
  --ink: #1a1714;
  --ink-soft: #3a3530;
  --paper: #f5f0e8;
  --paper-2: #efe9dd;
  --cream: #ede7d6;
  --white: #fffdf8;
  --red: #c0392b;
  --red-light: #f5e6e4;
  --gold: #b8860b;
  --gold-light: #f5f0dc;
  --teal: #2a6b5e;
  --teal-light: #e0efec;
  --blue: #4a6a94;
  --blue-light: #e8eef5;
  --purple: #5a3d99;
  --purple-light: #f0eaff;
  --gray: #8a8278;
  --border: #d4cbbf;
  --transit: #5a6b7a;
  --transit-light: #eaeff3;
  --shadow: 0 1px 3px rgba(26,23,20,.06), 0 6px 24px rgba(26,23,20,.05);
  --radius: 8px;
  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.serif { font-family: 'Shippori Mincho', serif; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 1200; /* above Leaflet controls (~1000) */
  background: rgba(26,23,20,.96);
  backdrop-filter: blur(8px);
  color: var(--paper);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.5rem; flex-wrap: wrap;
}
.nav-brand {
  font-family: 'Shippori Mincho', serif; font-weight: 700;
  font-size: 1.1rem; color: var(--paper); white-space: nowrap;
  display: flex; align-items: center; gap: .5rem;
}
.nav-brand .jp { color: var(--gold); }
.nav-links { display: flex; gap: .25rem; flex-wrap: wrap; margin-left: auto; }
.nav-links a {
  color: #c9c1b4; font-size: 13px; font-weight: 500;
  padding: .35rem .7rem; border-radius: 6px; white-space: nowrap;
}
.nav-links a:hover { background: rgba(255,255,255,.08); color: var(--paper); text-decoration: none; }
.nav-links a.active { background: var(--red); color: #fff; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.5rem 5rem; }
.wrap-narrow { max-width: 860px; }

/* ---------- HERO ---------- */
.hero {
  background: var(--ink); color: var(--paper);
  padding: 3rem 1.5rem 2.5rem; position: relative; overflow: hidden;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; position: relative; z-index: 2; }
.hero::before {
  content: attr(data-jp);
  position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%);
  font-family: 'Shippori Mincho', serif; font-size: 10rem; opacity: .06;
  line-height: 1; pointer-events: none; z-index: 1; white-space: nowrap;
}
.hero .kicker {
  font-size: 11px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .6rem;
}
.hero h1 { font-family: 'Shippori Mincho', serif; font-size: 2.6rem; font-weight: 800; line-height: 1.08; }
.hero .sub { color: #b0a898; margin-top: .5rem; font-size: 1rem; }
.hero-meta { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 1.25rem; font-size: 13px; color: #c9c1b4; }
.hero-meta span { display: flex; align-items: center; gap: .4rem; }
.hero-meta b { color: var(--paper); font-weight: 600; }

/* ---------- SECTION HEADERS ---------- */
.section-title {
  font-family: 'Shippori Mincho', serif; font-size: 1.5rem; font-weight: 700;
  margin: 2.5rem 0 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--ink);
  display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap;
}
.section-title .count { font-size: 12px; color: var(--gray); font-weight: 400; font-family: 'DM Sans'; }
.eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gray); margin-bottom: .3rem; }

/* ---------- CARDS ---------- */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 1.25rem 1.4rem; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* type accent border */
.t-ville { border-left: 4px solid var(--blue); }
.t-nature { border-left: 4px solid var(--teal); }
.t-culture { border-left: 4px solid var(--gold); }
.t-transit { border-left: 4px solid var(--transit); }
.t-special { border-left: 4px solid var(--red); }
.t-city { border-left: 4px solid var(--blue); }

/* ---------- TAGS ---------- */
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; letter-spacing:.02em; }
.tag-must { background: var(--red-light); color: var(--red); }
.tag-onsen { background: var(--gold-light); color: var(--gold); }
.tag-transport { background: var(--transit-light); color: var(--transit); }
.tag-exp { background: var(--purple-light); color: var(--purple); }
.tag-fire { background: #fff0e0; color: #c06000; }
.tag-night { background: var(--cream); color: var(--gray); }

/* ---------- DAY CARDS (itinéraire) ---------- */
.day-card { margin-bottom: 10px; overflow: hidden; }
.day-head {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 0 1rem; align-items: center;
  padding: .85rem 1.1rem; cursor: pointer; user-select: none;
}
.day-head:hover { background: #faf8f3; }
.day-date { text-align: center; line-height: 1.15; }
.day-date .wd { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--gray); }
.day-date .dd { font-size: 22px; font-weight: 300; font-family: 'Shippori Mincho', serif; }
.day-date .mo { font-size: 10px; color: var(--gray); text-transform: uppercase; }
.day-titles .dt { font-weight: 600; font-size: 15px; }
.day-titles .ds { font-size: 12.5px; color: var(--gray); margin-top: 1px; }
.day-head .chev { color: var(--gray); font-size: 12px; transition: transform .2s; margin-left:.5rem; }
.day-card.open .chev { transform: rotate(180deg); }

.day-body { display: none; border-top: 1px solid var(--cream); padding: 0 1.1rem 1.1rem; }
.day-card.open .day-body { display: block; }

/* inner tabs */
.tabs { display: flex; gap: 2px; margin: .9rem 0 0; border-bottom: 1px solid var(--border); }
.tab-btn {
  font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  background: none; border: none; cursor: pointer; color: var(--gray);
  padding: .5rem .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: flex; align-items: center; gap: .35rem;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--red); }
.tab-pane { display: none; padding-top: .9rem; }
.tab-pane.active { display: block; }

/* topo list */
.topo-item { display: flex; gap: .8rem; margin-bottom: .6rem; font-size: 13.5px; color: var(--ink-soft); }
.topo-item .time { flex-shrink: 0; min-width: 72px; font-weight: 600; color: var(--teal); font-size: 12px; padding-top: 1px; }

/* transport rows */
.leg { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.leg:last-child { border-bottom: none; }
.leg .mode { font-weight: 500; }
.leg .meta { color: var(--gray); font-size: 12px; }
.jr-pill { font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 10px; white-space: nowrap; }
.jr-yes { background: var(--teal-light); color: var(--teal); }
.jr-no { background: var(--red-light); color: var(--red); }
.jr-partial { background: var(--gold-light); color: var(--gold); }

/* note boxes */
.box { border-radius: 0 6px 6px 0; padding: .55rem .8rem; font-size: 12.5px; margin-top: .6rem; line-height: 1.55; }
.box-note { background: var(--teal-light); border-left: 3px solid var(--teal); color: #1a4a40; }
.box-warning { background: var(--red-light); border-left: 3px solid var(--red); color: #7a1f16; }
.box-booking { background: var(--purple-light); border-left: 3px solid var(--purple); color: #3a2878; }
.box-tip { background: var(--gold-light); border-left: 3px solid var(--gold); color: #6a5000; }
.box .box-link { display: inline-block; margin-top: 3px; font-weight: 600; font-size: 12px; }

/* ---------- ÉTAPE PAGE ---------- */
.etape-hero { background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.5rem; position: relative; overflow: hidden; }
.etape-hero .jpbg { position:absolute; right:1rem; bottom:-1.5rem; font-family:'Shippori Mincho',serif; font-size:6rem; opacity:.08; }
.subtab-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.subtab-nav button {
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--white); border: 1px solid var(--border); color: var(--ink-soft);
  padding: .45rem 1rem; border-radius: 20px;
}
.subtab-nav button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.attraction { display: flex; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--cream); }
.attraction:last-child { border-bottom: none; }
.attraction .ic { font-size: 1.3rem; flex-shrink: 0; width: 2rem; text-align:center; }
.attraction .a-name { font-weight: 600; }
.attraction .a-name .jp { font-weight: 400; color: var(--gray); font-size: 12px; margin-left: .4rem; }
.attraction .a-desc { font-size: 13px; color: var(--ink-soft); margin-top: 1px; }
.attraction .a-meta { font-size: 11.5px; color: var(--gray); margin-top: 3px; display: flex; gap: .8rem; flex-wrap: wrap; align-items:center; }
.chip { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 4px; }
.chip-momiji { background: #fae3df; color: var(--red); }
.chip-book { background: var(--purple-light); color: var(--purple); }
.chip-type { background: var(--cream); color: var(--gray); }

.def-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--cream); font-size: 13.5px; }
.def-row:last-child { border-bottom: none; }
.def-row .k { color: var(--gray); flex-shrink: 0; }
.def-row .v { text-align: right; font-weight: 500; }

/* ---------- CHECKLIST (todo / packing) ---------- */
.check {
  display: flex; align-items: flex-start; gap: .7rem; padding: .7rem .9rem;
  background: var(--white); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px;
  cursor: pointer; transition: opacity .15s;
}
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--teal); flex-shrink: 0; cursor: pointer; }
.check .c-body { flex: 1; }
.check .c-title { font-weight: 500; font-size: 14px; }
.check .c-note { font-size: 12px; color: var(--gray); margin-top: 2px; }
.check.done .c-title { text-decoration: line-through; color: var(--gray); }
.check.done { opacity: .6; }
.check-meta { display: flex; gap: .5rem; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.prio { font-size: 9.5px; font-weight: 700; padding: 1px 7px; border-radius: 4px; text-transform: uppercase; letter-spacing:.03em; }
.prio-haute { background: var(--red-light); color: var(--red); }
.prio-moyenne { background: var(--gold-light); color: var(--gold); }
.prio-basse { background: var(--cream); color: var(--gray); }
.deadline { font-size: 11.5px; color: var(--gray); }

.progress-bar { height: 8px; background: var(--cream); border-radius: 10px; overflow: hidden; margin: .4rem 0 1.2rem; }
.progress-bar > i { display: block; height: 100%; background: var(--teal); border-radius: 10px; transition: width .3s; }

/* category headers */
.cat-head { display: flex; align-items: center; gap: .5rem; font-family: 'Shippori Mincho', serif; font-size: 1.15rem; font-weight: 700; margin: 1.8rem 0 .8rem; }
.cat-head .ic { font-size: 1.2rem; }

/* ---------- PANELS / STATS ---------- */
.stat { text-align: center; padding: 1.1rem .5rem; }
.stat .n { font-family: 'Shippori Mincho', serif; font-size: 2rem; font-weight: 700; color: var(--red); line-height: 1; }
.stat .l { font-size: 12px; color: var(--gray); margin-top: .35rem; }

.pill-list { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { font-size: 12px; padding: .3rem .7rem; background: var(--cream); border-radius: 20px; color: var(--ink-soft); }

/* ---------- MAP ---------- */
.map-wrap { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.map-wrap svg { width: 100%; height: auto; display: block; }
.map-node { cursor: pointer; }
.map-node text { font-size: 11px; font-family: 'DM Sans'; fill: var(--ink); font-weight: 600; }
.map-node:hover circle { stroke: var(--red); stroke-width: 2.5; }

/* Leaflet pins + popup */
.vj-pin span {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 12px;
  border: 2px solid #fffdf8; box-shadow: 0 1px 5px rgba(0,0,0,.35);
  font-family: 'DM Sans', sans-serif;
}
.leaflet-popup-content { font-family: 'DM Sans', sans-serif; font-size: 13px; margin: .6rem .8rem; line-height: 1.5; }
.leaflet-container { font-family: 'DM Sans', sans-serif; }

/* ---------- GRAPH ---------- */
#graph-canvas { width: 100%; height: 640px; display: block; background: var(--paper-2); border-radius: var(--radius); border: 1px solid var(--border); cursor: grab; }
.graph-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; font-size: 12px; }
.graph-legend span { display: flex; align-items: center; gap: .4rem; color: var(--gray); }
.graph-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.graph-tip { font-size: 12px; color: var(--gray); }

/* ---------- TABLE ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--cream); }
table.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--gray); }

/* ---------- MISC ---------- */
.muted { color: var(--gray); }
.center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.lead { font-size: 1.05rem; color: var(--ink-soft); line-height: 1.7; }
.divider { height: 1px; background: var(--border); margin: 2rem 0; }
.back-link { font-size: 13px; color: var(--gray); display: inline-flex; align-items: center; gap: .3rem; margin-bottom: 1rem; }

.footer { text-align: center; color: var(--gray); font-size: 12px; padding: 2rem 1.5rem 3rem; border-top: 1px solid var(--border); margin-top: 2rem; }

.loading { text-align: center; padding: 4rem 1rem; color: var(--gray); }

/* segmented timeline strip on home */
.timeline { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-seg {
  flex: 1 1 auto; min-width: 88px; background: var(--white); border: 1px solid var(--border);
  border-radius: 6px; padding: .6rem .7rem; text-decoration: none; color: var(--ink);
  border-top: 3px solid var(--gray); transition: transform .12s, box-shadow .12s;
}
.tl-seg:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.tl-seg .tl-dates { font-size: 10.5px; color: var(--gray); }
.tl-seg .tl-name { font-weight: 600; font-size: 13px; margin-top: 2px; }
.tl-seg .tl-jp { font-family: 'Shippori Mincho', serif; font-size: 11px; color: var(--gray); }

@media print {
  .nav, .footer { display: none; }
  .day-body { display: block !important; }
  .tab-pane { display: block !important; }
  body { font-size: 11px; }
}
