/* MORAVIA TIMING - hlavní styl */

:root {
  --navy: #0f1720;
  --navy-2: #1a2534;
  --orange: #ff5a1f;
  --orange-dark: #e0440b;
  --gray-100: #f7f8fa;
  --gray-200: #eceef1;
  --gray-400: #9aa3ad;
  --gray-600: #5b6570;
  --text: #1c242c;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(15, 23, 32, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--gray-600); }

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: .85rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.6); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: var(--navy-2); }
.btn-outline-dark { background: transparent; border-color: var(--gray-400); color: var(--text); }
.btn-outline-dark:hover { background: var(--gray-100); }
.btn-sm { padding: 9px 18px; font-size: .78rem; }

/* --- Header / Nav --- */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.logo {
  color: var(--white);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo span { color: var(--orange); }
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--gray-200);
  font-weight: 600;
  font-size: .92rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.nav-links a:hover, .nav-links a.active { color: var(--orange); text-decoration: none; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--navy-2);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
  }
  .nav-links.open { max-height: 400px; }
  .nav-links li { border-top: 1px solid rgba(255,255,255,.08); }
  .nav-links a { display: block; padding: 14px 20px; }
}

/* --- Hero --- */
.hero {
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 100px 0 128px;
}
.hero .eyebrow {
  color: var(--orange);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .85rem;
  margin-bottom: 14px;
}
.hero h1 { color: var(--white); max-width: 720px; }
.hero p.lead { color: var(--gray-200); max-width: 560px; font-size: 1.1rem; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.page-hero {
  background: var(--navy);
  color: var(--white);
  padding: 64px 0 44px;
}
.page-hero-photo {
  background-size: cover;
  background-position: center;
  min-height: 300px;
  display: flex;
  align-items: center;
  padding: 24px 0;
}
.page-hero h1 { color: var(--white); margin-bottom: 6px; }
.breadcrumb { color: var(--gray-400); font-size: .9rem; }
.breadcrumb a { color: var(--gray-400); }

/* --- Sections --- */
section { padding: 72px 0; }
.section-alt { background: var(--gray-100); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .eyebrow {
  color: var(--orange-dark); font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; font-size: .8rem; margin-bottom: 8px;
}

.grid {
  display: grid;
  gap: 26px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}
.card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(255,90,31,.12);
  color: var(--orange-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 18px;
}

.team-grid { display: flex; flex-wrap: wrap; justify-content: center; }
.team-card { text-align: center; aspect-ratio: 1 / 1; display: flex; flex-direction: column; justify-content: center; width: 252px; }
.team-card h3 { margin-bottom: 16px; }
.team-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-avatar svg { width: 100%; height: 100%; display: block; }

.list-check { list-style: none; padding: 0; margin: 0; }
.list-check li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  color: var(--text);
}
.list-check li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--orange-dark);
  font-weight: 800;
}

.price-box {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 34px;
}
.price-box .amount { font-size: 2.4rem; font-weight: 800; color: var(--orange); }
.price-box ul { list-style: none; padding: 0; margin: 18px 0 0; }
.price-box li { padding: 8px 0; border-top: 1px solid rgba(255,255,255,.1); color: var(--gray-200); }

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
table.results {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}
table.results th, table.results td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
}
table.results th {
  background: var(--gray-100);
  text-transform: uppercase;
  font-size: .78rem;
  letter-spacing: .05em;
  color: var(--gray-600);
}
table.results tr:last-child td { border-bottom: none; }
table.results td.date { white-space: nowrap; color: var(--gray-600); font-variant-numeric: tabular-nums; }
table.results td.disciplina-col { text-align: center; vertical-align: middle; padding-left: 2px; padding-right: 2px; }
.disciplina-ikona { width: 32px; height: 32px; border-radius: 50%; display: inline-block; }
/* Pevné šířky sloupců - aby tabulka "Připravované závody" měla sloupce zarovnané
   se "Seznamem výsledků" nad ní, i když má jiný obsah (HTML by jinak počítal
   šířku sloupců každé tabulky zvlášť podle jejího vlastního obsahu). Všechny sloupce
   VŽDY v % (ne mix s px) a musí dát dohromady přesně 100 % - jinak si prohlížeč
   zbylý prostor u table-layout:fixed přihodí k sloupci bez %, ikonu tak fakticky
   zvětší a šířka pak neodpovídá tomu, co je tu napsané (ověřeno v praxi). */
