/* Robin of Loxley: shared components, v2.
   Plain CSS on top of tokens.css, so a Jinja template, a static page and a
   React app use the same class names. Load tokens.css first.
   Markup for each piece is in brand/DESIGN.md under Components.

   Everything is prefixed rol- and has one class per element, so it can sit
   beside an app's own CSS (Tailwind included) without fighting it. Each
   piece sets its own box-sizing, so it works without a global reset. */

.rol-container, .rol-btn, .rol-input, .rol-card, .rol-surface, .rol-tag,
.rol-header__menu-panel, .rol-header__menu > summary { box-sizing: border-box; }

/* ---- Base (opt in with class="rol" on <body>) ---------------------------- */

.rol {
  margin: 0;
  background: var(--rol-parchment);
  color: var(--rol-ink);
  font-family: var(--rol-font-body);
  font-size: var(--rol-text-body);
  line-height: var(--rol-leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.rol ::selection { background: var(--rol-straw); color: var(--rol-ink); }
.rol :focus-visible { outline: var(--rol-focus); outline-offset: 2px; }

/* ---- Layout -------------------------------------------------------------- */

.rol-container {
  width: 100%;
  max-width: calc(var(--rol-container) + 2 * var(--rol-gutter));
  margin-inline: auto;
  padding-inline: var(--rol-gutter);
}
.rol-section { padding-block: var(--rol-section); }
.rol-prose { max-width: var(--rol-measure); }

/* ---- Type ---------------------------------------------------------------- */

.rol-h1, .rol-h2, .rol-h3 {
  font-family: var(--rol-font-display);
  font-weight: 400;
  line-height: var(--rol-leading-display);
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
.rol-h1 { font-size: var(--rol-text-h1); }
.rol-h2 { font-size: var(--rol-text-h2); }
.rol-h3 { font-size: var(--rol-text-h3); letter-spacing: 0; }
.rol-lede { font-size: var(--rol-text-lede); color: var(--rol-ink-soft); max-width: 60ch; text-wrap: pretty; }
.rol-small { font-size: var(--rol-text-small); color: var(--rol-ink-faint); }

/* Small capitals, for table heads and data labels. Never above a heading. */
.rol-label {
  font-size: var(--rol-text-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rol-link {
  color: var(--rol-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--rol-dur-press) ease;
}
.rol-link:hover { color: var(--rol-accent-hover); text-decoration-thickness: 2px; }

/* ---- Buttons ------------------------------------------------------------- */

.rol-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rol-space-2);
  min-height: var(--rol-control-h);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--rol-radius);
  font-family: var(--rol-font-body);
  font-size: var(--rol-text-body);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--rol-dur-press) var(--rol-ease-out),
    background-color var(--rol-dur-press) ease,
    border-color var(--rol-dur-press) ease,
    color var(--rol-dur-press) ease;
}
.rol-btn:active { transform: scale(0.97); }
.rol-btn:focus-visible { outline: var(--rol-focus); outline-offset: 2px; }
.rol-btn[disabled], .rol-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Primary: the app's accent. */
.rol-btn--primary { background: var(--rol-accent); color: var(--rol-on-accent); }
.rol-btn--primary:hover { background: var(--rol-accent-hover); }
/* Secondary: an outline in ink. */
.rol-btn--secondary { background: transparent; color: var(--rol-ink); border-color: var(--rol-line-strong); }
.rol-btn--secondary:hover { background: var(--rol-accent-soft); border-color: var(--rol-ink); }
/* Go: scarlet, for the single most important action on a screen. One per screen. */
.rol-btn--go { background: var(--rol-scarlet); color: var(--rol-on-scarlet); }
.rol-btn--go:hover { background: color-mix(in oklab, var(--rol-scarlet) 85%, var(--rol-ink)); }
/* On the dark band: gold with Sherwood text, or an outline in band text. */
.rol-btn--gold { background: var(--rol-gold); color: #10261A; }
.rol-btn--gold:hover { background: color-mix(in oklab, var(--rol-gold) 85%, #FCF9F2); }
.rol-btn--band { background: transparent; color: var(--rol-band-text); border-color: rgba(245, 239, 225, 0.5); }
.rol-btn--band:hover { border-color: var(--rol-band-text); }
/* Small: dense app screens only (toolbars, table rows). Not for marketing pages. */
.rol-btn--sm { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }

/* ---- Forms --------------------------------------------------------------- */

.rol-field { display: grid; gap: 6px; }
.rol-field__label { font-size: 0.875rem; font-weight: 600; color: var(--rol-ink); }
.rol-field__hint { font-size: var(--rol-text-small); color: var(--rol-ink-faint); }
.rol-field__error { font-size: var(--rol-text-small); color: var(--rol-scarlet); font-weight: 600; }
.rol-input {
  width: 100%;
  min-height: var(--rol-control-h);
  padding: 10px 12px;
  border: 1px solid var(--rol-line-strong);
  border-radius: var(--rol-radius);
  background: var(--rol-linen);
  color: var(--rol-ink);
  font: inherit;
  font-size: var(--rol-text-body);   /* 16px keeps iOS from zooming on focus */
  transition: border-color var(--rol-dur-press) ease, box-shadow var(--rol-dur-press) ease;
}
.rol-input::placeholder { color: var(--rol-ink-faint); }
.rol-input:hover { border-color: var(--rol-ink-soft); }
.rol-input:focus { outline: none; border-color: var(--rol-accent); box-shadow: 0 0 0 2px var(--rol-accent); }
.rol-input[aria-invalid="true"] { border-color: var(--rol-scarlet); }

/* ---- Surfaces ------------------------------------------------------------ */

/* A card: linen, a hairline, 6px corners, no shadow. Never a card inside a card. */
.rol-card {
  background: var(--rol-linen);
  border: 1px solid var(--rol-line);
  border-radius: var(--rol-radius-lg);
  padding: var(--rol-space-5);
}
/* The one important surface per page (pricing, the comparison): the ink rule
   and the woodcut shadow. Once per page. */
.rol-surface {
  background: var(--rol-linen);
  border: var(--rol-rule);
  border-radius: var(--rol-radius-lg);
  box-shadow: var(--rol-shadow);
}
/* A status tag: moss fill, accent text. */
.rol-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--rol-moss);
  color: var(--rol-lincoln);
  font-size: var(--rol-text-small);
  font-weight: 700;
}

/* The woodcut band: near-black, at the top of a page, once. Add
   rol-band--quiver for the quiver photograph fading in on the right. */
.rol-band { background-color: var(--rol-band); color: var(--rol-band-text); }
.rol-band .rol-lede { color: var(--rol-band-soft); }
.rol-band--quiver {
  background-image:
    linear-gradient(90deg, var(--rol-band) 38%, rgba(23, 32, 26, 0.55) 70%, rgba(23, 32, 26, 0.2)),
    image-set(url('quiver.webp') type('image/webp'), url('quiver.jpg') type('image/jpeg'));
  background-repeat: no-repeat;
  background-size: cover;
  background-position: right center;
}
@media (max-width: 720px) {
  .rol-band--quiver { background-image: linear-gradient(var(--rol-band), var(--rol-band)); }
}

/* ---- Tables -------------------------------------------------------------- */

.rol-table-wrap { overflow-x: auto; }
.rol-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rol-table th, .rol-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rol-line); }
.rol-table thead th {
  background: var(--rol-band);
  color: var(--rol-band-text);
  font-size: var(--rol-text-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rol-table tbody tr:last-child td { border-bottom: 0; }

/* ---- Prices: always a pair ----------------------------------------------- */

.rol-price { display: grid; gap: var(--rol-space-1); }
.rol-price__them { color: var(--rol-ink-soft); }
.rol-price__them s, .rol-price__them del {
  color: var(--rol-ink);
  font-weight: 600;
  text-decoration-color: var(--rol-scarlet);
  text-decoration-thickness: 2px;
}
.rol-price__us {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--rol-font-display);
  font-size: var(--rol-text-h3);
  line-height: 1.1;
  color: var(--rol-accent);
}
.rol-price__source { font-size: var(--rol-text-small); color: var(--rol-ink-faint); }
/* The target dot: gold centre, scarlet ring. Before our price, nowhere else. */
.rol-dot {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: var(--rol-radius-pill);
  background: var(--rol-gold);
  box-shadow: 0 0 0 3px var(--rol-scarlet);
}

/* ---- Header -------------------------------------------------------------- */

.rol-header { border-bottom: 1px solid var(--rol-line); background: var(--rol-parchment); color: var(--rol-ink); }
.rol-header--band { background: var(--rol-band); color: var(--rol-band-text); border-bottom-color: transparent; }
.rol-header__inner {
  display: flex;
  align-items: center;
  gap: var(--rol-space-5);
  min-height: var(--rol-header-h);
}
.rol-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-family: var(--rol-font-display);
  font-size: 1.375rem;
  line-height: 1;
  white-space: nowrap;
}
.rol-header__brand img, .rol-header__brand svg { width: 28px; height: 28px; flex: none; }
.rol-header__nav { display: flex; align-items: center; gap: var(--rol-space-5); margin-left: auto; }
.rol-header__nav a {
  color: var(--rol-ink-soft);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--rol-dur-press) ease;
}
.rol-header__nav a:hover, .rol-header__nav a[aria-current="page"] { color: var(--rol-ink); }
.rol-header--band .rol-header__nav a { color: var(--rol-band-soft); }
.rol-header--band .rol-header__nav a:hover,
.rol-header--band .rol-header__nav a[aria-current="page"] { color: var(--rol-band-text); }
.rol-header__actions { display: flex; align-items: center; gap: var(--rol-space-3); }
.rol-header__brand + .rol-header__actions { margin-left: auto; }   /* no nav: push actions right */

