/* Hut Hunter server-rendered pages: a place, the A to Z directory, not found.
   Tokens only (tokens.css: Overprint Survey, light and dark); mobile first, readable at 360 px
   with no sideways scroll, clean in print. The app's style.css is not loaded here. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-ink);
  font-family: var(--font-ui); font-weight: var(--weight-regular); font-size: 16px; line-height: 1.5;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
a { color: var(--color-brand); text-underline-offset: 2px; }
a:hover { color: var(--color-brand-hover); }
h1, h2, h3, p, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 10; background: var(--color-brand); color: var(--color-on-brand); padding: 10px 14px; border-radius: var(--radius-m); font-weight: var(--weight-strong); }
.skip:focus { top: 12px; color: var(--color-on-brand); }

/* header */
.pg-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top)); background: var(--color-surface); border-bottom: 1px solid var(--color-line);
}
.pg-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--color-ink); text-decoration: none;
  font-family: var(--font-display); font-weight: var(--weight-display); font-size: 21px; line-height: 1; letter-spacing: var(--tracking-display); }
.pg-brand span:last-child { padding-top: 3px; }
.pg-brand:hover { color: var(--color-ink); }
.pg-mark { width: 30px; height: 30px; background: var(--logo-mark) center / contain no-repeat; flex: none; }
.pg-nav { display: flex; gap: 4px; }
.pg-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-m); color: var(--color-ink); text-decoration: none; font-weight: var(--weight-medium); }
.pg-nav a:hover { background: var(--color-surface-sunken); }

/* page */
.pg { max-width: 860px; margin: 0 auto; padding: 12px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; font-size: 14px; color: var(--color-ink-muted); }
.crumbs li + li::before { content: "\203A"; margin: 0 8px; color: var(--color-ink-subtle); }
.crumbs a { color: var(--color-ink-muted); }
.crumbs [aria-current] { color: var(--color-ink); }
h1 { font-family: var(--font-display); font-weight: var(--weight-display); font-stretch: var(--display-stretch, normal); font-size: 32px; line-height: 1.1; letter-spacing: var(--tracking-display); }
.lede { color: var(--color-ink-muted); max-width: 68ch; }
.note, .fresh { font-size: 14px; color: var(--color-ink-muted); }

.hero { display: flex; flex-direction: column; gap: 14px; }
.hero-text { display: flex; flex-direction: column; gap: 6px; }
.kind { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--color-ink-muted); font-size: 15px; font-weight: var(--weight-medium); }
.coords { font-size: 14px; color: var(--color-ink-muted); }
.approx { color: var(--status-tight-ink); }
.tag { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: var(--weight-medium); line-height: 1; padding: 4px 7px; border-radius: var(--radius-s);
  background: var(--color-brand-tint); color: var(--color-brand); white-space: nowrap; }
.tag-nobook { background: var(--status-nobook-tint); color: var(--status-nobook-ink); }
.photo { position: relative; border-radius: var(--radius-l); overflow: hidden; background: var(--color-surface-sunken); aspect-ratio: 16 / 9; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; right: 8px; bottom: 6px; font-size: 11.5px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }

.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns:empty { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-m); border: 1px solid transparent; font-weight: var(--weight-strong); font-size: 15px;
  text-decoration: none; line-height: 1.1; transition: background-color .15s, border-color .15s;
}
.btn-primary { background: var(--color-brand); color: var(--color-on-brand); }
.btn-primary:hover { background: var(--color-brand-hover); color: var(--color-on-brand); }
.btn-secondary { background: var(--color-surface); color: var(--color-ink); border-color: var(--color-line-strong); }
.btn-secondary:hover { background: var(--color-surface-sunken); color: var(--color-ink); }
.btn-quiet { background: var(--color-surface-sunken); color: var(--color-ink); border-color: var(--color-line); font-weight: var(--weight-medium); }
.btn-quiet:hover { border-color: var(--color-line-strong); color: var(--color-ink); }

