/* Components shared across pages: buttons, chips, tags, pills, header, footer, cards, notices.
   Class names from the v0.2 draft are kept so every page picks up the new skin. */

/* ---------- Buttons ----------
   Grotesk caps, radius 0, 1px border. States: hover, focus, active, disabled, loading, success. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: var(--r-0);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease-ink), color var(--dur-fast) var(--ease-ink), border-color var(--dur-fast) var(--ease-ink), transform var(--dur-fast) var(--ease-ink);
}
/* Phones: a long label wraps inside the button instead of pushing the layout wider */
@media (max-width: 559px) {
  .btn { white-space: normal; }
}
.btn .icon { width: 1em; height: 1em; }
.btn:active { transform: translateY(1px); }
.btn--lg { min-height: 56px; padding: 16px 30px; font-size: 1rem; }
.btn--sm { min-height: 36px; padding: 8px 14px; font-size: var(--fs-label); }
.btn--block { width: 100%; }

/* Primary. --gold is the draft's primary class; brass can't carry text on paper, so it is the ink block now. */
.btn--primary, .btn--ink, .btn--gold { background: var(--ink); color: var(--newsprint); border-color: var(--ink); }
.btn--primary:hover, .btn--ink:hover, .btn--gold:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn--primary:active, .btn--ink:active, .btn--gold:active { background: var(--ink-3); }

/* Secondary: outline on paper */
.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: var(--newsprint); }

/* Secondary on ink surfaces */
.btn--outline-light { border-color: var(--on-ink-2); color: var(--newsprint); }
.btn--outline-light:hover { border-color: var(--newsprint); background: var(--newsprint); color: var(--ink); }
.section--ink .btn--primary, .section--ink .btn--ink, .section--ink .btn--gold { background: var(--newsprint); color: var(--ink); border-color: var(--newsprint); }
.section--ink .btn--primary:hover, .section--ink .btn--ink:hover, .section--ink .btn--gold:hover { background: var(--on-ink-2); border-color: var(--on-ink-2); }

/* Danger (destructive confirmations only) */
.btn--red { background: var(--red); border-color: var(--red); color: var(--newsprint); }
.btn--red:hover { background: #8E1C15; border-color: #8E1C15; }

/* Disabled: no hover, no press */
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn:disabled:hover, .btn[aria-disabled="true"]:hover { background: var(--ink); }
.btn--outline:disabled:hover { background: transparent; color: var(--ink); }

/* Loading: label dims, spinner appears. Set aria-busy="true" and disabled together. */
.btn[aria-busy="true"] { cursor: progress; opacity: 1; }
.spinner {
  width: 1em; height: 1em;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-right-color: currentColor; border-style: dotted; }
}

/* Success: ink fill with the check glyph from the font, no icon */
.btn.is-success { background: var(--ink); color: var(--newsprint); border-color: var(--ink); }
.btn.is-success::before { content: '\2713'; font-family: var(--font-body); font-weight: 600; }

/* Phone CTA: the number in the label face, with a hairline underline */
.btn--tel {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 400;
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}

/* Text link with a hairline underline, grotesk caps */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  line-height: 1.2;
  border-bottom: 1px solid var(--ink);
  padding-top: 2px;
  transition: color var(--dur-fast) var(--ease-ink), border-color var(--dur-fast) var(--ease-ink);
}
.link-arrow:hover { color: var(--red); border-color: var(--red); }
.link-arrow--light { color: var(--newsprint); border-color: var(--on-ink-2); }
.link-arrow--light:hover { color: var(--brass); border-color: var(--brass); }

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  background: transparent;
  border-radius: var(--r-0);
  color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease-ink), color var(--dur-fast) var(--ease-ink);
}
.icon-btn:hover { background: var(--ink); color: var(--newsprint); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; background: transparent; color: var(--ink); }

