/* Sjuhäradscupen, landningssidan för anmälan. PBA-färgerna (svart, rött) och Bricolage Grotesque ur prototypen.
   Förebilderna (forebilder.md): Vasaloppet (rubrik och knapp nederst i helbild), Göteborgsvarvet (datumet stort),
   UTMB (status med prick), Berlin Marathon (sponsorer direkt under heron). Mobilen först. */
:root {
  --svart: #000; --vit: #fff; --grund: #EBEBEB;
  --rod: #E00000;          /* knappar, valt, fel. 4,9:1 mot vitt */
  --rod-pa-svart: #FF4D4D; /* årtalet på svart. 5,6:1 mot svart */
  --text: #000; --svag: #595959; /* 7:1 mot vitt, 5,9:1 mot grund */
  --linje: #DCDCDC; --linje-falt: #8C8C8C;
  --marg: clamp(16px, 5.556vw, 80px);
  --font: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  /* Rollerna som designsystemets komponenter (glid, intrade) läser, med värdena ur tokens.css */
  --yta: var(--grund); --yta-djup: var(--svart); --pa-djup: var(--vit);
  --luft-5: 24px; --luft-7: 48px; --luft-8: 72px; --radie-stor: 20px;
  --kurva-expo: cubic-bezier(.19, 1, .22, 1); --kurva-standard: cubic-bezier(.4, 0, .2, 1);
  --tid-kvick: .12s; --tid-normal: .2s; --tid-lugn: .4s;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--grund); color: var(--text);
  font: 400 16px/24px var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
main { flex: 1 0 auto; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.ram { padding-inline: max(var(--marg), env(safe-area-inset-left, 0px)) max(var(--marg), env(safe-area-inset-right, 0px));
  max-width: 1280px; margin-inline: auto; }
.ram.smal { max-width: calc(760px + 2 * var(--marg)); }
.svag { color: var(--svag); }
.hel { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--svart); outline-offset: 2px; }
.topp :focus-visible, .hero :focus-visible, .band :focus-visible, .fot :focus-visible { outline-color: var(--vit); }
.hoppa { position: absolute; left: 8px; top: -60px; background: var(--vit); padding: 8px 12px; z-index: 50; }
.hoppa:focus { top: 8px; }

/* Knappar: piller (IPL-måtten ur prototypen). Färgen ändras vid hover, inget lyft (animation, smak) */
.knapp { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 24px; border: 0;
  border-radius: 999px; background: var(--rod); color: var(--vit); font: 700 16px/1 var(--font); text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background-color var(--tid-normal); -webkit-tap-highlight-color: transparent; }
