/* ---------------------------------------------------------------
   rapsheet.css — the fighter profile.

   Its own file rather than more weight in design2.css: this page has a
   lot of one-off layout and none of it is reused elsewhere.
   --------------------------------------------------------------- */

/* Hero: the feature image with the name and Morality standing on it,
   bottom left. Fixed aspect so a tall or short upload can't change the
   shape of the page. */
.rap-hero {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--elevated);
  /* The copy is absolutely positioned, so without this a missing image
     would collapse the box to nothing and the name would sit on air. */
  min-height: 9rem;
}
/* The image sets its own height rather than being cropped to a fixed band.
   object-fit:cover in a 21/7 frame was cutting the top off anyone standing
   upright in their feature art -- the whole point of the picture. */
.rap-hero-bg {
  display: block;
  width: 100%;
  height: auto;
}
/* Darkened from the bottom so the name stays readable whatever the image
   is doing behind it. */
.rap-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.35) 30%, transparent 62%);
}
/* The name floats over the foot of the image, wherever that now falls. */
.rap-hero-copy {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 1;
  padding: 1.5rem 1.75rem;
}
.rap-hero-copy h1 {
  margin: 0.4rem 0 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}
.rap-hero-align {
  display: inline-block;
  font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border: 1px solid currentColor; border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
}

@media (max-width: 700px) {
  .rap-hero-copy { padding: 1rem; }
}

.rap-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2rem;
  align-items: start;
}

/* No frame at all. The portrait is a transparent cut-out sitting on the
   page -- a border and a panel behind it only drew a box around nothing.
   Framed art keeps working here; it simply carries its own edges. */
.rap-portrait {
  position: relative;
}
.rap-portrait-fg { width: 100%; height: auto; display: block; position: relative; z-index: 1; }
/* A silhouette is a flat shape and shouldn't fill the frame edge to edge. */
.rap-portrait-fg.is-silhouette { padding: 2rem; opacity: 0.55; }

.rap-portrait.has-cutout .rap-portrait-fg {
  width: 100%; height: auto;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.75));
}

.rap-nickname {
  font-family: var(--display);
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem);
  letter-spacing: 0.03em;
  margin: 0 0 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
}
/* Stamps with no nickname beside them shouldn't reserve heading-sized space
   above the stats. */
.rap-nickname.is-stamps-only { font-size: 0; margin-bottom: 1rem; }
/* Held Dominions, stamped beside the name. */
.rap-stamp {
  font-family: var(--mono);
  font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #C9A227;
  border: 1px solid #C9A227;
  padding: 0.3rem 0.6rem;
  transform: rotate(-1.5deg);
}

.rap-stats {
  display: grid;
  /* FIXED at three columns rather than auto-fit: six stats then read as two
     even rows of three. auto-fit packed four onto a wide screen and left two
     stranded underneath. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem 1.5rem;
  margin: 0 0 1.75rem;
}
.rap-stats dt {
  font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.2rem;
}
.rap-stats dd { margin: 0; font-size: 1rem; line-height: 1.35; }

.rap-bio { line-height: 1.65; margin-bottom: 1.5rem; }
.rap-bio p:last-child { margin-bottom: 0; }

/* The redaction. A block of nothing -- the point is that something has
   been removed, so it carries no text at all. */
.rap-classified {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--muted); margin: 0 0 1.5rem;
}
/* The bar covers the text rather than replacing it, so revealing is a
   colour change with no reflow -- the line doesn't jump when clicked. */
