/* Hub pages and child pages (design/hub-template.md, design/system/index.html#hub-header).
   Hub accent --c (tokens.css --hub-{id}, set by hubStyle) is only ever a dot, rule or underline.
   Link AFTER tokens.css and guide.css. */

/* ---------- Mono label ("No.02 - JAPOW", tags) ---------- */
.lbl {
  margin: 0;
  color: var(--mute);
  font: var(--w-label) 0.74rem/1.6 var(--f2);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

/* ---------- Hub page ---------- */
.hub-page .crumbs a {
  color: var(--ink);
}
.hub-hero {
  position: relative;
  margin-top: var(--space-3);
}
.hub-hero .hkj {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font: var(--w-kanji) min(40vw, 22rem) / 1 var(--fj);
  pointer-events: none;
  opacity: 0.9;
}
.hub-hero .card {
  position: absolute;
  left: var(--gut);
  bottom: var(--space-5);
  /* Owner: the summary runs wider than the h1. */
  max-width: min(47.5rem, 100% - 2 * var(--gut));
  padding: var(--space-5);
  border: 1px solid var(--ink);
  background: var(--bg);
}
.hub-hero h1 {
  max-width: 31rem;
  margin-top: var(--space-2);
  font: var(--w-head) var(--fs-h1-hub) / var(--lh-tight) var(--f1);
  letter-spacing: var(--track-head);
  text-wrap: balance;
}
/* Hub, region and child pages (.hub-page) and the 404 share one H1 size, 50px bold on desktop across the
   whole 760px card (design/_qa/live-vs-mock.md item 7). --hub-h1 is the owner's choice, one line to flip
   (phone size is the clamp minimum in both):
   option (c), live: the mock's clamp(28px, 3.5vw, 50px): 50px wide desktop, 28px on phones
   option (a): full hub size, about 3 lines of 22 characters: var(--fs-h1-hub) */
:root {
  --hub-h1: clamp(28px, 3.5vw, 50px);
}
.hub-page > .hub-hero h1 {
  max-width: none;
  font-size: var(--hub-h1);
  font-weight: var(--w-bold);
  line-height: 1.08;
}
.hub-hero .card p:last-child {
  margin-top: var(--space-3);
  color: var(--ink2);
}
@media (max-width: 700px) {
  .hub-hero .card {
    position: relative;
    left: 0;
    bottom: 0;
    max-width: none;
    margin: calc(-1 * var(--space-6)) var(--space-3) 0;
  }
}

/* Can-I verdict: the word plus a dot in its colour, never colour alone. */
.verdict {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  color: var(--vc, var(--ink));
  font: var(--w-bold) var(--fs-mono) var(--f2);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.verdict i {
  width: var(--dot-m);
  height: var(--dot-m);
  border-radius: var(--radius-dot);
  background: currentColor;
}
.v-yes {
  --vc: var(--v-yes);
}
.v-yes-if {
  --vc: var(--v-if);
}
.v-no {
  --vc: var(--v-no);
}
.v-depends {
  --vc: var(--v-dep);
}

/* Hero photo: the page's own or its topic fallback (src/lib/guide/fallback-photos.ts). */
.hub-hero .hero-img {
  display: block;
  width: 100%;
  height: min(70vh, 36rem);
  height: min(70svh, 36rem);
  object-fit: cover;
}
@media (max-width: 700px) {
  .hub-hero .hero-img {
    height: 14rem;
  }
}

/* Ways bar: every listed hub, colour dot each, current one underlined; scrolls sideways on phones. */
.ways-bar {
  display: flex;
  gap: 1.4rem;
  margin: var(--space-6) 0 0;
  padding: 0;
  overflow-x: auto;
  border-block: 1px solid var(--rule);
  list-style: none;
  scrollbar-width: none;
  font: var(--w-label) 0.74rem var(--f2);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.ways-bar li {
  flex: none;
}
.ways-bar a {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  color: var(--mute);
  text-decoration: none;
}
.ways-bar a i {
  width: var(--dot-s);
  height: var(--dot-s);
  border-radius: var(--radius-dot);
  background: var(--c);
  box-shadow: 0 0 0 1px var(--ink);
}
.ways-bar a:hover,
.ways-bar a[aria-current="page"] {
  color: var(--ink);
}
.ways-bar a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--ink);
}
.ways-bar a:focus-visible {
  outline-offset: -3px;
}

.hub-sec {
  padding: clamp(2rem, 5vw, 3rem) 0 0;
}
.hub-sec > h2 {
  margin-bottom: var(--space-4);
  font: var(--w-head) var(--fs-h2) / 1.1 var(--f1);
  letter-spacing: var(--track-head);
}

/* Child pages */
.child-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 1000px) {
  .child-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 599px) {
  .child-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.child-card {
  display: block;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
}
.child-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  filter: var(--photo-gray, grayscale(1));
  transition: filter var(--t-img) var(--ease);
}
a.child-card:hover img,
a.child-card:focus-visible img {
  filter: none;
}
.child-card .b {
  padding: var(--space-3) 0 0;
}
.child-card .b b {
  display: inline;
  background: linear-gradient(var(--c, var(--ink)), var(--c, var(--ink))) 0
    100% / 0 0.2em no-repeat;
  font: var(--w-bold) 1.25rem/1.25 var(--f1);
  transition: background-size var(--t-base);
}
a.child-card:hover .b b,
a.child-card:focus-visible .b b {
  background-size: 100% 0.2em;
}
.child-card .b span:last-child {
  display: block;
  margin-top: var(--space-2);
  color: var(--ink2);
  font-size: var(--fs-body-m);
}
.tag {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--mute);
  font: var(--w-label) var(--fs-mono-s) var(--f2);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