.knapp:hover { background: #C80000; }
.knapp--sm { height: 40px; padding: 0 16px; font-size: 14px; }
.knapp--stor { height: 56px; padding: 0 32px; font-size: 18px; }
.knapp--ljus { background: var(--vit); color: var(--svart); box-shadow: inset 0 0 0 2px var(--linje); }
.knapp--ljus:hover { background: var(--vit); box-shadow: inset 0 0 0 2px var(--svag); }
.knapp--bred { width: 100%; }

/* Sidhuvudet på undersidorna: svart list med loggan som text */
.topp { background: var(--svart); color: var(--vit); }
.topp .ram { display: flex; align-items: center; height: 64px; }
.logga { display: flex; align-items: baseline; gap: 6px; font-size: 20px; line-height: 24px; font-weight: 800;
  letter-spacing: -.3px; text-decoration: none; white-space: nowrap; }
.logga-ar { color: var(--rod-pa-svart); }
@media (min-width: 900px) { .topp .ram { height: 80px; } .logga { font-size: 22px; } }

/* ---- Heron: helskärm med slingan ur videolabbet. Rubrik, datum och knapp nederst på en toning (Vasaloppet) ---- */
.hero { color: var(--vit); min-height: 560px; }
.glid-hero > video.hero-film { object-position: 50% 45%; }
.hero-toning { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,.15) 42%, rgba(0,0,0,.82) 72%, #000 100%); }
.hero-text { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; display: grid; justify-items: start;
  padding-bottom: max(calc(var(--luft-7) + 28px), env(safe-area-inset-bottom)); }
.hero h1 { font-size: 46px; line-height: 46px; font-weight: 800; letter-spacing: -1.6px; margin-bottom: 20px; }
.hero h1 em { display: block; font-style: normal; color: var(--rod-pa-svart); }
/* Datumet som eget block (Göteborgsvarvet), platsen under */
.hero-datum { font-size: 26px; line-height: 30px; font-weight: 800; letter-spacing: -.5px; }
.hero-plats { font-size: 17px; line-height: 24px; font-weight: 600; color: rgba(255,255,255,.82); margin-top: 4px; }
.hero-knapp { width: 100%; margin-top: 28px; }
/* Status med prick (UTMB) */
.hero-status { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; line-height: 20px;
  font-weight: 700; color: rgba(255,255,255,.85); }
.prick { width: 8px; height: 8px; border-radius: 50%; background: var(--rod-pa-svart); box-shadow: 0 0 0 4px rgba(255,77,77,.2); }
.prick--av { background: rgba(255,255,255,.5); box-shadow: none; }
@media (max-width: 359px) { .hero h1 { font-size: 38px; line-height: 40px; } .hero-datum { font-size: 22px; line-height: 26px; } }
@media (min-width: 700px) {
  .hero-toning { background: linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.45) 38%, rgba(0,0,0,0) 65%),
    linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.6) 100%); }
  .hero-text { padding-bottom: calc(var(--luft-8) + 40px); }
  .hero h1 { font-size: clamp(64px, 7.2vw, 104px); line-height: .96; letter-spacing: -3px; margin-bottom: 28px; }
  .hero-datum { font-size: 36px; line-height: 40px; letter-spacing: -.8px; }
  .hero-plats { font-size: 20px; line-height: 28px; }
  .hero-knapp { width: auto; margin-top: 32px; }
}

/* ---- Arket som glider upp över heron (designsystemets glid) ---- */
.glid-innehall > .ark { background: var(--grund); overflow: hidden; }
/* Sponsorerna tidigt, i en remsa överst på arket (Berlin Marathon; Sami 2026-10-28: sponsorerna ska synas hela tiden) */
.remsa { background: var(--vit); padding-block: 14px; border-bottom: 1px solid var(--linje); }
.remsa .loop { --loop-fart: 36; --loop-lucka: 8px; }
.remsa li { width: 112px; height: 56px; display: grid; place-items: center; padding: 6px 10px; }
.remsa img { max-width: 100%; max-height: 40px; width: auto; height: auto; object-fit: contain; }
@media (min-width: 700px) { .remsa { padding-block: 18px; } .remsa li { width: 148px; height: 64px; } .remsa img { max-height: 48px; } }

/* Sektionerna: 32 px emellan, 16 px från rubrik till innehåll (Sami 2026-10-28) */
.sidor { padding-block: 32px 48px; display: grid; gap: 40px; }
.sektion { display: grid; gap: 16px; min-width: 0; scroll-margin-top: 16px; }
.sektion h2, .tavla h2 { font-size: 30px; line-height: 34px; font-weight: 800; letter-spacing: -.6px; }
.sektion-rubrik { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.antal { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--svag); font-variant-numeric: tabular-nums; }
@media (min-width: 700px) { .sidor { padding-block: 56px 72px; gap: 56px; } .sektion h2, .tavla h2 { font-size: 40px; line-height: 44px; letter-spacing: -1px; } }

