/* exora.fm — the only stylesheet for the catalog and document pages.
 *
 * It spends tokens.css and names nothing of its own: every colour, size, weight
 * and metric below is a var() extracted from the app's own DesignSystem source,
 * so token drift between the app and the site is impossible by construction.
 * A literal hex or px here would be a bug.
 *
 * Idioms are transcribed from design-guide.md, which governs both renderers:
 *   - the rule pair (3px ink, 2px gap, 1px oxblood) under page titles ONLY;
 *   - covers on a white mat with an oxblood offset down-right, both rendered
 *     as box-shadow so they sit BEHIND the artwork — never an overlay across
 *     it (§ Artwork, and the reason that rule is written down);
 *   - one row style everywhere;
 *   - no text-transform anywhere, ever;
 *   - light only. No dark theme in Phase 1: a second theme is a second design.
 */

/* ---------------------------------------------------------------- page */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--type-body-size);
  font-weight: var(--type-body-weight);
  line-height: 1.5;
}

/* 640px is the only literal metric in this file and the only one that may be:
 * it is the measure of a text column on a desktop browser, which the app — a
 * phone-width surface — has no opinion about and therefore no token for. Every
 * other number and colour below comes from tokens.css. */
.masthead,
.page,
.footer {
  max-width: 640px;
  margin: 0 auto;
  padding-left: var(--margin);
  padding-right: var(--margin);
}

.masthead {
  padding-top: var(--margin);
  padding-bottom: var(--margin);
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--type-track-title-size);
  font-weight: var(--type-screen-title-weight);
  color: var(--ink);
  text-decoration: none;
}

a {
  color: var(--oxblood);
}

a:focus-visible,
.row-link:focus-visible {
  outline: var(--rule-thin) solid var(--oxblood);
  outline-offset: var(--rule-gap);
}

/* ---------------------------------------------------------------- titles */
.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--type-screen-title-size);
  font-weight: var(--type-screen-title-weight);
  line-height: 1.2;
}

/* The rule pair. The relationship between the two weights IS the identity —
 * 3px ink, 2px of ground, 1px oxblood. The oxblood line is a ::after on the ink
 * rule rather than a second element so the pair cannot be separated by an edit
 * to the markup. Under page titles only; nowhere else in the system. */
.rule-pair {
  position: relative;
  height: var(--rule-thick);
  margin-top: var(--row-vertical-padding);
  margin-bottom: calc(var(--rule-gap) + var(--rule-thin) + var(--row-vertical-padding));
  background: var(--ink);
}

.rule-pair::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + var(--rule-gap));
  height: var(--rule-thin);
  background: var(--oxblood);
}

.section-title {
  margin: calc(var(--margin) * 1.5) 0 var(--row-vertical-padding);
  font-family: var(--font-display);
  font-size: var(--type-track-title-size);
  font-weight: var(--type-screen-title-weight);
}

/* ---------------------------------------------------------------- covers */
/* The mat is a spread shadow and the offset is a displaced shadow of the same
 * outer size, so the oxblood shows as an even keyline down and right of the
 * mat. Both render behind the image: nothing crosses the artwork's edge. The
 * padding reserves the room the two shadows need so neither is clipped. */
.cover {
  margin: 0 0 var(--art-text-gap);
}

.cover-hero {
  padding: var(--hero-mat) calc(var(--hero-mat) + var(--hero-offset))
           calc(var(--hero-mat) + var(--hero-offset)) var(--hero-mat);
}

.cover-hero img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 0 0 var(--hero-mat) var(--mat),
              var(--hero-offset) var(--hero-offset) 0 var(--hero-mat) var(--oxblood);
}

/* ---------------------------------------------------------------- rows */
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  border-bottom: var(--rule-thin) solid var(--hairline);
}

.row-link {
  display: flex;
  align-items: center;
  gap: var(--art-text-gap);
  min-height: var(--row-height);
  padding: var(--row-vertical-padding) 0;
  color: var(--ink);
  text-decoration: none;
}

.row-plain .row-link {
  min-height: auto;
}

