/* ============================================================================
   erf-pages.css — components for generated data pages only.
   Linked from /rental-prices/** and /gauteng-rental-market/. NEVER from index.html.

   WHY THIS FILE EXISTS (ADR-021)
   ------------------------------
   assets/erf.css is a PURGED Tailwind build: it contains only the ~150 utility
   classes index.html actually uses. A Tailwind class that is not in that build
   does not error -- it silently does nothing. There is no table styling in it at
   all, so the central component of a data page cannot be built from it.

   Rebuilding Tailwind would need a JS toolchain this machine does not have, and
   would regenerate the stylesheet the homepage depends on. So: plain CSS, here,
   reading the custom properties erf.css already defines on :root.

   RULE FOR ANYONE EDITING THE RENDERER
   ------------------------------------
   Inside a generated page, use the classes below. Do NOT reach for a Tailwind
   utility unless you have confirmed it exists in erf.css -- it probably does not,
   and it will fail quietly.

   Every colour below is a token from erf.css, so a palette change propagates
   here automatically. Do not hard-code a hex value in this file.
   ========================================================================== */

/* ---- page shell --------------------------------------------------------- */
.erf-doc {
  max-width: 72rem;                 /* matches the homepage's max-w-6xl */
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}
@media (min-width: 768px) { .erf-doc { padding: 4rem 1.5rem 7rem; } }

.erf-crumb {
  font-size: .8125rem;
  color: rgb(var(--c-mute));
  margin-bottom: 1.5rem;
}
.erf-crumb a { color: rgb(var(--c-mute)); text-decoration: none; }
.erf-crumb a:hover { color: rgb(var(--c-navy)); text-decoration: underline; }
.erf-crumb span { margin: 0 .5rem; color: rgb(var(--c-rule)); }

.erf-doc h1 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 400;
  font-size: 2.25rem;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: rgb(var(--c-navy));
}
@media (min-width: 768px) { .erf-doc h1 { font-size: 3rem; } }

.erf-doc h2 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.25;
  color: rgb(var(--c-navy));
  margin-top: 3.5rem;
  margin-bottom: 1rem;
}
.erf-doc h3 {
  font-size: 1rem;
  font-weight: 600;
  color: rgb(var(--c-navy));
  margin-top: 2rem;
  margin-bottom: .5rem;
}
.erf-doc p { color: rgb(var(--c-mute)); line-height: 1.7; margin-bottom: 1rem; }
.erf-doc a { color: rgb(var(--c-navy)); text-decoration: underline; text-underline-offset: 3px; }
.erf-doc a:hover { color: rgb(var(--c-gold)); }

/* ---- freshness stamp ---------------------------------------------------- */
.erf-stamp {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1.25rem;
  margin: 1.25rem 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgb(var(--c-rule));
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .75rem;
  color: rgb(var(--c-mute));
}
.erf-stamp strong { color: rgb(var(--c-navy)); font-weight: 500; }

/* ---- the direct answer, first thing a searcher reads --------------------- */
.erf-answer {
  border-left: 3px solid rgb(var(--c-gold));
  background: linear-gradient(to right, rgb(var(--c-gold) / .06), transparent);
  padding: 1.25rem 1rem 1.25rem 1.5rem;
  margin: 0 0 2.5rem;
}
.erf-answer p { color: rgb(var(--c-ink)); font-size: 1.0625rem; margin-bottom: .75rem; }
.erf-answer p:last-child { margin-bottom: 0; }