/* Anmälda lag: korta rader */
.lagen { list-style: none; margin: 0; padding: 0; display: grid; background: var(--vit); border-radius: 12px; overflow: hidden; }
.lag { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px 16px; border-top: 1px solid var(--linje); }
.lag:first-child { border-top: 0; }
.lag h3 { font-size: 17px; line-height: 22px; font-weight: 700; overflow-wrap: anywhere; }
.lag-klubb { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--svag); }
.lag-spelare { font-size: 14px; line-height: 20px; margin-top: 6px; }
.marke { width: 40px; height: 40px; border-radius: 50%; background: var(--vit); object-fit: contain; box-shadow: 0 0 0 1px var(--linje); }
.marke--init { display: grid; place-items: center; background: var(--grund); font-size: 11px; font-weight: 800; letter-spacing: .3px; box-shadow: none; }
@media (min-width: 900px) {
  .lagen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lag { padding: 18px 20px; }
  .lag:nth-child(2) { border-top: 0; }
  .lag:nth-child(2n) { border-left: 1px solid var(--linje); }
}
.tomt { display: grid; justify-items: start; gap: 16px; padding: 24px 20px; background: var(--vit); border-radius: 12px; }
.tomt p { font-size: 20px; line-height: 26px; font-weight: 700; }

/* Så spelas cupen: rader, etiketten först (UTMB) */
.fakta { margin: 0; display: grid; background: var(--vit); border-radius: 12px; overflow: hidden; }
.fakta div { display: grid; gap: 2px; padding: 14px 16px; border-top: 1px solid var(--linje); }
.fakta div:first-child { border-top: 0; }
.fakta dt { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--svag); }
.fakta dd { margin: 0; }
@media (min-width: 700px) {
  .fakta div { grid-template-columns: 160px minmax(0, 1fr); gap: 24px; padding: 18px 20px; align-items: baseline; }
  .fakta dt { font-size: 15px; }
}

/* Nyheter */
.nyheter { display: grid; gap: 8px; }
.nyhet { display: grid; gap: 4px; align-content: start; padding: 18px 16px; background: var(--vit); border-radius: 12px; scroll-margin-top: 16px; }
.nyhet time { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--svag); }
.nyhet h3 { font-size: 20px; line-height: 26px; font-weight: 700; margin-bottom: 4px; }
.nyhet p + p { margin-top: 12px; }
@media (min-width: 700px) { .nyheter { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; } .nyhet { padding: 24px; } }

/* Sponsortavlan som affischen: alla loggor stora i rutor. Rutnätet ritas med skuggor, så att en tom ruta blir vit */
.tavla { background: var(--vit); padding-block: 32px 40px; }
.tavla h2 { margin-bottom: 16px; }
.tavla-lista { list-style: none; margin: 0 calc(var(--marg) * -1); padding: 1px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; overflow: hidden; }
.tavla-lista li { background: var(--vit); aspect-ratio: 3 / 2; display: grid; place-items: center; padding: 14px; box-shadow: 0 0 0 1px var(--linje); }
.tavla-lista a { display: grid; place-items: center; width: 100%; height: 100%; }
.tavla-lista img { max-width: 100%; max-height: 64px; object-fit: contain; }
@media (min-width: 700px) {
  .tavla { padding-block: 56px 64px; }
  .tavla h2 { margin-bottom: 24px; }
  .tavla-lista { margin-inline: 0; padding: 1px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .tavla-lista li { padding: 20px; }
  .tavla-lista img { max-height: 88px; }
}

/* Fast knapp längst ned i telefonen när heronknappen är förbi (Vasaloppet, UTMB) */
.fast-knapp { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; height: 56px; border-radius: 999px; background: var(--rod);
  color: var(--vit); font: 700 18px/1 var(--font); text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,.28);
  transform: translateY(calc(100% + 24px)); transition: transform var(--tid-lugn) var(--kurva-expo); }
