/* dist/rugbyanimator/app/play.css
   Public play pages (/rugbyanimator/plays/...). Layered on top of session.css,
   which already defines the "Deep Pitch" tokens (--canvas, --surface, --green,
   …) — this file adds only the chrome those pages need and reuses those tokens
   rather than introducing a second palette. */

/* ---- Archivo, the display face ----
   Self-hosted to match how the homepage ships Space Grotesk and Market Maker
   ships Inter/JetBrains Mono/Saira Condensed — same origin, no third party on
   a page whose job is a fast first paint for crawlers.

   Weight axis only. The width axis doubles the file (88KB vs 35KB for latin)
   and nothing here uses it. latin-ext is declared but its unicode-range means
   a browser only fetches it if a play title actually contains one of those
   characters — today none do, so it costs nothing to have ready. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ball: #F2C53D;
  /* Display only. Body copy, the player UI and every numeral stay on the
     system stack that session.css sets — Archivo is a display face and reading
     text is not its job. */
  --font-display: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* The four places it applies, and nowhere else. */
.ra-wordmark,
.ra-h1,
.ra-more h2,
.ra-catsection h2,
.ra-tile-title { font-family: var(--font-display); }

.ra-body { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- shared site header ---- */
.ra-sitehead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.ra-wordmark {
  color: var(--textPrimary); text-decoration: none;
  font-weight: 700; font-size: 16px; letter-spacing: .02em; text-transform: uppercase;
}
.ra-sitenav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ra-sitenav a { color: var(--textDim); text-decoration: none; font-size: 14px; font-weight: 500; }
.ra-sitenav a:hover { color: var(--textPrimary); }
.ra-sitenav a[aria-current="page"] { color: var(--green); }
.ra-cta-sm {
  background: var(--green); color: var(--onGreen) !important;
  padding: 7px 14px; border-radius: 999px; font-weight: 700 !important;
}

/* ---- page shell ---- */
/* 1120px, the width the product pages use. At 680px a desktop showed two
   library tiles per row and a phone-sized player in a sea of green. */
.ra-page { max-width: 1120px; margin: 0 auto; padding: 22px 18px 48px; width: 100%; flex: 1; box-sizing: border-box; }
/* Running text stays at a readable measure inside the wider page. */
.ra-desc, .ra-catblurb { max-width: 68ch; }

.ra-crumbs { font-size: 13px; color: var(--textFaint); margin-bottom: 14px; line-height: 1.6; }
.ra-crumbs a { color: var(--textDim); text-decoration: none; }
.ra-crumbs a:hover { color: var(--textPrimary); text-decoration: underline; }
.ra-crumbs .ra-sep { margin: 0 7px; opacity: 0.55; }

.ra-h1 { font-size: 30px; line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.02em; }
.ra-desc { color: var(--textDim); font-size: 16px; line-height: 1.6; margin: 18px 0 0; }

/* ---- a play: title, player, then the words ----
   Phones keep that order in one column. From 900px the player takes the left
   and grows with the window (play.js), and the title and words sit beside it. */
.ra-playhero { display: grid; grid-template-areas: "title" "player" "info"; }
.ra-playhero > .ra-h1 { grid-area: title; }
.ra-playhero > .ra-playermount { grid-area: player; }
.ra-playhero > .ra-playinfo { grid-area: info; }
@media (min-width: 900px) {
  .ra-playhero {
    grid-template-columns: minmax(0, 1fr) 340px; column-gap: 40px;
    grid-template-rows: auto 1fr; grid-template-areas: "player title" "player info";
    align-items: start;
  }
  .ra-playhero > .ra-h1 { font-size: 36px; margin-top: 4px; }
  .ra-playinfo .ra-desc { margin-top: 0; }
}

/* ---- the animation ---- */
.ra-playermount {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; min-height: 200px;
}
.ra-loading-msg { color: var(--textFaint); text-align: center; padding: 72px 16px; margin: 0; font-size: 14px; }
.ra-playerfail { padding: 20px; color: var(--textDim); font-size: 14px; }

/* ---- a Pro play: opening positions behind a lock ----
   The lock is a strip under the diagram, not laid over it: an overlay hid the
   ball at a lineout, and the setup is the one thing this page still shows. */
.ra-playlocked .ra-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 640px; }
.ra-lockpanel {
  padding: 14px 16px;
  background: var(--surface); border-top: 1px solid var(--line);
}
.ra-lockpanel-tag {
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--ball, #F2C53D);
}
.ra-lockpanel p { margin: 4px 0 0; color: var(--textPrimary); font-size: 14px; line-height: 1.4; }

