/* thetonnageclub.com: market map, market pages, membership page.
   Loads after site.css (fonts, tokens, header, footer, .btn, .container). */

.container.wide { max-width: 1280px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- page head ---------- */

.pagehead { padding: 18px 0 12px; border-bottom: 1px solid var(--ink); display: flex; gap: 20px; align-items: baseline; flex-wrap: wrap; }
.pagehead h1 { font-size: 22px; margin: 0; }
.pagehead .sub { color: var(--slate); font-size: 14px; }

/* ---------- controls ---------- */

.controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--rule); }
#q { font: 400 15px/1.3 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; padding: 7px 10px; min-width: 300px; }
.legend { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--slate); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--rule); }
.sw.avail { background: #4b596e; border-color: #4b596e; }
.sw.unavail { background: #e4e7eb; }
.legend .num { color: var(--ink); }
.zoomctl { display: flex; gap: 4px; margin-left: auto; }
.zoomctl button { font: 400 14px/1 var(--mono); background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; padding: 7px 11px; cursor: pointer; color: var(--ink); }
.zoomctl button:hover { border-color: var(--ink); }

/* ---------- map + sheet ---------- */

.stage { display: grid; grid-template-columns: 1fr; border-bottom: 1px solid var(--rule); }
.mapbox { position: relative; padding: 10px 0 6px; }
.mapbox svg { width: 100%; height: auto; display: block; cursor: grab; touch-action: none; }
.mapbox svg.grabbing { cursor: grabbing; }
.state { fill: none; stroke: var(--rule); stroke-width: 0.7; pointer-events: none; vector-effect: non-scaling-stroke; }
.mkt { fill: #4b596e; stroke: #fff; stroke-width: 0.6; cursor: pointer; vector-effect: non-scaling-stroke; transition: opacity 140ms ease; }
.mkt.unavail { fill: #e4e7eb; stroke: var(--rule); }
.mkt.dim { opacity: 0.15; }
.mkt.hover { stroke: var(--accent); stroke-width: 1.6; }
.mkt.sel { stroke: var(--accent); stroke-width: 2.2; }
.lbl-g text { font-family: var(--sans); font-size: 11px; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 2px; font-size: 13px; line-height: 1.35; max-width: 280px; display: none; z-index: 5; }
.tip b { font-weight: 600; display: block; margin-bottom: 3px; }
.tip .num { color: #d9dde3; }
.tip .st { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.tip .more { color: #aab3c0; }
.mapnote { font-size: 12px; color: var(--slate); padding: 0 0 8px; }

.sheet { padding: 14px 0; border-top: 1px solid var(--rule); }
.sheet .eyebrow { margin-bottom: 4px; }
.sheet h2 { font-size: 20px; margin: 0 0 10px; text-wrap: balance; }
.sheet .empty { color: var(--slate); font-size: 14px; }
.sheet .empty p { margin: 0 0 8px; }
.sheet-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.sheet-cta .hint { font-size: 13px; color: var(--slate); }
.hero3 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.hero3 > div { padding: 10px 10px 10px 0; border-right: 1px solid var(--rule); margin-right: 10px; }
.hero3 > div:last-child { border-right: 0; margin-right: 0; }
.hero3 .v { font-family: var(--mono); font-size: 21px; font-weight: 500; line-height: 1.2; }
.hero3 .l { font-size: 12px; color: var(--slate); line-height: 1.3; margin-top: 2px; }
.sec { margin-top: 14px; }
.sec h3, .sec .h3 { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate); font-weight: 600; margin: 0 0 2px; padding-bottom: 4px; border-bottom: 1px solid var(--ink); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.row.sub { padding: 3px 0 3px 14px; border-bottom: 0; }
.row.sub .k, .row.sub .v { font-size: 13px; color: var(--slate); }
.row.sub + .row:not(.sub) { border-top: 1px solid var(--rule); }
.row .k { font-size: 14px; }
.row .v { font-family: var(--mono); font-size: 14px; text-align: right; white-space: nowrap; }
.row .src { grid-column: 1 / -1; font-size: 12px; color: var(--slate); line-height: 1.35; }
.row.last { border-bottom: 0; }
.counties { font-size: 13px; color: var(--slate); line-height: 1.5; padding: 6px 0; }
.status { display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 2px; border: 1px solid var(--ink); }
.wait { padding: 12px; border: 1px solid var(--rule); border-radius: 2px; font-size: 14px; color: var(--slate); margin: 0 0 12px; }
.wait b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.wform { display: grid; gap: 8px; margin-top: 10px; max-width: 420px; }
.wform input { font: 400 14px/1.3 var(--sans); padding: 7px 9px; border: 1px solid var(--rule); border-radius: 2px; background: var(--paper); color: var(--ink); }
.wform .btn { justify-self: start; }
.wform .done { font-size: 14px; color: var(--ink); }
.permalink { font-size: 13px; }

/* ---------- table ---------- */

.tablehead { display: flex; align-items: baseline; gap: 12px; padding: 16px 0 6px; }
.tablehead h2 { font-size: 15px; margin: 0; }
.tablehead .count { font-size: 13px; color: var(--slate); }
.tablehead .toggle { margin-left: auto; font-size: 13px; color: var(--slate); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.tablewrap { overflow-x: auto; }
table.mk { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 14px; }
table.mk thead th { text-align: left; font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate); padding: 8px 18px 8px 0; border-bottom: 1px solid var(--ink); cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--paper); vertical-align: bottom; line-height: 1.25; }
table.mk th.n, table.mk td.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.mk thead th.sorted { color: var(--ink); }
table.mk thead th.sorted::after { content: " \2193"; color: var(--accent); }
table.mk thead th.sorted.asc::after { content: " \2191"; }
table.mk tbody td { padding: 7px 18px 7px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.mk tbody tr { cursor: pointer; }
table.mk tbody tr:hover { background: var(--fog); }
table.mk tbody tr.sel { background: var(--fog); box-shadow: inset 3px 0 0 var(--accent); }
table.mk tbody tr.unavailable td { color: var(--slate); }
table.mk td.name { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
table.mk td.name .subm { display: block; font-size: 12px; color: var(--slate); }
.pill { font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; border: 1px solid var(--ink); padding: 1px 5px; border-radius: 2px; color: var(--ink); white-space: nowrap; }
.pill.unavailable { color: var(--slate); border-color: var(--rule); background: var(--fog); }
.tfoot { font-size: 13px; color: var(--slate); padding: 12px 0 8px; max-width: 72ch; }

/* ---------- CTA band ---------- */

.band { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: center; border-top: 1px solid var(--ink); padding: 22px 0 28px; }
.band h2 { font-size: 20px; margin: 0 0 6px; }
.band p { margin: 0; color: var(--slate); font-size: 14px; max-width: 60ch; }
.band .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn.ghost:hover { background: var(--fog); opacity: 1; }

/* ---------- booking modal ---------- */

.modal { position: fixed; inset: 0; background: rgba(22, 24, 28, 0.55); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal.open { display: flex; }
.modal .box { background: var(--paper); width: min(920px, 100%); height: min(720px, 92vh); border-radius: 2px; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.modal .bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.modal .bar b { font-weight: 600; }
.modal .bar .hint { color: var(--slate); font-size: 13px; }
.modal .bar button { margin-left: auto; font: 400 14px/1 var(--mono); background: none; border: 1px solid var(--rule); border-radius: 2px; padding: 6px 10px; cursor: pointer; color: var(--ink); }
.modal iframe { flex: 1; border: 0; width: 100%; }
.modal .fallback { padding: 8px 14px; font-size: 13px; color: var(--slate); border-top: 1px solid var(--rule); }

/* ---------- market page (static) ---------- */

.mpage { padding: 20px 0 8px; }
.mpage .crumbs { font-size: 13px; color: var(--slate); margin-bottom: 10px; }
.mpage .crumbs a { color: var(--slate); }
.mpage h1 { font-size: 26px; margin: 0 0 12px; text-wrap: balance; }
.mpage .sheet { border-top: 0; padding-top: 0; max-width: 720px; }

/* ---------- layout at width ---------- */

@media (min-width: 880px) {
  .stage { grid-template-columns: minmax(0, 7fr) minmax(340px, 5fr); }
  .mapbox { padding-right: 18px; border-right: 1px solid var(--rule); }
  .sheet { padding: 14px 0 14px 20px; border-top: 0; max-height: 700px; overflow-y: auto; }
  .band { grid-template-columns: minmax(0, 7fr) minmax(300px, 5fr); }
  .band .btns { justify-self: end; }
}

@media (prefers-reduced-motion: reduce) { .mkt { transition: none; } }
