/* public.css */
/* The public pages' own rules (the league's look comes in as the custom properties of the page's <style>,
   app/templates/public/layout.html: --primary, --bg, --tab-*, --row-*, --th, … and the few rules that print a
   league's own number: sizes, gaps, corners). Moved out of the layout on 2026-11-13 so the browser keeps it. */
  body { margin: 0; padding: 0 0.75rem 1.5rem; background: var(--bg); color: var(--text); }
  h1, h2, h3 { color: var(--heading); }
  a { color: var(--primary); }
  /* A round's cell of Ukupni poredak with the time: the points below it in "Tekst 2" */
  [data-round-below] { color: var(--text2); }
  /* Athletes' names in every results table are bold (owner, 2026-10-30) */
  td a[href^="/athletes/"], .athlete-name { font-weight: bold; }
  /* A round's date below its name in Ukupni poredak's headings, in "Datum"; aligned as the headings of numbers
     ("Poravnanje naslova brojčanih stupaca", owner 2026-11-05: were always centred) */
  th [data-round-date] { color: var(--round-date); font-weight: normal; font-size: .85em; white-space: nowrap; }
  tbody tr [data-round-below] { color: var(--row-text2); }
  tbody tr:nth-child(even) [data-round-below] { color: var(--row-alt-text2); }
  /* The marks of a round's result, "Oznake u ukupnom poretku" on "Izgled" (docs open point 59) */
  .mark { display: inline-block; font-weight: bold; padding: 0 .3em; border-radius: .2em; line-height: 1.35; vertical-align: middle; }
  .muted { color: var(--muted); }

  /* Top line: seasons, language */
  .topline { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.25rem 0.875rem; font-size: .85rem; padding: 0.375rem 0; }
  .topline a { text-decoration: none; }
  .topline { align-items: center; }
  /* The languages and the platform's logo at "Jezik i logo platforme" on "Izgled", in % of the top line (owner,
     2026-11-03; 150 % by default) */
  /* The league's Instagram and Facebook at the top line's left end, over the left logo, as large as the
     platform's logo (docs open point 85) */
  nav[data-social] { display: flex; gap: 0.5rem; margin-right: auto; }
  nav[data-social] a { display: block; line-height: 0; }
  /* Header: left logo (also a link home), the page's title (REZULTATI, SEZONE, STATISTIKA, INFORMACIJE,
     PRIJAVE), right logo */
  .masthead { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
  .masthead .side { max-height: 12.5rem; max-width: var(--logo-width); height: auto; flex-shrink: 0; }   /* only the title gives way */
  .masthead a.side { display: block; }
  /* The title at the left or the right logo ("Poravnanje" of Zaglavlje on "Izgled"); in the middle by default */
  .masthead[data-align="left"] { justify-content: flex-start; }
  .masthead[data-align="left"] > :last-child { margin-left: auto; }
  .masthead[data-align="right"] { justify-content: flex-end; }
  .masthead[data-align="right"] > :first-child { margin-right: auto; }
  .masthead a.side img { display: block; max-width: 100%; max-height: 12.5rem; height: auto; }
  /* The seasons page: each season's name large (owner, 2026-11-04) */
  /* "uskoro": a season in setup */
  .soon { font-size: 1.25em; font-weight: bold; color: var(--secondary); }
  /* Athletes whose seasons differ (ADR 0007): the birth year as an amber badge, the name as an outlined one */
  svg.flag-sign { width: 1.1rem; height: 1.1rem; flex: none; }
  .season-flag { display: inline-flex; align-items: center; gap: 0.2rem; margin-left: 0.3rem; padding: 0 0.35rem; font-size: 0.7em; font-weight: 700; line-height: 1.5;
                 text-decoration: none; vertical-align: middle; border-radius: 0.25rem; }
  .season-flag-birth-year { background: #ffc400; color: #111; border: 1px solid #c77700; }
  .season-flag-name { background: none; color: var(--heading); border: 1px solid currentColor; border-radius: 1em; }
  .season-differences { margin: 0.5rem 0 1rem; padding: 0.5rem 0.75rem; border-left: 0.25rem solid #c77700; background: var(--panel, transparent); }
  .season-differences ul { margin: 0.25rem 0 0; padding-left: 1.2rem; }
  /* Data Issues and Data Sources (docs open point 81) */
  /* The flag: an SVG of fixed colours (black square, yellow sign), so no row or link colour hides it (2026-11-06) */
  a.data-issue-flag, span.data-issue-flag { display: inline-flex; align-items: center; gap: 0.25rem; vertical-align: middle;
                                            margin-left: 0.3rem; line-height: 1; text-decoration: none; border: 0; background: none; }
  /* Why a name is flagged, beside the sign (dvostruko, spol, tim, napomena) */
  .flag-reason { font-size: 0.7em; font-weight: 700; color: var(--heading); }
  svg.data-issue-sign { width: 2.1rem; height: 2.1rem; display: block; }
  ul.data-issues { list-style: none; padding: 0.5rem 0.75rem; margin: 0 0 1rem; border-left: 0.25rem solid #c77700;
                   background: color-mix(in srgb, #c77700 8%, transparent); }
  ul.data-issues li { margin: 0.2rem 0; }
  .data-sources-link { text-align: center; margin: 1.5rem 0 0.25rem; font-size: 0.875rem; }
  .masthead .side[data-logo-right] { width: var(--logo-width); max-height: none; }
  /* The script at the end sizes the title to the smaller logo's height; this is its size before (or without) it */
  .masthead .title { font-size: clamp(1.25rem, 4vw, 5rem); font-weight: bold; color: var(--heading); line-height: 1;
                     white-space: nowrap; flex: 0 1 auto; min-width: 0; text-decoration: none; }
  /* Round bar */
  /* Its colours, spacing, size and corners are the league's "Traka kola" on "Izgled": its entries are buttons, as
     the tabs, in one bar without spacing, each on its own with it */
  .roundbar a { text-decoration: none; color: var(--roundbar-link); }
  .roundbar > a[aria-current="page"] { font-weight: bold; color: var(--roundbar-current); background: var(--roundbar-current-bg); }
  .roundbar span { color: var(--roundbar-inactive); }
  /* The season row: the seasons' tabs, then "Informacije", "Statistika" and "Prijave" at the right end */
  /* Its colours, spacing, size and corners are "Sezone" on "Izgled" (until set, the tabs'); nav.tab.seasonbar
     outweighs the rules of nav.tab below. Without spacing the tabs are one bar, as the tabs' */
  nav.tab.seasonbar a { background: var(--season-tab-bg); color: var(--season-tab-text); border-radius: var(--season-tab-radius); }
  nav.tab.seasonbar a:hover { background: color-mix(in srgb, var(--season-tab-text) 8%, var(--season-tab-bg)); }
  nav.tab.seasonbar a[aria-selected="true"] { background: var(--season-tab-active-bg); color: var(--season-tab-active-text); }
  /* Informacije, Statistika, Merch … in a row of their own above the seasons, at the right; the seasons wrap among
     themselves, so more seasons never push a link away (owner, 2026-11-12) */
  nav.seasonbar { flex-wrap: wrap; }
  nav.seasonbar .season-links { order: -1; display: flex; flex-wrap: wrap; gap: inherit; width: 100%; justify-content: flex-end; }
  nav.seasonbar .home-link { margin-right: auto; font-weight: bold; }
  nav.tab.seasonbar.site-links { margin-bottom: 0.5rem; }   /* outweighs nav.tab.seasonbar { margin-bottom: 0 } of the page's own style */
  nav.seasonbar .season-list { display: flex; flex-wrap: wrap; gap: inherit; width: 100%; }
  /* The navigation button row (Početna, Informacije, Statistika, Fotografije, Prijave, Merch): every button looks the same */
  nav.seasonbar .season-links a { font-weight: bold; }

  table { border-collapse: collapse; width: 100%; margin-bottom: 1.25rem; }
  th, td { border: 1px solid var(--line); padding: 0.5rem; }
  /* "Poravnanje" on "Izgled": every table's text columns (names, countries, …), and its numbers' (.num:
     ranks, times, points, bonuses, dates) headings and data */
  th { background: var(--th); color: var(--th-text); }
  /* The rows' colours are the league's "Retci tablica" on "Izgled" (docs open point 58) */
  tbody tr { background: var(--row-bg); color: var(--row-text); }
  tbody tr:nth-child(even) { background: var(--row-alt-bg); color: var(--row-alt-text); }
  tbody tr a { color: var(--row-link); }
  tbody tr:nth-child(even) a { color: var(--row-alt-text); }
  tbody tr:nth-child(even):hover { background: var(--row-hover); color: #000; }
  tbody tr:nth-child(even):hover a { color: #000; }
  tbody tr:hover { background: var(--tint); }
  .table-wrap { overflow-x: auto; }
  img.flag { height: 0.875rem; margin-right: 0.3125rem; vertical-align: middle; }
  td.country { white-space: nowrap; }

  /* Tabs (.tab) and sub-tabs (.tabs), as the old site's .tab and .subtab */
  /* Their colours, spacing and corners are the league's "Kartice" on "Izgled" (docs open point 57); without
     spacing they are one bar, as the old site's, with spacing each tab stands on its own */
  nav.tab, nav.tabs { overflow: hidden; border: 1px solid var(--line); margin-bottom: 0.625rem; display: flex; flex-wrap: wrap;
                      background: var(--tab-bg); border-radius: var(--tab-radius); }
  nav.tab a, nav.tabs a { color: var(--tab-text); background: var(--tab-bg); border-radius: var(--tab-radius);
                          text-decoration: none; transition: .3s; }
  nav.tab a:hover, nav.tabs a:hover { background: color-mix(in srgb, var(--tab-text) 8%, var(--tab-bg)); }
  nav.tab a[aria-selected="true"], nav.tabs a[aria-selected="true"] { background: var(--tab-active-bg); color: var(--tab-active-text); }
  .tabcontent { padding: 0.375rem 0.75rem; border: 1px solid var(--line); border-top: none; margin-bottom: 1.25rem; }
  nav.tab[hidden] { display: none; }
  nav.tab[hidden] ~ .tabcontent { border-top: 1px solid var(--line); }
  .download { display: inline-block; background: var(--secondary); color: var(--on-secondary); padding: 0.625rem 1.25rem;
              text-decoration: none; border-radius: 0.3125rem; font-weight: bold; margin: 0.25rem 0 0.75rem; }
  /* A Course panel's "Sezona …" and "Staza …" in one row (owner, 2026-11-04)  */
  .panel-headings { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1.25rem; }
  /* A heading with the workbook's button at the right end of its row (Timski poredak, owner 2026-11-04)  */
  .heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 1rem; }
  .heading-row .download { margin: 0.25rem 0; }
  /* In the Timovi panel "Sezona: …" right above the team heading, without the gap between them (owner, 2026-11-04)  */
  [data-teams] > h2[data-season-name] { margin-bottom: 0; }
  /* Every panel's "Sezona: …" right under the tab row (owner, 2026-11-04)  */
  .tabcontent > h2[data-season-name], .tabcontent > .panel-headings > h2 { margin-top: 0.25rem; }
  /* A page's heading close above its tab row, a Course's headings close above its sub-tabs (owner, 2026-11-04)  */
  h1:has(+ nav.tab) { margin-bottom: 0.375rem; }
  .tabcontent > .panel-headings > h2 { margin-bottom: 0.375rem; }
  /* A sub-tab's heading (Muški, Žene, a category) close above its table  */
  [data-panel] > h3 { margin: 0.25rem 0 0.375rem; }
  [data-teams] > .heading-row h2 { margin-top: 0.25rem; }
  /* In a sub-tabs' row the workbook's button sits at its right end, as tall as the tabs  */
  nav.tabs a.download, nav.tabs a.download:hover { margin: 0 0 0 auto; display: flex; align-items: center;
                                                   background: var(--secondary); color: var(--on-secondary);
                                                   border-radius: 0.3125rem; }
  details.calendar { margin: 0 0 1rem; }
  details.calendar summary { cursor: pointer; color: var(--primary); }
  [data-contributor] { font-weight: 700; }
  .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.75rem; }
  .card { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.75rem; }

  /* Forms (registration): one column, the league's colours */
  form.public-form { max-width: 35rem; margin-bottom: 1.25rem; }
  /* Two short fields side by side (name and surname, club and country); one under the other on a phone */
  .public-form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.75rem; }
  @media (max-width: 30rem) { .public-form .pair { grid-template-columns: 1fr; } }
  form.public-form.inline { max-width: none; margin: 0.5rem 0; }
  /* A whole form in a gray panel, like the admin's fieldsets */
  form.public-form.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 0.5rem; padding: 1.125rem 1.25rem 0.375rem; }
  .public-form p { margin: 0 0 0.875rem; }
  /* Field names small and muted, like the admin's labels */
  .public-form label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 0.25rem; }
  .public-form input:not([type=checkbox]):not([type=file]), .public-form select, .public-form textarea {
    box-sizing: border-box; width: 100%; padding: 0.5625rem 0.625rem; font: inherit; color: var(--text); background: var(--bg);
    border: 1px solid color-mix(in srgb, var(--text) 30%, var(--bg)); border-radius: 0.3125rem; }
  .public-form input:focus, .public-form select:focus, .public-form textarea:focus {
    outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
  .public-form input[name=code] { max-width: 10em; font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
  .public-form .check { display: flex; align-items: flex-start; gap: 0.5rem; }
  .public-form .check input { margin-top: 0.1875rem; width: 1.125rem; height: 1.125rem; accent-color: var(--primary); flex: none; }
  .public-form .check label { display: inline; font-weight: normal; font-size: 1rem; color: var(--text); }
  .public-form button, button.button { font: inherit; font-weight: bold; cursor: pointer; border: 0; border-radius: 0.3125rem;
    padding: 0.625rem 1.25rem; background: var(--secondary); color: var(--on-secondary); }
  .public-form button.plain { background: none; color: var(--primary); border: 1px solid var(--primary); padding: 0.375rem 0.875rem; }
  .public-form button:hover { filter: brightness(1.08); }
  .privacy { border-left: 0.1875rem solid var(--primary); background: var(--tint); padding: 0.625rem 0.75rem; margin: 0 0 0.875rem;
             white-space: pre-line; font-size: .9rem; }
  p[role=status], p[role=alert] { padding: 0.625rem 0.75rem; border-radius: 0.3125rem; max-width: 47.5rem; }
  p[role=status] { background: var(--tint); border-left: 0.25rem solid var(--primary); }
  p[role=alert] { background: color-mix(in srgb, #c62828 10%, var(--bg)); border-left: 0.25rem solid #c62828; }
  table.prices { width: auto; min-width: min(100%, 26.25rem); }
  [data-pay-at-start] { font-weight: bold; font-size: 1.1rem; }
  [data-pay-at-start] > :first-child, .privacy > :first-child { margin-top: 0; }
  [data-pay-at-start] > :last-child, .privacy > :last-child { margin-bottom: 0; }
  ul.full { color: #c62828; font-weight: 600; }
  ul.registrations { list-style: none; padding: 0; max-width: 47.5rem; }
  ul.registrations > li { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.75rem 0.875rem; margin-bottom: 0.75rem; }
  ul.registrations > li > p:first-child { font-weight: 600; margin-top: 0; }
  img.hub3a { max-width: 100%; height: auto; background: #fff; padding: 0.375rem; }
  /* KEKS Pay and Revolut QR codes on "Moje prijave" */
  /* the bank transfer details under the HUB3A code on "Moje prijave" */
  dl.bank-transfer { display: grid; grid-template-columns: max-content 1fr; gap: 2px 0.75rem; margin: 0 0 0.75rem; }
  dl.bank-transfer dt { color: var(--muted); font-size: 0.85rem; }
  dl.bank-transfer dd { margin: 0; overflow-wrap: anywhere; }
  .pay-apps { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
  .pay-apps figure { margin: 0; text-align: center; }
  .pay-apps img { width: 10rem; height: auto; background: #fff; padding: 0.25rem; }
  footer.version { margin: 2rem auto 1rem; text-align: center; font: 0.75rem/1.4 ui-monospace, monospace; opacity: 0.75; }
  /* The operator's impressum link in every footer and its page (docs open point 86), in the league's look */
  p.impressum-link { margin: 1.5rem 0 0; text-align: center; font-size: 0.85rem; }
  table.about-us { width: auto; max-width: 100%; margin: 1rem 0 1.5rem; border-collapse: collapse; }
  table.about-us th, table.about-us td { border: 0; padding: 0.3rem 2rem 0.3rem 0; text-align: left; vertical-align: top; background: none; color: inherit; }
  table.about-us th { font-weight: 700; text-transform: uppercase; font-size: 0.85rem; white-space: nowrap; }
  table.about-us tbody + tbody tr:first-child > * { padding-top: 1.2rem; }
  article.legal { max-width: 52rem; line-height: 1.55; }
  article.legal h2 { font-size: 1.15rem; margin-top: 1.5rem; }
  footer.impressum { margin: 1rem 0; padding: 1rem; border: 1px solid var(--line, currentColor); border-radius: 0.5rem; font-size: 0.9rem; }
  footer.impressum .operator { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1rem; }
  footer.impressum .legal-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.75rem; border-top: 1px solid var(--line, currentColor); }
  /* The pages of one form or one short list (registration, the code, my orders, the merch order) are a centred column,
     the merch order a wider one for its option drop-downs, price and quantity in one row (owner, 2026-11-13) */
  .form-page { max-width: 44rem; margin-inline: auto; }
  .form-page.wide { max-width: 52rem; }
  .form-page form.public-form { max-width: none; }

  /* Wide results tables on a phone (owner, 2026-11-13): the name (a team's name) column stays in view while the table scrolls
     sideways, over a cell of its own colours; a hint above a table that scrolls is added by static/js/public_tables.js */
  th.sticky-name, td.sticky-name { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
  th.sticky-name { background: var(--th-sticky, var(--th)); color: var(--th-text); z-index: 2; }
  td.sticky-name { background: var(--row-bg); }
  tbody tr:nth-child(even) td.sticky-name { background: var(--row-alt-bg); }
  tbody tr:hover td.sticky-name { background: var(--tint); }
  tbody tr:nth-child(even):hover td.sticky-name { background: var(--row-hover); }
  @media (max-width: 40rem) { td.sticky-name, th.sticky-name { min-width: 5.5rem; max-width: 9rem; overflow-wrap: break-word; } }
  .scroll-hint { margin: 0.25rem 0 0.375rem; font-size: 0.8rem; color: var(--muted); }
