/* Shared styles for Market Update pages — loosely matches the ElDoradoHillsCA.com palette.
   Color tokens are chosen to meet WCAG 2.2 AA: 4.5:1 for body text and 3:1 for
   large text, UI components, and graphics (including gold on cream). */
:root {
  --serif: "Brygada 1918", Charter, "Iowan Old Style", Georgia, serif;
  --sans: "Overpass", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --text: #242424;
  --text-soft: #383D37;
  /* Darkened from #C99A3C (2.22:1 on page, 2.47:1 on paper) to meet 4.5:1 AA
     against both cream backgrounds: 4.54:1 on --page, 5.06:1 on --paper. */
  --gold: #8F6410;
  --focus: #2A3D2E;
  --sign: #1F6B45;
  --hill: #2A3D2E;
  --page: #F3EEE3;
  --paper: #FFFAF3;
  --rule: #E8C48F;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Prevent visually hidden chart tables from widening the page (WCAG 1.4.10). */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

a {
  color: var(--hill);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2.5px; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link: visually hidden until focused, then shown at the top of the page. */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 100;
  padding: 0.5em 0.85em;
  background: var(--hill);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
}
.skip-link:not(:focus):not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus,
.skip-link:focus-visible {
  color: #fff;
  text-decoration: none;
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

.wrap {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand svg { width: 26px; height: 26px; flex: none; }
.nav {
  display: flex;
  align-items: center;
  gap: 8px 18px;
  font-size: 0.875rem;
  flex-wrap: wrap;
}
.nav a {
  color: var(--text);
  padding: 0.4em 0.15em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.for-sale {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
}
.for-sale a { color: var(--text); }

main { padding: 28px 0 56px; }

.kicker {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sign);
}
h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.4em;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 1.8em 0 0.6em;
  overflow-wrap: break-word;
}
.dateline, .lede, .note {
  color: var(--text-soft);
}
.dateline { margin: 0 0 1.2em; font-size: 0.95rem; }
article p, .intro p { margin: 0 0 1.1em; max-width: 68ch; text-wrap: pretty; }
.disclaimer {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
  color: var(--text-soft);
}
.issue-list { list-style: none; margin: 1.5em 0 0; padding: 0; }
.issue-list li {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.1em 1.2em 1em;
  margin: 0 0 1em;
}
.issue-list h2 { margin: 0 0 0.25em; font-size: 1.35rem; }
.issue-list h2 a { color: var(--text); text-decoration-color: var(--gold); }
.issue-date { margin: 0 0 0.5em; font-size: 0.92rem; color: var(--text-soft); }
.issue-list p { margin: 0; }
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 22px 0 36px;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: space-between;
}
.site-footer a { color: var(--text); }

.permalink {
  margin: 0 0 1.4em;
  font-size: 0.92rem;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.nav a[aria-current="page"] { font-weight: 700; }

.rate-chart, .listing-chart {
  margin: 0 0 1.6em;
  padding: 0.85em 0.85em 0.65em;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  max-width: 100%;
}
.rate-chart svg, .listing-chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.rate-chart figcaption, .listing-chart figcaption {
  margin: 0.45em 0 0.15em;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* Visually hidden, but available to assistive technology (skip link, new-tab
   announcements, and chart data tables). Do not use display:none. */
.sr-only {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  max-width: 1px;
  max-height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 360px) {
  .wrap { width: calc(100% - 20px); }
  .rate-chart, .listing-chart { padding: 0.55em 0.4em 0.45em; }
  main { padding: 20px 0 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
