/* HorseJournal Knowledge Hub — dressage arena module. Layered on styles.css +
   breeds.css + knowledge.css. Reuses the existing tokens (purple/cream/pink,
   DM Serif + Outfit, radii). Only the arena-diagram components live here; this
   is not a second design system. */

/* ---------- arena diagram wrapper ---------- */
.arena-diagram { margin: 14px 0 6px; }
.arena-svg {
  display: block; width: 100%; height: auto;
  max-width: 560px; margin: 0 auto;
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.arena-svg.is-wide { max-width: 760px; }
.arena-caption { text-align: center; color: var(--muted); font-size: .9rem; margin: 8px 0 0; }

/* two arenas side by side on a figure detail page */
.arena-pair {
  display: grid; gap: 20px; margin: 12px 0 4px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}
.arena-pair figure { margin: 0; }
.arena-pair figcaption {
  text-align: center; color: var(--purple-800); font-weight: 600;
  font-size: .95rem; margin: 8px 0 0;
}

/* ---------- SVG element styling (theme-driven, no baked colours) ---------- */
.arena-sand   { fill: var(--cream-200); }
.arena-rail   { fill: none; stroke: var(--purple-900); stroke-width: .35; }
.arena-inner  { fill: none; stroke: rgba(46,26,90,.16); stroke-width: .16; }
.arena-inner-dash { fill: none; stroke: rgba(46,26,90,.28); stroke-width: .16; stroke-dasharray: .9 .9; }
.arena-letter-tick { fill: none; stroke: var(--purple-700); stroke-width: .18; }
.arena-letter-dot  { fill: var(--purple-300, #b9a6e0); }
.arena-letter-text {
  fill: var(--purple-900); font-family: var(--font-sans, "Outfit", sans-serif);
  font-weight: 700; text-anchor: middle; dominant-baseline: central;
}
.arena-letter-center { fill: var(--purple-600, #6b4fb0); font-style: italic; }

/* highlighted ridden track of a figure */
.arena-track-line {
  fill: none; stroke: var(--pink-500, #e0679b);
  stroke-width: .55; stroke-linecap: round; stroke-linejoin: round;
}
.arena-track-fillnone { fill: none; }
.arena-point { fill: var(--pink-600, #c9407e); stroke: var(--cream-100); stroke-width: .12; }
.arena-arrow { fill: var(--pink-600, #c9407e); }

/* ---------- legend ---------- */
.arena-legend {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  margin: 10px 0 0; padding: 0; list-style: none;
  font-size: .86rem; color: var(--ink-soft);
}
.arena-legend li { display: inline-flex; align-items: center; gap: 7px; }
.arena-legend .swatch { width: 22px; height: 0; border-top: 3px solid var(--pink-500, #e0679b); border-radius: 2px; }
.arena-legend .swatch.dot { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--pink-600, #c9407e); }
.arena-legend .swatch.letter { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--purple-300, #b9a6e0); }

/* ---------- pure-CSS arena-size toggle on the hub ---------- */
.arena-toggle { display: flex; gap: 8px; justify-content: center; margin: 4px 0 10px; }
.arena-toggle label {
  cursor: pointer; border: 1px solid var(--line); background: var(--cream-100);
  color: var(--purple-800); border-radius: 999px; padding: 7px 16px;
  font-weight: 600; font-size: .95rem; transition: background var(--duration-base) var(--ease-out);
}
.arena-toggle label:hover { background: var(--pink-100); }
.arena-size-radio { position: absolute; opacity: 0; width: 0; height: 0; }
.arena-panel { display: none; }
/* radios sit just before .arena-toggle + panels inside .arena-switch */
#arena-sz-40:checked ~ .arena-toggle label[for="arena-sz-40"],
#arena-sz-60:checked ~ .arena-toggle label[for="arena-sz-60"] {
  background: var(--purple-700); color: #fff; border-color: var(--purple-700);
}
#arena-sz-40:checked ~ .arena-panels .arena-panel.for-40 { display: block; }
#arena-sz-60:checked ~ .arena-panels .arena-panel.for-60 { display: block; }

/* ---------- letter position table ---------- */
.arena-table-wrap { overflow-x: auto; margin: 14px 0 4px; }
table.arena-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.arena-table caption { text-align: left; color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
table.arena-table th, table.arena-table td {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line);
}
table.arena-table thead th { color: var(--purple-900); font-weight: 700; }
table.arena-table td.arena-code { font-weight: 700; color: var(--purple-800); }

/* ---------- letter card tile (big glyph) ---------- */
.arena-letter-tile {
  aspect-ratio: 4 / 3; display: grid; place-content: center;
  background: radial-gradient(120% 100% at 50% 40%, var(--cream-100) 0%, var(--cream-200) 45%, var(--purple-50) 100%);
}
.arena-letter-tile span {
  font-family: var(--font-serif); font-size: 3.2rem; color: var(--purple-800); line-height: 1;
}

/* highlighted letter on a detail-page arena */
.arena-letter-hl { fill: var(--pink-600, #c9407e); }
.arena-letter-texthl { fill: var(--pink-600, #c9407e); font-weight: 700; }

/* ---------- overview cards linking the three sub-pages ---------- */
.arena-nav-grid {
  list-style: none; padding: 0; margin: 6px 0 10px;
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

@media (max-width: 720px) {
  .arena-svg { max-width: 100%; }
}
