/* =====================================================================
   Těšínský kros – vizuální styl
   Barvy vychází z loga: tmavě modrý kruh, světle modrý okraj, oranžový kolík.
   Oranžová (kolík) je jediný akcent – patří jen hlavním akcím.
   ===================================================================== */

@font-face { font-family: "Big Shoulders"; font-weight: 700; font-display: swap; src: url(/assets/fonts/big-shoulders-display-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Big Shoulders"; font-weight: 700; font-display: swap; src: url(/assets/fonts/big-shoulders-display-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Big Shoulders"; font-weight: 800; font-display: swap; src: url(/assets/fonts/big-shoulders-display-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Big Shoulders"; font-weight: 800; font-display: swap; src: url(/assets/fonts/big-shoulders-display-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Big Shoulders"; font-weight: 900; font-display: swap; src: url(/assets/fonts/big-shoulders-display-latin-ext-900-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Big Shoulders"; font-weight: 900; font-display: swap; src: url(/assets/fonts/big-shoulders-display-latin-900-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(/assets/fonts/barlow-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(/assets/fonts/barlow-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: italic; font-display: swap; src: url(/assets/fonts/barlow-latin-ext-400-italic.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: italic; font-display: swap; src: url(/assets/fonts/barlow-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(/assets/fonts/barlow-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(/assets/fonts/barlow-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(/assets/fonts/barlow-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(/assets/fonts/barlow-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(/assets/fonts/barlow-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(/assets/fonts/barlow-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --ink: #0f2740;
  --ink-2: #163a5e;
  --blue: #1e5a96;
  --sky: #3c8bd0;
  --sky-soft: #e3effa;
  --baton: #f07c1f;
  --baton-dark: #c95f0c;
  --paper: #f3f6f9;
  --card: #ffffff;
  --line: #d3dde8;
  --muted: #56687b;
  --ok: #2d7a4b;
  --ok-soft: #e2f3e8;
  --warn: #9a5b00;
  --warn-soft: #fdf0dc;
  --bad: #b8323a;
  --bad-soft: #fbe5e6;

  --display: "Big Shoulders", "Arial Narrow", Impact, sans-serif;
  --text: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 4px;
  --r: 8px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--text); }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1; letter-spacing: .005em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.5rem; font-weight: 700; }
p { margin: 0 0 1em; }
small { font-size: .85em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--baton); color: var(--ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-xl { margin-top: 3rem; }
.lead { font-size: 1.2rem; max-width: 62ch; }
.hint { color: var(--muted); font-size: .92rem; }
.empty { padding: 1.5rem; background: var(--card); border: 2px dashed var(--line); border-radius: var(--r); color: var(--muted); }

/* ---------- Hlavička ---------- */
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; margin-right: auto; }
.brand img { width: 52px; height: 52px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.55rem; line-height: .95; }
.brand-name small { display: block; font-family: var(--text); font-weight: 500; font-size: .8rem; color: #a9c4df; }
.main-nav { display: flex; align-items: center; gap: .25rem; }
.main-nav a { color: #dbe7f3; text-decoration: none; padding: .55rem .8rem; border-radius: var(--r-sm); font-weight: 600; }
.main-nav a:hover { color: #fff; background: var(--ink-2); }
.main-nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--sky); }
.main-nav .nav-login { border: 2px solid #3d6188; }
.main-nav .nav-admin { color: var(--baton); }
.nav-user { padding: .3rem !important; }
.nav-user img, .avatar-fallback { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sky); color: #fff; font-weight: 700; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; color: #fff; cursor: pointer; }
.burger, .burger::before, .burger::after { display: block; width: 24px; height: 2px; background: currentColor; position: relative; transition: transform .2s; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -7px; } .burger::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .burger { background: transparent; }
.nav-toggle[aria-expanded="true"] .burger::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .burger::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--ink); flex-direction: column; align-items: stretch; padding: .5rem var(--gutter) 1rem; border-top: 1px solid var(--ink-2); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .8rem .5rem; }
  .nav-user { display: flex; gap: .5rem; align-items: center; }
  .nav-user .sr-only { position: static; width: auto; height: auto; clip: auto; }
}