/* Phone: the nav folds into a <details> menu. No script needed. */
.rol-header__menu { display: none; position: relative; }
.rol-header__menu > summary {
  list-style: none;
  display: inline-grid;
  place-items: center;
  width: var(--rol-control-h);
  height: var(--rol-control-h);
  border-radius: var(--rol-radius);
  cursor: pointer;
}
.rol-header__menu > summary::-webkit-details-marker { display: none; }
.rol-header__menu > summary svg { width: 22px; height: 22px; }
.rol-header__menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  display: grid;
  padding: var(--rol-space-2);
  background: var(--rol-linen);
  color: var(--rol-ink);
  border: 1px solid var(--rol-line-strong);
  border-radius: var(--rol-radius-lg);
  z-index: 20;
  transform-origin: top right;
  animation: rol-pop var(--rol-dur-ui) var(--rol-ease-out);
}
.rol-header__menu-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--rol-radius);
  color: var(--rol-ink);
  text-decoration: none;
  font-weight: 500;
}
.rol-header__menu-panel a:hover { background: var(--rol-accent-soft); }
@keyframes rol-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .rol-header__inner { gap: var(--rol-space-3); }
  .rol-header__nav { display: none; }
  .rol-header__actions { margin-left: auto; gap: var(--rol-space-2); }
  .rol-header__menu { display: block; }
  .rol-header__actions .rol-btn { min-height: 40px; padding: 0 14px; }
  .rol-header__actions .rol-header__secondary { display: none; }   /* e.g. Sign in: it moves into the menu */
}

