/* ============================================================
   rp-ui.css — Reading Portrait's shared design language.

   One container dialect, six components, one signature gesture.
   Pages opt in by linking this AFTER styles.css/mobile-overrides
   and using the .rp-* classes; nothing here reaches into pages
   uninvited (every selector is namespaced).

   The dialect:
   · Surface: warm paper page (--page) → white cards → ink hero
     (reserved for the reader's identity alone).
   · Type: Josefin small-caps for LABELS, Lato for prose; italics
     only where a human voice speaks (letters, notes) — never UI.
   · Signature: the gilt double-rule (borrowed from the clothbound
     cover placeholder) as the recurring section flourish, and the
     book cover as the interface's atom.
   ============================================================ */

/* ---------- Card — the one container ---------- */
.rp-card {
  background: #FFFFFF;
  border: 1px solid rgba(47, 42, 53, 0.12);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(47, 42, 53, 0.04);
  padding: 1.75rem;
}

.rp-card--lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.rp-card--lift:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 42, 53, 0.22);
  box-shadow: 0 8px 24px rgba(47, 42, 53, 0.08);
}

/* Antique variant — for prompts/asides that should sit BEHIND the
   white cards in visual priority, not compete with them. */
.rp-card--paper {
  background: var(--antique-white, #F0EAD8);
}

/* ---------- Eyebrow — the one label ---------- */
.rp-eyebrow {
  font-family: var(--font-primary, 'Josefin Sans', sans-serif);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blueberry, #2F2A35);
  opacity: 0.55;
}

/* Eyebrow row: label left, quiet action right. */
.rp-eyebrow-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

/* ---------- Flourish — the signature gilt double-rule ---------- */
.rp-flourish {
  width: 56px;
  height: 0;
  border: none;
  border-top: 3px double var(--lemon-tart, #f7e8ad);
  margin: 0.65rem auto 0.9rem;
}
.rp-flourish--left { margin-left: 0; margin-right: auto; }

/* ---------- Buttons — primary and quiet, nothing else ---------- */
.rp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-primary, 'Josefin Sans', sans-serif);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: var(--blueberry, #2F2A35);
  border: 1px solid var(--blueberry, #2F2A35);
  padding: 0.65rem 1.2rem;
  min-height: 36px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}
.rp-btn:hover { background: var(--eggplant, #4D303F); transform: translateY(-1px); }

.rp-btn--quiet {
  color: var(--blueberry, #2F2A35);
  background: transparent;
  border-color: rgba(47, 42, 53, 0.3);
}
.rp-btn--quiet:hover { background: rgba(47, 42, 53, 0.05); transform: none; }

.rp-btn:disabled { opacity: 0.55; cursor: default; transform: none; }

/* Arrow link — the quiet in-text action. */
.rp-arrow {
  font-family: var(--font-primary, 'Josefin Sans', sans-serif);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blueberry, #2F2A35);
  opacity: 0.8;
  text-decoration: none;
  border: none;
  border-bottom: 1px solid rgba(47, 42, 53, 0.35);
  padding: 0 0 1px;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.rp-arrow:hover { opacity: 1; }
.rp-arrow::after { content: ' \2192'; }

/* ---------- List row — hairline-separated content line ---------- */
.rp-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(47, 42, 53, 0.07);
}
.rp-row:last-child { border-bottom: none; }

/* ---------- Cover — the atom of the interface ---------- */
.rp-cover {
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 51px;
  border-radius: 1px 2px 2px 1px;
  overflow: hidden;
  background: var(--blueberry, #2F2A35);
  box-shadow: 0 1px 3px rgba(47, 42, 53, 0.25), inset 1px 0 0 rgba(255, 255, 255, 0.08);
}
.rp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-cover--md { width: 56px; height: 84px; }

/* Clothbound fallback when no jacket exists — ink board, gilt rules. */
.rp-cover-cloth {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #3A3442 0%, var(--blueberry, #2F2A35) 70%);
  border-top: 2px double var(--lemon-tart, #f7e8ad);
  border-bottom: 2px double var(--lemon-tart, #f7e8ad);
}

/* ---------- Chip — small status/category tag ---------- */
.rp-chip {
  display: inline-block;
  font-family: var(--font-primary, 'Josefin Sans', sans-serif);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(47, 42, 53, 0.08);
  color: var(--blueberry, #2F2A35);
}

/* ---------- Accessibility ---------- */
.rp-btn:focus-visible,
.rp-arrow:focus-visible,
.rp-card--lift:focus-visible {
  outline: 2px solid var(--almost-plum, #6F3841);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .rp-btn, .rp-card--lift, .rp-arrow { transition: none; }
  .rp-btn:hover, .rp-card--lift:hover { transform: none; }
}
