/* HomeScope.ie — every sale since 2010: the price trend and the sales list (public/js/sales.js).
   Used on the home page map and the county and town pages; tokens come from app.css / site.css. */

/* ---- trend: one column per year */
.sales-trend { margin: 12px 0 4px; }
.st-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; align-items: baseline; margin-bottom: 6px; }
.st-title { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.st-sum { font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.st-sum b { color: var(--ink); }
.st-chart { position: relative; height: 112px; margin: 12px 0 0 46px; }
.st-grid { position: absolute; inset: 0 0 18px 0; pointer-events: none; }
.st-grid span { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.st-grid i { position: absolute; right: calc(100% + 6px); top: -7px; font-style: normal; font-size: 11px; line-height: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-bars { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.st-bar { position: relative; display: block; height: 100%; padding: 0 0 18px; margin: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink-3); border-radius: 4px; }
.st-bar i { position: absolute; left: 1px; right: 1px; bottom: 18px; background: var(--p2); border-radius: 4px 4px 0 0; transition: background var(--dur, .15s); }
.st-bar.is-part i { background: repeating-linear-gradient(135deg, var(--p2) 0 3px, color-mix(in srgb, var(--p2) 45%, transparent) 3px 6px); }
.st-bar.is-none::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: 20px; border-top: 2px solid var(--line-strong); }
.st-bar:hover i, .st-bar:focus-visible i { background: var(--p4); }
.st-bar.is-picked i { background: var(--primary); }
.st-bar span { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-bar.is-picked span { color: var(--ink); font-weight: 700; }
.st-bar .st-yhide { visibility: hidden; }
.st-bar.is-picked .st-yhide { visibility: visible; }
.st-bar:focus-visible { outline: 2px solid var(--focus, var(--primary)); outline-offset: 1px; }
.st-tip { position: absolute; right: 0; top: -4px; padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; pointer-events: none; opacity: 0; transition: opacity .1s; }
.st-tip.is-on { opacity: 1; }
.st-note, .st-none { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--ink-3); }

/* ---- list */
.sales-list { margin-top: 14px; }
.sl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 6px; }
.sl-title { margin: 0; font-family: var(--font); font-size: var(--fs-md); font-weight: 700; color: var(--ink); letter-spacing: 0; }
.sl-tools { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 260px; justify-content: flex-end; }
.sl-find { flex: 1 1 170px; max-width: 240px; }
@media (max-width: 520px) { .sl-find { order: 3; max-width: none; flex-basis: 100%; } }
.sl-find input, .sl-sort select, .sl-period select { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); }
.sl-sort select, .sl-period select { width: auto; padding-right: 6px; }
.sl-period select { font-weight: 600; }
.sl-count, .sl-status { margin: 4px 0 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.sl-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sl-list li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "addr price" "meta price"; gap: 1px 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.sl-list li:focus { outline: 2px solid var(--focus, var(--primary)); outline-offset: -2px; }
.sl-addr { grid-area: addr; font-size: var(--fs-sm); color: var(--ink); overflow-wrap: anywhere; }
.sl-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs-xs); color: var(--ink-3); }
.sl-price { grid-area: price; align-self: center; font-weight: 700; font-size: var(--fs-sm); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sl-tag { display: inline-block; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 11px; line-height: 17px; color: var(--ink-2); }
.sl-tag.is-warn { border-color: var(--warning); }
.sl-more { margin: 10px 0 0; }
.sl-note { margin: 10px 0 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--ink-3); }
.sl-note a { color: inherit; }
.sl-retry { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; }

/* the home page's card: 3 sales, then "Show more sales" */
.sl-expand { margin: 10px 0 0; }
.sl-collapse { display: block; margin: 8px 0 0; padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-size: var(--fs-sm); font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---- trend: the median above each bar, the change on the year before under each year,
   and a few plain facts above the chart. Labels are ink, not bar colour. */
.st-facts { list-style: none; margin: 2px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.st-facts b { color: var(--ink); }
.st-chart { --st-base: 34px; --st-head: 18px; height: 168px; margin-top: 10px; }
.st-grid { bottom: var(--st-base); top: var(--st-head); }
.st-bar { padding-bottom: var(--st-base); }
.st-bar i { bottom: var(--st-base); }
.st-bar.is-none::after { bottom: calc(var(--st-base) + 2px); }
.st-bar span.st-year { bottom: 16px; }
.st-val { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.st-chg { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font-size: 11px; line-height: 16px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-bar.is-picked .st-chg { color: var(--ink); font-weight: 700; }
.is-tight .st-val, .is-tight .st-chg { font-size: 10px; letter-spacing: -0.02em; }
.is-bare .st-val, .is-bare .st-chg { display: none; }
.is-bare .st-bar.is-picked .st-val, .is-bare .st-bar.is-picked .st-chg, .is-bare .st-bar:hover .st-val, .is-bare .st-bar:hover .st-chg { display: block; }
.st-chart .st-tip { left: 0; right: auto; top: auto; z-index: 2; width: max-content; max-width: 100%; }
.st-chart.is-bare { --st-base: 18px; --st-head: 4px; height: 130px; }
.is-bare .st-bar span.st-year { bottom: 0; }