/* ---- Footer -------------------------------------------------------------- */

.rol-footer {
  border-top: 1px solid var(--rol-line-strong);
  padding-block: var(--rol-space-8) var(--rol-space-7);
  color: var(--rol-ink-soft);
  font-size: 0.9375rem;
}
.rol-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--rol-space-6); }
.rol-footer__cols h2, .rol-footer__cols h3 { font-family: var(--rol-font-body); font-size: 0.9375rem; font-weight: 700; color: var(--rol-ink); margin: 0 0 var(--rol-space-3); }
.rol-footer__cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--rol-space-2); }
.rol-footer a { color: inherit; text-decoration: none; }
.rol-footer a:hover { color: var(--rol-ink); text-decoration: underline; text-underline-offset: 3px; }
.rol-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--rol-space-4);
  margin-top: var(--rol-space-7);
  padding-top: var(--rol-space-5);
  border-top: 1px solid var(--rol-line);
  font-size: var(--rol-text-small);
  color: var(--rol-ink-faint);
}
.rol-footer__legal p { margin: 0; max-width: 72ch; }

/* The family badge. Use <picture> so dark mode gets the reversed file. */
.rol-badge { display: inline-flex; flex: none; border-radius: 20px; }
.rol-badge img { display: block; width: 164px; height: 40px; }

@media (prefers-reduced-motion: reduce) {
  .rol-btn:active { transform: none; }
  .rol-header__menu-panel { animation: none; }
}