.row-cover {
  flex: 0 0 auto;
  padding: var(--list-mat) calc(var(--list-mat) + var(--list-offset))
           calc(var(--list-mat) + var(--list-offset)) var(--list-mat);
}

.row-cover img {
  display: block;
  width: var(--list-cover);
  height: var(--list-cover);
  box-shadow: 0 0 0 var(--list-mat) var(--mat),
              var(--list-offset) var(--list-offset) 0 var(--list-mat) var(--oxblood);
}

/* min-width:0 lets the stack shrink inside the flex row; without it the
 * ellipsis never triggers. Both children are display:block for the same reason
 * — text-overflow is silently ignored on an inline span. */
.row-text {
  flex: 1 1 auto;
  min-width: 0;
}

.row-title,
.row-secondary {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row-title {
  font-family: var(--font-display);
  font-size: var(--type-track-title-size);
  font-weight: var(--type-track-title-weight);
}

.row-secondary {
  color: var(--muted);
  font-size: var(--type-secondary-size);
  font-weight: var(--type-secondary-weight);
}

.row-data {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--type-data-size);
  font-weight: var(--type-data-weight);
}

/* ---------------------------------------------------------------- detail */
.detail-artist,
.detail-album {
  margin: 0 0 var(--data-block-gap);
  font-size: var(--type-secondary-size);
}

.detail-album {
  color: var(--muted);
}

.bio,
.lede {
  font-size: var(--type-body-size);
}

.preview {
  display: block;
  width: 100%;
  margin: var(--margin) 0 var(--data-block-gap);
}

.preview-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--type-small-label-size);
  font-weight: var(--type-small-label-weight);
}

/* Data block — mono, label left, value right, divider above (§ Structure). */
.data-block {
  margin: var(--margin) 0 0;
  padding-top: var(--data-block-gap);
  border-top: var(--rule-thin) solid var(--hairline2);
  font-family: var(--font-mono);
  font-size: var(--type-data-size);
  font-weight: var(--type-data-weight);
}

.data-row {
  display: flex;
  justify-content: space-between;
  gap: var(--art-text-gap);
  padding-bottom: var(--data-block-gap);
}

.data-row dt {
  color: var(--muted);
}

.data-row dd {
  margin: 0;
}

/* ---------------------------------------------------------------- cta */
/* The app has no button, so this is the site's one invention — and it is built
 * only from idioms that already exist: an ink hairline box, oxblood text, and
 * the same offset keyline the covers wear. */
.cta-wrap {
  margin: var(--margin) 0;
}

.cta {
  display: inline-block;
  padding: var(--row-vertical-padding) var(--margin);
  border: var(--rule-thin) solid var(--ink);
  box-shadow: var(--list-offset) var(--list-offset) 0 0 var(--oxblood);
  color: var(--oxblood);
  font-family: var(--font-display);
  font-size: var(--type-track-title-size);
  font-weight: var(--type-track-title-weight);
  text-decoration: none;
}

/* ---------------------------------------------------------------- documents */
.doc h2,
.doc h3 {
  margin: calc(var(--margin) * 1.5) 0 var(--row-vertical-padding);
  font-family: var(--font-display);
  font-size: var(--type-track-title-size);
  font-weight: var(--type-screen-title-weight);
}

.doc h3 {
  font-size: var(--type-secondary-size);
}

.doc ul {
  margin: 0 0 var(--margin);
  padding-left: var(--margin);
}

.doc code {
  font-family: var(--font-mono);
  font-size: var(--type-data-size);
}

.doc hr {
  height: var(--rule-thin);
  margin: var(--margin) 0;
  border: 0;
  background: var(--hairline2);
}

/* ---------------------------------------------------------------- footer */
.footer {
  margin-top: calc(var(--margin) * 2);
  padding-top: var(--row-vertical-padding);
  padding-bottom: calc(var(--margin) * 2);
  border-top: var(--rule-thin) solid var(--hairline);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--type-small-label-size);
  font-weight: var(--type-small-label-weight);
}

.footer p {
  margin: 0 0 var(--data-block-gap);
}