/* ---------- Chips (filters) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: var(--r-chip);
  background: transparent;
  font-family: var(--font-label);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease-ink), color var(--dur-fast) var(--ease-ink);
}
.chip:hover { background: var(--newsprint-2); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--ink); color: var(--newsprint); }
.chip__count { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0; font-variant-numeric: tabular-nums; opacity: 0.8; }
.chip:disabled { opacity: 0.4; cursor: not-allowed; background: transparent; }

/* County tags inside calendar cells and cards */
.tag {
  display: inline-block;
  font-family: var(--font-label);
  font-size: var(--fs-tag);
  font-weight: 600;
  letter-spacing: var(--track-tag);
  text-transform: uppercase;
  line-height: 1;
  padding: 4px 6px 3px;
  border: 1px solid var(--rule);
  border-radius: var(--r-chip);
  color: var(--lead);
  background: transparent;
}

/* ---------- Status pills (sale status) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-label);
  font-size: var(--fs-tag);
  font-weight: 700;
  letter-spacing: var(--track-tag);
  text-transform: uppercase;
  line-height: 1;
  padding: 5px 8px 4px;
  border: 1px solid;
  border-radius: var(--r-chip);
  white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; background: currentColor; }
.pill--confirmed { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.pill--adjourned { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bd); }
.pill--cancelled { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-bd); }
.pill--update { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--newsprint);
  border-bottom: var(--hairline) solid var(--rule);
  transition: border-color var(--dur-fast) var(--ease-ink);
}
.site-header.is-scrolled { border-bottom-color: var(--ink); }
/* The masthead runs the full width of the window; the page columns below stay at --max */
.site-header__inner {
  max-width: none;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 40px);
}

/* Brand lockup. The draft's text mark stays until Phase 3 inlines the SVG; both are styled. */
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); color: var(--ink); }
/* The client's logo artwork (stacked wordmark under the roof mark), 501x136 */
.brand__logo { height: 40px; width: auto; display: block; }
@media (max-width: 1279px) { .brand__logo { height: 34px; } }
@media (max-width: 559px) { .brand__logo { height: 30px; } }
.brand__mark {
  width: 32px; height: 32px;
  border: 1px solid var(--ink);
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.1rem;
}
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-family: var(--font-label); font-weight: 700; font-size: 1rem; letter-spacing: 0.06em; }
.brand__sub { font-family: var(--font-label); font-size: 0.5625rem; letter-spacing: 0.32em; color: var(--lead); margin-top: 4px; }

.primary-nav { flex-grow: 1; }
.primary-nav__list { display: flex; flex-wrap: nowrap; gap: clamp(10px, 1.2vw, 28px); }
.primary-nav__list a {
  display: inline-flex; align-items: center;
  min-height: var(--tap);
  font-family: var(--font-label);
  font-size: 0.875rem; /* 14px: one size for every word in the header */
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) var(--ease-ink), border-color var(--dur-fast) var(--ease-ink);
}
.primary-nav__list a:hover { color: var(--red); }
.primary-nav__list a[aria-current="page"] { border-bottom-color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: clamp(12px, 1.2vw, 20px); white-space: nowrap; flex-shrink: 0; }
/* Written as a[href] so it outranks the global tel-link rule in base.css */
.header-actions a.header-actions__phone {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--r-0);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: var(--track-caps);
  font-variant-numeric: proportional-nums; /* same rhythm as the lettered boxes; tabular digits read as a different face */
  line-height: 1.1;
  color: var(--ink);
  transition: background-color var(--dur-fast) var(--ease-ink), color var(--dur-fast) var(--ease-ink);
}
.header-actions a.header-actions__phone:hover { background: var(--ink); color: var(--newsprint); }
/* Log in is a boxed button the same size as Start free (outline vs. filled) */
.header-actions__login {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px;
  padding: 10px 22px;
  border: 1px solid var(--ink);
  border-radius: var(--r-0);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--ink);
  background: transparent;
  transition: background-color var(--dur-fast) var(--ease-ink), color var(--dur-fast) var(--ease-ink);
}
.header-actions__login:hover { background: var(--ink); color: var(--newsprint); }
.header-actions .btn { min-height: 40px; padding-block: 10px; font-size: 0.875rem; }

