/* The free search pages: food areas (/area/...), the list of them (/areas) and the guides. On top
   of styles.css (tokens, header, footer, buttons, chips) and report.css (the report's parts,
   figures and charts), so an area page reads like a short report on that street.
   Spacing steps: 4, 8, 12, 16, 24, 32, 48, 64. */

.pages .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.pg { padding-top: 16px; }
.pg .small { font-size: var(--t-small); }

/* Breadcrumb */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 0; padding: 0; list-style: none; font-size: var(--t-small); color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; min-height: 44px; }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.crumbs a { color: var(--ink-2); }

/* Page head: kicker, title, what stands out, the four figures */
.pg-head { padding-top: 8px; }
.pg-head h1 { margin-top: 12px; max-width: 22em; font: 750 var(--t-title)/1.06 var(--f-display); letter-spacing: -0.02em; font-variation-settings: "opsz" 60; }
.hub .pg-head h1, .guide .pg-head h1 { max-width: 18em; }
.pg-head > .lede { max-width: 38em; margin-top: 16px; color: var(--ink-2); font-size: var(--t-lead); line-height: 1.55; }
.stands-out { margin-top: 24px; padding: clamp(20px, 4vw, 32px); border-radius: var(--r-tray); background: var(--tint-sky); }
.stands-out .figures { margin: 24px 0 4px; }
.stands-out h2 { color: var(--primary); font-size: var(--t-kicker); font-weight: 600; line-height: 1.4; letter-spacing: 0.16em; text-transform: uppercase; }
.stands-out p { max-width: 40em; margin-top: 12px; color: var(--ink); font-size: var(--t-lead); line-height: 1.5; }
.stands-out p + p { margin-top: 8px; }
.stands-out .measured { margin-top: 16px; color: var(--muted); font-size: var(--t-caption); line-height: 1.5; }

