/* Prostagma? design-system patterns (`.ps-*`).

   Ported from the design system's patterns.css. Three deliberate
   differences from the upstream export:

   1. No `url()` anywhere. Production serves static assets through
      ProstagmaManifestStaticFilesStorage, which fails collectstatic on any
      CSS url() it cannot resolve. Upstream patterns that depend on assets
      the repo does not ship (`.ps-panel--woven` texture, `.ps-close`
      sprite) are omitted rather than shipped broken. Decorative images the
      designs do use — the section underline — are `<img>` tags in the
      template, where `{% static %}` can resolve them.

   2. `.ps-page` does not claim `min-height: 100vh`. It sits below the
      site header inside base.html, so a viewport-height floor would push
      every page taller than the viewport.

   3. Link colouring is scoped under `.ps-page` instead of a bare `a`
      selector, so this file cannot restyle links on pages that have not
      been migrated.

   Only the patterns the migrated stats screens actually use are ported.
   The upstream export also defines `--woven` / `--bracket` / `--plaque`
   panel shells, `.ps-facts`, `.ps-article`, `.ps-plate`, `.ps-index` and a
   full-bleed `.ps-hero`; port them here if and when a screen needs one.

   Requires ds_tokens.css (and therefore site_theme.css) to be loaded first. */

/* ---------- page shell ---------- */

.ps-page {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(36, 115, 126, 0.22), transparent 60%),
    var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.ps-page a {
  color: var(--text-gold);
  text-decoration: none;
}

.ps-page a:hover {
  color: var(--text-gold-strong);
}

/* The wrapper declares its own typography rather than inheriting it. Player
   Search nests this inside a legacy shell that sets a serif face, and a
   design-system region must look the same wherever it is mounted. */
.ps-wrap {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  padding: clamp(2rem, 3.4vw, 3.2rem) var(--page-gutter) 5rem;
  color: var(--text-primary);
  font-family: var(--font-body);
}

/* ---------- panel + band ---------- */

.ps-panel {
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 231, 158, 0.05), rgba(0, 0, 0, 0.1)),
    var(--surface-panel-strong);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 240, 200, 0.08);
}

.ps-band {
  padding: 0.62rem 0.9rem;
  background: rgba(20, 34, 58, 0.88);
  border-bottom: 2px solid var(--gold-300);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.1);
  color: var(--gold-100);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Engraved — the default table/panel shell across the stats screens. */

.ps-panel--engraved > .ps-band {
  display: flex;
  position: relative;
  align-items: center;
  gap: 0.7rem;
  padding: 0.66rem 0.9rem;
  background: linear-gradient(180deg, rgba(31, 50, 82, 0.95), rgba(16, 27, 46, 0.95));
  border-bottom: 1px solid var(--gold-600);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, 0.14),
    inset 0 -3px 0 rgba(232, 196, 111, 0.16);
  font-family: var(--font-title);
  font-size: 0.84rem;
  /* Baskervville SC's weight axis tops out at 700. */
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.ps-panel--engraved > .ps-band::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--gold-300);
  box-shadow: 0 0 8px rgba(232, 196, 111, 0.7);
  transform: rotate(45deg);
}

.ps-panel--engraved > .ps-band::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  left: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(232, 196, 111, 0.55) 12%,
    rgba(232, 196, 111, 0.55) 88%,
    transparent
  );
}

.ps-panel--engraved .ps-table th {
  background: rgba(10, 17, 32, 0.5);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.4), inset 0 -1px 0 rgba(255, 240, 200, 0.05);
  color: var(--gold-400);
}

.ps-panel--engraved .ps-table th + th {
  border-left: 1px solid rgba(213, 177, 101, 0.2);
}

/* ---------- chips ---------- */

.ps-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ps-chip {
  flex: none;
  padding: 0.34rem 0.78rem;
  border: 1px solid rgba(213, 177, 101, 0.45);
  border-radius: var(--radius-pill);
  background: rgba(20, 34, 58, 0.85);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-micro);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- data table ---------- */

.ps-table {
  width: 100%;
  border-collapse: collapse;
}