table.results-zavody { table-layout: fixed; min-width: 640px; }
table.results-zavody th:nth-child(1), table.results-zavody td:nth-child(1) { width: 13%; }
table.results-zavody th:nth-child(2), table.results-zavody td:nth-child(2) { width: 4.5%; }
table.results-zavody th:nth-child(3), table.results-zavody td:nth-child(3) { width: 49%; }
table.results-zavody th:nth-child(4), table.results-zavody td:nth-child(4) { width: 33.5%; }
.akce-radek { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.akce-radek .btn-xs { padding: 6px 10px; font-size: .72rem; }
.akce-radek .akce-registrace { display: flex; gap: 8px; align-items: center; }

/* Na mobilu se tabulka závodů mění na karty pod sebou (místo vodorovného
   scrollování) - hlavička se skryje, řádek je flex-řádek s datem, ikonou a názvem
   vedle sebe (a zalomí se, pokud se nevejdou), tlačítka jsou vždy na vlastním řádku. */
@media (max-width: 700px) {
  table.results-zavody { min-width: 0; }
  table.results-zavody thead { display: none; }
  table.results-zavody, table.results-zavody tbody, table.results-zavody tr, table.results-zavody td {
    display: block; width: 100% !important;
  }
  table.results-zavody tr {
    display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 6px;
    padding: 14px 18px; border-bottom: 1px solid var(--gray-200);
  }
  table.results-zavody tr:last-child { border-bottom: none; }
  table.results-zavody td { padding: 0; border-bottom: none; width: auto !important; }
  table.results-zavody td.date { font-weight: 600; color: var(--text); }
  table.results-zavody td:nth-child(3) { flex: 1 1 auto; min-width: 0; }
  table.results-zavody td:nth-child(4) { flex: 1 0 100%; }
  .akce-radek { flex-wrap: wrap; white-space: normal; justify-content: flex-start; margin-top: 8px; }
  .akce-radek .akce-registrace { flex-wrap: wrap; }
}

.year-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.year-tabs a {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--gray-200);
  color: var(--text);
  font-weight: 700;
  font-size: .9rem;
}
.year-tabs a.active, .year-tabs a:hover { background: var(--orange); color: var(--white); text-decoration: none; }

.empty-note {
  padding: 30px;
  text-align: center;
  color: var(--gray-600);
  background: var(--gray-100);
  border-radius: var(--radius);
}

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .9rem; }
.form-field input, .form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}
.form-field input:focus, .form-field textarea:focus { outline: 2px solid var(--orange); border-color: transparent; }
.form-field input[type="radio"], .form-field input[type="checkbox"] { width: auto; }
.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.hp-field { position: absolute; left: -9999px; }

.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; }
.alert-success { background: #e6f6ec; color: #1a7a3d; }
.alert-error { background: #fdeceb; color: #c0331d; }

.contact-info dt { font-weight: 700; color: var(--text); margin-top: 16px; }
.contact-info dd { margin: 2px 0 0; color: var(--gray-600); }

.eu-project-card { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }
.eu-project-flag { flex: 0 0 auto; width: 130px; }
.eu-project-flag svg { width: 100%; height: auto; border-radius: 4px; display: block; }
.eu-project-text { flex: 1 1 320px; }
.eu-project-text h3 { margin-bottom: 6px; }

/* --- Footer --- */
.site-footer {
  background: var(--navy);
  color: var(--gray-400);
  padding: 50px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--white); font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--gray-400); }
.site-footer a:hover { color: var(--orange); }
.partners-section { padding-top: 20px; }
.partner-logos { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; justify-content: center; margin-bottom: 26px; }
.partner-logos:last-child { margin-bottom: 0; }
.partner-logos a { display: block; line-height: 0; transition: transform .15s; }
.partner-logos a:hover { transform: translateY(-2px); }
.partner-logos img {
  background: #fff;
  padding: 18px 28px;
  border-radius: 10px;
  height: 90px;
  width: auto;
  display: block;
}
@media (max-width: 600px) {
  .partner-logos img { height: 64px; padding: 14px 20px; }
}
.partner-logos-white img {
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 20px;
  font-size: .85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* --- Cookie lišta --- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: var(--navy);
  color: var(--gray-200);
  box-shadow: 0 -4px 18px rgba(0,0,0,.2);
}
.cookie-banner-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}
.cookie-banner-inner p { margin: 0; color: var(--gray-200); flex: 1 1 400px; font-size: .9rem; }
.cookie-banner-inner a { color: var(--orange); }
.cookie-banner-actions { display: flex; gap: 10px; flex: 0 0 auto; }

/* --- Modální okno (úprava přihlášky) --- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  padding: 0;
}
.icon-btn:hover { background: var(--gray-100); color: var(--text); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,32,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-box h3 { margin-bottom: 18px; padding-right: 24px; }
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-600);
}
.modal-close:hover { color: var(--text); }

/* --- Admin --- */
.admin-shell { background: var(--gray-100); min-height: 100vh; }
.admin-bar {
  background: var(--navy); color: var(--white);
  padding: 16px 0;
}
.admin-bar .container { display: flex; justify-content: space-between; align-items: center; }
.admin-bar a { color: var(--gray-200); }

