/* thingstodointokyoguide.com — murasaki/Heian-purple editorial theme */

:root {
  --bg:        #fafaf8;
  --bg-alt:    #f4f1ec;
  --border:    #ddd6cf;
  --text:      #1c1b18;
  --muted:     #5a5751;
  --accent:    #5d2c52;
  --accent-dk: #41203b;
  --accent-lt: #f3e8f0;
  --warn:      #9a6809;
  --highlight: #fde68a;
  --highlight-strong: #fbd35a;
  --serif:     'Fraunces', Georgia, serif;
  --sans:      'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:      ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace;
  --max:       820px;
  --wide:      1120px;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .5rem;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-top: 2.5rem; }
h3 { font-size: 1.2rem; margin-top: 1.5rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--accent-dk); }
strong { font-weight: 700; }
small { font-size: .85em; color: var(--muted); }

ul, ol { padding-left: 1.4rem; }
li { margin: .25rem 0; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.wide      { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }

/* === u-link: yellow-highlighter persistent marker === */
.u-link {
  position: relative;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  padding: 0 .12em;
  background-image: linear-gradient(to top,
    transparent .15em,
    var(--highlight) .15em,
    var(--highlight) 1.05em,
    transparent 1.05em);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transition: background-image .15s, color .15s;
}
.u-link:hover {
  color: var(--accent);
  background-image: linear-gradient(to top,
    transparent .15em,
    var(--highlight-strong) .15em,
    var(--highlight-strong) 1.05em,
    transparent 1.05em);
}

/* === Site header === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}
.header-inner {
  max-width: var(--wide); margin: 0 auto; padding: .65rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
}
.brand strong { color: var(--accent); }
.header-nav { display: flex; gap: 1.5rem; }
.header-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.header-nav a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.header-nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); }

.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer;
  font-size: 1.4rem; color: var(--text); padding: .25rem .5rem;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--bg); border-top: 1px solid var(--border);
  padding: .5rem 1.5rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: .65rem 0; text-decoration: none; color: var(--text);
  font-weight: 600; border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: 0; }

@media (max-width: 720px) {
  .header-nav { display: none; }
  .nav-toggle { display: block; }
}
@media (min-width: 721px) {
  .mobile-nav, .mobile-nav.open { display: none; }
}

/* === Hero === */
.hero {
  max-width: var(--max); margin: 0 auto; padding: 3.5rem 1.5rem 2rem;
}
.hero .kicker {
  font-family: var(--mono); font-size: .75rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1rem;
}
.hero h1 { margin-bottom: 1rem; }
.hero .deck {
  font-size: 1.2rem; color: var(--muted); line-height: 1.55; max-width: 38em;
}
.hero .byline {
  margin-top: 1.5rem; font-size: .9rem; color: var(--muted);
  font-family: var(--mono);
}

.hero-tours { padding-bottom: 1.5rem; }

/* === Facts bar (dark band) === */
.facts-bar {
  background: var(--text);
  color: var(--bg);
  margin: 2rem 0 0;
  padding: 1.5rem 0;
}
.facts-inner {
  max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
}
.fact { min-width: 0; }
.fact-num {
  display: block;
  font-family: var(--serif); font-size: 1.8rem; font-weight: 700; line-height: 1;
  color: #f6d2c0;
}
.fact-label {
  display: block;
  font-family: var(--mono); font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.7);
  margin-top: .35rem;
  overflow-wrap: anywhere;
}

/* === Sticky anchor-nav === */
.anchor-nav {
  position: sticky; top: 52px; z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.anchor-nav::-webkit-scrollbar { display: none; }
.anchor-nav-list {
  max-width: var(--wide); margin: 0 auto;
  padding: 0 1.5rem;
  display: inline-flex; gap: .15rem;
  list-style: none; min-width: 100%;
}
.anchor-nav-list li { flex-shrink: 0; padding: 0; margin: 0; }
.anchor-nav-list li::before { content: none; }
.anchor-link {
  display: inline-block;
  padding: .55rem .8rem;
  font-family: var(--mono);
  font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s, opacity .15s;
  opacity: .55; white-space: nowrap;
}
.anchor-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  opacity: 1;
}

