/* lp.css — cross-project design primitives for latinprayer-django.
 *
 * Mirrors the iOS/web app's app/styles/components/_vocabulary.scss so the
 * two surfaces read as one product. Token aliases ("--lp-*") and font
 * variables live in base.html :root; the primitives below consume them.
 *
 * When a primitive needs to evolve, update both `/style` pages (App +
 * Web) so the design rule stays singular. The app is the source of
 * truth — port values FROM the app's _vocabulary.scss, not the other
 * way around.
 */

/* ─── @font-face: self-hosted Inter + EB Garamond ──────────────────
 *
 * Variable fonts shipped with the app (app/fonts/{Inter,EB_Garamond}/).
 * Copied verbatim so the two surfaces render the exact same glyphs.
 * Inter covers the entire sans surface (chrome + body + eyebrows);
 * EB Garamond is reserved for the loud serif title (.h1) and the
 * occasional decorative serif italic. */
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter/Inter-VariableFont.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter/Inter-Italic-VariableFont.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('fonts/EB_Garamond/EBGaramond-VariableFont.ttf') format('truetype-variations');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('fonts/EB_Garamond/EBGaramond-Italic-VariableFont.ttf') format('truetype-variations');
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

/* ─── lp-eyebrow ────────────────────────────────────────────────────
 *
 * Small uppercase classifier that names what kind of thing sits below
 * it (SAINTS / BIBLE / TODAY'S ROSARY). Sans (Inter), 600 weight,
 * tight tracked uppercase, muted color. Default = no bottom margin —
 * parents own inter-child spacing. */
.lp-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--lp-muted);
  text-transform: uppercase;
}

/* Loose-flow modifier — 6px bottom margin so an eyebrow sits
 * comfortably above a title in a stacked block. */
.lp-eyebrow--with-gap { margin-bottom: 6px; }

/* Deprecated alias — kept so existing callsites that explicitly opt
 * out of margin still compile. New code should just use .lp-eyebrow. */
.lp-eyebrow--inline { margin-bottom: 0; }

/* Standalone modifier — used when the eyebrow stands on its own
 * without a wrapper that provides horizontal padding. */
.lp-eyebrow--standalone { padding: 18px 14px 10px; margin-bottom: 0; }

/* Link modifier — eyebrow doubles as a back-link to its parent index.
 * Pairs a left .lp-chev with the eyebrow text. */
.lp-eyebrow--link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--lp-muted);
  cursor: pointer;
}
.lp-eyebrow--link:active { opacity: 0.6; }
.lp-eyebrow--link .lp-chev { color: var(--lp-key); }

/* ─── .h1 / .h2 ─────────────────────────────────────────────────────
 *
 * The two loud title sizes, named after the HTML elements they pair
 * with so the system reads like markdown:
 *
 *   .h1 — 1.75rem — the page heading at the top of every section page.
 *   .h2 — 1.25rem — the in-card / in-content heading.
 *
 * .h1 is serif (EB Garamond) at display weight — the ONE allowance
 * for serif in the chrome. .h2 is sans (Inter) at semi-bold — the
 * family flip makes the hierarchy felt as well as sized. */
.h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--lp-fg);
  margin: 0;
  padding: 0;
}
.h2 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--lp-fg);
  margin: 0;
}

/* ─── lp-title ──────────────────────────────────────────────────────
 *
 * Medium-weight heading. The 'this is what the section is about' line
 * that sits between an eyebrow above and body/quote below. Card refs
 * ('Luke 12:20', 'John 3'), section row titles, list-item heads. */
.lp-title {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--lp-fg);
}

/* ─── lp-sub ────────────────────────────────────────────────────────
 *
 * Sister primitive to .lp-eyebrow — the "small muted helper text that
 * supports the loud line above or beside it" role. Subtitles,
 * metadata, captions, hints, dates, counts. Sentence-case (NOT upper).
 * Sans regular, muted, generous line-height. No default margin. */
.lp-sub {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--lp-muted);
  line-height: 1.55;
}

/* ─── lp-body ───────────────────────────────────────────────────────
 *
 * Reading body text — paragraphs, descriptions, prose. The default. */
.lp-body {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--lp-fg);
}