.lang-toggle { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--r-0); min-height: 40px; }
.lang-toggle a {
  font-family: var(--font-label);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  padding: 0 14px;
  min-height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.lang-toggle a[aria-current="true"] { background: var(--ink); color: var(--newsprint); }

.menu-toggle { display: none; border: 0; background: transparent; }

/* The number shows from 1440px up; between 1280 and 1439 the phone is an icon link and the EN/ES toggle
   moves to the footer, so the larger nav type never collides with the actions */
@media (max-width: 1599px) { .header-actions .lang-toggle { display: none; } }
@media (max-width: 1439px) { .header-actions__phone span { display: none; } }
.primary-nav { min-width: 0; }
@media (max-width: 1279px) {
  .menu-toggle { display: inline-flex; }
  .header-actions { gap: 8px; margin-left: auto; }
  .header-actions__phone, .header-actions .btn { display: none; }

  .primary-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: var(--z-nav);
    background: var(--newsprint);
    padding: 8px var(--gutter) 120px;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity var(--dur-fast) var(--ease-ink), transform var(--dur-fast) var(--ease-ink), visibility 0s linear var(--dur-fast);
  }
  .primary-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity var(--dur-fast) var(--ease-ink), transform var(--dur-fast) var(--ease-ink); }
  .primary-nav__list { flex-direction: column; gap: 0; }
  .primary-nav__list a { min-height: 56px; width: 100%; border-bottom: 1px solid var(--rule); font-size: var(--fs-sm); }
  .primary-nav__list a[aria-current="page"] { border-bottom-color: var(--rule); color: var(--red); }
  .primary-nav__cta { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
  body.nav-open { overflow: hidden; }
}
/* Between the hamburger and 1440px there is no room for the toggle; Spanish stays in the footer and the mobile menu */
@media (max-width: 1439px) {
  .header-actions .lang-toggle { display: none; }
}
@media (min-width: 1280px) {
  .primary-nav__cta { display: none; }
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 32px;
  margin-bottom: clamp(28px, 3vw, 48px);
  padding-top: 16px;
  border-top: var(--hairline) solid var(--ink);
  flex-wrap: wrap;
}
.section-head h2 { margin-top: 10px; max-width: 22ch; }
.section-head .lead { max-width: 440px; }

/* ---------- Property card: the clipping ---------- */
.prop-card {
  background: var(--newsprint);
  border: 1px solid var(--ink);
  border-radius: var(--r-0);
  overflow: hidden;
}
.prop-card__photo {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 16px 16px 0;
  border: 1px solid var(--rule);
  background-color: var(--newsprint-2);
  background-image: var(--halftone);
}
.prop-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.prop-card__badge {
  position: absolute; top: 10px; left: 10px;
  font-family: var(--font-mono); font-size: var(--fs-tag);
  background: var(--ink); color: var(--newsprint);
  padding: 5px 8px;
}
.prop-card__photo .pill { position: absolute; top: 10px; right: 10px; }
.prop-card__body { padding: 20px 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.prop-card__title { font-family: var(--font-body); font-weight: 500; font-size: 1.35rem; line-height: 1.1; letter-spacing: -0.01em; }
.prop-card__meta { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--lead); margin-top: 6px; }
.prop-card__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; font-variant-numeric: tabular-nums; }
.prop-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px dotted var(--rule); }
.prop-stat dt { font-family: var(--font-label); font-size: var(--fs-tag); letter-spacing: var(--track-tag); color: var(--lead); text-transform: uppercase; }
.prop-stat dd { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 500; }
.prop-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--rule); padding-top: 14px; }
.prop-card__lock { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--lead); }
@media (max-width: 559px) {
  .prop-card__stats { grid-template-columns: 1fr; }
}

/* ---------- Stat strip ---------- */
.stat-strip { background: var(--ink); color: var(--on-ink); }
.stat-strip__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-strip__item { padding: 36px 32px; border-right: 1px solid var(--line-on-ink); }
.stat-strip__item:first-child { padding-left: 0; }
.stat-strip__item:last-child { border-right: 0; }
.stat-strip__value { white-space: nowrap; font-family: var(--font-display); font-size: clamp(1.75rem, 1rem + 2vw, 3rem); font-weight: 500; color: var(--brass); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: var(--track-display); }
.stat-strip__label { font-size: var(--fs-xs); color: var(--on-ink-2); margin-top: 10px; }
@media (max-width: 859px) {
  .stat-strip__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip__item { padding: 20px 16px; }
  .stat-strip__item:nth-child(odd) { padding-left: 0; }
  .stat-strip__item:nth-child(2) { border-right: 0; }
  .stat-strip__item:nth-child(-n + 2) { border-bottom: 1px solid var(--line-on-ink); }
}