.rap-redacted {
  display: inline-block;
  padding: 0 0.35rem;
  border: 0;
  border-radius: 1px;
  background: var(--paper, #EDE7DA);
  color: transparent;
  font: inherit;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.rap-redacted:hover { background: #fff; }
.rap-redacted:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rap-redacted.is-revealed {
  background: transparent;
  color: var(--fg);
  padding: 0;
  cursor: default;
  pointer-events: none;
}
/* Selecting the page shouldn't hand over the text of an unrevealed bar. */
.rap-redacted:not(.is-revealed) .rap-redacted-text { user-select: none; }

.rap-threat { margin-bottom: 1.75rem; }
.rap-threat .kicker { margin: 0 0 0.6rem; }
.rap-threat-row { display: flex; align-items: center; gap: 0.9rem; }
.rap-threat-label {
  font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); min-width: 5rem;
}
.rap-threat-bar {
  flex: 1; height: 0.45rem;
  background: var(--elevated); border-radius: 1px;
  overflow: hidden;
}
.rap-threat-bar > span {
  display: block; height: 100%;
  background: var(--paper, #EDE7DA);
}
.rap-threat-num { font-family: var(--mono); font-size: 0.8rem; min-width: 1.5rem; text-align: right; }

.rap-affil {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.rap-affil > div {
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface); padding: 0.9rem 1.1rem;
}
.rap-affil .kicker { margin: 0 0 0.3rem; }
.rap-affil-name { font-family: var(--display); font-size: 1.4rem; margin: 0; letter-spacing: 0.02em; }
.rap-affil-name a:not(.btn):not(.nav-link):not(.apply-link):not(.wordmark) { color: var(--fg); }
.rap-affil-name a:hover { color: var(--accent); }
.rap-affil-line { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.9rem; }

/* The Book keeps the board renderer, set apart by a rule rather than a
   panel so it reads as a continuation of the file. */
.rap-book {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.rap-book .kicker { margin: 0 0 1rem; }

/* The four histories, as drawers. Closed by default -- they're reference,
   not the point of the page. */
.rap-drawer {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  margin-bottom: 0.6rem;
}
.rap-drawer > summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  list-style: none;
}
.rap-drawer > summary::-webkit-details-marker { display: none; }
/* A caret, so a closed drawer plainly reads as openable. */
.rap-drawer > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.6rem;
  color: var(--accent);
  transition: transform 140ms ease;
}
.rap-drawer[open] > summary::before { transform: rotate(90deg); }
.rap-drawer > summary:hover { color: var(--fg); }
.rap-drawer[open] > summary { color: var(--fg); border-bottom: 1px solid var(--border); }
.rap-drawer-body { padding: 1rem 1.1rem 1.1rem; }

@media (max-width: 860px) {
  .rap-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .rap-portrait { max-width: 26rem; }
  /* Two rows of three is too tight below this; three rows of two reads
     better than squeezing the labels. */
  .rap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rap-affil { grid-template-columns: 1fr; }
}

/* ---- History tables inside the drawers ----
   board.css scopes all of this to .env-body, which these drawers are not
   inside -- so the tables were rendering completely unstyled: centred
   headings, red links, no row separation. Styled here for all four. */
.rap-drawer-body .history-scroll {
  max-height: 24rem;
  overflow-y: auto;
  /* Narrow screens scroll sideways rather than crushing the columns. */
  overflow-x: auto;
}
.rap-drawer-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.rap-drawer-body th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted);
  padding: 0 0.9rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  /* Headings stay put while the body scrolls under them. */
  position: sticky; top: 0;
  background: var(--surface);
}
.rap-drawer-body td {
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  vertical-align: top;
  line-height: 1.35;
}
.rap-drawer-body tr:last-child td { border-bottom: 0; }
/* A long promo title should take the slack; dates and results are short and
   shouldn't be broken across lines to make room for it. */
.rap-drawer-body td:first-child { width: 55%; }
.rap-drawer-body td:not(:first-child) { white-space: nowrap; }
/* The timeline is two columns, and its second one is prose -- it needs to
   wrap like the first. */
#board-timeline td:last-child { white-space: normal; width: auto; }
#board-timeline td:first-child { width: 9rem; }
/* The first column is the thing you're scanning for, so it carries the
   weight; everything after it is supporting detail. */
.rap-drawer-body td:first-child { color: var(--fg); }
.rap-drawer-body td:not(:first-child) { color: var(--muted); }
/* Links inherit the site-wide red otherwise, which on a dense table makes
   every row shout. */
.rap-drawer-body a:not(.btn):not(.nav-link):not(.apply-link):not(.wordmark) {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.rap-drawer-body a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.rap-drawer-body .empty { color: var(--muted); font-style: italic; margin: 0; }

.rap-drawer-body .history-pager {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 0 0;
}
.rap-drawer-body .history-pager button {
  border: 1px solid var(--border); background: var(--elevated); color: var(--fg);
  border-radius: 4px; padding: 0.3rem 0.7rem;
  font-family: var(--mono); font-size: 0.7rem; cursor: pointer;
}
.rap-drawer-body .history-pager button:hover { border-color: var(--accent); }
.rap-drawer-body .history-pager button[disabled] { opacity: 0.35; cursor: default; }
.rap-drawer-body .history-page-label {
  font-family: var(--mono); font-size: 0.7rem; color: var(--muted);
}

/* ---- Finishers and signatures ----
   Listed on the sheet rather than hidden behind a click: they're the first
   thing anyone writing a match against this character needs. */
.rap-moves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.25rem 1.75rem;
  margin: 0 0 1.75rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.rap-move-set .kicker { margin: 0 0 0.6rem; }
.rap-move { margin-bottom: 0.7rem; }
.rap-move:last-child { margin-bottom: 0; }
.rap-move-name {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
/* The finisher is the one that ends the fight, so it reads louder than the
   signatures listed beside it. */
.rap-move.is-finisher .rap-move-name { color: var(--accent); }
.rap-move-detail {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.15rem;
}

/* ---- The stamp ----
   Their catchphrase, bottom right of the feature image. Opposite corner to
   the name so the two never collide, however long either runs. */
.rap-hero-stamp {
  position: absolute;
  right: 1.5rem; bottom: 1.5rem;
  z-index: 1;
  margin: 0;
  max-width: 45%;
  text-align: right;
  font-family: var(--display);
  font-size: clamp(1rem, 0.7rem + 1vw, 1.5rem);
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  background: rgba(0, 0, 0, 0.55);
  padding: 0.6rem 1rem;
  /* Slightly askew, like something pressed on rather than typed. */
  transform: rotate(-1.5deg);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

@media (max-width: 700px) {
  /* Under the name rather than beside it -- side by side at this width
     leaves neither enough room to read. */
  .rap-hero-stamp {
    position: static;
    max-width: none; text-align: left;
    margin: 0.6rem 1rem 1rem;
    transform: none;
  }
}