/* ─── lp-quote ──────────────────────────────────────────────────────
 *
 * Italic block — verse text, citations, pull quotes. Inline ink (full
 * --lp-fg) because quoted matter is content, not metadata. Italic
 * sans, not serif, per the no-serif-at-small-sizes rule. */
.lp-quote {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: var(--lp-fg);
}

/* ─── lp-chev ───────────────────────────────────────────────────────
 *
 * Brand-coloured chevron — used as a tap-affordance marker at the end
 * of a tappable row. Painted in --lp-key (rubric/oxblood). Sizes by
 * modifier; inherits color when nested inside a link that overrides. */
.lp-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lp-key);
  flex-shrink: 0;
  pointer-events: none;
  line-height: 1;
}
.lp-chev > svg { width: 1em; height: 1em; display: block; }
.lp-chev--sm { font-size: 0.75rem; }
.lp-chev--md { font-size: 1rem; }
.lp-chev--lg { font-size: 1.4rem; }

/* Colorless chevron — directional marker that should not pick up the
 * brand key (e.g. inside a muted breadcrumb, expand/collapse caret). */
.lp-chev--muted { color: var(--lp-muted); }

/* ─── lp-arrow ──────────────────────────────────────────────────────
 *
 * Inline arrow glyph — for cross-references and external links inside
 * prose (read more →, learn more ↗). Tiny, picks up surrounding ink
 * color so it blends with the link or label it ends. */
.lp-arrow {
  display: inline-block;
  font-style: normal;
  margin-left: 0.25em;
  font-size: 0.85em;
  line-height: 1;
  color: inherit;
  transform: translateY(-0.05em);
}
.lp-arrow--external { transform: translateY(-0.05em) rotate(-45deg); }

/* ─── lp-chip ───────────────────────────────────────────────────────
 *
 * Canonical filter/toggle chip. Tappable. Soft transparent wash by
 * default, accent-tinted when .is-active. Full pill (999px), 1px
 * hairline border, small sans label. */
.lp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 5px 12px;
  background: color-mix(in oklab, var(--lp-fg) 5%, transparent);
  border: 1px solid color-mix(in oklab, var(--lp-fg) 10%, transparent);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--lp-fg);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
  text-decoration: none;
}
.lp-chip.is-active {
  background: color-mix(in oklab, var(--lp-key) 12%, transparent);
  border-color: color-mix(in oklab, var(--lp-key) 35%, transparent);
  color: var(--lp-key);
}

/* Rectangular modifier — for grid layouts (e.g. saints month picker)
 * where full-pill 999px looks out-of-place against the grid rhythm. */
.lp-chip--rect { border-radius: 8px; }

/* Compact modifier — for chip rows that need to fit in narrow rails
 * (search overlay's 4 filters). */
.lp-chip--compact { padding: 3px 9px; font-size: 0.7rem; gap: 4px; }

/* Solid modifier — for chips that act as primary affordances rather
 * than passive filters (e.g. a "Try it" action chip). */
.lp-chip--solid {
  background: var(--lp-key);
  border-color: var(--lp-key);
  color: #fff;
}
.lp-chip--solid.is-active { color: #fff; }

/* Card modifier — bigger picker-style chip ('Book ⌄ · Chapter ⌄') that
 * sits on a card surface (transparent so the card chrome shows). */
.lp-chip--card {
  background: transparent;
  border-width: 0.5px;
  border-color: var(--lp-border);
  padding: 5px 12px;
}

/* Inline counter inside a chip — soft pill at half-size for "All 12 /
 * Bookmarks 3" patterns. */
.lp-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25em;
  padding: 0 0.4em;
  border-radius: 999px;
  background: color-mix(in oklab, var(--lp-fg) 12%, transparent);
  font-size: 0.85em;
  line-height: 1.5;
  color: inherit;
}
.lp-chip.is-active .lp-chip-count {
  background: color-mix(in oklab, var(--lp-key) 22%, transparent);
}

/* ─── lp-tag ────────────────────────────────────────────────────────
 *
 * Soft pill that LABELS something (non-tappable). Status tags, content
 * categories, language flags. Same shape as .lp-chip but never picks
 * up an active state. */
.lp-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--lp-fg) 6%, transparent);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--lp-muted);
  white-space: nowrap;
}

/* Caps modifier — tracked-uppercase tag (CANONICAL, OPTIONAL, MEMORIA).
 * The "this content has a definite category" pattern. */