.fast-knapp.syns { transform: none; }
@media (min-width: 700px) { .fast-knapp { display: none; } }
@media (max-width: 699px) { .landning .fot .ram { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* Sidfot: arrangören med märket (Sami 2026-10-28) */
.fot { position: relative; z-index: 1; background: var(--svart); color: rgba(255,255,255,.75); font-size: 14px; line-height: 22px; }
.fot .ram { display: flex; align-items: center; gap: 16px; padding-block: 32px max(32px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
.fot-marke { width: 56px; height: 56px; border-radius: 50%; background: var(--vit); object-fit: contain; flex: none; }
.fot p { flex: 1 1 200px; }
.fot b { display: block; color: var(--vit); font-size: 16px; line-height: 24px; }
.loggain { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 16px; border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px; color: var(--vit); font-weight: 700; text-decoration: none; transition: background-color var(--tid-normal); }
.loggain:hover { background: rgba(255,255,255,.1); }

/* Undersidorna: svart band, på anmälan med tävlingsbilden bakom */
.band { position: relative; background: var(--svart); color: var(--vit); overflow: hidden; isolation: isolate; }
.band .ram { position: relative; padding-block: 32px; display: grid; gap: 6px; }
.band h1 { font-size: 36px; line-height: 40px; font-weight: 800; letter-spacing: -.8px; }
.band p { font-size: 16px; line-height: 22px; font-weight: 700; color: rgba(255,255,255,.82); }
.band--bild .ram { padding-top: 140px; }
.band-bild { position: absolute; inset: 0; z-index: -1; }
.band-bild img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.band-bild::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.5) 45%, #000 100%); }
@media (min-width: 700px) {
  .band .ram { padding-block: 48px; } .band h1 { font-size: 52px; line-height: 56px; letter-spacing: -1.4px; }
  .band--bild .ram { padding-top: 200px; }
}

/* Formuläret */
.formular { display: grid; gap: 16px; }
.del { margin: 0; padding: 20px 16px; border: 0; background: var(--vit); border-radius: 12px; display: grid; gap: 16px; min-width: 0; }
.del legend { float: left; width: 100%; padding: 0; font-size: 20px; line-height: 26px; font-weight: 800; }
.del legend + * { clear: both; }
.falt { display: grid; gap: 6px; min-width: 0; }
.falt label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--svag); }
.falt input, .falt select { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--linje-falt); border-radius: 8px;
  background: var(--vit); color: var(--text); font: 400 16px/24px var(--font); appearance: none; -webkit-appearance: none; }
.falt select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.falt input:focus-visible, .falt select:focus-visible { outline: 2px solid var(--svart); outline-offset: -1px; border-color: var(--svart); }
.har-fel input:not([type=checkbox]), .har-fel select { border-color: var(--rod); }
.fel { font-size: 14px; line-height: 20px; font-weight: 600; color: #C00000; }
.fel-ruta { padding: 14px 16px; border-radius: 12px; background: #FDECEC; color: #A00000; font-weight: 600; }
.falt-par { display: grid; gap: 16px; }
@media (min-width: 560px) { .falt-par { grid-template-columns: 1fr 1fr; } }
.js .annan:not(.visas) { display: none; }

.spelarlista { list-style: none; margin: 0; padding: 0; display: grid; }
.spelarrad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding-block: 16px; border-top: 1px solid var(--linje); }
.spelarrad:first-child { padding-top: 0; border-top: 0; }
.js .spelarrad.gomd { display: none; }
.spelarrad .nr { display: none; }
.sp-namn { grid-column: 1 / -1; }
.sp-ungdom { align-self: end; min-height: 48px; }
.spelarrad .fel { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .spelarrad { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: end; }
  .sp-namn { grid-column: auto; }
}
.kryss { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; line-height: 20px; cursor: pointer; }
.kryss input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--rod); }
.lagg-till { justify-self: start; }
.skicka { display: grid; gap: 12px; padding-top: 4px; }
.skicka .kryss { font-size: 15px; line-height: 22px; align-items: flex-start; }
.skicka .kryss input { margin-top: 1px; }
.skicka .knapp { height: 56px; font-size: 18px; }
.faller { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Klar */
.kort { background: var(--vit); border-radius: 12px; padding: 4px 16px; }
.rader { margin: 0; display: grid; }
.rader div { display: grid; gap: 4px; padding-block: 14px; border-top: 1px solid var(--linje); }
.rader div:first-child { border-top: 0; }
.rader dt { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--svag); }
.rader dd { margin: 0; }
.enkel { margin: 0; padding-left: 20px; }
.knapprad { display: flex; flex-wrap: wrap; gap: 12px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .knapp, .fast-knapp { transition: none; } }