/* ---- chips ---- */
.ra-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ra-chip {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface2); color: var(--textDim);
  border: 1px solid var(--line); text-decoration: none;
}
a.ra-chip:hover { color: var(--textPrimary); border-color: var(--lineStrong); }
.ra-chip-cat { color: var(--textPrimary); }
.ra-chip-free { color: var(--green); border-color: rgba(91, 208, 138, 0.4); }
.ra-chip-pro { color: var(--textDim); } /* textFaint is 3.8:1 on the chip; textDim is 4.6 */

/* ---- calls to action ---- */
.ra-ctarow { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.ra-btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px;
  border-radius: 999px; font-size: 15px; font-weight: 700;
  text-decoration: none; box-sizing: border-box;
}
.ra-btn-primary { background: var(--green); color: var(--onGreen); }
.ra-btn-ghost { color: var(--textPrimary); border: 1px solid var(--lineStrong); }
.ra-btn:focus-visible, .ra-sitenav a:focus-visible, .ra-crumbs a:focus-visible {
  outline: 2px solid var(--green); outline-offset: 3px;
}

/* ---- search + category tabs ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ra-filterbar { margin: 26px 0 4px; }
.ra-searchwrap { display: block; max-width: 520px; }
.ra-search {
  width: 100%; box-sizing: border-box;
  background: var(--surface2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--textPrimary); font: inherit; font-size: 15px;
  padding: 12px 18px; -webkit-appearance: none; appearance: none;
}
.ra-search::placeholder { color: var(--textFaint); }
.ra-search:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(91, 208, 138, 0.18);
}
.ra-search::-webkit-search-cancel-button { filter: invert(0.7); }

.ra-tabs {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
}
.ra-tab {
  position: relative; padding: 8px 1px 11px;
  color: var(--textDim); text-decoration: none;
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
}
.ra-tab:hover { color: var(--textPrimary); }
.ra-tab.is-active { color: var(--textPrimary); }
.ra-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--green); border-radius: 2px;
}
.ra-tab:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }

.ra-searchcount {
  margin: 12px 0 0; color: var(--textFaint); font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ra-searchempty {
  margin: 22px 0 0; padding: 20px; text-align: center;
  color: var(--textDim); font-size: 14.5px;
  background: var(--surface); border: 1px dashed var(--lineStrong); border-radius: var(--radius);
}

/* ---- play lists ---- */
.ra-more, .ra-catsection { margin-top: 34px; }
.ra-more h2, .ra-catsection h2 { font-size: 18px; margin: 0 0 12px; }
.ra-catsection h2 a { color: var(--textPrimary); text-decoration: none; }
.ra-catsection h2 a:hover { text-decoration: underline; }
.ra-count {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; color: var(--textFaint); font-weight: 400; margin-left: 6px;
}
.ra-catblurb { color: var(--textDim); font-size: 14px; line-height: 1.55; margin: 0 0 14px; }

.ra-othercats { margin-top: 40px; }
.ra-othercats h2 { font-size: 15px; margin: 0 0 10px; color: var(--textDim); }
.ra-othercats a { margin-right: 8px; }

/* ---- footer ---- */
.ra-pagefoot {
  border-top: 1px solid var(--line); margin-top: auto;
  padding: 20px 18px; display: flex; flex-wrap: wrap; gap: 18px;
  justify-content: center; background: var(--surface);
}
.ra-pagefoot a { color: var(--textDim); text-decoration: none; font-size: 13px; }
.ra-pagefoot a:hover { color: var(--textPrimary); }

@media (max-width: 520px) {
  .ra-h1 { font-size: 25px; }
  .ra-sitehead { padding: 12px 14px; }
  .ra-sitenav { gap: 14px; }
  .ra-btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