/* Which kinds of place fit: one row per kind */
.scroll { position: relative; max-width: 100%; margin-top: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kinds-fit, .areas-table { min-width: 34rem; font-size: var(--t-small); }
.kinds-fit th, .kinds-fit td, .areas-table th, .areas-table td { padding: 12px 12px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.kinds-fit thead th, .areas-table thead th { color: var(--muted); font-size: var(--t-caption); font-weight: 600; border-bottom-color: var(--line-strong); }
.kinds-fit tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.kinds-fit td:last-child { white-space: nowrap; }
.kinds-fit b, .areas-table b { font-variant-numeric: tabular-nums; }
.per { display: block; color: var(--muted); font-size: var(--t-caption); line-height: 1.45; }
.part .scroll + .pnote { margin-top: 16px; }
/* On a phone (or with big text) each kind becomes a short block: name and match, then what's
   already there, then the link, so nothing hides off the side. */
@container section (max-width: 36em) {
  .kinds-fit { min-width: 0; }
  .kinds-fit thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .kinds-fit tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .kinds-fit tbody th, .kinds-fit td { display: block; padding: 0; border: 0; }
  .kinds-fit td:nth-child(3), .kinds-fit td:last-child { grid-column: 1 / -1; }
  .kinds-fit td:last-child a { display: inline-flex; align-items: center; min-height: 32px; }
}

/* What's already here: places by kind as short bars */
.kind-bars { display: grid; gap: 6px; max-width: 34rem; margin: 24px 0 0; padding: 0; list-style: none; }
.kind-bars li { display: grid; grid-template-columns: minmax(7.5em, 34%) minmax(0, 1fr) 3.2em; gap: 12px; align-items: center; min-height: 32px; font-size: var(--t-small); }
.kind-bars i { display: block; height: 12px; min-width: 3px; border-radius: var(--r-bar); background: var(--primary); }
.kind-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.part .body > h3 { margin-top: 32px; font-size: var(--t-body); font-weight: 650; }
.part .body > h3 + .nearest { margin-top: 8px; }
.part .body > .kind-bars + p, .part .body > .nearest + .pnote, .part .body > .kind-bars + .pnote { margin-top: 16px; }
.part .body > p:not([class]) { margin-top: 16px; color: var(--ink-2); }

/* Limits */
.limits { display: grid; gap: 10px; max-width: 40em; margin: 16px 0 0; padding: 0; list-style: none; }
.limits li { position: relative; padding-left: 22px; color: var(--ink-2); }
.limits li::before { content: ""; position: absolute; left: 2px; top: 0.75em; width: 10px; height: 2px; background: var(--muted); }
.limits b { color: var(--ink); }
.limits + p, .limits + p + p { max-width: 40em; margin-top: 16px; color: var(--ink-2); }

/* The way on to the free check */
.go-box { margin-top: 48px; padding: clamp(20px, 4.5vw, 40px); border-radius: var(--r-tray); background: var(--cover); color: var(--on-cover); }
.go-box h2 { color: #fff; font: 750 var(--t-h2-report)/1.15 var(--f-display); letter-spacing: -0.018em; }
.go-box p { max-width: 36em; margin-top: 12px; line-height: 1.55; }
.go-box .ctas { margin-top: 24px; }
.go-box .btn:not(.btn-primary) { border-color: rgb(230 238 242 / 0.4); background: transparent; color: #fff; }
.go-box .btn:not(.btn-primary):hover { border-color: #fff; }
.go-box .btn-primary { border-color: var(--on-cover-accent, #62bfd5); background: var(--on-cover-accent, #62bfd5); color: #04212a; }

/* Nearby areas, more links, how the page was made */
.near { margin-top: 48px; }
.near h2, .made h2 { font-size: var(--t-h3); font-weight: 700; line-height: 1.3; }
.near-list { display: grid; max-width: 34rem; margin: 12px 0 0; padding: 0; list-style: none; }
.near-list li { display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); }
.near-list span { color: var(--muted); font-size: var(--t-small); font-variant-numeric: tabular-nums; }
.near .small { margin-top: 8px; }
.more { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 32px; font-size: var(--t-small); }
.more a { display: inline-flex; align-items: center; min-height: 44px; }
.made { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--t-small); }
.made p { max-width: 46em; margin-top: 8px; line-height: 1.55; }

/* A city's areas side by side */
.areas-table { min-width: 36rem; }
.areas-table thead th { font-size: var(--t-small); color: var(--ink); }
.areas-table thead th a { font-weight: 700; }
.areas-table tbody th { width: 28%; color: var(--ink-2); font-weight: 500; }
.areas-table td { color: var(--ink); font-weight: 600; }
.areas-table td .per { font-weight: 400; }
/* On a phone each measure's name sits above the areas' values, so all three show at once. */
.cmp { container: cmp / inline-size; }
@container cmp (max-width: 40em) {
  .areas-table, .areas-table thead, .areas-table tbody { display: block; min-width: 0; }
  .areas-table tr { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); column-gap: 12px; border-bottom: 1px solid var(--line); }
  .areas-table thead tr { border-bottom-color: var(--line-strong); }
  .areas-table thead th:first-child { display: none; }
  .areas-table th, .areas-table td { border: 0; }
  .areas-table tbody th { grid-column: 1 / -1; width: auto; padding: 12px 0 4px; color: var(--muted); font-size: var(--t-caption); font-weight: 600; }
  .areas-table td { padding: 0 0 12px; overflow-wrap: anywhere; }
}
.area-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: 16px; margin: 32px 0 0; padding: 0; list-style: none; }
.area-cards li { padding: 24px; border-radius: var(--r-screen); background: var(--surface); box-shadow: var(--hair), var(--sh-1); }
.area-cards h2 { font: 750 var(--t-h3)/1.2 var(--f-display); }
.area-cards p { margin-top: 8px; }
.area-cards .small { margin-top: 4px; }
.area-cards .card-go { display: inline-flex; min-height: 44px; align-items: center; font-weight: 600; }

/* The list of areas, and of guides */
.hub-country { margin-top: 48px; }
.hub-country > h2 { font: 750 var(--t-h2-report)/1.15 var(--f-display); letter-spacing: -0.018em; }
.hub-city { margin-top: 24px; }
.hub-city h3 { font-size: var(--t-h3); font-weight: 700; line-height: 1.3; }
.hub-city ul, .guide-cards { display: grid; margin: 8px 0 0; padding: 0; list-style: none; }
.hub-city li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hub-city li a { font-weight: 600; }
.hub-city li span { color: var(--muted); font-size: var(--t-small); }
.guide-cards { gap: 16px; margin-top: 32px; }
.guide-cards li { padding: 24px; border-radius: var(--r-screen); background: var(--surface); box-shadow: var(--hair), var(--sh-1); }
.guide-cards h2 { font: 750 var(--t-h3)/1.25 var(--f-display); }
.guide-cards p { max-width: 40em; margin-top: 8px; color: var(--ink-2); }

/* A guide: the method page's reading width, plus tables, worked examples and the calculator */
.guide.doc { padding-top: 0; }
.guide .byline { margin-top: 12px; color: var(--muted); font-size: var(--t-small); }
.guide .answer { margin-top: 24px; padding: 20px 24px; border-radius: var(--r-screen); background: var(--tint-sky); color: var(--ink); font-size: var(--t-lead); line-height: 1.5; }
.guide table.money { font-size: var(--t-small); }
.guide table.money th { width: auto; }
.guide table.money thead th { color: var(--muted); font-size: var(--t-caption); font-weight: 600; }
.guide .worked { margin-top: 16px; padding: 16px 20px; border-radius: var(--r-row); background: var(--sunk); color: var(--ink-2); font-size: var(--t-small); }
.guide .worked p { margin-top: 6px; }
.guide .worked p:first-child { margin-top: 0; }
.guide .source { color: var(--muted); font-size: var(--t-caption); }
.guide .go-box, .guide .more { max-width: none; }

/* The rent calculator (public/rent.js fills in the answers; the worked table works without it) */
.calc { display: grid; gap: 16px; margin-top: 24px; padding: clamp(20px, 4vw, 28px); border-radius: var(--r-screen); background: var(--surface); box-shadow: var(--hair), var(--sh-2); }
.calc[hidden] { display: none; }
.calc .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); gap: 16px; }
.calc h2 { margin: 0; }
.calc label { display: grid; gap: 6px; color: var(--ink); font-size: var(--t-small); font-weight: 600; }
.calc label span { color: var(--muted); font-size: var(--t-caption); font-weight: 400; }
.calc input, .calc select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-small); background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem; }
.calc output { display: block; }
.calc .result { padding: 16px 20px; border-radius: var(--r-row); background: var(--sunk); color: var(--ink); line-height: 1.55; }
.calc .result b { font-variant-numeric: tabular-nums; }
.calc .result .chip { margin-right: 6px; }
.calc .result p + p { margin-top: 8px; }
.calc .note { color: var(--muted); font-size: var(--t-caption); }

@media (max-width: 479px) {
  .kind-bars li { grid-template-columns: minmax(6.5em, 38%) minmax(0, 1fr) 2.8em; gap: 8px; }
}

/* The count sheet prints one per page, with room to write */
.count-sheet td { height: 44px; }
.count-sheet th, .count-sheet td { border-right: 1px solid var(--line); padding-left: 6px; }
.count-sheet td:first-child { white-space: nowrap; }
@media print {
  .top, .foot, .crumbs, .go-box, .more, .calc { display: none !important; }
  .count-sheet { break-before: page; }
  body { background: #fff; }
}