.lp-tag--caps {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.62rem;
  font-weight: 600;
}

/* Semantic colour modifiers — pick up the area-specific accent.
 * BIBLE = oxblood, PRAYER = oxblood, VOCAB = quiet teal. Keep usage
 * disciplined — only on home/index pages where the category needs to
 * read at a glance. */
.lp-tag--bible  { color: var(--lp-key); background: color-mix(in oklab, var(--lp-key) 8%, transparent); }
.lp-tag--prayer { color: var(--lp-key); background: color-mix(in oklab, var(--lp-key) 8%, transparent); }
.lp-tag--vocab  { color: #0ea5a0;       background: color-mix(in oklab, #0ea5a0 10%, transparent); }

/* ─── lp-divider ────────────────────────────────────────────────────
 *
 * Hairline divider between sibling sections. Default is a flat 1px
 * rule; the --label modifier centres a small uppercase label inside
 * (CONTINUED, ABOVE / BELOW). */
.lp-divider {
  height: 1px;
  background: var(--lp-border);
  border: 0;
  margin: 1.5rem 0;
}
.lp-divider--label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: transparent;
  height: auto;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lp-muted);
}
.lp-divider--label::before,
.lp-divider--label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--lp-border);
}

/* ─── lp-row / lp-row--link ─────────────────────────────────────────
 *
 * Flat-row primitive. Replaces per-page ad-hoc list CSS (.saint-list,
 * .prayer-list, .catechism-index) with one shared vocabulary. Buttons
 * (.button) are reserved for the ONE high-affordance action per
 * screen; everything else is a row with a chevron. */
.lp-row {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--lp-border);
}
.lp-row:last-child { border-bottom: 0; }

.lp-row--link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--lp-fg);
  cursor: pointer;
  transition: opacity 120ms ease;
}
.lp-row--link > .lp-row__body { flex: 1; min-width: 0; }
.lp-row--link > .lp-chev { color: var(--lp-key); flex-shrink: 0; }
.lp-row--link:hover { opacity: 0.8; }
.lp-row--link:active { opacity: 0.6; }

/* Quiet modifier — row without the loud chevron, for in-content lists
 * where every item is content rather than navigation. */
.lp-row--quiet { color: var(--lp-fg); }
.lp-row--quiet > .lp-chev { display: none; }

/* Noted modifier — row carries a leading note marker (bookmark icon,
 * dot). The marker sits in .lp-row__icon, body in .lp-row__body, time
 * in .lp-row__time. */
.lp-row--noted {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0 0.75rem;
}
.lp-row__icon { flex-shrink: 0; padding-top: 0.25rem; color: var(--lp-key); }
.lp-row__thumb { flex-shrink: 0; width: 40px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--lp-card); }
.lp-row__time { flex-shrink: 0; align-self: flex-start; margin-top: 0.25rem; white-space: nowrap; color: var(--lp-muted); font-size: 0.8125rem; }

/* ─── lp-ord ────────────────────────────────────────────────────────
 *
 * Tiny ordinal prefix at the head of a row — roman or arabic
 * numeral that names "this is item N in the list". Sans, small,
 * uppercase, muted; fixed min-width so consecutive ordinals align
 * vertically (i. / ii. / iii.). */
.lp-ord {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lp-muted);
  flex-shrink: 0;
  min-width: 1.8rem;
  font-variant-numeric: tabular-nums;
}

/* ─── lp-row__trailing ──────────────────────────────────────────────
 *
 * Small trailing meta on a row — "Feast: May 26", "13 steps",
 * "Sext", language flag. Right-side, muted, doesn't compete with
 * the .lp-chev. Use inside an .lp-row--link AFTER .lp-row__body but
 * BEFORE the trailing .lp-chev. Same typographic register as
 * .lp-sub but flex-shrink:0 so it never wraps the row. */
.lp-row__trailing {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--lp-muted);
  white-space: nowrap;
}

/* ─── lp-stack ──────────────────────────────────────────────────────
 *
 * Vertical layout utility — flex column with a default gap. Used when
 * a few children need to read as one unit (eyebrow + title + sub,
 * or a small group of rows). */
.lp-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.lp-stack--tight { gap: 0.4rem; }
.lp-stack--loose { gap: 1.5rem; }