/* ---- snapshot figures --------------------------------------------------- */
.erf-snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgb(var(--c-rule));
  border: 1px solid rgb(var(--c-rule));
  margin: 1.5rem 0 2.5rem;
}
@media (min-width: 640px) { .erf-snapshot { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.erf-stat { background: rgb(var(--c-card)); padding: 1rem; }
.erf-stat .k {
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .18em;
  color: rgb(var(--c-mute)); display: block; margin-bottom: .5rem;
}
.erf-stat .v {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.25rem; font-weight: 500; color: rgb(var(--c-navy));
}
.erf-stat .s { display: block; margin-top: .35rem; font-size: .75rem; color: rgb(var(--c-mute)); }

/* ---- the data table ----------------------------------------------------- */
.erf-table-wrap { overflow-x: auto; margin: 1.5rem 0 1rem; }
.erf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  min-width: 34rem;
}
.erf-table caption {
  caption-side: top;
  text-align: left;
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .18em;
  color: rgb(var(--c-gold));
  padding-bottom: .75rem;
}
.erf-table th, .erf-table td {
  padding: .75rem .875rem;
  text-align: left;
  border-bottom: 1px solid rgb(var(--c-rule));
}
.erf-table thead th {
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em;
  color: rgb(var(--c-mute));
  border-bottom: 1px solid rgb(var(--c-navy));
  white-space: nowrap;
}
.erf-table td.num, .erf-table th.num {
  text-align: right;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  white-space: nowrap;
}
.erf-table tbody tr:hover { background: rgb(var(--c-soft)); }
.erf-table td.name { color: rgb(var(--c-navy)); font-weight: 500; }

/* A figure the claim gate suppressed. The dash is the argument -- see the
   homepage's withheld tile. Never render 0 or "n/a" here. */
.erf-withheld { color: rgb(var(--c-goldlift)); font-family: "IBM Plex Mono", ui-monospace, monospace; }

.erf-n { font-size: .8125rem; color: rgb(var(--c-mute)); }
.erf-tier {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  padding: .15rem .4rem; border: 1px solid rgb(var(--c-rule)); color: rgb(var(--c-mute));
  white-space: nowrap;
}
.erf-tier.reliable { border-color: rgb(var(--c-gold) / .5); color: rgb(var(--c-gold)); }

/* ---- caveats and limits ------------------------------------------------- */
.erf-note {
  border: 1px solid rgb(var(--c-rule));
  background: rgb(var(--c-soft));
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: .9375rem;
}
.erf-note p { margin-bottom: 0; }
.erf-note strong { color: rgb(var(--c-navy)); }

/* ---- related pages ------------------------------------------------------ */
.erf-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgb(var(--c-rule));
  border: 1px solid rgb(var(--c-rule));
  margin: 1.25rem 0;
}
@media (min-width: 768px) { .erf-links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.erf-links a {
  background: rgb(var(--c-card));
  padding: .875rem 1rem;
  text-decoration: none;
  color: rgb(var(--c-navy));
  font-size: .9375rem;
}
.erf-links a:hover { background: rgb(var(--c-soft)); color: rgb(var(--c-gold)); }
.erf-links a .n { display: block; font-size: .75rem; color: rgb(var(--c-mute)); margin-top: .2rem; }

/* Two-up. Four cards in a three-column grid leave a dead cell beside the
   fourth, which reads as a broken card. Declared after the 768px rule above so
   it wins at every width. */
.erf-links.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .erf-links.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .erf-links.two { grid-template-columns: 1fr; } }
.erf-links a .num {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: .18em;
  color: rgb(var(--c-gold));
  margin-bottom: .45rem;
}

/* ---- conversion --------------------------------------------------------- */
.erf-cta {
  border: 1px solid rgb(var(--c-rule));
  background: linear-gradient(to bottom, rgb(var(--c-card)), rgb(var(--c-soft) / .6));
  padding: 1.75rem;
  margin: 3rem 0 0;
}
.erf-cta h2 { margin-top: 0; }
.erf-cta a.btn {
  display: inline-block;
  margin-top: 1rem;
  background: linear-gradient(to bottom, rgb(var(--c-goldlift)), rgb(var(--c-gold)));
  color: #fff;
  padding: .875rem 1.75rem;
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
  transition: transform .3s, box-shadow .3s;
}
.erf-cta a.btn:hover {
  transform: translateY(-2px);
  color: #fff;
  box-shadow: 0 10px 15px -3px rgb(var(--c-gold) / .35);
}

/* ---- movement arrows ---------------------------------------------------- */
.erf-up   { color: rgb(var(--c-gold)); }
.erf-down { color: rgb(var(--c-mute)); }
.erf-flat { color: rgb(var(--c-mute)); }