/* === Callouts === */
.tldr {
  background: var(--accent-lt);
  border-left: 4px solid var(--accent);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.tldr h2 { margin-top: 0; font-size: 1.15rem; color: var(--accent-dk); }
.tldr ul { margin: .5rem 0 0; }

.callout {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

/* === Top 10 list === */
.top10-list {
  list-style: none; padding: 0; margin: 0;
  counter-reset: top10;
}
.top10-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  counter-increment: top10;
}
.top10-item::before {
  content: counter(top10, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 1.5rem; font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.top10-item h3 { margin: 0 0 .35rem; font-size: 1.25rem; }
.top10-meta { font-size: .9rem; color: var(--muted); margin: .25rem 0 .75rem; }
.top10-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.chip {
  display: inline-block;
  padding: .25rem .65rem;
  font-size: .8rem; font-weight: 600;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}
.chip.accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chip.accent:hover { background: var(--accent-dk); color: #fff; }

/* === Hidden gems grid === */
.gem-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin: 1rem 0;
}
.gem-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}
.gem-card h3 { margin-top: 0; font-size: 1.05rem; }
.gem-card p { font-size: .95rem; margin-bottom: .75rem; }

/* === Persona grid === */
.persona-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin: 1rem 0;
}
.persona-card {
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  background: var(--bg);
}
.persona-card h3 {
  margin-top: 0; font-size: 1.05rem;
  font-family: var(--mono); letter-spacing: .05em;
}
.persona-card ul { padding-left: 1.2rem; font-size: .95rem; margin-bottom: .75rem; }

/* === Season grid === */
.season-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem; margin: 1rem 0;
}
.season-card {
  border-top: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  background: var(--bg-alt);
}
.season-card h3 {
  margin-top: 0; font-size: 1.05rem;
  font-family: var(--mono); letter-spacing: .05em;
}
.season-card p { font-size: .95rem; margin-bottom: .75rem; }

/* === Flag (red flags) grid === */
.flag-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin: 1rem 0;
}
.flag-card {
  border: 1px dashed var(--warn);
  padding: 1rem 1.25rem;
  background: #fffaf0;
}
.flag-card h3 {
  margin-top: 0; font-size: 1rem; color: var(--warn);
  font-family: var(--mono); letter-spacing: .05em;
}
.flag-card p { font-size: .9rem; margin-bottom: 0; }

/* === Tours catalogue === */
.top-picks {
  margin: 3rem 0 2rem;
}
.top-picks h2 { margin-bottom: .5rem; }
.top-picks .deck { color: var(--muted); margin-bottom: 1.5rem; }

.picks-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem; margin: 1.5rem 0;
}
.pick-card {
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pick-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(93, 44, 82, .12);
  transform: translateY(-2px);
}
.pick-img {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
}
.pick-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.pick-card:hover .pick-img img { transform: scale(1.04); }
.pick-persona {
  position: absolute; top: .75rem; left: .75rem;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .35rem .65rem;
  z-index: 2;
}
.pick-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex; flex-direction: column; flex: 1;
}
.pick-body h3 {
  margin: 0 0 .5rem; font-size: 1.1rem; line-height: 1.3;
}
.pick-body h3 a {
  color: var(--text); text-decoration: none;
}
.pick-body h3 a:hover { color: var(--accent); }
.pick-meta { font-size: .9rem; color: var(--muted); margin-bottom: .85rem; flex: 1; }