/* ---------- Hlášky ---------- */
.flashes { padding-top: 1rem; }
.flash { margin: 0 0 .5rem; padding: .8rem 1rem; border-radius: var(--r-sm); border-left: 5px solid var(--sky); background: var(--sky-soft); font-weight: 500; }
.flash-success { border-color: var(--ok); background: var(--ok-soft); }
.flash-error { border-color: var(--bad); background: var(--bad-soft); }

/* ---------- Tlačítka ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.2rem; border-radius: var(--r-sm); border: 2px solid transparent; font: 700 1rem/1.2 var(--text); text-decoration: none; cursor: pointer; background: var(--card); color: var(--ink); transition: background-color .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.1rem; }
.btn-baton { background: var(--baton); color: var(--ink); }
.btn-baton:hover { background: #ff8e33; color: var(--ink); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--ink-2); color: #fff; }
.btn-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn-light:hover { border-color: #fff; color: #fff; }
.btn-ghost { border-color: var(--line); background: var(--card); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-text { background: none; border: 0; padding: .5rem .2rem; color: var(--blue); text-decoration: underline; font-weight: 600; }
.btn-danger-text { color: var(--bad); }
.btn-oauth { width: 100%; justify-content: flex-start; padding: .9rem 1.2rem; border-color: var(--line); font-size: 1.05rem; }
.btn-google:hover { border-color: #4285f4; }
.btn-facebook { background: #1877f2; color: #fff; }
.btn-facebook:hover { background: #0f63d6; color: #fff; }
.link-more { font-weight: 700; }

/* ---------- Úvod: hero ---------- */
.hero {
  background-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='400' viewBox='0 0 800 400'%3E%3Cg fill='none' stroke='%233c8bd0' stroke-opacity='.16' stroke-width='1.5'%3E%3Cpath d='M-20 330c90-40 160-10 250-40s140-90 240-80 170 60 350 20'/%3E%3Cpath d='M-20 290c100-45 170-15 250-45s150-95 245-85 175 55 345 15'/%3E%3Cpath d='M-20 250c110-50 180-20 255-50s160-95 250-90 180 50 335 10'/%3E%3Cpath d='M-20 210c120-55 185-25 260-55s165-90 255-90 185 45 325 5'/%3E%3Cpath d='M-20 170c125-55 190-30 265-58s170-85 260-88 190 40 315 0'/%3E%3Cpath d='M-20 130c130-60 195-35 270-62s175-80 265-85 195 35 305-5'/%3E%3Cpath d='M-20 90c135-60 200-40 275-65s180-75 270-80 200 30 295-10'/%3E%3Cpath d='M-20 50c140-60 205-45 280-68s185-70 275-75 205 25 285-15'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 1100px auto; background-position: center bottom;
  color: #fff; padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 8vw, 6rem); overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-title { font-size: clamp(4.2rem, 13vw, 10rem); font-weight: 900; line-height: .82; margin: 0 0 1.5rem; letter-spacing: -.01em; }
.hero-title span { display: block; }
.hero-lead { font-size: 1.22rem; color: #d3e2f1; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

/* Startovní číslo – hlavní motiv úvodu */
.bib {
  position: relative; display: grid; justify-items: center; text-align: center; text-decoration: none; color: var(--ink);
  background: #fff; border-radius: 6px; padding: 2.6rem 2rem 1.6rem; transform: rotate(-2.5deg);
  box-shadow: 0 1px 0 #c9d6e4, 0 22px 50px -18px rgba(0,0,0,.6);
  animation: bib-in .7s cubic-bezier(.2,.8,.2,1) both .1s;
}
.bib:hover { color: var(--ink); transform: rotate(-1.5deg) translateY(-3px); transition: transform .25s; }
@keyframes bib-in { from { opacity: 0; transform: rotate(-8deg) translateY(30px); } }
.pin { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 3px #b8c6d5; }
.pin-tl { top: 14px; left: 14px; } .pin-tr { top: 14px; right: 14px; } .pin-bl { bottom: 14px; left: 14px; } .pin-br { bottom: 14px; right: 14px; }
.bib-head { font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1.05; background: var(--blue); color: #fff; padding: .45rem 1rem; border-radius: 3px; width: 100%; }
.bib-number { font-family: var(--display); font-weight: 900; font-size: clamp(6rem, 14vw, 10rem); line-height: .9; margin: .6rem 0 0; font-variant-numeric: tabular-nums; }
.bib-caption { font-weight: 600; font-size: 1.1rem; color: var(--muted); margin-bottom: 1rem; }
.bib-foot { display: flex; justify-content: space-between; gap: 1rem; width: 100%; border-top: 2px dashed var(--line); padding-top: .8rem; font-weight: 600; font-size: .95rem; }
.bib-foot span:last-child { color: var(--muted); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .bib { max-width: 420px; width: 100%; justify-self: center; }
}

/* ---------- Sekce ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-tight { padding-top: 2rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.section-head h2 { margin: 0; }
.page-head { background: var(--card); border-bottom: 1px solid var(--line); padding: clamp(2rem, 5vw, 3.5rem) 0; }
.page-head-compact { padding: 2rem 0 1.6rem; }
.page-head h1 { margin-bottom: .3em; }
.page-head .lead { margin-bottom: 0; color: var(--muted); }
.crumbs { margin: 0 0 .6rem; font-weight: 600; }
.crumbs a { text-decoration: none; }
.crumbs a::before { content: "‹ "; }

/* ---------- Seznam závodů ---------- */
.race-list { display: grid; gap: 1rem; }
.race-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 240px; background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.race-date { display: grid; align-content: center; justify-items: center; background: var(--ink); color: #fff; text-decoration: none; padding: 1rem .5rem; }
.race-relay .race-date { background: var(--blue); }
.race-date .d { font-family: var(--display); font-weight: 900; font-size: 3.4rem; line-height: .85; }
.race-date .m { font-weight: 600; }
.race-date .y { font-size: .85rem; opacity: .75; }
.race-body { padding: 1.2rem 1.4rem; }
.race-type { margin: 0 0 .2rem; font-weight: 700; color: var(--blue); font-size: .95rem; }
.race-body h3 { font-size: 1.9rem; margin: 0 0 .3rem; }
.race-body h3 a { color: var(--ink); text-decoration: none; }
.race-body h3 a:hover { color: var(--blue); }
.race-meta { margin: 0 0 .4rem; font-weight: 500; }
.race-tagline { margin: 0; color: var(--muted); }
.race-side { padding: 1.2rem 1.4rem; border-left: 1px dashed var(--line); display: flex; flex-direction: column; gap: .4rem; justify-content: center; }
.race-side .btn { margin-top: .4rem; }
.race-count { margin: 0; }
.race-count strong { font-family: var(--display); font-size: 1.6rem; }
meter { width: 100%; height: 8px; }
meter::-webkit-meter-bar { background: var(--sky-soft); border: 0; border-radius: 4px; height: 8px; }
meter::-webkit-meter-optimum-value { background: var(--sky); border-radius: 4px; }
meter::-moz-meter-bar { background: var(--sky); border-radius: 4px; }
.state { margin: 0; font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; gap: .45rem; }
.state::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); flex: none; }
.state-open::before { background: #3fbf6a; box-shadow: 0 0 0 3px rgba(63,191,106,.25); }
.state-not_open::before { background: var(--sky); }
.state-full::before, .state-closed::before { background: var(--baton); }
.race-list-past .race-row { opacity: .85; }
.race-list-past .race-date { background: var(--muted); }
@media (max-width: 860px) {
  .race-row { grid-template-columns: 84px minmax(0, 1fr); }
  .race-date .d { font-size: 2.6rem; }
  .race-side { grid-column: 1 / -1; border-left: 0; border-top: 1px dashed var(--line); }
}

/* ---------- Kroky ---------- */
.section-steps { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 3.6rem; }
.steps li::before { content: counter(step); position: absolute; top: 0; left: 0; font-family: var(--display); font-weight: 900; font-size: 3rem; line-height: 1; color: var(--sky); }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 1.4rem; left: 3rem; right: -1.5rem; border-top: 3px dotted var(--line); }
.steps h3 { margin-bottom: .3rem; }
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 1.4rem; } .steps li::after { display: none; } }

/* ---------- Aktuality ---------- */
.news-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.2rem; }
.news-grid-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.news-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.news-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.news-card > div { padding: 1.1rem 1.2rem 1.3rem; }
.news-card time { color: var(--muted); font-size: .9rem; font-weight: 600; }
.news-card h3, .news-card h2 { font-size: 1.6rem; margin: .2rem 0 .4rem; }
.news-card h3 a, .news-card h2 a { color: var(--ink); text-decoration: none; }
.news-card h3 a:hover, .news-card h2 a:hover { color: var(--blue); }
.news-card p { margin: 0; color: var(--muted); }
.news-lead h3 { font-size: 2rem; }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr; } }

