/* Reading statistics on /library/: the per-year challenge cards and the shelf
   summary. The accent is the site's green, validated for lightness band, chroma,
   and surface contrast against both the light card (#ffffff) and the dark card
   (#1d3b27). Dark values are re-stepped for the dark surface in dark.css under
   the --rs- prefix, matching the --gst- pattern already used by
   garden-scroll-table.css. */

.rs {
  --rs-surface: #ffffff;
  --rs-ink: #284d36;
  --rs-ink-2: #52514e;
  --rs-muted: #7d8a80;
  --rs-grid: #e4e8e0;

  /* Accent, drawn from the site's own greens rather than the stock blue so the
     dashboard reads as part of this garden. Validated on the white card for
     lightness band, chroma, and 3:1 contrast; re-stepped for the dark card in
     dark.css, where it lands on the green the site already uses for links. */
  --rs-s1: #2e7d46;

  /* Unfilled track of the challenge meter: a lighter step of the fill's own hue. */
  --rs-track: #cbe4d5;

  --rs-sans: var(--headings, 'Encode Sans Semi Condensed'), system-ui, -apple-system, sans-serif;
  font-family: var(--rs-sans);
  color: var(--rs-ink);
}

/* ---------- figures ---------- */

.rs-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0.35rem;
}

.rs-hero-value {
  font-family: var(--rs-sans);
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
  color: var(--rs-s1);
}

.rs-hero-label {
  font-size: 0.9rem;
  color: var(--rs-ink-2);
  max-width: 46ch;
  margin-bottom: 0;                 /* the tiles supply the spacing below */
}

.rs-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem 1.5rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.rs-tile-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--rs-ink);
}

.rs-tile-label {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--rs-muted);
  margin-top: 0.2rem;
}

/* ---------- shared section chrome ---------- */

.rs-figure { margin: 2.5rem 0 0; }

/* Panels sit on their own card rather than straight on the page, which is the
   surface the palette was validated against (#ffffff light, #1d3b27 dark) and
   matches the cards the rest of the site already uses. */
.rs-panel {
  background: var(--rs-surface);
  border: 1px solid var(--rs-grid);
  border-radius: 10px;
  padding: 1.25rem 1.35rem 1.4rem;
}

.rs-panel > figcaption { margin-bottom: 0.1rem; }

/* The shelf summary is a panel, not a figure, so it needs the same rhythm the
   figures get from .rs-figure. Without this it butts against the year cards. */
.rs-summary { margin-top: 2.5rem; }

.rs-figure > figcaption {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--rs-ink);
  margin-bottom: 0.15rem;
}

/* Section headers, matched to the "Notes" h2 further down the page (32px,
   weight 500, the body serif). The chart captions above stay a level below
   these so the page keeps two ranks of heading rather than one. */
.rs-figure > figcaption.rs-h2 {
  font-family: var(--summary, 'Frank Ruhl Libre'), serif;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.85rem;
}

.rs-note {
  font-size: 0.85rem;
  color: var(--rs-muted);
  margin-bottom: 1rem;
  max-width: 70ch;
}

/* ---------- reading challenges ---------- */

.rs-years {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.rs-year {
  position: relative;                /* anchor for the card-wide stretched link */
  border: 1px solid var(--rs-grid);
  border-radius: 8px;
  padding: 0.9rem 1rem 1rem;
  background: var(--rs-surface);
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.rs-year:hover {
  border-color: var(--rs-s1);
  transform: translateY(-1px);
}

.rs-year-more {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--rs-muted);
}

.rs-year:hover .rs-year-more { color: var(--rs-s1); }

.rs-year-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.rs-year-n {
  font-size: 1.05rem;
  font-weight: 700;
  color: #9e3410 !important;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.16em;
  text-decoration-color: rgba(158, 52, 16, 0.45);
}

.rs-year-n:hover {
  color: #7d280b !important;
  text-decoration-color: #7d280b;
}

.rs-year-books {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--rs-s1);
  margin-top: 0.35rem;
}

.rs-year-books small {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--rs-muted);
  margin-left: 0.3rem;
}

.rs-meter {
  height: 8px;
  border-radius: 4px;
  background: var(--rs-track);
  overflow: hidden;
  margin: 0.55rem 0 0.3rem;
}

.rs-meter > div {
  height: 100%;
  background: var(--rs-s1);
  border-radius: 4px;
}

.rs-year-goal {
  font-size: 0.76rem;
  color: var(--rs-muted);
}

.rs-year-facts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.5rem;
  font-size: 0.78rem;
  color: var(--rs-ink-2);
  margin: 0.65rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rs-grid);
}

.rs-year-facts dt { font-weight: 400; color: var(--rs-muted); }
.rs-year-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