/* sections */
.sec { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-l); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sec h2 { font-family: var(--font-display); font-weight: var(--weight-display); font-stretch: var(--display-stretch, normal); font-size: 22px; line-height: 1.2; letter-spacing: var(--tracking-display); }
.sec-head { display: flex; flex-direction: column; gap: 4px; }
.sec-note { font-size: 14px; color: var(--color-ink-muted); }
.verdict { border-color: transparent; }
.verdict.st-free { background: var(--status-free-tint); }
.verdict.st-nobook { background: var(--status-nobook-tint); }
.verdict.st-nobook h2 { color: var(--status-nobook-ink); }
.verdict.st-none { background: var(--status-none-tint); }
.nexts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 17px; }
.nexts b { color: var(--status-free-ink); font-weight: var(--weight-strong); }
.verdict .fresh { color: var(--color-ink-muted); }

/* the bunk calendar: one table per month, Monday first */
.cals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px 20px; align-items: start; }
.cal { table-layout: fixed; border-collapse: separate; border-spacing: 3px; margin: -3px; width: calc(100% + 6px); }
.cal caption { text-align: left; font-weight: var(--weight-strong); padding: 0 3px 4px; }
.cal th { font-size: 12px; font-weight: var(--weight-strong); color: var(--color-ink-muted); padding-bottom: 2px; }
.cd { height: 52px; padding: 0; border-radius: var(--radius-s); background: var(--color-surface-sunken); vertical-align: top; border: 1px solid transparent; }
.cd-x { background: transparent; }
.cd-in { display: flex; flex-direction: column; height: 100%; padding: 3px 4px; line-height: 1; }
.cd-d { font-size: 11.5px; color: var(--color-ink-muted); }
.cd-n { font-family: var(--font-numeric); font-size: 18px; font-weight: var(--weight-display); text-align: center; margin-top: 2px; }
.cd-s { font-size: 10.5px; text-align: center; margin-top: auto; white-space: nowrap; }
.cd.st-free { background: var(--status-free-tint); color: var(--status-free-ink); box-shadow: inset 0 -3px 0 var(--status-free); }
.cd.st-full { background: repeating-linear-gradient(135deg, var(--status-full-tint) 0 5px, var(--color-surface) 5px 8px); color: var(--status-full-ink); border-color: var(--color-line); }
.cd.st-closed { background: var(--color-surface); border: 1px dashed var(--status-closed); color: var(--status-closed-ink); }
.cd.st-notyet { background: var(--color-surface); border: 1px dotted var(--color-line-strong); color: var(--color-ink-muted); }
.cd.st-na { background: transparent; border: 1px solid var(--color-line); color: var(--color-ink-subtle); }
.cd.st-closed .cd-s, .cd.st-notyet .cd-s { margin-top: 10px; font-size: 11px; font-weight: var(--weight-medium); }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--color-ink-muted); }
.ck { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw.st-free { background: var(--status-free-tint); box-shadow: inset 0 -3px 0 var(--status-free); }
.sw.st-full { background: repeating-linear-gradient(135deg, var(--status-full-tint) 0 3px, var(--color-surface) 3px 5px); box-shadow: inset 0 0 0 1px var(--status-full); }
.sw.st-closed { border: 1px dashed var(--status-closed); }
.sw.st-notyet { border: 1px dotted var(--color-line-strong); }

/* forecast */
.wx-wrap { overflow-x: auto; margin: 0 -4px; }
.wx { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.wx th, .wx td { padding: 7px 4px; text-align: left; border-bottom: 1px solid var(--color-line); vertical-align: middle; }
.wx thead th { font-size: 12.5px; font-weight: var(--weight-strong); color: var(--color-ink-muted); vertical-align: bottom; }
.wx tbody th { font-weight: var(--weight-strong); white-space: nowrap; }
.wx tr:last-child > * { border-bottom: 0; }
.wx .num { text-align: right; white-space: nowrap; }
.wx small { color: var(--color-ink-muted); font-size: 12.5px; }
.wx-c { display: flex; align-items: center; gap: 6px; }
.wx-ic { width: 24px; height: 24px; flex: none; }
.wx-snow { display: block; font-size: 12.5px; color: var(--status-free-ink); }
.wx-wait { color: var(--color-ink-muted); font-size: 14px; }

/* nearby and siblings */
.nb-list, .sib-list { list-style: none; margin: 0; padding: 0; }
.nb-list li + li { border-top: 1px solid var(--color-line); }
.nb { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n av" "km av"; gap: 0 12px; align-items: center;
  min-height: 52px; padding: 8px 6px; margin: 0 -6px; border-radius: var(--radius-m); color: var(--color-ink); text-decoration: none; }
.nb:hover { background: var(--color-surface-sunken); color: var(--color-ink); }
.nb-name { grid-area: n; font-weight: var(--weight-strong); color: var(--color-brand); }
.nb-km { grid-area: km; font-size: 13.5px; color: var(--color-ink-muted); }
.nb-av { grid-area: av; font-size: 14px; font-weight: var(--weight-strong); text-align: right; }
.nb.st-free .nb-av { color: var(--status-free-ink); }
.nb.st-full .nb-av { color: var(--status-full-ink); }
.nb.st-nobook .nb-av { color: var(--status-nobook-ink); }
.nb.st-none .nb-av { color: var(--status-none-ink); font-weight: var(--weight-medium); }
.sib-list { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.sib-list a { display: inline-block; padding: 4px 0; }

/* directory */
.jump ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.jump a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--color-line-strong);
  background: var(--color-surface); color: var(--color-ink); text-decoration: none; font-size: 14px; font-weight: var(--weight-medium); }
.jump a:hover { border-color: var(--color-ink); }
.jump .n { display: none; }
.n { font-family: var(--font-numeric); font-weight: var(--weight-strong); color: var(--color-ink-muted); font-size: .8em; }
.dir-sec { scroll-margin-top: 12px; }
.dir { list-style: none; margin: 0; padding: 0; columns: 1; column-gap: 28px; }
.dir li { break-inside: avoid; padding: 5px 0; display: flex; flex-direction: column; line-height: 1.3; }
.dk { font-size: 12.5px; color: var(--color-ink-muted); }

/* footer */
.pg-foot { max-width: 860px; margin: 0 auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--color-line);
  font-size: 13px; color: var(--color-ink-muted); display: flex; flex-direction: column; gap: 8px; }