.book-cta {
  display: inline-block;
  padding: .55rem 1.1rem;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: .95rem;
  text-decoration: none;
  border-radius: 4px;
  align-self: flex-start;
}
.book-cta:hover { background: var(--accent-dk); color: #fff; }

/* === Catalogue methodology + filter bar === */
.catalogue { margin-top: 2.5rem; }
.tours-section-title { margin-top: 0; }
.methodology { margin: 1rem 0 1.5rem; color: var(--muted); font-size: .95rem; }
.methodology p { margin-bottom: .5rem; }

.filter-bar {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 1rem;
  display: flex; flex-wrap: wrap; gap: 1rem; row-gap: .75rem;
  align-items: center;
}
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.filter-label {
  font-family: var(--mono); font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-right: .25rem;
}
.filter-chip {
  font: inherit; cursor: pointer;
  padding: .35rem .75rem;
  font-size: .85rem; font-weight: 600;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background .12s, color .12s, border-color .12s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

.count-bar {
  font-family: var(--mono); font-size: .85rem;
  color: var(--muted);
  margin: 1rem 0 .5rem;
}
.count-bar #tourCount { color: var(--text); font-weight: 700; }

.topic-banner {
  background: #fff7e6;
  border-left: 4px solid var(--warn);
  padding: .85rem 1.25rem;
  margin: 1rem 0;
  font-size: .95rem;
}

/* === Catalogue table === */
.table-wrap { overflow-x: auto; margin: 1rem -1.5rem; }
@media (min-width: 880px) { .table-wrap { margin: 1rem 0; } }
.data-table {
  width: 100%; min-width: 760px;
  border-collapse: collapse;
  font-size: .92rem;
}
.data-table thead th {
  background: var(--bg-alt);
  text-align: left;
  padding: .75rem .85rem;
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: default;
}
.data-table thead th.sortable { cursor: pointer; user-select: none; }
.data-table thead th.sortable:hover { color: var(--accent); }
.data-table thead th.sort-active { color: var(--accent); }
.data-table tbody td {
  padding: .8rem .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table tbody tr:hover { background: var(--bg-alt); }

.tc-name a {
  color: var(--text); text-decoration: none; font-weight: 600;
}
.tc-name a:hover { color: var(--accent); text-decoration: underline; }
.tc-rating { font-weight: 700; color: var(--accent-dk); white-space: nowrap; }
.tc-reviews { white-space: nowrap; color: var(--muted); }
.tc-duration { white-space: nowrap; }
.tc-price { white-space: nowrap; font-weight: 700; }
.tc-book .book-cta { padding: .35rem .8rem; font-size: .85rem; }

.badge {
  display: inline-block;
  padding: .15rem .55rem;
  font-size: .72rem; font-weight: 700;
  font-family: var(--mono); letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--accent-lt); color: var(--accent-dk);
  border-radius: 4px;
  white-space: nowrap;
}
.badge.type-food      { background: #fceee0; color: #8a4a16; }
.badge.type-culture   { background: #efe0ec; color: #5d2c52; }
.badge.type-fuji      { background: #e0e8f4; color: #2a4670; }
.badge.type-quirky    { background: #fff0e8; color: #b54215; }
.badge.type-walking   { background: #e8f0e4; color: #3f6b32; }
.badge.type-cruise    { background: #e0eef4; color: #1f5a72; }
.badge.type-nightlife { background: #2a1538; color: #f6d2c0; }
.badge.type-tickets   { background: #fff4e0; color: #8a6920; }
.badge.type-private   { background: #f0e8f6; color: #5d3590; }
.badge.type-daytrip   { background: #e8eef4; color: #2c4470; }
.badge.type-tours     { background: var(--bg-alt); color: var(--muted); }

.tour-row-hidden { display: none; }

/* === Meta note (methodology footer for tours.html) === */
.meta-note {
  margin: 3rem 0 1rem;
  padding: 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: .95rem;
}
.meta-note h2 { margin-top: 0; font-size: 1.15rem; }

/* === Logistics-table / data-table reuse === */
.data-table.simple thead th { background: var(--bg-alt); }

/* === FAQ === */
.faq-list { margin: 1rem 0; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-question {
  width: 100%;
  background: none; border: 0; cursor: pointer;
  text-align: left;
  font: inherit; font-weight: 700;
  font-size: 1.05rem;
  padding: 1rem 2rem 1rem 0;
  position: relative; color: var(--text);
}
.faq-question::after {
  content: '+';
  position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--accent); font-family: var(--mono);
}
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease, padding .2s;
  padding: 0 0;
}
.faq-item.open .faq-answer {
  max-height: 1000px;
  padding: 0 0 1.25rem;
}
.faq-answer p { margin: 0 0 .75rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* === Floating plan pill === */
.plan-pill {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  background: var(--accent); color: #fff;
  padding: .7em 1.3em; border-radius: 40px;
  text-decoration: none;
  font-weight: 700; font-size: .95rem;
  box-shadow: 0 4px 16px rgba(93, 44, 82, .25);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s, background .15s;
}
.plan-pill.visible {
  opacity: 1; pointer-events: auto;
}
.plan-pill:hover { background: var(--accent-dk); color: #fff; }

/* === Footer === */
.site-footer {
  margin-top: 4rem;
  background: var(--text); color: var(--bg);
  padding: 3rem 1.5rem 2rem;
}
.footer-grid {
  max-width: var(--wide); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand { font-family: var(--serif); font-size: 1.2rem; margin-bottom: .5rem; }
.footer-brand strong { color: #f6d2c0; }
.site-footer p { font-size: .9rem; line-height: 1.55; color: rgba(255,255,255,.85); }
.site-footer a { color: #f6d2c0; }
.footer-h {
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin: 0 0 .75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin: .35rem 0; font-size: .9rem; }
.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { text-decoration: underline; }
.copy {
  max-width: var(--wide); margin: 2rem auto 0;
  font-size: .82rem; color: rgba(255,255,255,.5);
  text-align: center;
  padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.1);
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
}