.ps-table th {
  padding: 0.55rem 0.75rem;
  background: rgba(20, 34, 58, 0.55);
  border-bottom: 1px solid rgba(213, 177, 101, 0.34);
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.ps-table td {
  padding: 0.58rem 0.75rem;
  border-bottom: 1px solid rgba(213, 177, 101, 0.14);
  color: rgba(246, 234, 208, 0.86);
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
  vertical-align: top;
}

.ps-table td:first-child {
  color: #fff6dd;
  font-weight: 700;
}

.ps-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

.ps-table tbody tr:last-child td {
  border-bottom: 0;
}

.ps-table tbody tr:hover td {
  background: rgba(255, 236, 176, 0.07);
}

/* ---------- page hero (plinth) ---------- */

.ps-phero {
  display: block;
  position: relative;
  padding: 7px;
  border-radius: 6px;
  background: linear-gradient(180deg, #e4c078, #a9761f 52%, #6d4611);
  box-shadow:
    0 26px 60px -20px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 251, 232, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.ps-phero-in {
  display: block;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(28, 46, 76, 0.95), rgba(10, 17, 32, 0.98));
  box-shadow:
    inset 0 2px 12px rgba(0, 0, 0, 0.85),
    inset 0 0 0 1px rgba(255, 236, 176, 0.16),
    inset 0 -20px 40px -20px rgba(0, 0, 0, 0.8);
}

.ps-phero-in::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 120% at 12% -10%, rgba(232, 196, 111, 0.13), transparent 60%),
    radial-gradient(70% 130% at 92% 0%, rgba(36, 115, 126, 0.2), transparent 64%);
  pointer-events: none;
}

.ps-phero-in::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 34%;
  background: linear-gradient(180deg, rgba(255, 244, 214, 0.07), transparent);
  pointer-events: none;
}

.ps-phero-body {
  position: relative;
  z-index: 1;
  padding: clamp(1.9rem, 3.4vw, 2.9rem) clamp(1.9rem, 3.4vw, 3rem) clamp(1.7rem, 2.6vw, 2.3rem);
}

.ps-phero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(1.6rem, 3vw, 3rem);
}

.ps-phero-eyebrow {
  color: var(--text-gold);
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: 800;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.ps-phero-title {
  margin: 0.35rem 0 0;
  color: #fff6dd;
  font-family: var(--font-title);
  font-size: clamp(2.6rem, 4.4vw, 3.9rem);
  letter-spacing: 0.015em;
  line-height: 0.94;
  text-shadow: 0 14px 34px rgba(0, 0, 0, 0.65);
}

/* The repo's Header_Underline asset is a 2px-tall strip that site_theme.css
   stretches to 7px via background-size. As an <img> it would render at its
   natural aspect -- a 1px hairline -- so the height is set explicitly. */
/* Clan Detail's title carries a bracketed tag plus a full clan name, so the
   supplied reference steps the same face down one size rather than wrapping. */
.ps-phero-title--compact {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
}

.ps-phero-underline {
  display: block;
  width: 290px;
  height: 7px;
  max-width: 56%;
  margin: 0.5rem 0 0.1rem;
  opacity: 0.85;
}

.ps-phero-lede {
  margin: 0.5rem 0 0;
  max-width: 60ch;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  line-height: 1.4;
  text-wrap: pretty;
}

/* Clan Detail uses the lede as a status line ("Invite Only . Active . Roster
   updated Aug 26"), which the reference sets a step below the reading lede. */
.ps-phero-lede--compact {
  font-size: 1rem;
}

.ps-phero-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.4rem;
  padding-top: 1.15rem;
  border-top: 2px solid rgba(213, 177, 101, 0.4);
}

.ps-phero-tab {
  padding: 0.5rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ps-phero-tab span {
  margin-left: 0.4rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 400;
}

.ps-phero-tab:hover {
  color: var(--text-gold-strong);
}

.ps-phero-tab[aria-current] {
  border-color: var(--gold-400);
  background: linear-gradient(180deg, rgba(31, 50, 82, 0.9), rgba(14, 24, 42, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.16), 0 2px 10px rgba(0, 0, 0, 0.5);
  color: var(--gold-100);
}

/* ---------- section rule heading ---------- */

.ps-rule-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.ps-rule-head h2,
.ps-rule-head h3 {
  flex: none;
  margin: 0;
  color: #fff2d2;
  font-family: var(--font-title);
  font-size: 1.32rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ps-rule-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(213, 177, 101, 0.45), rgba(213, 177, 101, 0.06));
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .ps-phero-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
