/* The public pages. Loaded after site.css and scoped to body.public, so the editor and admin pages are not affected. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/SchibstedGrotesk-VF.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

body.public {
  /* The palette is the target face: gold, red, blue, black and white, on cool paper. */
  --paper: #f2f5f9;
  --surface: #ffffff;
  --ink: #0f2742;
  --muted: #4d6077;
  --line: #d3dce7;
  --control: #71849b;      /* borders of form controls: 3:1 against the page */
  --gold-edge: #a87f00;
  --link: #14609f;
  --focus: #1b78c4;
  --gold: #f2b900;
  --red: #d8382c;
  --blue: #1b78c4;
  --black: #1a1c20;
  --ring-white: #ffffff;
  --ring-stroke: rgba(15, 39, 66, .3);

  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: clip;
}

@media (prefers-color-scheme: dark) {
  body.public {
    --paper: #0b1625;
    --surface: #112033;
    --ink: #e6edf5;
    --muted: #9db0c5;
    --line: #263a50;
    --control: #5d7691;
    --gold-edge: #f2b900;
    --link: #82bef4;
    --focus: #82bef4;
    --ring-white: #d6dee9;
    --ring-stroke: rgba(0, 0, 0, .35);
  }
}

body.public a { color: var(--link); }
body.public :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap.wide { max-width: 72rem; padding: 0 1.25rem; }

/* ---- header and footer ---- */
.masthead { border-bottom: 1px solid var(--line); }
.masthead .wrap { padding-top: .8rem; padding-bottom: .8rem; }
.wordmark {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 700; letter-spacing: -.01em; color: var(--ink); text-decoration: none;
}
body.public .wordmark { color: var(--ink); }
.wordmark-mark { width: 1.6rem; height: 1.6rem; display: block; }
.wordmark-mark .target { width: 100%; height: 100%; display: block; }

.colophon {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 4rem; padding-top: 1.5rem; padding-bottom: 2.5rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem;
}
.colophon p { margin: 0; }

/* ---- the target (the one picture on the page) ---- */
.target .ring { stroke: var(--ring-stroke); stroke-width: .6; }
.target .white { fill: var(--ring-white); }
.target .black { fill: var(--black); stroke: rgba(255, 255, 255, .4); }
.target .blue { fill: var(--blue); }
.target .red { fill: var(--red); }
.target .gold { fill: var(--gold); }

/* ---- hero ---- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 2rem; align-items: center; padding: 2.5rem 0 2.25rem;
}
body.public .hero h1 {
  font-size: clamp(2.7rem, 6.6vw, 4.9rem); line-height: 1; letter-spacing: -.035em;
  font-weight: 800; margin: 0 0 .9rem;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34rem; margin: 0 0 1.75rem; }
.hero-art { justify-self: end; width: min(100%, 25rem); aspect-ratio: 1; margin-right: -2.5rem; }
.hero-art .target { width: 100%; height: 100%; display: block; }

/* ---- the filter ---- */
.filter {
  display: grid; gap: 1.1rem; max-width: 40rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: .75rem;
  padding: 1.15rem 1.25rem 1.3rem;
}
.seg { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg legend { padding: 0; margin-bottom: .4rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.seg-options { display: inline-flex; border: 1px solid var(--control); border-radius: .5rem; overflow: hidden; }
.seg-options label { position: relative; cursor: pointer; }
.seg-options input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-options span { display: flex; align-items: center; gap: .45rem; padding: .5rem 1.1rem; font-weight: 600; }
.seg-options label + label span { border-left: 1px solid var(--control); }
.seg-options input:checked + span { background: var(--ink); color: var(--paper); }
.seg-options input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
body.public select {
  font: inherit; width: 100%; padding: .55rem .7rem;
  border: 1px solid var(--control); border-radius: .5rem; background: var(--paper); color: var(--ink);
}

.filter-actions { display: flex; align-items: center; gap: 1.25rem; }
body.public button {
  font: inherit; font-weight: 700; padding: .65rem 1.3rem;
  border: 0; border-radius: .5rem; background: var(--ink); color: var(--paper); cursor: pointer;
}
body.public button:hover { background: var(--link); }
.reset { font-weight: 600; }

/* ---- environment marker: gold is outdoors, blue is indoors ---- */
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; flex: none; }
.dot.ute { background: var(--gold); box-shadow: inset 0 0 0 1.5px var(--gold-edge); }
.dot.inne { background: var(--blue); }

/* ---- results ---- */
.results { padding-top: 1.25rem; scroll-margin-top: 1rem; }
.status { max-width: 44rem; color: var(--muted); margin: 0 0 1.1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
body.public .chips a {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .6rem .3rem .85rem; border: 1px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink); font-weight: 600; text-decoration: none;
}
body.public .chips a:hover { background: var(--ink); color: var(--paper); }
.chips .x { font-size: 1.15rem; line-height: 1; }

.jump { display: flex; flex-wrap: wrap; gap: .45rem .6rem; margin: 0 0 1rem; }
body.public .jump a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem;
  border: 1px solid var(--line); border-radius: .5rem; background: var(--surface);
  color: var(--ink); text-decoration: none;
}
body.public .jump a:hover { border-color: var(--ink); }

