/* Prerendered list pages, landing pages and /fasebi (lane E). Uses the tokens and components of style.css; never edits it. */

/* Home, district and landing pages: build.js prerenders the first cards in a fixed order for crawlers. With JS on, the list
   stays invisible (its space kept, so nothing moves) until home.js has drawn this visit's own order, then build.js's inline
   line after home.js removes data-pre. With JS off, or if home.js fails, the prerendered cards simply stay visible. */
.pre-h #list[data-pre], .pre-h #moreRow[data-pre] { visibility: hidden; }

/* ---------- A–Z link list at the bottom of list pages ---------- */
.az { padding-top: 0; }
.az-h { font-size: 20px; margin-bottom: 14px; }
.az-list { list-style: none; margin: 0; padding: 0; columns: 4 220px; column-gap: 28px; font-size: 14px; }
.az-list li { break-inside: avoid; padding-block: 4px; display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.az-list a { color: var(--ink-2); text-decoration: none; }
.az-list a:hover { color: var(--accent-text); text-decoration: underline; }
.az-list span { color: var(--muted); font-size: 12.5px; }

/* ---------- related list pages after the list (build.js relatedHtml): "ასევე ვაკეში", "იოგა რაიონების მიხედვით" ---------- */
.l-rel-sec { padding-block: 40px 0; }
/* Landing pages hide the city-wide price block; #districts has an inline padding-top:0 meant for that block above it */
#prices[hidden] + #districts { padding-top: 32px !important; }
.l-rel-h { font-size: 20px; margin-bottom: 14px; }
.l-rel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.l-rel a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: border-color .15s;
}
.l-rel a:hover { border-color: var(--ink); }
.l-rel a span { color: var(--muted); font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- landing pages: own hero copy, no plates, no category chips, search lives in the toolbar ---------- */
body[data-landing] .hero-inner { grid-template-columns: minmax(0, 1fr); padding-block: 36px 34px; }
body[data-landing] .hero-copy { gap: 14px; max-width: 980px; }
body[data-landing] .hero .search, body[data-landing] #quick, body[data-landing] .hero-plates { display: none; }
.hero .crumbs { padding: 0; color: var(--hero-muted); font-size: 13px; }
.hero .crumbs a { color: var(--hero-fg); text-decoration: none; }
.hero .crumbs a:hover { text-decoration: underline; color: var(--hero-fg); }
.hero h1.l-h1 { font-size: clamp(30px, 3.9vw, 54px); line-height: 1.02; }
.hero .lead.l-facts { font-family: var(--f-display); font-stretch: 87.5%; font-weight: 700; color: var(--hero-fg); font-size: clamp(17px, 1.7vw, 21px); max-width: 760px; }
.l-note { color: var(--hero-muted); font-size: 13.5px; max-width: 720px; }
.l-note b { color: var(--hero-fg); font-weight: 700; }
.l-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.l-actions .btn { text-decoration: none; }

/* ---------- /fasebi ---------- */
.l-hero-inner { display: flex; flex-direction: column; gap: 14px; padding-block: 36px 34px; max-width: 1320px; }
.f-bands-sec { padding-bottom: 24px; }
.f-table-sec { padding-top: 24px; }
.f-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.f-search { display: flex; align-items: center; gap: 8px; flex: 0 1 360px; min-width: 0; position: relative; }
.f-search .ico { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.f-search .input { width: 100%; padding-left: 38px; }
.f-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); -webkit-overflow-scrolling: touch; }
.f-wrap:focus-visible { outline-offset: 0; }
.f-table { width: 100%; min-width: 700px; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.f-table th, .f-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.f-table tbody tr:last-child td { border-bottom: 0; }
.f-table th { position: sticky; top: 0; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.f-table th button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.f-table th button::after { content: "↕"; color: var(--muted); font-weight: 400; }
.f-table th[aria-sort="ascending"] button::after { content: "↑"; color: var(--ink); }
.f-table th[aria-sort="descending"] button::after { content: "↓"; color: var(--ink); }
.f-table th.num, .f-table td.num { text-align: right; }
.f-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.f-table td.num.none, .f-table td.none { color: var(--muted); font-weight: 400; }
.f-table th:first-child, .f-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; max-width: 260px; }
.f-table th:first-child { background: var(--surface-2); z-index: 2; }
.f-table td:first-child a { color: var(--ink); font-weight: 700; text-decoration: none; }
.f-table td:first-child a:hover { color: var(--accent-text); text-decoration: underline; }
.f-table .f-place { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.f-table .mk { font-weight: 400; color: var(--muted); margin-left: 3px; }
.f-table .mk.ok { color: var(--ok); }
.f-table .f-other { font-variant-numeric: tabular-nums; }
.f-table .f-src { color: var(--ink-2); font-size: 13px; }
.f-table .f-src small { display: block; color: var(--muted); font-size: 12px; }
.f-unknown { margin-top: 12px; font-size: 14px; }
/* the compare pill ("+ შედარება", saved.js heartHtml) in the last column */
.f-table th.f-act, .f-table td.f-act { width: 1%; padding-left: 4px; text-align: right; vertical-align: middle; }
.f-table .f-save { min-width: 0; width: auto; height: 32px; padding: 0 12px; font-size: 12.5px; white-space: nowrap; }
/* /fasebi#<gym id> (the gym page's "see this price with the others"): the row is marked, every cell (the sticky name cell too) */
.f-table tbody tr:target td { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.f-table tbody tr:target td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.f-table tbody tr:target td:first-child a { color: var(--accent-text); }
@media (prefers-reduced-motion: no-preference) {
  .f-table tbody tr:target td { animation: f-target 1.6s ease-out .2s 2 alternate; }
  @keyframes f-target { to { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); } }
}

/* ---------- price bands as links (/fasebi; the home page's #prices uses the same markup): each row opens the list ---------- */
.pb-bands .pb-row {
  grid-column: 1 / -1; display: grid; grid-template-columns: inherit; gap: inherit; align-items: center;
  color: inherit; text-decoration: none; border-radius: 8px; margin: -3px -6px; padding: 3px 6px; transition: background-color .15s;
}
.pb-bands .pb-bar i { background: var(--accent); }
.pb-bands .pb-row:hover { background: var(--surface-2); }
.pb-bands .pb-row:hover .pb-range { text-decoration: underline; text-underline-offset: 3px; }
.pb-bands .pb-row:hover .pb-bar i { background: var(--accent-hover); }
.pb-bands .pb-row:hover .pb-bar { background: var(--surface-3); }
.pb-bands .pb-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pb-bands .pb-row .pb-n::after { content: " ›"; color: var(--muted); }
.f-how-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; max-width: 820px; color: var(--ink-2); }
.f-how-list a { color: var(--accent-text); }

@media (max-width: 900px) {
  body[data-landing] .hero-inner { padding-block: 22px 20px; }
  body[data-landing] .hero-copy { gap: 10px; }
  .hero h1.l-h1 { font-size: clamp(26px, 7vw, 40px); }
  .hero .lead.l-facts { font-size: 16px; }
  .l-note { font-size: 13px; }
  .hero .crumbs { font-size: 12.5px; }
  .l-hero-inner { padding-block: 22px 22px; gap: 10px; }
  .az-list { columns: 2 150px; column-gap: 16px; }
  .f-table { font-size: 13.5px; min-width: 620px; }
  .f-table th, .f-table td { padding: 9px 10px; }
  .f-table th:first-child, .f-table td:first-child { min-width: 140px; max-width: 170px; }
}
/* Phones: each row becomes a compact card (name and area, then the known prices on one line with their column names
   from data-l, then the source and date); the column titles become a row of sort buttons. Unknown prices are left out. */
@media (max-width: 600px) {
  .f-wrap { overflow: visible; border: 0; border-radius: 0; background: none; }
  .f-table, .f-table thead, .f-table tbody { display: block; min-width: 0; font-size: 14px; }
  .f-table thead tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
  .f-table thead tr::before { content: "დალაგება:"; font-size: 12.5px; color: var(--muted); margin-right: 2px; }
  .f-table th, .f-table th:first-child { position: static; padding: 0; border: 0; background: none; min-width: 0; max-width: none; }
  .f-table th button { padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
  .f-table th[aria-sort] button { border-color: var(--ink); }
  .f-table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px; padding: 11px 14px; border: 1px solid var(--line); border-top-width: 0; background: var(--surface); position: relative; }
  .f-table th.f-act { display: none; }
  .f-table td.f-act { position: absolute; top: 6px; right: 8px; width: auto; padding: 0; }
  .f-table tbody tr:target { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); }
  .f-table tbody tr:target td, .f-table tbody tr:target td:first-child { background: none; box-shadow: none; animation: none; }
  .f-table tbody tr:first-child { border-top-width: 1px; border-radius: var(--r-md) var(--r-md) 0 0; }
  .f-table tbody tr:last-child { border-radius: 0 0 var(--r-md) var(--r-md); }
  .f-table tbody tr:only-child { border-radius: var(--r-md); }
  .f-table tbody tr[hidden] { display: none; }
  .f-table td, .f-table td:first-child { position: static; padding: 0; border: 0; min-width: 0; max-width: none; background: none; }
  .f-table td:first-child { flex: 1 0 100%; display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; padding-right: 120px; }
  .f-table td:first-child a { flex: none; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .f-table .f-place { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .f-table td.none { display: none; }
  .f-table td.num { text-align: left; }
  .f-table td[data-l]::before { content: attr(data-l) " "; color: var(--muted); font-weight: 400; }
  .f-table .f-src { flex: 1 0 100%; font-size: 12px; color: var(--muted); }
  .f-table .f-src small { display: inline; font-size: inherit; }
  .f-table .f-src small::before { content: " · "; }
}
/* the eyebrow is hidden on phones by style.css (.hero .eyebrow); landing pages keep their crumbs instead */

/* ---------- 404 (build.js): "4 ? 4" with the dashed no-price plate, search, tools, category chips ---------- */
body[data-page="404"] { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body[data-page="404"] main { flex: 1; }
.e404 { display: flex; align-items: center; justify-content: center; padding-block: clamp(36px, 7vw, 88px); }
.e404-box { width: 100%; max-width: 640px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.e404-num { display: flex; align-items: center; gap: clamp(10px, 2.4vw, 20px); margin: 0 0 6px; font-family: var(--f-display); font-stretch: 75%; font-weight: 900;
  font-size: clamp(96px, 22vw, 168px); line-height: .9; color: var(--ink); font-variant-numeric: tabular-nums; }
.e404-plate { display: inline-grid; place-items: center; width: .92em; height: .92em; border-radius: 50%; border: max(4px, .045em) dashed var(--accent);
  color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.e404-plate b { font-size: .58em; font-weight: 900; line-height: 1; }
@media (prefers-reduced-motion: no-preference) { .e404-plate { animation: e404-spin 14s linear infinite; } .e404-plate b { animation: e404-spin 14s linear infinite reverse; } }
@keyframes e404-spin { to { transform: rotate(360deg); } }
.e404-h { font-size: clamp(26px, 4.4vw, 38px); line-height: 1.1; margin: 0; }
.e404-sub { color: var(--muted); margin: 0; max-width: 34em; text-wrap: balance; }
.e404-guess { margin: 2px 0 0; padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.e404-guess a { color: var(--accent-text); font-weight: 700; }
.e404-search { display: flex; gap: 8px; width: 100%; max-width: 520px; margin-top: 10px; }
.e404-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.e404-field .ico { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.e404-field .input { width: 100%; height: 46px; padding-left: 42px; }
.e404-search .btn { height: 46px; }
.e404-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 4px; font-size: 14.5px; }
.e404-tools a { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; color: var(--ink); font-weight: 600; text-decoration: none; }
.e404-tools a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.e404-tools .ico { width: 17px; height: 17px; color: var(--accent); }
.e404-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); width: 100%; }
.e404-cats .chip { text-decoration: none; }
@media (max-width: 480px) {
  .e404-search .btn { padding: 0 14px; }
  .e404-tools { gap: 0 14px; }
}