.pg-404 { padding-top: 48px; }

@media (min-width: 640px) {
  .pg { padding: 20px 24px 40px; gap: 20px; }
  h1 { font-size: 40px; }
  .sec { padding: 20px 22px; }
  .hero { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .hero-text { flex: 1; min-width: 0; padding-top: 6px; }
  .photo { flex: none; width: 300px; }
  .dir { columns: 2; }
  .pg-foot { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 559px) {
  .wx small { display: block; }
  .wx thead th, .wx .num { white-space: normal; }
  .wx .wx-mon { display: block; font-weight: var(--weight-regular); color: var(--color-ink-muted); font-size: 12.5px; }
  .wx th, .wx td { padding: 6px 3px; }
  .wx-c { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 13px; line-height: 1.2; }
}

@media (max-width: 380px) {
  .cd { height: 48px; }
  .cd-in { padding: 3px 2px; }
  .cd-n { font-size: 16px; }
  .cd-s { font-size: 9.5px; }
  .cd.st-closed .cd-s, .cd.st-notyet .cd-s { font-size: 9.5px; }
  .wx { font-size: 13.5px; }
  .wx-c { gap: 4px; }
  .wx-ic { width: 20px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .pg-head, .pg-nav, .skip, .btns, .jump, .pg-foot p:last-child { display: none !important; }
  .pg { max-width: none; padding: 0; }
  .sec { border: 1px solid #bbb; break-inside: avoid; background: #fff !important; }
  .verdict { background: #fff !important; }
  .cd { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; }
  .photo { max-width: 260px; }
  .wx-wrap { overflow: visible; }
}