.past-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .5rem 2rem; }
.past-list li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: .6rem 0; }
.past-list span { color: var(--muted); }

.section-partners h2 { font-size: 1.6rem; }
.partners { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: center; }
.partners img { max-height: 64px; width: auto; filter: grayscale(1); opacity: .8; transition: filter .2s, opacity .2s; }
.partners a:hover img { filter: none; opacity: 1; }
.partners .partner-main img { max-height: 90px; }
.partners span { font-weight: 700; color: var(--muted); }

/* ---------- Detail závodu ---------- */
.race-hero { position: relative; background: var(--ink); color: #fff; padding: clamp(2.5rem, 6vw, 4rem) 0 2.2rem; overflow: hidden; }
.race-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .32; }
.race-hero.has-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink) 25%, rgba(15,39,64,.35)); }
.race-hero-inner { position: relative; z-index: 1; }
.race-hero .race-type { color: #9cc4ea; }
.race-hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 900; margin-bottom: .2em; }
.race-when { font-size: 1.25rem; font-weight: 600; margin-bottom: .5rem; }
.race-hero .lead { color: #d3e2f1; }
.race-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; margin-top: 1.4rem; }
.race-hero .state { color: #fff; }
.my-reg-note { margin: 1rem 0 0; background: rgba(255,255,255,.1); display: inline-block; padding: .5rem .8rem; border-radius: var(--r-sm); }
.my-reg-note a { color: #fff; font-weight: 700; }

.tabs { display: flex; gap: .3rem; box-shadow: inset 0 -2px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-top: 1rem; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: .7rem 1rem; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 4px solid transparent; white-space: nowrap; flex: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--baton); }
.count { display: inline-block; min-width: 1.6em; padding: 0 .4em; border-radius: 1em; background: var(--sky-soft); color: var(--blue); font-size: .85em; text-align: center; font-family: var(--text); font-weight: 700; }

.race-info { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; margin-bottom: 2.5rem; }
.facts { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: var(--r); padding: 1.3rem 1.4rem; align-self: start; }
.facts h2 { font-size: 1.6rem; }
.facts dl { margin: 0; display: grid; gap: .1rem; }
.facts dt { color: var(--muted); font-size: .9rem; font-weight: 600; margin-top: .6rem; }
.facts dd { margin: 0; font-weight: 600; }
@media (max-width: 900px) { .race-info { grid-template-columns: 1fr; } }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .3em; }
.prose img { border-radius: var(--r); }
.map-embed { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article-img { width: 100%; margin-bottom: 1.5rem; }

/* ---------- Tabulky ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 1.8rem; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: .88rem; color: var(--muted); font-weight: 700; padding: .7rem .9rem; border-bottom: 2px solid var(--line); white-space: nowrap; background: #f8fafc; }
.table td { padding: .65rem .9rem; border-bottom: 1px solid #e6ecf2; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fbfe; }
.table .num { text-align: right; width: 1%; white-space: nowrap; }
.table .time { font-weight: 700; }
.cat-title { margin-top: 1.6rem; display: flex; align-items: center; gap: .6rem; }
.podium-1 td:first-child { font-weight: 800; color: var(--baton-dark); }
.splits { display: flex; flex-wrap: wrap; gap: .2rem .9rem; color: var(--muted); font-size: .88rem; }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 99px; background: var(--sky-soft); color: var(--blue); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.pill-confirmed { background: var(--ok-soft); color: var(--ok); }
.pill-pending { background: var(--warn-soft); color: var(--warn); }
.pill-cancelled { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }

/* ---------- Formuláře ---------- */
label, .field { display: block; font-weight: 600; font-size: .97rem; }
label > small, label > .hint { font-weight: 500; color: var(--muted); }
label > input, label > select, label > textarea, .field > .seg { margin-top: .35rem; }
label > .hint { display: block; margin-top: .3rem; }
.field-error { margin-top: .3rem !important; }
.label { font-weight: 600; }
input, select, textarea { width: 100%; font: 400 1.05rem/1.4 var(--text); color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: var(--r-sm); padding: .65rem .8rem; min-height: 48px; }
textarea { min-height: auto; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b4c4d6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(60,139,208,.22); }
input[aria-invalid="true"] { border-color: var(--bad); }
input:disabled { background: var(--paper); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; min-height: 0; accent-color: var(--blue); margin: 0; flex: none; }
.field-error { color: var(--bad); font-weight: 600; font-size: .92rem; margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.2rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 1rem; }
.check { display: flex !important; gap: .7rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .2rem; }
.seg { display: flex; gap: .5rem; }
.seg label { flex: 1; display: block; position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: .65rem; border: 2px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-weight: 600; min-height: 48px; }
.seg input:checked + span { border-color: var(--blue); background: var(--sky-soft); color: var(--blue); }
.seg input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; align-items: start; }
@media (max-width: 960px) { .form-layout { grid-template-columns: 1fr; } .summary { order: -1; } }
.reg-form { display: grid; gap: 1.5rem; }
.block { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem 1.5rem 1.6rem; margin: 0; min-width: 0; }
.block > legend { font-family: var(--display); font-weight: 800; font-size: 1.7rem; padding: 0 .4rem; margin-left: -.4rem; }
.block > .grid-2 + label, .block > .legs + label { margin-top: 1rem; }
.legs { display: grid; gap: 1.2rem; }
.leg { border: 0; border-left: 4px solid var(--sky); padding: .2rem 0 .4rem 1.1rem; margin: 0; min-width: 0; }
.leg legend { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; padding: 0; margin-bottom: .7rem; }
.leg-no { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--baton); color: var(--ink); font-family: var(--display); font-weight: 900; font-size: 1.2rem; }
.leg legend small { color: var(--muted); font-weight: 500; }
.cat-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.cat-choice { position: relative; display: grid !important; gap: .1rem; padding: .9rem 1rem .9rem 2.8rem; border: 2px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-weight: 400; }
.cat-choice input { position: absolute; left: 1rem; top: 1.05rem; }
.cat-choice:has(input:checked) { border-color: var(--blue); background: var(--sky-soft); }
.cat-choice.is-fit { border-color: #8fc0e6; }
.cat-name { font-weight: 700; }
.cat-rule { color: var(--muted); font-size: .9rem; }
.cat-fit { color: var(--ok); font-weight: 700; font-size: .85rem; }
.consents { display: grid; gap: .8rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1rem; }
.form-actions form { margin: 0; }
.callout { background: var(--sky-soft); border-radius: var(--r); padding: 1rem 1.2rem; }
.callout p:last-child { margin-bottom: 0; }
.oauth-inline { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.callout-result { background: var(--warn-soft); margin: 1.5rem 0; }

.summary { position: sticky; top: 90px; }
.summary-card { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--baton); border-radius: var(--r); padding: 1.3rem 1.4rem; }
.summary-card h2 { font-size: 1.7rem; }
.summary-card dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.summary-card dt { color: var(--muted); }
.summary-card dd { margin: 0; font-weight: 600; text-align: right; }
.summary-card.paid { border-top-color: var(--ok); }
.qr { display: grid; place-items: center; background: #fff; padding: .5rem; margin: 0 auto .4rem; width: 220px; max-width: 100%; }
.qr svg, .qr img { width: 100%; height: auto; display: block; }

/* ---------- Detail přihlášky ---------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }
@media (max-width: 960px) { .detail-layout { grid-template-columns: 1fr; } }
.ticket { display: grid; grid-template-columns: 1fr auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 2rem; }
.ticket-main { padding: 1.3rem 1.5rem; }
.ticket-main p { margin: 0 0 .3rem; }
.ticket-label { color: var(--muted); font-weight: 600; font-size: .9rem; }
.ticket-name { font-family: var(--display); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.ticket-bib { display: grid; align-content: center; justify-items: center; padding: 1rem 1.8rem; background: var(--ink); color: #fff; border-left: 3px dashed var(--paper); }
.ticket-bib span { font-size: .8rem; color: #a9c4df; }
.ticket-bib strong { font-family: var(--display); font-weight: 900; font-size: 3.6rem; line-height: 1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
.kv-large { font-size: 1.15rem; }

.my-list { display: grid; gap: .8rem; }
.my-item { display: grid; grid-template-columns: 80px 1fr auto; gap: 1rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1.1rem; text-decoration: none; color: var(--ink); }
.my-item:hover { border-color: var(--blue); color: var(--ink); }
.my-bib { font-family: var(--display); font-weight: 900; font-size: 2.4rem; text-align: center; color: var(--blue); }
.my-main { display: grid; }
@media (max-width: 600px) { .my-item { grid-template-columns: 60px 1fr; } .my-item .pill { grid-column: 2; justify-self: start; } }

.login-box .oauth-buttons { display: grid; gap: .8rem; max-width: 420px; margin: 1.5rem 0 1rem; }
.staff-login { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1rem; max-width: 420px; }
.staff-login summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.staff-login form { margin-top: 1rem; }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; max-width: 220px; }

.error-page .error-code { font-family: var(--display); font-weight: 900; font-size: 6rem; line-height: 1; color: var(--sky); margin: 0; }
.debug { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); padding: 1rem; font-size: .8rem; overflow: auto; }

/* ---------- Patička ---------- */
.site-footer { background: var(--ink); color: #c4d6e8; margin-top: 3rem; }
.tape { height: 14px; background: repeating-linear-gradient(-45deg, var(--baton) 0 18px, #fff 18px 36px); }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; padding-top: 2.5rem; padding-bottom: 1.5rem; }
.footer-grid p { margin: 0 0 .4rem; }
.footer-title { font-family: var(--display); font-weight: 800; font-size: 1.4rem; color: #fff; margin-bottom: .6rem !important; }
.site-footer a { color: #fff; }
.social { display: flex; gap: 1rem; flex-wrap: wrap; }
.copyright { font-size: .85rem; color: #8aa5c0; padding-bottom: 1.5rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

@media print {
  .site-header, .site-footer, .tabs, .form-actions, .nav-toggle { display: none !important; }
  body { background: #fff; }
}

/* Automaticky určená kategorie */
.cat-auto { border: 2px dashed var(--line); border-radius: var(--r); padding: 1rem 1.2rem; }
.cat-auto p { margin: 0; }
.cat-auto-label { color: var(--muted); font-weight: 600; font-size: .9rem; }
.cat-auto-name { font-family: var(--display); font-weight: 800; font-size: 1.9rem; line-height: 1.1; margin: .1rem 0 .2rem !important; }
.cat-auto.is-ok { border-style: solid; border-color: var(--blue); background: var(--sky-soft); }
.cat-auto.is-bad { border-style: solid; border-color: var(--bad); background: var(--bad-soft); }
.cat-auto.is-bad .cat-auto-name { color: var(--bad); }
.cat-list { margin-top: 1rem; }
.cat-list summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.cat-list ul { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.cat-list .cat-choice { padding: .7rem .9rem; cursor: default; border-width: 1px; }
.cat-list .cat-choice.is-fit { border: 2px solid var(--blue); background: var(--sky-soft); }

/* Odkazy na tmavém pozadí – při najetí myší nesmí ztmavnout (výchozí a:hover je tmavě modrý) */
.brand:hover, .brand:focus-visible { color: #fff; }
.brand:hover .brand-name { color: #fff; }
.brand:hover img { transform: rotate(-6deg); transition: transform .2s; }
.site-footer a:hover { color: var(--baton); }
.race-date:hover { color: #fff; }
.my-reg-note a:hover { color: var(--baton); }
.btn-light:hover, .btn-primary:hover, .btn-facebook:hover { color: #fff; }