/* ─── lp-more-link ──────────────────────────────────────────────────
 *
 * Trailing quiet nav link at the end of a card/section ("All N
 * saints →", "More verses →"). Picks up --lp-key, small caps, no
 * underline by default. */
.lp-more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--lp-key);
  text-decoration: none;
  margin-top: 0.8rem;
}
.lp-more-link:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.lp-more-link--left { flex-direction: row-reverse; }

/* ─── lp-vocab-card ─────────────────────────────────────────────────
 *
 * The "word + meaning" mini-card used on the home Vocab section and
 * inside the prayer interlinear strip. Word in serif italic, meaning
 * in sans muted. */
.lp-vocab-card {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background: color-mix(in oklab, var(--lp-fg) 4%, transparent);
}
.lp-vocab-card__word {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--lp-fg);
}
.lp-vocab-card__meaning {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--lp-muted);
  line-height: 1.45;
}

/* ─── bible-quote ───────────────────────────────────────────────────
 *
 * Scripture block — italic body with the citation row beneath it. Used
 * on the home page's featured verse, on the lectionary cards. */
.bible-quote {
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--lp-fg);
}
.bible-quote__citation {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.8125rem;
  color: var(--lp-muted);
}

/* ─── lp-decoration ─────────────────────────────────────────────────
 *
 * Serif italic ornament — the one place where EB Garamond appears
 * outside .h1. Used for occasional pull-quote ornaments and the
 * colophon's signature line. Quiet, single-line. */
.lp-decoration {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
  color: var(--lp-muted);
  letter-spacing: 0.01em;
}

/* ─── lp-completion-grid ────────────────────────────────────────────
 *
 * 7-cell binary grid showing the last week's completion state (one
 * dot per day). Green = done, today gets an outline ring. Used on
 * the home page's "this week" summary. */
.lp-completion-grid {
  display: inline-grid;
  grid-template-columns: repeat(7, 0.6rem);
  gap: 4px;
  align-items: center;
}
.lp-completion-grid__cell {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  background: var(--lp-border);
}
.lp-completion-grid__cell.is-done { background: #0ea5a0; }
.lp-completion-grid__cell.is-today { outline: 1.5px solid var(--lp-fg); outline-offset: 1px; }

/* ─── Layout utilities ──────────────────────────────────────────────
 *
 * .container = the canonical 720px reading column with safe-area
 * insets (mirrors the app's app/styles/utilities/_layout.scss).
 * .edge-wrap = inner section with --pad-x horizontal rhythm.
 * .screen   = full-height bg surface (for app-like screens). */
:root { --pad-x: 18px; --space-y: 12px; }

.lp-container {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.lp-edge-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--lp-bg);
  border-radius: 12px;
  padding: var(--pad-x);
  margin: var(--space-y) auto;
}
.lp-edge-wrap--flush {
  padding: 0;
  margin: 0;
  border-radius: 0;
}
.lp-screen {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  background-color: var(--lp-bg);
}

/* ─── /style page chrome — only used on /style/ itself ────────────── */
.style-block {
  margin: 3rem 0;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--lp-border);
}
.style-block:last-child { border-bottom: 0; }
.style-block-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.style-block-num {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lp-muted);
}
.style-block-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.005em;
  margin: 0;
}
.style-block-job {
  margin: 0 0 1.6rem;
  color: var(--lp-muted);
  font-style: italic;
}
.style-exhibit {
  margin: 1.4rem 0;
  padding: 1.2rem 0;
  border-top: 1px dashed var(--lp-border);
}
.style-exhibit-caption {
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--lp-muted);
}
.style-exhibit-caption code {
  background: var(--lp-accent-soft);
  padding: 0 0.3em;
  border-radius: 2px;
  font-size: 0.92em;
  font-family: ui-monospace, Menlo, monospace;
}
.style-note {
  background: var(--lp-accent-soft);
  border-left: 3px solid var(--lp-key);
  padding: 0.9rem 1.1rem;
  margin: 1.4rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
}
.style-token-grid {
  display: grid;
  grid-template-columns: 12rem 4rem 1fr;
  gap: 0.5rem 1rem;
  align-items: center;
  margin: 0.6rem 0 1rem;
  font-size: 0.92rem;
}
.style-token-swatch {
  display: block;
  width: 100%;
  height: 1.6rem;
  border: 1px solid var(--lp-border);
}