/* ---------- CTA band and footer ---------- */
.cta-band {
  background: var(--newsprint);
  color: var(--ink);
  padding-block: clamp(48px, 5vw, 72px);
  border-top: 1px solid var(--ink);
  box-shadow: inset 0 4px 0 -1px var(--ink); /* the Oxford pair: 1px border + 3px inset */
}
.cta-band__inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta-band p { margin-top: 10px; color: var(--lead); font-size: var(--fs-lead); }
.cta-band__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.site-footer { background: var(--ink); color: var(--on-ink-2); padding-block: 64px 40px; font-size: var(--fs-xs); line-height: 1.8; }
.site-footer__grid { display: grid; grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr)); gap: 40px; }
@media (max-width: 1079px) { .site-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.site-footer h2 { font-family: var(--font-label); font-size: var(--fs-tag); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--brass); font-weight: 600; margin-bottom: 10px; }
.site-footer a { color: var(--on-ink-2); display: inline-block; padding-block: 2px; border-bottom: 1px solid transparent; }
.site-footer a:hover { color: var(--newsprint); border-bottom-color: var(--brass); }
.site-footer .brand { color: var(--newsprint); display: block; }
.site-footer__logo { width: 200px; height: auto; display: block; }
.site-footer .brand__name { color: var(--newsprint); }
.site-footer .brand__sub { color: var(--brass); }
.site-footer address { margin-top: 14px; }
.site-footer__legal { border-top: 1px solid var(--line-on-ink); margin-top: 40px; padding-top: 24px; display: flex; justify-content: space-between; gap: 32px; font-size: var(--fs-xs); color: var(--on-ink-3); line-height: 1.6; }
.site-footer__legal p { max-width: 760px; }
.site-footer__credit a { color: var(--on-ink-2); }
@media (max-width: 859px) {
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__legal { flex-direction: column; }
}
/* The fixed action bar shows up to 719px; the footer keeps its credit clear of it at the same widths */
@media (max-width: 719px) {
  .site-footer { padding-bottom: 110px; }
}
@media (max-width: 559px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Mobile action bar ---------- */
.action-bar { display: none; }
@media (max-width: 719px) {
  .action-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: var(--z-bar);
    display: flex;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--newsprint);
    border-top: 1px solid var(--ink);
  }
  .action-bar .btn { flex: 1 1 0; min-height: 48px; }
}

/* ---------- Notices ---------- */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid;
  border-left-width: 3px;
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.notice .icon { margin-top: 2px; }
.notice--info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); border-left-color: var(--info-fg); }
.notice--error { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-bd); border-left-color: var(--red); }
.notice--ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); border-left-color: var(--ok-fg); }
.notice--warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bd); border-left-color: var(--warn-fg); }

@media (max-width: 559px) {
  .cta-band__actions { width: 100%; }
  .cta-band__actions .btn { flex: 1 1 100%; }
}

/* ---------- Link chips row (homepage markets, 404) ---------- */
.markets-strip__links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Empty state ---------- */
.empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.empty__head { font-family: var(--font-body); font-size: var(--fs-h3); font-style: italic; }
.empty p { color: var(--lead); max-width: 48ch; }

/* ---------- Photo slot (awaiting the field team's drive-by) ---------- */
.photo-slot {
  position: relative;
  border: 1px solid var(--rule);
  background-color: var(--newsprint-2);
  background-image: var(--halftone);
  display: flex; align-items: flex-end;
  padding: 10px 12px;
}
.photo-slot--4-3 { aspect-ratio: 4 / 3; }
.photo-slot--3-2 { aspect-ratio: 3 / 2; }
.photo-slot__caption { position: relative; font-family: var(--font-mono); font-size: var(--fs-tag); color: var(--lead); letter-spacing: 0.02em; background: var(--newsprint); padding: 3px 6px; }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.55); }

/* Spanish labels run longer: give the nav back some room on mid-size desktops */
html[lang="es"] .primary-nav__list { gap: clamp(8px, 1vw, 24px); }
@media (max-width: 1599px) { html[lang="es"] .header-actions__login { display: none; } }