/* ---- overview: one row per division, outdoor and indoor rounds side by side ---- */
.matrix-head, .matrix-row { display: grid; grid-template-columns: 13rem 1fr 1fr; gap: 1.5rem; }
.matrix-head { padding-bottom: .55rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
.matrix-head span { display: flex; align-items: center; gap: .45rem; }
.matrix-row { align-items: start; padding: 1.15rem 0; border-top: 1px solid var(--line); }
body.public .matrix-row h2 { margin: 0; font-size: 1.4rem; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
body.public .matrix-row h2 a { color: var(--ink); text-decoration: none; }
body.public .matrix-row h2 a:hover { text-decoration: underline; text-underline-offset: .2em; }
.matrix.single .matrix-head, .matrix.single .matrix-row { grid-template-columns: 13rem 1fr; }
.cell-label { display: none; }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
body.public .pills a {
  display: inline-block; padding: .3rem .75rem; border: 1px solid var(--line); border-radius: .5rem;
  background: var(--surface); color: var(--ink); font-weight: 500; text-decoration: none;
}
body.public .pills a:hover { border-color: var(--ink); }
.none { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---- a record list ---- */
.listing { margin-top: 2rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
.listing:first-of-type { margin-top: 1rem; }
body.public .listing-head h2 { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
body.public .page-head h1 { margin: 0; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.listing-round { display: flex; align-items: center; gap: .5rem; margin: .45rem 0 0; color: var(--muted); }
.listing-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: .65rem 0 0; font-size: .95rem; }
.back { margin: 1.25rem 0 0; font-size: .95rem; }
.page-head { margin-top: .75rem; }

.class { margin-top: 1.9rem; }
body.public .class-name { margin: 0 0 .3rem; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.table-scroll { overflow-x: auto; }
table.records { width: 100%; border-collapse: collapse; table-layout: fixed; }
.records thead th:nth-child(1) { width: 7rem; }
.records thead th:nth-child(3) { width: 6rem; }
.records thead th:nth-child(4) { width: 8.5rem; }
.records thead th:nth-child(5) { width: 2rem; }
.records th, .records td {
  padding: .5rem .85rem .5rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline;
}
.records thead th { font-size: .85rem; font-weight: 600; color: var(--muted); border-bottom-color: var(--ink); }
.records tbody th { width: 6.5rem; font-weight: 600; white-space: nowrap; }
.records .num { text-align: right; white-space: nowrap; padding-right: 1.1rem; }
/* Tabular figures only for the scores, so they line up. In this font they also make commas and full stops figure-wide. */
.records .points { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.records .date { color: var(--muted); font-variant-numeric: normal; }
.date-inline { display: none; }
.records .mark { width: 1.5rem; padding-right: 0; text-align: center; }
.members-inline { display: block; color: var(--muted); font-size: .92rem; }
.muted { color: var(--muted); }

.best {
  display: inline-block; width: .8rem; height: .8rem; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--ink); vertical-align: -.05em;
}
.note { display: flex; align-items: center; gap: .5rem; margin: 2rem 0 0; color: var(--muted); font-size: .95rem; }

/* ---- narrow screens ---- */
@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 0; }
  .hero-art { order: -1; position: relative; width: 100%; height: 8.5rem; aspect-ratio: auto; margin: 0; overflow: hidden; }
  .hero-art .target { position: absolute; right: -3.5rem; top: -5.75rem; width: 17rem; height: 17rem; }

  .matrix-head { display: none; }
  .matrix-row { grid-template-columns: 1fr; gap: .7rem; }
  .cell-label { display: block; margin: 0 0 .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
}

@media (max-width: 36rem) {
  .wrap.wide { padding: 0 1rem; }
  .fields { grid-template-columns: 1fr; }
  .seg-options { display: flex; }
  .seg-options label { flex: 1; }
  .seg-options span { justify-content: center; padding-left: .5rem; padding-right: .5rem; }
  body.public .listing-head h2 { font-size: 1.7rem; }
  .records th, .records td { padding-right: .6rem; }

  /* The date moves under the holder, which gives the name room. */
  .records .date { display: none; }
  .date-inline { display: block; color: var(--muted); font-size: .88rem; }
  .records thead th:nth-child(1) { width: 4.6rem; }
  .records thead th:nth-child(3) { width: 3.7rem; }
  .records thead th:nth-child(5) { width: 1.4rem; }
  .records .num { padding-right: .5rem; }
}