/* Hub prose: callouts are blockquotes that open with a bold label (**Safety**, **To verify**, **Before you book**, **Before you go**):
   ruled boxes with the hub-colour left edge and a mono label. */
.hub-page .prose blockquote {
  max-width: var(--measure);
  margin: var(--space-4) 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--rule);
  border-left: var(--bw-4) solid var(--c, var(--ink));
  background: var(--bg);
}
.hub-page .prose blockquote strong:first-child {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--mute);
  font: var(--w-label) var(--fs-mono) var(--f2);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.hub-page .prose a {
  color: var(--ink);
  text-decoration-color: var(--c, var(--ink));
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Next way in: a transit line whose dot rides across on hover/focus. */
.next {
  display: grid;
  grid-template-columns: auto minmax(2rem, 1fr) auto;
  gap: 1.4rem;
  align-items: center;
  margin-top: clamp(3rem, 7vw, 5rem);
  padding: var(--space-6) 0;
  border-block: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}
.next .line {
  position: relative;
  height: 1px;
  background: var(--ink);
}
.next .line::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--dot-l);
  height: var(--dot-l);
  margin: -6px 0 0 -6px;
  border-radius: var(--radius-dot);
  background: var(--c, var(--acc));
  box-shadow: 0 0 0 1px var(--ink);
  transition: left var(--t-settle, 1.2s) var(--ease-line);
}
.next:hover .line::after,
.next:focus-visible .line::after {
  left: 100%;
}
.next b {
  font: var(--w-head) clamp(1.6rem, 3.6vw, 2.8rem) / 1 var(--f1);
}
@media (max-width: 599px) {
  .next {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }
  .next .line {
    display: none;
  }
}

/* Child page gallery: up to 6 photos, two up (one on phones), B&W until hover like the cards. */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: var(--photo-gray, grayscale(1));
  transition: filter var(--t-img) var(--ease);
}
.gallery img:hover {
  filter: none;
}
@media (max-width: 599px) {
  .gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* FAQ */
.faq details {
  max-width: var(--measure);
  border-bottom: 1px solid var(--rule);
}
.faq details:first-of-type {
  border-top: 1px solid var(--ink);
}
.faq summary {
  display: flex;
  align-items: center;
  min-height: var(--target);
  padding: var(--space-2) 0;
  font: var(--w-bold) var(--fs-body) / 1.4 var(--f1);
  cursor: pointer;
}
.faq details p {
  margin: 0 0 var(--space-4);
  color: var(--ink2);
}