.admin-layout { display: flex; min-height: 100vh; align-items: stretch; }
.admin-sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--navy); color: var(--white);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar-title {
  padding: 22px 20px 18px; font-weight: 700; line-height: 1.3;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  margin-bottom: 10px;
}
.admin-sidebar-links { display: flex; flex-direction: column; }
.admin-sidebar-links a {
  padding: 11px 20px; color: var(--gray-200); text-decoration: none;
  border-left: 3px solid transparent;
}
.admin-sidebar-links a:hover { background: rgba(255, 255, 255, .07); color: var(--white); }
.admin-sidebar-links a.active {
  background: rgba(255, 255, 255, .07); color: var(--white);
  font-weight: 600; border-left-color: var(--orange);
}
.admin-sidebar-submenu { display: flex; flex-direction: column; }
.admin-sidebar-submenu a {
  padding: 8px 20px 8px 38px; font-size: .92rem; color: var(--gray-200); text-decoration: none;
  border-left: 3px solid transparent;
}
.admin-sidebar-submenu a:hover { background: rgba(255, 255, 255, .07); color: var(--white); }
.admin-sidebar-submenu a.active {
  background: rgba(255, 255, 255, .07); color: var(--white);
  font-weight: 600; border-left-color: var(--orange);
}
/* Akční lišta přilepená dole u dlouhých seznamů se zaškrtávátky (např. slučování
   duplicitních běžců/týmů) - at není potřeba scrollovat na úplný konec seznamu,
   aby šlo dosáhnout na tlačítko. `left` odpovídá šířce .admin-sidebar (230px). */
.admin-sticky-actions {
  position: fixed; left: 230px; right: 0; bottom: 0; z-index: 20;
  background: var(--white); padding: 14px 20px;
  box-shadow: 0 -2px 10px rgba(15, 23, 32, .12);
  display: flex; align-items: center; gap: 12px;
}
.admin-sidebar-links-bottom {
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.admin-main { flex: 1; min-width: 0; }
.admin-back-link { display: inline-block; margin-bottom: 18px; }

@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%; height: auto; position: static; flex-direction: row;
    flex-wrap: wrap; align-items: center; padding: 10px 14px;
  }
  .admin-sidebar-title { display: none; }
  .admin-sidebar-links { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-links a { padding: 6px 10px; border-left: none; }
  .admin-sidebar-links a.active { border-left: none; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
  /* Podmenu se na mobilu "rozpustí" mezi ostatní položky (display:contents) -
     žádné vnořené zalomení navíc, jen se jeho odkazy zařadí do stejného řádku. */
  .admin-sidebar-submenu { display: contents; }
  .admin-sticky-actions { left: 0; padding: 10px 14px; }
  .admin-sidebar-submenu a { padding: 6px 10px; border-left: none; }
  .admin-sidebar-submenu a.active { border-left: none; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
  .admin-sidebar-links-bottom { margin-top: 0; padding-top: 0; border-top: none; }
}
.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  margin-bottom: 26px;
}
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 20px;
}
.login-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gray-200); }
table.admin-table th { font-size: .78rem; text-transform: uppercase; color: var(--gray-600); }
.admin-details-toggle { cursor: pointer; font-weight: 600; padding: 8px 0; list-style: revert; }
.admin-details-toggle::marker { color: var(--gray-600); }
details[open] > .admin-details-toggle { margin-bottom: 8px; }
.mt-id-copy { cursor: pointer; font-family: monospace; font-size: .78rem; color: var(--gray-400); }
.mt-id-copy:hover { color: var(--gray-600); text-decoration: underline; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-file { background: #e6f0fd; color: #1258a8; }
.badge-link { background: #fef3e6; color: #a85e12; }
.badge-ok { background: #e6f6ec; color: #1a7a3d; }
.badge-err { background: #fdeceb; color: #c0331d; }
.btn-xs { padding: 6px 14px; font-size: .75rem; }
.btn-danger { background: #c0331d; color: #fff; }
.btn-danger:hover { background: #9c281a; }
.dup-chip { display: inline-flex; align-items: center; gap: 4px; background: #fef3e6; color: #a85e12; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: .75rem; font-weight: 600; margin: 2px 4px 2px 0; }
.dup-chip-x { border: none; background: transparent; color: #a85e12; cursor: pointer; font-size: .95rem; line-height: 1; padding: 3px 6px; border-radius: 50%; }
.dup-chip-x:hover { background: rgba(168, 94, 18, .18); }
