/**
 * style/base.css
 *
 * Design tokens + chrome layout (header/footer) for YardPogo v2.
 * --brand-size / --brokerage-size enforce BUILD-SPEC §3.1: the brokerage
 * name must render at least as large as the YardPogo brand mark.
 * test/chrome-check.mjs parses this file and asserts
 * --brokerage-size >= --brand-size numerically.
 */

:root {
  /* Color tokens */
  --color-bg: #ffffff;
  --color-surface: #f6f7f5;
  --color-text: #1b1f1c;
  --color-text-muted: #565f59;
  --color-border: #d9ddd7;
  --color-accent: #1f5c4c;
  --color-accent-contrast: #ffffff;
  --color-link: #1f5c4c;

  /* Neutral trend colors (BUILD-SPEC §6.4 — no buyer/seller red/green framing) */
  --color-trend-up: #3a6b8a;
  --color-trend-down: #8a6a3a;
  --color-trend-flat: #6b6f68;

  /* Type scale */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-body: 1rem;
  --font-size-small: 0.875rem;
  --font-size-h1: 2rem;
  --font-size-h2: 1.5rem;
  --font-size-h3: 1.125rem;

  /* Chrome sizing — brokerage must be >= brand (BUILD-SPEC §3.1) */
  --brand-size: 1.25rem;
  --brokerage-size: 1.25rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;

  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #14161a;
    --color-surface: #1c1f24;
    --color-text: #eceeec;
    --color-text-muted: #a7ada6;
    --color-border: #33383e;
    --color-accent: #6bbfa1;
    --color-accent-contrast: #0e120f;
    --color-link: #6bbfa1;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

a {
  color: var(--color-link);
}

h1 {
  font-size: var(--font-size-h1);
}
h2 {
  font-size: var(--font-size-h2);
}
h3 {
  font-size: var(--font-size-h3);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------- */
/* Header / brand + brokerage                                             */
/* ---------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-header__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.brand-mark {
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--brand-size);
}

.brokerage-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--brokerage-size);
}

/* ---------------------------------------------------------------------- */
/* Footer / compliance lines                                              */
/* ---------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  margin-top: var(--space-5);
}

.site-footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.footer-brokerage {
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--font-size-body);
  margin: 0;
}

.footer-territory,
.footer-anti-solicitation,
.footer-data-sources {
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Data currency / attribution / disclaimer                               */
/* ---------------------------------------------------------------------- */

.data-currency {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.listing-attribution {
  font-size: var(--font-size-body);
  color: var(--color-text);
}

.mls-number {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.consumer-service-disclaimer {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

/* ---------------------------------------------------------------------- */
/* Layout shell used by static pages                                      */
/* ---------------------------------------------------------------------- */

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--space-4);
}

.lede {
  font-size: var(--font-size-h3);
  color: var(--color-text-muted);
  max-width: 42rem;
}

.badge {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  border-radius: var(--radius);
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-small);
  font-weight: 600;
}

.link-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.link-list li {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  text-align: left;
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

/* ---------------------------------------------------------------------- */
/* Map app shell (Milestone 4 fills the mount points)                     */
/* ---------------------------------------------------------------------- */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-shell main#main-content {
  flex: 1;
  max-width: none;
  padding: 0;
  position: relative;
}

#map-mount {
  position: absolute;
  inset: 0;
}

#sidebar-mount {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  overflow: hidden;
}

#filters-mount,
#search-mount {
  position: absolute;
  z-index: 2;
}

#search-mount {
  top: var(--space-3);
  left: var(--space-3);
}

#filters-mount {
  top: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
}
