/* =========================================================================
   MTBO sacensību vietne (mtbo-wcup.lv) — publiskā lapa.
   Pamatā Talsu BJC CMS noformējums, zīmola krāsa — orientēšanās oranžā.

   Koncepts: "lietišķi redakcionāls". Lapa ir balta, gaisīga un mierīga;
   krāsu un rotaļīgumu ienes pats logo, fotogrāfijas un saturs, nevis
   noformējums. Struktūru veido plānas 1px līnijas un atstarpes, nevis rāmji
   un ēnas. Sadaļu krāsas parādās tikai kā punkts, etiķete un šaura svītra
   kartītes augšmalā.

   Kustība (Emil Kowalski principi):
     • animē tikai transform/opacity; UI kustība zem 300 ms;
     • ease-out ienākšanai, nekad ease-in;
     • katra :hover kustība aiz (hover: hover) — pieskāriens nav pele;
     • prefers-reduced-motion = mazāk un maigāk, nevis nulle.
   ========================================================================= */

:root {
    /* ---- Virsmas un teksts: orientēšanās kartes papīrs un tinte ---- */
    --ink:       #16211B;   /* meža melnā — virsraksti un pamatteksts */
    --ink-2:     #0F1813;   /* tumšās joslas (kājene) */
    --ink-soft:  #56635B;   /* palīgteksts, 6.1:1 uz balta, 5.7:1 uz kartes papīra */
    --paper:     #FFFFFF;
    --paper-2:   #F7F4EC;   /* kartes papīrs — joslas, iedobes, vietturi */
    --paper-3:   #EEE9DD;
    --line:      #E6E0D2;   /* 1px matu līnija, silta */
    --line-2:    #D2CAB8;   /* redzamāka līnija, fokusa rāmji */

    /* ---- Kartes krāsas (ISMTBOM): trase, horizontāles, mežs, klajums ---- */
    --overprint: #A3238E;   /* IOF trases violetā — kontrolpunkti, trase; 6.6:1 uz balta */
    --contour:   #B5652E;   /* horizontāļu brūnā */
    --forest:    #2F7D3A;
    --open-land: #F7D97A;
    --flag:      #F26B21;   /* kontrolpunkta karodziņa oranžā — tikai rotājumam */

    /* ---- Zīmola krāsa: kontrolpunkta oranžā, padziļināta lasāmībai ---- */
    --brand:      #C2410C;
    --brand-dark: #9A3412;
    --brand-soft: #FFF1E8;
    --brand-warm: #B42318;  /* CX80 sarkanā — tikai smalkam uzsvaram */

    /* ---- Sadaļu akcenti (sinhroni ar section_palette() PHP pusē) ---- */
    --c1: #C2410C;  /* oranža    */
    --c2: #B42318;  /* sarkana   */
    --c3: #E9A812;  /* dzeltena  */
    --c4: #2F6F3A;  /* meža zaļa */
    --c5: #6D3FA8;  /* violeta   */
    --c6: #0A6FA6;  /* zila      */

    --accent:     var(--c1);
    --accent-ink: #FFFFFF;

    /* ---- Forma ---- */
    --r-sm: 2px;
    --r-md: 3px;
    --r-lg: 3px;

    --shadow-sm: 0 1px 2px rgba(20, 38, 59, .05);
    --shadow-md: 0 6px 20px rgba(20, 38, 59, .09), 0 2px 6px rgba(20, 38, 59, .05);
    --shadow-lg: 0 18px 48px rgba(20, 38, 59, .16);

    /* ---- Kustības līknes (no animations.dev; nekad neizdomātas) ---- */
    --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

    /* ---- Burti ---- */
    --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
    --body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Uz dzeltenās balts teksts nelasās — tai tumšs. */
.acc-3 { --accent-ink: #14263B; }

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    /* Rezervēta ritjoslas vieta: kad atveras attēla logs un ritjosla pazūd,
       saturs nepaslīd sāņus. */
    scrollbar-gutter: stable;
}
html.lightbox-open { overflow: hidden; }

body {
    margin: 0;
    font-family: var(--body);
    font-size: 1.0313rem;      /* 16.5px */
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: 0;          /* šauram fontam negatīva atstarpe salīp */
    line-height: 1.08;
    color: var(--ink);
    margin: 0;
}

a { color: var(--ink); }
img { max-width: 100%; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 3px;
}

.container { width: min(1200px, 100% - 2.5rem); margin-inline: auto; }

/* Mazā etiķete — datumi, kategorijas, meta */
.tag {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

/* Redzams tikai ekrānlasītājam */
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: fixed; top: .6rem; left: 50%; z-index: 3000;
    transform: translate(-50%, -180%);
    background: var(--ink); color: #fff; font-weight: 600;
    padding: .65rem 1.1rem; border-radius: var(--r-sm); text-decoration: none;
    transition: transform 180ms var(--ease-out);
}
.skip-link:focus-visible { transform: translate(-50%, 0); color: #fff; }

/* Lasīšanas progress — CSS ritināšanas laika josla: bez JS un ārpus galvenā
   pavediena. Pārlūkos bez atbalsta vienkārši nav redzama. */
.scroll-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1200;
    background: var(--brand);
    transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}
@supports (animation-timeline: scroll()) {
    .scroll-progress { animation: progress linear forwards; animation-timeline: scroll(root block); }
    @keyframes progress { to { transform: scaleX(1); } }
}

/* =========================================================================
   Kontaktjosla virs izvēlnes
   ========================================================================= */
.topbar {
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
    font-size: .85rem;
}
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; min-height: 42px; padding: .3rem 0; }
.topbar a, .topbar span { color: var(--ink-soft); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.topbar a { transition: color 160ms ease; }
.topbar-social { margin-left: auto; display: flex; align-items: center; gap: 1.1rem; font-weight: 600; }
.topbar svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* =========================================================================
   Navigācija
   ========================================================================= */
.nav-wrap {
    position: sticky; top: 0; z-index: 1000;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    transition: box-shadow 220ms var(--ease-out);
}
.nav-wrap.scrolled { box-shadow: var(--shadow-sm); }

.nav-bar { display: flex; align-items: center; gap: 1.5rem; min-height: 74px; }

.nav-brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; white-space: nowrap; }
.brand-logo { width: auto; height: 54px; display: block; }
.brand-name {
    font-family: var(--display); font-weight: 800; font-size: 1rem;
    letter-spacing: -.02em; line-height: 1.25; color: var(--ink);
}
.brand-name small {
    display: block; font-family: var(--body); font-weight: 500;
    font-size: .74rem; letter-spacing: 0; color: var(--ink-soft);
}

.nav-links { display: flex; align-items: center; gap: .1rem; margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links > li { position: relative; list-style: none; }
.nav-link {
    position: relative; display: block; padding: .55rem .7rem;
    text-decoration: none; font-weight: 600; font-size: .94rem; color: var(--ink);
    white-space: nowrap;
    transition: color 160ms ease;
}
/* Aktīvo sadaļu iezīmē svītra zem teksta, nevis krāsains laukums. */
.nav-link::after {
    content: ""; position: absolute; left: .7rem; right: .7rem; bottom: -1px; height: 2px;
    background: var(--accent, var(--brand)); border-radius: 2px;
    transform: scaleX(0); transform-origin: 50% 50%;
    transition: transform 200ms var(--ease-out);
}
.nav-link.active { color: var(--brand); }
.nav-link.active::after { transform: none; }
.nav-item-has-children > .nav-link { padding-right: 1.35rem; }
.nav-item-has-children > .nav-link::before {
    content: ""; position: absolute; right: .55rem; top: 50%; width: 5px; height: 5px;
    border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    transition: transform 200ms var(--ease-out);
}

/* Apakšizvēlne — izaug no sava izvēlnes punkta */
.nav-sub {
    position: absolute; top: calc(100% + 1px); left: -.2rem; min-width: 250px;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
    box-shadow: var(--shadow-md); padding: .4rem; margin: 0; list-style: none;
    opacity: 0; visibility: hidden;
    transform: scale(.98) translateY(-4px); transform-origin: 20% 0;
    transition: opacity 170ms var(--ease-out), transform 170ms var(--ease-out), visibility 170ms;
}
.nav-item-has-children:hover .nav-sub,
.nav-item-has-children:focus-within .nav-sub { opacity: 1; visibility: visible; transform: none; }
.nav-item-has-children:hover > .nav-link::before,
.nav-item-has-children:focus-within > .nav-link::before { transform: translateY(-30%) rotate(225deg); }
.nav-sub a {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .65rem; border-radius: var(--r-sm);
    text-decoration: none; font-weight: 500; font-size: .93rem; color: var(--ink);
    transition: background-color 150ms ease, color 150ms ease;
}
.nav-sub .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--dot, var(--brand)); }

/* Starpsolis pirms pogas izvēlnes: kad punkti tikko neietilpst rindā, vispirms
   saspiežam atstarpes un noņemam zīmola apakšvirsrakstu, un tikai tad, ja arī
   ar to nepietiek, pārejam uz pogu. Klasi uzliek main.js pēc mērījuma. */
.nav-tight .nav-bar { gap: 1rem; }
.nav-tight .nav-brand { gap: .55rem; }
.nav-tight .nav-brand small { display: none; }
.nav-tight .brand-logo { height: 46px; }
.nav-tight .nav-link { padding: .5rem .5rem; font-size: .89rem; }
.nav-tight .nav-item-has-children > .nav-link { padding-right: 1.1rem; }

.nav-toggle {
    display: none; margin-left: auto;
    width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: var(--r-md);
    background: var(--paper); color: var(--ink); cursor: pointer;
    flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    transition: transform 130ms var(--ease-out), background-color 160ms ease;
}
.nav-toggle:active { transform: scale(.96); }
.nav-toggle span { display: block; width: 18px; height: 1.8px; background: currentColor; border-radius: 2px; transition: transform 220ms var(--ease-out), opacity 150ms ease; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(5.8px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-5.8px) rotate(-45deg); }

/* =========================================================================
   Pogas un saites
   ========================================================================= */
.btn-bjc {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--brand); color: #fff; cursor: pointer; border: 1px solid var(--brand);
    font-family: var(--body); font-weight: 600; font-size: .97rem;
    padding: .78rem 1.4rem; border-radius: var(--r-md); text-decoration: none;
    transition: background-color 170ms ease, border-color 170ms ease, transform 130ms var(--ease-out);
}
.btn-bjc:active { transform: scale(.98); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:active { color: var(--accent-ink); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:active { color: var(--ink); }
.btn-sm { padding: .52rem 1rem; font-size: .9rem; }

.link-arrow {
    display: inline-flex; align-items: center; gap: .4rem;
    font-weight: 600; font-size: .95rem; text-decoration: none; color: var(--brand);
    transition: color 160ms ease;
}
.link-arrow span { transition: transform 200ms var(--ease-out); }

/* Sadaļas etiķete ar punktu — krāsa parādās tikai šeit un kartītes svītrā */
.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink-soft);
}
.eyebrow::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--dot, var(--accent)); flex: 0 0 auto;
}

/* =========================================================================
   Sākumlapas hero
   ========================================================================= */
.hero { position: relative; overflow: hidden; padding: clamp(2.4rem, 5vw, 4.2rem) 0 clamp(2rem, 4vw, 3.4rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
/* Bez programmas paneļa (piem. ja ir sacensību dienu cilnes) hero ir vienā kolonnā. */
.hero-grid-single { grid-template-columns: minmax(0, 1fr); }

/* ---- Saulīte no logo -------------------------------------------------------
   Lēni pārvietojas pāri hero blokam kā pa debesīm. Ārējais slānis nes to
   horizontāli vienmērīgā ātrumā, iekšējais ceļ un laiž lejā — tāpēc ceļš
   sanāk loks, nevis taisne. Kustība ir tikai transform, tātad notiek ārpus
   galvenā pavediena. Rotājums, tāpēc pointer-events: none.                   */
.hero-sun {
    position: absolute; top: 0; left: 0; z-index: 0;
    pointer-events: none;
    /* Negatīva aizture sāk ciklu no vidus, tāpēc saulīte ir redzama jau
       lapas atvēršanas brīdī. Bez tās tā sāktu ceļu ārpus ekrāna un
       parādītos tikai pēc kādām sešām sekundēm. */
    animation: sun-across 54s linear -13s infinite;
}
.hero-sun img {
    display: block; width: clamp(36px, 4.2vw, 58px); height: auto;
    opacity: .92;
    animation: sun-rise 27s ease-in-out -13s infinite alternate,
               sun-turn 46s linear infinite;
}
@keyframes sun-across {
    from { transform: translateX(-14vw); }
    to   { transform: translateX(106vw); }
}
@keyframes sun-rise {
    from { transform: translateY(clamp(80px, 15vh, 150px)); }
    to   { transform: translateY(16px); }
}
@keyframes sun-turn {
    from { rotate: 0deg; }
    to   { rotate: 360deg; }
}

/* ---- Hero ar fotogrāfijām -------------------------------------------------
   Attēli mainās ar pārklāšanos (crossfade). Pāreja, nevis keyframes, lai
   maiņu varētu pārtraukt pusceļā.

   Pārklājums ir GAIŠS, nevis tumšs: silts, gandrīz balts plīvurs kreisajā
   pusē, kas pa labi izgaist un ļauj fotogrāfijai izskanēt. Teksts paliek
   tumšs, tāpēc tas lasās neatkarīgi no tā, cik gaiša ir bilde — un lapa
   nekļūst par tumšu plāksni.                                                 */
.hero-has-media {
    position: relative;
    padding: clamp(3.2rem, 6vw, 5rem) 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
/* Saturs vienmēr virs saulītes — arī tad, kad hero ir bez fotogrāfijām. */
.hero > .container { position: relative; z-index: 1; }
.hero-slides { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.hero-slide {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0;
    transition: opacity 900ms ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-slides::after {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(100deg,
            rgba(255, 253, 249, .96) 0%,
            rgba(255, 253, 249, .90) 36%,
            rgba(255, 253, 249, .42) 62%,
            rgba(255, 252, 246, .06) 100%),
        /* Plāns silts tonis pār visu, lai dažādas bildes izskatās kā viena
           sērija. Tas summējas ar augšējo slāni, tāpēc te pietiek ar maz —
           pie .3 labā mala patiesībā bija aizklāta gandrīz uz pusi. */
        linear-gradient(rgba(255, 249, 238, .12), rgba(255, 249, 238, .12));
}

/* Uz gaišā fona teksts ir parastajās krāsās — atsevišķi noteikumi nav vajadzīgi.

   Notikumu kartīte ir daļēji caurspīdīga, lai fotogrāfija izskan arī cauri tai.
   Aiz kartītes fonu izpludinām: bez tā zem teksta būtu bildes detaļas, un
   80% baltums vien nepietiktu, lai sīkais teksts paliktu mierīgi lasāms.
   Palīgteksts te ir mazliet tumšāks — uz caurspīdīga fona parastais tonis
   nokristu zem 4.5:1 kontrasta. */
.hero-has-media .timetable {
    --ink-soft: #45566B;
    background: rgba(255, 255, 255, .8);
    -webkit-backdrop-filter: blur(12px) saturate(115%);
    backdrop-filter: blur(12px) saturate(115%);
    border-color: rgba(255, 255, 255, .75);
    box-shadow: var(--shadow-md);
}
.hero-has-media .timetable-head,
.hero-has-media .timetable-foot { background: rgba(255, 255, 255, .3); }
.hero-has-media .tt-when { background: rgba(255, 255, 255, .55); }
.hero-has-media .tt-row + .tt-row { border-top-color: rgba(20, 38, 59, .1); }
.hero-has-media .timetable-head { border-bottom-color: rgba(20, 38, 59, .1); }
.hero-has-media .timetable-foot { border-top-color: rgba(20, 38, 59, .1); }

/* Pārlūkos bez backdrop-filter caurspīdīgums paliek, bet blīvāks — citādi
   teksts stāvētu tieši uz neizpludinātas fotogrāfijas. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .hero-has-media .timetable { background: rgba(255, 255, 255, .93); }
}

@media (max-width: 991.98px) {
    /* Sašaurinātā skatā teksts stāv pāri visai bildei, tāpēc plīvurs ir
       vienmērīgs, nevis izgaistošs. */
    .hero-slides::after {
        background:
            linear-gradient(rgba(255, 253, 249, .9) 0%, rgba(255, 253, 249, .84) 100%),
            linear-gradient(rgba(255, 249, 238, .12), rgba(255, 249, 238, .12));
    }
}

/* Iestādes nosaukums virs devīzes — mierīgs paraksts, nevis otrs virsraksts */
.hero-kicker {
    display: flex; align-items: center; gap: .7rem;
    margin: 0 0 1rem; font-size: .95rem; font-weight: 600; color: var(--ink-soft);
    letter-spacing: .01em;
}
.hero-kicker::before { content: ""; width: 28px; height: 2px; background: var(--brand-warm); flex: 0 0 auto; }

.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); letter-spacing: -.028em; }
/* Svītra, kas uzvelkas zem atslēgvārdiem, kad lapa atveras. Zīmēta ar fona
   gradientu, nevis absolūtu ::after, lai tā seko tekstam arī tad, ja
   administrators ieraksta garāku frāzi un tā lūzt vairākās rindās. */
.hero h1 .hl {
    background-image: linear-gradient(transparent 76%, var(--c3) 76%, var(--c3) 90%, transparent 90%);
    background-repeat: no-repeat;
    background-size: 0 100%;
    animation: underline 560ms 280ms var(--ease-out) forwards;
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@keyframes underline { to { background-size: 100% 100%; } }
.hero-lead { font-size: 1.09rem; color: var(--ink-soft); margin: 1.1rem 0 1.9rem; max-width: 48ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; }

/* Hero galvenā poga — tā pati oranžā kā riteņa bremžu disks un logo kompasa adata; tumšs teksts (~5.5:1, WCAG AA).
   Ierobežots ar .hero, jo tā pati .hero-actions klase ir arī kontaktu joslā. */
.hero .btn-bjc:not(.btn-ghost) {
    background: var(--flag); border-color: var(--flag); color: var(--ink);
}
.hero .btn-bjc:not(.btn-ghost):active { color: var(--ink); }

/* ---- Tuvākie notikumi ---- */
.timetable {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.timetable-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.timetable-head h2 { font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.tt-row {
    display: grid; grid-template-columns: 58px 1fr; gap: 1rem; align-items: center;
    padding: .95rem 1.3rem; text-decoration: none; color: var(--ink);
    transition: background-color 160ms ease;
}
.tt-row + .tt-row { border-top: 1px solid var(--line); }
/* Pulciņu rindai nav datuma — tad kolonna ir viena, un krāsu nes punkts. */
.tt-row-plain { grid-template-columns: 1fr; }
.tt-row-plain .tt-what > span::before {
    content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--dot, var(--brand)); margin-right: .55rem; vertical-align: middle;
}
.tt-when {
    text-align: center; line-height: 1.15; padding: .4rem .2rem;
    background: var(--paper-2); border-radius: var(--r-sm);
    font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.tt-when b { display: block; font-family: var(--display); font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; color: var(--dot, var(--brand)); text-transform: none; }
.tt-what { display: flex; flex-direction: column; gap: .1rem; font-weight: 600; font-size: .97rem; line-height: 1.35; }
.tt-what .bar { display: none; }
.tt-what small { font-weight: 400; color: var(--ink-soft); font-size: .86rem; }
.timetable-foot { padding: .9rem 1.3rem; border-top: 1px solid var(--line); background: var(--paper-2); }

/* =========================================================================
   Sekcijas
   ========================================================================= */
.section { padding: clamp(2.6rem, 5vw, 4.4rem) 0; }
.section-tight { padding-top: 0; }
/* Kontaktu josla sākumlapas beigās: augšā tāda pati atstarpe kā kājenes
   margin-top, apakšā 0 — tā josla stāv baltā laukuma vidū. */
.section-cta { padding: clamp(3rem, 6vw, 4.5rem) 0 0; }
.section-alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.55rem, 2.8vw, 2.1rem); }
.section-head p { color: var(--ink-soft); margin: .55rem 0 0; max-width: 58ch; font-size: 1rem; }
.section-head .eyebrow { margin-bottom: .7rem; }

/* ---- Sadaļu kartītes ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 1.25rem; }
.tile {
    position: relative; display: flex; flex-direction: column; gap: .45rem;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 1.5rem 1.4rem; text-decoration: none; color: var(--ink); overflow: hidden;
    transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), border-color 180ms ease;
}
/* Šaura sadaļas krāsas svītra augšmalā — vienīgā lielākā krāsas vieta */
.tile::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--dot, var(--brand));
}
.tile:active { transform: scale(.995); }
/* Līniju ikona sadaļas krāsā — tikpat daudz krāsas, cik svītrai augšmalā */
.tile-icon { display: block; width: 26px; height: 26px; margin-bottom: .9rem; color: var(--dot, var(--brand)); }
.tile-icon svg { width: 100%; height: 100%; display: block; }
.tile h3 { font-size: 1.12rem; }
.tile p { margin: 0; color: var(--ink-soft); font-size: .94rem; line-height: 1.6; }

/* =========================================================================
   Lapas galva (iekšējās lapas)
   ========================================================================= */
.page-head {
    position: relative;
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
    padding: clamp(1.8rem, 4vw, 2.8rem) 0 clamp(2rem, 4vw, 3rem);
    margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
}
/* Sadaļas krāsa parādās kā šaura svītra lapas augšmalā — tikpat daudz,
   cik kartītēm, ne vairāk. */
.page-head::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--accent);
}
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); max-width: 24ch; }
.page-head-intro { margin: .9rem 0 0; max-width: 62ch; font-size: 1.06rem; color: var(--ink-soft); }
.page-head-actions { margin: 1.2rem 0 0; }
.crumbs { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; font-size: .88rem; color: var(--ink-soft); flex-wrap: wrap; }
.crumbs a { color: var(--ink-soft); text-decoration: none; transition: color 150ms ease; }
.crumbs .tag { color: var(--ink-soft); }

/* =========================================================================
   Jaunumi
   ========================================================================= */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.6rem; }
.news-card {
    display: flex; flex-direction: column; background: var(--paper);
    border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
    text-decoration: none; color: var(--ink);
    transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), border-color 180ms ease;
}
.news-card:active { transform: scale(.995); }
.news-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 320ms var(--ease-out); }
/* Vietturis ierakstam bez attēla: tā pati līniju ikona neitrālā tonī.
   Sadaļas krāsu šeit neliek — trīs krāsainas plāksnes blakus kliegtu
   skaļāk par pašu saturu. */
.news-thumb-fallback {
    width: 100%; height: 100%; display: grid; place-items: center;
    background: var(--paper-2); color: var(--ink-soft);
}
.news-thumb-fallback svg, .prog-thumb .thumb-icon svg { width: 44px; height: 44px; opacity: .38; }
.news-body { padding: 1.2rem 1.3rem 1.35rem; display: flex; flex-direction: column; flex: 1 1 auto; gap: .5rem; }
.news-body h3 { font-size: 1.15rem; line-height: 1.3; }
.news-body p { margin: 0; color: var(--ink-soft); font-size: .94rem; line-height: 1.6; }
.news-more {
    margin-top: auto; padding-top: .9rem;
    font-weight: 600; font-size: .92rem; color: var(--brand);
    display: inline-flex; align-items: center; gap: .35rem;
}
.news-more::after { content: "→"; transition: transform 200ms var(--ease-out); }

/* ---- Raksta lapa ---- */
.article { max-width: 760px; margin: 0 auto; }
.article > .article-img:first-child {
    width: 100%; margin: 0 0 1.8rem; border-radius: var(--r-lg);
    display: block; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line);
}
.article-lead { font-size: 1.17rem; line-height: 1.65; color: var(--ink); font-weight: 500; margin: 0 0 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.article-body { line-height: 1.8; font-size: 1.06rem; }
.article-body h2 { font-size: 1.42rem; margin: 2.2rem 0 .7rem; }
.article-body h3 { font-size: 1.18rem; margin: 1.7rem 0 .5rem; }
.article-body p { margin: 0 0 1.15rem; }
.article-body ul, .article-body ol { margin: 0 0 1.15rem 1.2rem; padding: 0; }
.article-body li { margin-bottom: .45rem; }
.article-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.article-body img { border-radius: var(--r-md); border: 1px solid var(--line); height: auto; }
/* Iegultais saturs (Google kalendārs, video). Izmēru nosaka CSS, nevis
   width/height atribūti — tā tas der arī telefonā, un iegultnis nesalūzt,
   ja atribūtu nav. */
.article-body iframe {
    display: block; width: 100%; aspect-ratio: 4 / 3; min-height: 520px;
    border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper-2);
}
.article-body blockquote {
    margin: 1.6rem 0; padding: .2rem 0 .2rem 1.3rem;
    border-left: 3px solid var(--brand); color: var(--ink); font-size: 1.08rem;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 0 0 1.3rem; font-size: .96rem; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: .65rem .8rem; text-align: left; }
.article-body thead th { background: var(--paper-2); font-weight: 700; }
/* Platas tabulas (maksas, programma) šaurā ekrānā ritina pašas sevi, nevis
   izspiežas ārpus lapas — body ir overflow-x: hidden, tāpēc tās tiktu nogrieztas. */
@media (max-width: 720px) {
    .article-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: .9rem; }
    .article-body th, .article-body td { padding: .5rem .6rem; min-width: 4.5rem; }
}

/* =========================================================================
   Programmas / pulciņi
   ========================================================================= */
.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.6rem; }
.prog-card {
    display: flex; flex-direction: column; background: var(--paper);
    border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
    text-decoration: none; color: var(--ink);
    transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), border-color 180ms ease;
}
.prog-card:active { transform: scale(.995); }
.prog-thumb {
    aspect-ratio: 4 / 3; overflow: hidden; display: grid; place-items: center;
    background: var(--paper-2); color: var(--ink-soft); border-bottom: 1px solid var(--line);
}
.prog-thumb .thumb-icon { display: block; line-height: 0; }
.prog-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 320ms var(--ease-out); }
.prog-body { padding: 1.2rem 1.3rem 1.35rem; display: flex; flex-direction: column; gap: .5rem; flex: 1 1 auto; }
.prog-body h3 { font-size: 1.15rem; }
.prog-body p { margin: 0; color: var(--ink-soft); font-size: .94rem; line-height: 1.6; }
.prog-meta { display: flex; flex-direction: column; gap: .35rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.prog-meta div { display: flex; gap: .6rem; align-items: baseline; font-size: .91rem; }
.prog-meta dt { font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-soft); min-width: 78px; }
.prog-meta dd { margin: 0; font-weight: 500; }

/* =========================================================================
   Dokumenti
   ========================================================================= */
/* ---- Meklēšana un kategoriju filtrs ----
   Filtrēšana notiek pārlūkā, tāpēc bez JS to nerāda: citādi būtu lodziņš,
   kas neko nedara. */
html:not(.js) .doc-filter { display: none; }

.doc-filter { margin-bottom: 1.6rem; }
.doc-search { position: relative; max-width: 420px; }
.doc-search svg {
    position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--ink-soft); pointer-events: none;
}
.doc-search input {
    width: 100%; font: inherit; font-size: .97rem; color: var(--ink);
    padding: .7rem 1rem .7rem 2.6rem;
    background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-sm);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
.doc-search input::placeholder { color: var(--ink-soft); }
.doc-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.doc-cats { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.doc-chip {
    display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
    font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink);
    padding: .42rem .8rem; border-radius: 999px;
    background: var(--paper); border: 1px solid var(--line-2);
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 130ms var(--ease-out);
}
.doc-chip span { font-weight: 500; font-size: .8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.doc-chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.doc-chip.is-on span { color: rgba(255, 255, 255, .75); }
.doc-chip:active { transform: scale(.97); }

.doc-count { margin: .9rem 0 0; font-size: .88rem; color: var(--ink-soft); min-height: 1.2em; }

.doc-list { display: flex; flex-direction: column; }
/* Filtrēšana notiek, kamēr cilvēks raksta — te animācijai nav vietas. */
.doc-row[hidden] { display: none; }
.doc-row {
    display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
    padding: 1.15rem .4rem; border-bottom: 1px solid var(--line);
    transition: background-color 160ms ease;
}
.doc-row:first-child { border-top: 1px solid var(--line); }
.doc-ext {
    flex: 0 0 auto; width: 44px; height: 52px; border-radius: var(--r-sm);
    display: grid; place-items: center; background: var(--paper-2);
    border: 1px solid var(--line);
    font-size: .64rem; font-weight: 700; letter-spacing: .04em; color: var(--ink-soft);
}
.doc-info { flex: 1 1 260px; }
.doc-info h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.doc-info p { margin: 0; color: var(--ink-soft); font-size: .93rem; line-height: 1.6; }
.doc-info .tag { display: block; margin-top: .3rem; }

/* =========================================================================
   Tabula no izklājlapas (DataTables)

   Tabula ir plata, tāpēc tā ritinās savā lodziņā, nevis stumj lapu sāņos.
   Bez JS paliek parasta HTML tabula ar visām rindām — tad ritina pati
   apvalka josla (.gt-scroll), ar JS to pārņem DataTables šūna.
   ========================================================================= */
.gt + .gt { margin-top: 2.6rem; border-top: 1px solid var(--line); padding-top: 2.4rem; }
.gt-title { font-size: 1.35rem; margin-bottom: .7rem; }

.gt-caption { display: flex; flex-direction: column; margin: 0 0 1.4rem; color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.gt-caption-lead { color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }

/* Filtrs strādā tikai ar JS, tāpēc bez tā pogas nerāda — jomu tad redz
   tabulas pirmajā kolonnā. */
html:not(.js) .gt-cats { display: none; }
.gt-cats { margin: 0 0 1.1rem; }

.gt-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.gt-scroll.is-dt { overflow: visible; border: 0; border-radius: 0; }
.gt-scroll.is-dt .dt-layout-table > .dt-layout-cell {
    overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md);
}

.gt-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: .92rem; }
.gt-table th, .gt-table td {
    padding: .68rem .85rem; text-align: left; vertical-align: top;
    border-bottom: 1px solid var(--line);
}
/* Rūtiņā var būt vairākas rindas (piem. pedagoga vārds un telefons). Tās nāk
   kā īsti jaunrindas simboli, tāpēc pārnesumu uzzīmē šis stils, nevis <br>. */
.gt-table td { white-space: pre-line; }
.gt-table thead th {
    background: var(--paper-2); border-bottom: 1px solid var(--line-2);
    font-family: var(--display); font-size: .71rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft);
    white-space: nowrap; padding-block: .55rem;
}
.gt-table tbody tr:last-child > * { border-bottom: 0; }
.gt-table tbody td { font-variant-numeric: tabular-nums; }
.gt-table tbody td:first-child { font-weight: 600; }
/* Tukša rūtiņa: "šajā dienā nodarbību nav". Punkts palīdz acij noturēt rindu. */
.gt-table tbody td:empty::after { content: "·"; color: var(--line-2); }
.gt-table a { color: var(--brand); text-decoration: none; font-weight: 500; white-space: nowrap; }
.gt-table td.dt-empty { text-align: center; color: var(--ink-soft); font-weight: 400; padding: 2rem 1rem; }
@media (hover: hover) {
    .gt-table tbody tr:hover > * { background: var(--paper-2); }
    .gt-table a:hover { text-decoration: underline; }
}

/* ---- DataTables kārtošanas bultas un vadīklas ----
   Bibliotēkas noformējums nāk no šī faila, nevis no tās pašas CSS, lai
   tabula izskatītos tāpat kā pārējā lapa. */
.gt-table th.dt-orderable-asc, .gt-table th.dt-orderable-desc { cursor: pointer; }
.gt-table th .dt-column-header { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.gt-table th span.dt-column-order { position: relative; flex: 0 0 auto; width: 9px; height: 15px; }
.gt-table th.dt-orderable-asc span.dt-column-order::before,
.gt-table th.dt-ordering-asc span.dt-column-order::before {
    position: absolute; left: 0; bottom: 50%; content: "▲"; font-size: .6em; line-height: 8px; opacity: .3;
}
.gt-table th.dt-orderable-desc span.dt-column-order::after,
.gt-table th.dt-ordering-desc span.dt-column-order::after {
    position: absolute; left: 0; top: 50%; content: "▼"; font-size: .6em; line-height: 8px; opacity: .3;
}
.gt-table th.dt-ordering-asc span.dt-column-order::before,
.gt-table th.dt-ordering-desc span.dt-column-order::after { opacity: 1; color: var(--brand); }

.dt-container .dt-layout-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }
.dt-container .dt-layout-row:not(.dt-layout-table):first-child { margin-bottom: 1rem; }
.dt-container .dt-layout-row:not(.dt-layout-table):last-child { margin-top: 1rem; }
.dt-container .dt-layout-cell.dt-layout-end { margin-left: auto; }
.dt-container .dt-layout-cell:empty { display: none; }

.dt-container .dt-search { position: relative; }
/* Uzraksts ir tikai ekrānlasītājam — redzamo paskaidrojumu nes vietturis. */
.dt-container .dt-search label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.dt-container .dt-search input {
    width: min(320px, 100%); font: inherit; font-size: .95rem; color: var(--ink);
    padding: .6rem .9rem; background: var(--paper);
    border: 1px solid var(--line-2); border-radius: var(--r-sm);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
.dt-container .dt-search input::placeholder { color: var(--ink-soft); }
.dt-container .dt-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.dt-container .dt-info { font-size: .88rem; color: var(--ink-soft); }
.dt-container .dt-paging { display: flex; flex-wrap: wrap; gap: .35rem; }
.dt-container .dt-paging-button {
    font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink); cursor: pointer;
    padding: .35rem .75rem; border-radius: 999px;
    background: var(--paper); border: 1px solid var(--line-2);
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.dt-container .dt-paging-button.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.dt-container .dt-paging-button.disabled { color: var(--ink-soft); border-color: var(--line); cursor: default; }
.dt-container .dt-paging .ellipsis { padding: 0 .3rem; color: var(--ink-soft); }

.gt-foot { margin: 1rem 0 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.6; }
.gt-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }
.gt-stamp { margin-left: .9rem; }

@media (max-width: 560px) {
    .gt-table { font-size: .88rem; }
    .gt-table th, .gt-table td { padding: .6rem .7rem; }
}

/* =========================================================================
   Pasākumi
   ========================================================================= */
.event-list { display: flex; flex-direction: column; }
.event-row {
    display: grid; grid-template-columns: 68px 1fr auto; gap: 1.4rem; align-items: center;
    padding: 1.25rem .4rem; border-bottom: 1px solid var(--line);
    transition: background-color 160ms ease;
}
.event-row:first-child { border-top: 1px solid var(--line); }
.event-date {
    text-align: center; line-height: 1.1; padding: .5rem .2rem;
    background: var(--paper-2); border-radius: var(--r-sm);
    font-variant-numeric: tabular-nums;
}
.event-date b { display: block; font-family: var(--display); font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; color: var(--accent); }
.event-date span { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 600; }
.event-main h3 { font-size: 1.08rem; margin-bottom: .25rem; }
.event-main p { margin: 0; color: var(--ink-soft); font-size: .93rem; line-height: 1.6; }
.event-when { font-size: .88rem; color: var(--ink-soft); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }

/* =========================================================================
   Cilvēki
   ========================================================================= */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(262px, 1fr)); gap: 1.4rem; }
.person {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 1.4rem; display: flex; flex-direction: column; gap: .2rem;
    transition: box-shadow 180ms var(--ease-out), border-color 180ms ease;
}
.person-photo, .person-initials {
    width: 60px; height: 60px; border-radius: 50%; margin-bottom: .9rem;
}
.person-photo { object-fit: cover; background: var(--paper-2); }
.person-initials {
    display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand);
    font-family: var(--display); font-weight: 800; font-size: 1.15rem;
}
.person h3 { font-size: 1.05rem; }
.person .role { color: var(--ink-soft); font-size: .92rem; margin: .1rem 0 .8rem; }
.person a { display: block; font-size: .93rem; font-weight: 500; text-decoration: none; word-break: break-word; color: var(--brand); }
.person a:hover { text-decoration: underline; }
.person .note { margin: .7rem 0 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.6; }

/* =========================================================================
   Galerija
   ========================================================================= */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.gallery-item {
    position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; width: 100%;
    border-radius: var(--r-md); border: 1px solid var(--line); padding: 0;
    cursor: zoom-in; background: var(--paper-2);
    transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.gallery-item:active { transform: scale(.99); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 320ms var(--ease-out); }
.gallery-item figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem .85rem .7rem;
    background: linear-gradient(transparent, rgba(13, 27, 43, .78));
    color: #fff; font-size: .87rem; font-weight: 500; text-align: left;
}

.lightbox {
    position: fixed; inset: 0; z-index: 2000; display: none;
    align-items: center; justify-content: center; padding: 1.5rem;
    background: rgba(13, 27, 43, .92); border: 0;
    opacity: 0; transition: opacity 220ms var(--ease-out);
}
.lightbox.is-mounted { display: flex; }
.lightbox.is-open { opacity: 1; }
.lightbox img {
    max-width: min(1100px, 100%); max-height: 86vh; border-radius: var(--r-md);
    transform: scale(.97); transform-origin: center;
    transition: transform 220ms var(--ease-out);
}
.lightbox.is-open img { transform: none; }
.lightbox-close {
    position: absolute; top: 1.2rem; right: 1.2rem; width: 44px; height: 44px;
    border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%;
    background: rgba(255, 255, 255, .1); color: #fff;
    font-size: 1.4rem; line-height: 1; cursor: pointer;
    transition: transform 150ms var(--ease-out), background-color 150ms ease;
}
.lightbox-close:active { transform: scale(.95); }

/* =========================================================================
   Teksta bloki, apakšsadaļas, tukšais stāvoklis
   ========================================================================= */
.blocks { display: flex; flex-direction: column; gap: 2.4rem; max-width: 760px; margin: 0 auto; }
.text-block > h2 { font-size: 1.42rem; margin-bottom: .9rem; }
.text-block img.block-img { border-radius: var(--r-md); border: 1px solid var(--line); margin-bottom: 1.2rem; display: block; width: 100%; }

/* Mazs bloka attēls (portrets) — blakus tekstam, nevis izstiepts pa visu platumu. */
.block-portrait {
    float: right; width: clamp(120px, 26%, 200px); height: auto; aspect-ratio: 1;
    object-fit: cover; margin: .3rem 0 1rem 1.6rem;
    border: 1px solid var(--line); border-radius: var(--r-md);
}
.text-block.has-portrait::after { content: ""; display: block; clear: both; }

/* ---- Pārskata karte ([overview-map] teksta blokā, skat. includes/overview_map.php) ---- */
.ov-map {
    width: 100%; height: clamp(320px, 52vw, 460px); margin: 1.2rem 0 .9rem;
    border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
    background: var(--paper-2);
}
.ov-map .ol-zoom button { border-radius: var(--r-sm); }
.ov-map-legend {
    list-style: none; margin: 0 0 1.6rem; padding: 0;
    display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-size: .93rem;
}
.ov-map-legend li { display: flex; align-items: center; gap: .5rem; margin: 0; padding: 0; }
.ov-map-legend li::before { content: none; }
.ov-map-dot {
    flex: none; width: .8rem; height: .8rem; border-radius: 50%;
    border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2);
}
.text-block + .text-block { border-top: 1px solid var(--line); padding-top: 2.4rem; }

/* Saite uz radniecīgu sadaļu lapas augšpusē (piem. no pulciņiem uz nodarbību
   plānu). Viena rinda, nevis kartīte — tā nekonkurē ar sadaļas saturu. */
.see-also {
    display: flex; align-items: center; gap: 1rem; margin-bottom: 2.2rem;
    padding: .95rem 1.15rem; text-decoration: none; color: var(--ink);
    background: var(--paper); border: 1px solid var(--line);
    border-left: 3px solid var(--dot, var(--brand)); border-radius: var(--r-md);
    transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out), border-color 180ms ease;
}
.see-also:active { transform: scale(.995); }
.see-also-icon {
    flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: var(--r-sm); background: var(--paper-2); color: var(--dot, var(--brand));
}
.see-also-icon svg { width: 20px; height: 20px; display: block; }
.see-also-text { display: flex; flex-direction: column; gap: .1rem; }
.see-also-text b { font-family: var(--display); font-size: 1.06rem; font-weight: 800; letter-spacing: -.015em; }
.see-also-text small { color: var(--ink-soft); font-size: .9rem; line-height: 1.5; }
.see-also-arrow {
    margin-left: auto; padding-left: .5rem; color: var(--dot, var(--brand)); font-size: 1.15rem;
    transition: transform 180ms var(--ease-out);
}

.child-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 1.25rem; }

.empty {
    background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 2.8rem 1.5rem; text-align: center; color: var(--ink-soft);
}
.empty h3 { margin-bottom: .45rem; font-size: 1.15rem; }
.empty p { margin: 0; }

/* =========================================================================
   Kontaktu josla + kājene
   ========================================================================= */
.cta-band {
    display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
    background: var(--ink-2); color: #fff;
    border-radius: var(--r-lg); padding: clamp(1.8rem, 4vw, 2.6rem);
}
.cta-band h2 { color: #fff; font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
.cta-band p { margin: .6rem 0 0; color: rgba(255, 255, 255, .72); max-width: 48ch; font-size: .98rem; }
.cta-band .btn-bjc { background: #fff; border-color: #fff; color: var(--ink); }
.cta-band .btn-bjc:active { color: var(--ink); }
.cta-band .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.cta-band .btn-ghost:active { color: #fff; }

/* =========================================================================
   Rīkotāju un atbalstītāju logo josla (virs kājenes katrā lapā)
   Logo stāv uz balta — svešus zīmolus nekrāso un neatkrāso. Grupas plūst
   rindā un pārnesas, tāpēc josla der gan 2, gan 12 logo.
   ========================================================================= */
.partners-band {
    margin-top: clamp(3rem, 6vw, 4.5rem);
    padding: clamp(1.8rem, 4vw, 2.6rem) 0;
    border-top: 1px solid var(--line);
    background: var(--paper);
}
.partners-band + .site-footer { margin-top: 0; }
.partners { display: flex; flex-wrap: wrap; gap: 1.8rem 3rem; align-items: flex-start; }
.partners-label {
    font-family: var(--body); font-size: .7rem; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
    margin: 0 0 .8rem;
}
.partners-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.8rem; }
.partner { display: flex; align-items: center; min-height: 56px; }
.partner a { display: flex; align-items: center; text-decoration: none; color: inherit; border-radius: var(--r-sm); }
.partner img { display: block; height: 56px; width: auto; max-width: 190px; object-fit: contain; }
.partner-name {
    display: flex; align-items: center; min-height: 56px; padding: .35rem .9rem;
    border: 1px solid var(--line); border-radius: var(--r-md);
    font-family: var(--display); font-weight: 700; font-size: 1.02rem; line-height: 1.1;
    color: var(--ink); max-width: 16ch;
}
.partner-caption {
    margin-left: .7rem; max-width: 12ch;
    font-family: var(--display); font-weight: 700; font-size: 1rem; line-height: 1.1; color: var(--ink);
}
.partners-page .partners { gap: 2.4rem 4rem; }
.partners-page .partner img { height: 80px; max-width: 260px; }
.partners-page .partner-name { min-height: 80px; font-size: 1.2rem; }
@media (hover: hover) {
    .partner a { transition: opacity 160ms ease; }
    .partner a:hover { opacity: .75; }
}
@media (max-width: 560px) {
    .partners { gap: 1.4rem; }
    .partner img { height: 44px; max-width: 150px; }
    .partner-name { min-height: 44px; font-size: .95rem; }
}
.site-footer {
    background: var(--ink-2); color: rgba(255, 255, 255, .7);
    margin-top: clamp(3rem, 6vw, 4.5rem); padding: clamp(2.6rem, 5vw, 3.6rem) 0 1.5rem;
    font-size: .94rem;
}
.site-footer h4 { color: #fff; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; }
.footer-grid.has-social { grid-template-columns: 1.3fr .85fr .85fr minmax(260px, 330px); }

/* ---- Facebook lente kājenē ----
   Vietturis ir tikpat augsts kā pati lente, lai pēc ielādes lapa nepalēktu. */
.footer-social .fb-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .8rem; text-align: center; min-height: 420px; padding: 1.6rem 1.2rem;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--r-md);
}
.footer-social .fb-placeholder svg { width: 34px; height: 34px; color: #fff; opacity: .45; }
.footer-social .fb-placeholder p { margin: 0; font-size: .85rem; color: rgba(255, 255, 255, .6); max-width: 30ch; }
.footer-social iframe {
    display: block; width: 100%; height: 420px;
    border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--r-md);
    background: var(--paper);
}
.footer-brand {
    display: inline-flex; align-items: center; gap: .75rem; margin-bottom: 1.1rem;
    font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: #fff; letter-spacing: -.02em;
}
.footer-brand img { height: 72px; width: auto; max-width: 100%; display: block; }
.site-footer p { margin: 0 0 .45rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.site-footer a { color: rgba(255, 255, 255, .7); text-decoration: none; transition: color 160ms ease; }
.site-footer .tag { color: rgba(255, 255, 255, .5); }
.footer-bottom {
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 2.6rem; padding-top: 1.3rem;
    font-size: .86rem; color: rgba(255, 255, 255, .55);
}
.footer-bottom-links { display: flex; gap: 1.4rem; }

/* =========================================================================
   Sīkdatņu paziņojums
   ========================================================================= */
.cookie-note {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500;
    padding: 0 1.25rem 1.25rem;
    /* Nebloķē lapu — apmeklētājs var lasīt un ritināt arī neizvēloties. */
    pointer-events: none;
}
.cookie-note[hidden] { display: none; }
.cookie-note-inner {
    pointer-events: auto;
    width: min(880px, 100%); margin-inline: auto;
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
    background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg); padding: 1.1rem 1.3rem;
    transform: translateY(14px); opacity: 0;
    transition: transform 260ms var(--ease-out), opacity 260ms var(--ease-out);
}
.cookie-note.is-open .cookie-note-inner { transform: none; opacity: 1; }
.cookie-note-text { flex: 1 1 320px; }
.cookie-note-text b { font-family: var(--display); font-size: .95rem; }
.cookie-note-text p { margin: .25rem 0 0; font-size: .89rem; line-height: 1.6; color: var(--ink-soft); }
.cookie-note-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

@media (max-width: 560px) {
    .cookie-note { padding: 0 .75rem .75rem; }
    .cookie-note-actions .btn-bjc { flex: 1 1 auto; justify-content: center; }
}

/* =========================================================================
   Sacensību dienas (includes/days.php)
   Josla augšā ir trase: tās pašas zīmes un numuri kā hero kartē, savienotas
   ar trases līniju. Panelī — lielas darbības sacensību dienai (starta
   protokoli, online rezultāti, GPS, rezultāti), zem tām programma un
   pārējās saites.
   Kustība: cilnes pārslēdz bieži, tāpēc pārslēgšana ir tūlītēja; spiežamiem
   elementiem tikai :active scale(.97); hover — tikai ierīcēm ar peli.
   ========================================================================= */
/* Lēcot uz #day-… vai #race-days, lipīgā izvēlne nedrīkst aizsegt joslu. */
.race-days, #race-days { scroll-margin-top: 96px; }
.js .day-panel { scroll-margin-top: 220px; }
.js .day-panel[data-day-hidden] { display: none; }

/* ---- Zobratu josla ---- */
.day-strip {
    --strip-bg: var(--paper-2);
    background: var(--strip-bg); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 1rem .6rem .7rem; margin-bottom: 1rem;
    overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity;
}
.day-tabs {
    position: relative; display: grid;
    grid-template-columns: repeat(var(--n), minmax(104px, 1fr));
    min-width: calc(var(--n) * 104px);
}
.day-tab {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding: 0 .35rem .7rem; text-align: center; text-decoration: none; color: var(--ink);
    border-radius: var(--r-md); scroll-snap-align: center;
    transition: background-color 150ms ease, transform 140ms var(--ease-out);
}
.day-tab:active { transform: scale(.97); }
.day-tab:focus-visible { outline: 2px solid var(--overprint); outline-offset: 2px; }

/* Zobrats: melns alumīnijs kā īstam; caurumi — joslas krāsā. Griešanās leņķi
   uzliek main.js, izvēloties dienu. */
.day-mark { position: relative; width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: .2rem; }
.day-mark .cog { width: 52px; height: 52px; transition: transform 560ms var(--ease-out); }
.cog-body, .cog-arm { fill: var(--ink); }
.cog-bolt { fill: var(--strip-bg, var(--paper-2)); }
.mark-rest .day-mark .cog { width: 34px; height: 34px; }
.mark-rest .cog-body { fill: #8A938C; }
.day-mark b {
    position: absolute; bottom: -4px; right: -10px; z-index: 3; min-width: 20px; height: 20px; padding: 0 .3rem;
    display: grid; place-items: center; border-radius: 999px;
    background: var(--strip-bg); border: 1.5px solid var(--ink);
    font-family: var(--display); font-weight: 800; font-size: .86rem; line-height: 1;
    color: var(--ink); font-variant-numeric: tabular-nums;
}
.day-tab-when { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.day-tab-dow { font-weight: 700; }
.day-tab-title {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: var(--display); font-weight: 700; font-size: 1.08rem; text-transform: uppercase; letter-spacing: .02em;
}
.mark-rest .day-tab-title { color: var(--ink-soft); font-weight: 600; }
.day-today {
    margin-top: .2rem; padding: .05rem .45rem; border-radius: 999px;
    background: var(--flag); color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
/* Tastatūras pārslēgšana — bez kustības (darbība atkārtojas bieži). */
.day-tabs.no-anim .day-mark .cog { transition: none; }

/* Aktīvā diena: zobrats trases violetā un svītra zem nosaukuma. */
.day-tab.is-active .cog-body, .day-tab.is-active .cog-arm { fill: var(--overprint); }
.day-tab.is-active .day-mark b { border-color: var(--overprint); background: var(--overprint); color: #fff; }
.day-tab.is-active .day-tab-title { color: var(--overprint); }
.day-tab.is-active::after {
    content: ""; position: absolute; left: 28%; right: 28%; bottom: 0; height: 3px;
    border-radius: 3px; background: var(--overprint);
}

/* ---- Dienas panelis ---- */
.day-panel {
    background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: clamp(1.2rem, 3vw, 2rem);
}
.day-panel + .day-panel { margin-top: 1rem; }    /* bez JS dienas stāv cita zem citas */

.day-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem 1.3rem;
    padding-bottom: 1.3rem; margin-bottom: 1.4rem;
    border-bottom: 2px dashed var(--line-2);
}
.day-head-mark { position: relative; width: 64px; height: 64px; display: grid; place-items: center; --strip-bg: #fff; }
.day-head-mark .cog { width: 64px; height: 64px; }
.day-head-mark.mark-race .cog-body, .day-head-mark.mark-race .cog-arm { fill: var(--overprint); }
.day-head-mark.mark-rest .cog { width: 40px; height: 40px; }
.day-head-mark b {
    position: absolute; top: -6px; right: -10px; min-width: 26px; height: 26px; padding: 0 .35rem;
    display: grid; place-items: center; border-radius: 999px; background: var(--ink); color: #fff;
    font-family: var(--display); font-weight: 800; font-size: 1.05rem; line-height: 1;
}
/* Atverot dienu, zobrats pagriežas uz vietas — īsi, tikai rotācija. */
.js .day-panel:not([data-day-hidden]) .day-head-mark .cog { animation: cog-turn 700ms var(--ease-out); }
@keyframes cog-turn { from { transform: rotate(-80deg); } }
.day-head-text h3 {
    margin-top: .2rem; font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800;
    text-transform: uppercase; line-height: .95;
}
.day-place {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .6rem .9rem; border: 1px solid var(--line-2); border-radius: var(--r-md);
    background: var(--paper-2); color: var(--ink); text-decoration: none;
    font-weight: 600; font-size: .95rem; line-height: 1.25;
    transition: background-color 150ms ease, border-color 150ms ease, transform 140ms var(--ease-out);
}
.day-place svg { width: 20px; height: 20px; color: var(--overprint); flex: 0 0 auto; }
.day-place small { display: block; font-size: .74rem; font-weight: 600; color: var(--overprint); }
a.day-place:active { transform: scale(.97); }

/* ---- Darbības: 4 lielas flīzes ---- */
.day-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.6rem; }
.day-action {
    display: flex; flex-direction: column; gap: .25rem; min-height: 122px;
    padding: 1rem 1.1rem; border-radius: var(--r-md); border: 1px solid var(--line-2);
    background: #fff; color: var(--ink); text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, transform 140ms var(--ease-out);
}
.day-action-icon svg { width: 26px; height: 26px; display: block; color: var(--overprint); margin-bottom: .35rem; }
.day-action-label { font-family: var(--display); font-weight: 700; font-size: 1.3rem; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
.day-action-sub { margin-top: auto; font-size: .86rem; font-weight: 600; color: var(--overprint); }
a.day-action:active { transform: scale(.97); }
.day-action ul { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.day-action li a { font-size: .9rem; font-weight: 600; color: var(--overprint); text-decoration: none; }

/* Gaida saites: tā pati vieta, bet klusi — skatītājs jau zina, kur tās būs. */
.day-action.is-pending { background: var(--paper-2); border-style: dashed; color: var(--ink-soft); }
.day-action.is-pending .day-action-icon svg { color: var(--ink-soft); opacity: .7; }
.day-action.is-pending .day-action-sub { color: var(--ink-soft); font-weight: 500; }

/* Online rezultāti un GPS sacensību laikā ir svarīgākie — pilnā trases krāsā. */
.day-action-live.is-ready, .day-action-gps.is-ready { background: var(--overprint); border-color: var(--overprint); color: #fff; }
.day-action-live.is-ready .day-action-icon svg, .day-action-gps.is-ready .day-action-icon svg,
.day-action-live.is-ready .day-action-sub, .day-action-gps.is-ready .day-action-sub,
.day-action-live.is-ready li a, .day-action-gps.is-ready li a { color: #fff; }

/* ---- Programma un pārējās saites ---- */
.day-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1.4rem, 3vw, 2.6rem); align-items: start; }
.day-grid-full { grid-template-columns: minmax(0, 1fr); }
.day-subhead {
    display: flex; align-items: center; gap: .45rem; margin: 0 0 .6rem;
    font-family: var(--display); font-weight: 700; font-size: 1.02rem;
    text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft);
}
.day-subhead svg { width: 18px; height: 18px; color: var(--overprint); }
.day-programme .article-body > :first-child { margin-top: 0; }
.day-programme .article-body > :last-child { margin-bottom: 0; }
.day-more { display: flex; flex-direction: column; gap: 1.3rem; }
.day-more ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.day-more a { font-weight: 600; color: var(--ink); text-decoration: none; }
.day-more a span { color: var(--overprint); }

@media (hover: hover) and (pointer: fine) {
    .day-tab:hover { background: color-mix(in srgb, var(--overprint) 6%, transparent); }
    a.day-place:hover { background: #fff; border-color: var(--overprint); }
    a.day-action:hover { border-color: var(--overprint); background: color-mix(in srgb, var(--overprint) 5%, #fff); }
    .day-action-live.is-ready:hover, .day-action-gps.is-ready:hover { background: #861C75; border-color: #861C75; }
    .day-action li a:hover, .day-more a:hover { text-decoration: underline; text-underline-offset: 3px; }
}

@media (max-width: 860px) {
    .day-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .day-grid { grid-template-columns: minmax(0, 1fr); }
    .day-head { grid-template-columns: auto minmax(0, 1fr); }
    .day-place { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 420px) {
    .day-action { min-height: 108px; padding: .85rem .9rem; }
    .day-action-label { font-size: 1.12rem; }
}

/* =========================================================================
   MTBO noformējums — orientēšanās kartes valoda
   Kartes papīrs, horizontāles, IOF trases violetā (kontrolpunkti, trase)
   un šaurs, sportisks virsrakstu fonts. Krāsa nāk no kartes, nevis rotājumiem.

   Kustība (Emil Kowalski «animation decision framework»):
     • trase uzzīmējas VIENU reizi, ielādējot sākumlapu — reta darbība, tāpēc
       drīkst būt izteiksmīga (1.1 s, ease-in-out — kustība pa ekrānu);
     • cilnes, hover, saites — bieži, tāpēc ≤ 180 ms vai bez animācijas;
     • spiežamiem elementiem :active scale(.97);
     • samazināta kustība — trase redzama uzreiz, paliek tikai caurspīdība.
   ========================================================================= */

/* ---- Virsraksti: šaurs, lielie burti tikai lielajiem līmeņiem ---- */
h1, h2 { text-transform: uppercase; }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 2.9rem); line-height: 1; }
.page-head h1 { font-size: clamp(2.3rem, 5.4vw, 3.8rem); line-height: .98; max-width: 22ch; }
.text-block > h2 { font-size: 1.85rem; }
.article-body h2 { font-size: 1.7rem; }
.article-body h3 { font-size: 1.32rem; }
.tile h3, .news-body h3 { font-size: 1.42rem; line-height: 1.12; }
.person h3 { font-size: 1.3rem; }
.empty h3 { font-size: 1.4rem; }
.brand-name { font-size: 1.32rem; letter-spacing: .01em; text-transform: uppercase; line-height: 1.05; }
.footer-brand { font-size: 1.45rem; text-transform: uppercase; }

/* ---- Etiķete ar mazu ķēdes zobratu ---- */
.eyebrow { color: var(--overprint); }
.eyebrow::before {
    width: 14px; height: 14px; border-radius: 0; background: var(--overprint);
    -webkit-mask: url('../img/cog.svg') center / contain no-repeat;
            mask: url('../img/cog.svg') center / contain no-repeat;
}

/* ---- Pogas ---- */
.btn-bjc {
    font-family: var(--display); font-weight: 700; font-size: 1.12rem;
    letter-spacing: .03em; text-transform: uppercase; padding: .66rem 1.35rem;
    transition: background-color 160ms ease, border-color 160ms ease, transform 140ms var(--ease-out);
}
.btn-bjc:active { transform: scale(.97); }
.btn-sm { font-size: 1rem; padding: .45rem .95rem; }

/* ---- Izvēlne: aktīvā sadaļa ar trases violeto ---- */
.nav-link.active { color: var(--overprint); }
.nav-link::after { background: var(--overprint); }
.topbar { background: var(--ink-2); border-bottom: 0; }
.topbar a, .topbar span { color: rgba(255, 255, 255, .72); }
.scroll-progress { background: var(--overprint); }

/* =========================================================================
   Hero — karte
   ========================================================================= */
.hero-map { background: var(--paper-2); border-bottom: 1px solid var(--line); }
.hero-contours {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: var(--contours) center / cover no-repeat;
    opacity: .3;
    /* Zem virsraksta horizontāles izgaist, lai teksts lasās bez fona plāksnes. */
    -webkit-mask-image: linear-gradient(100deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.45) 38%, #000 70%);
            mask-image: linear-gradient(100deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.45) 38%, #000 70%);
}
.hero-map .container { position: relative; z-index: 1; }
.hero-map .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.hero-map .hero-grid-single { grid-template-columns: minmax(0, 1fr); }

.hero-kicker { color: var(--ink); font-weight: 600; }
.hero-kicker::before { background: var(--flag); height: 3px; }

.hero h1 {
    font-size: clamp(2.9rem, 6.6vw, 5.4rem); font-weight: 800;
    line-height: .92; letter-spacing: -.005em;
}
/* Gads/izceltā daļa — trases violetā, savā rindā; bez pasvītrojuma animācijas. */
.hero h1 .hl {
    display: block; color: var(--overprint);
    background: none; animation: none;
}
.hero-lead { color: var(--ink-soft); margin: 1.2rem 0 1.4rem; }

.hero-countdown {
    display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
    margin: 0 0 1.7rem; padding-top: 1.1rem; border-top: 2px dashed var(--line-2);
    max-width: 30rem;
}
.hero-countdown b {
    font-family: var(--display); font-weight: 800; font-size: 3.1rem; line-height: .9;
    color: var(--ink); font-variant-numeric: tabular-nums;
}
.hero-countdown span {
    font-family: var(--display); font-weight: 700; font-size: 1.15rem;
    text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft);
}
.hero-countdown .is-live { color: var(--overprint); display: inline-flex; align-items: center; gap: .5rem; }
.hero-countdown .is-live::before {
    content: ""; width: 12px; height: 12px; border-radius: 50%; background: currentColor;
    animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: .35; } }

/* =========================================================================
   Velo motīvs — hero ritenis (includes/bike.php)
   Ielādējot lapu, ritenis ieripo no labās puses un apstājas (reti — drīkst
   būt izteiksmīgi; līkne ar garu bremzēšanu kā brīvrumbai). Ritinot lapu,
   tas griežas līdzi (CSS scroll-timeline — ārpus galvenā pavediena).
   Rotācijas leņķis atbilst nobrauktajam ceļam, tāpēc ritenis neslīd.
   ========================================================================= */
.hero-visual { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.hero-bike { position: relative; width: min(100%, 500px); aspect-ratio: 1; }
/* Ēna uz zemes — ritenis stāv, nevis karājas gaisā. */
.hero-bike::after {
    content: ""; position: absolute; left: 14%; right: 14%; bottom: -2.5%; height: 6%;
    background: radial-gradient(closest-side, rgba(22, 33, 27, .28), transparent);
    z-index: -1;
}
.hero-wheel, .hero-wheel-roll { width: 100%; height: 100%; }
.wheel { width: 100%; height: 100%; display: block; overflow: visible; }
.wheel-tire { fill: none; stroke: var(--ink); stroke-width: 22; }
.wheel-knobs rect { fill: var(--ink); }
.wheel-rim { fill: none; stroke: #2E3833; stroke-width: 8; }
.wheel-rim-inner { fill: none; stroke: #8A938C; stroke-width: 1.5; }
.wheel-spokes line { stroke: #4F5A54; stroke-width: 1.7; stroke-linecap: round; }
.wheel-rotor, .wheel-rotor-arms path { fill: var(--flag); }
.wheel-hub { fill: var(--ink); }
.wheel-hub-cap { fill: #3A4540; }
.wheel-axle { fill: var(--paper-2); }

/* 70% no diametra ≈ 1.4 rādiusi → 80° — ripo, nevis slīd. */
.js .hero-wheel { animation: wheel-in 1600ms cubic-bezier(0.16, 1, 0.3, 1) 150ms both; }
@keyframes wheel-in {
    from { transform: translateX(70%) rotate(80deg); opacity: 0; }
    25%  { opacity: 1; }
    to   { transform: none; opacity: 1; }
}
.js .hero-bike::after { animation: shadow-in 1600ms cubic-bezier(0.16, 1, 0.3, 1) 150ms both; }
@keyframes shadow-in { from { transform: translateX(70%); opacity: 0; } }
@supports (animation-timeline: scroll()) {
    .hero-wheel-roll { animation: wheel-roll linear both; animation-timeline: scroll(root block); }
    @keyframes wheel-roll { to { transform: rotate(-720deg); } }
}

.hero-stats { display: flex; gap: clamp(1.4rem, 4vw, 2.6rem); margin: 0; }
.hero-stats div { display: flex; flex-direction: column-reverse; align-items: center; }
.hero-stats dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: .9; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-stats dt { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }

@media (max-width: 960px) {
    .hero-bike { width: min(78%, 360px); }
}
@media (prefers-reduced-motion: reduce) {
    .js .hero-wheel, .js .hero-bike::after { animation: none; }
    .hero-wheel-roll { animation: none; }
    .js .day-panel:not([data-day-hidden]) .day-head-mark .cog { animation: none; }
    .day-mark .cog { transition: none; }
}


/* ---- Lapas galva (iekšējās lapas): tā pati karte, klusāk ---- */
.page-head { overflow: hidden; }
.page-head::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: var(--contours) 70% 40% / cover no-repeat; opacity: .16;
    -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
            mask-image: linear-gradient(90deg, transparent 20%, #000 75%);
}
.page-head .container { position: relative; z-index: 1; }
.page-head::before { background: var(--overprint); }

/* ---- Kartītes un saites ---- */
.tile::before { background: var(--overprint); }
/* Ziņa bez attēla: kartes fragments, nevis tukša pelēka plāksne. */
.news-thumb-fallback { position: relative; background: var(--paper-2); color: var(--overprint); }
.news-thumb-fallback::before {
    content: ""; position: absolute; inset: 0;
    background: var(--contours) 40% 50% / 260% auto no-repeat; opacity: .35;
}
.news-thumb-fallback svg { position: relative; opacity: .7; }
.tile-icon { color: var(--overprint); }
.news-more, .link-arrow { color: var(--overprint); }
.article-body a, .person a { color: var(--overprint); }

/* ---- Kontaktu josla + kājene: tumšais mežs ar horizontālēm ---- */
.cta-band, .site-footer { position: relative; overflow: hidden; }
.cta-band::after, .site-footer::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: var(--contours) center / cover no-repeat; opacity: .1;
    filter: brightness(2.2);
}
.cta-band > *, .site-footer > * { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }

@media (hover: hover) and (pointer: fine) {
    .topbar a:hover { color: #fff; }
}

@media (max-width: 960px) {
    .hero-map .hero-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-countdown .is-live::before { animation: none; }
}


/* =========================================================================
   Parādīšanās ritinot
   Bez JS saturs paliek redzams: sākuma stāvokli uzliek tikai .js klase.
   ========================================================================= */
.js [data-reveal] {
    opacity: 0; transform: translateY(14px);
    transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js [data-stagger-item] {
    opacity: 0; transform: translateY(12px);
    transition: opacity 380ms var(--ease-out), transform 380ms var(--ease-out);
}
.js [data-stagger-item].is-visible { opacity: 1; transform: none; }

/* =========================================================================
   Peles stāvokļi — tikai īstai pelei; pieskāriens tos nedrīkst izsaukt
   ========================================================================= */
@media (hover: hover) and (pointer: fine) {
    .topbar a:hover { color: var(--brand); }
    .nav-link:hover { color: var(--brand); }
    .nav-sub a:hover { background: var(--paper-2); color: var(--brand); }
    .nav-toggle:hover { background: var(--paper-2); }

    .btn-bjc:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
    .hero .btn-bjc:not(.btn-ghost):hover { background: #E45D16; border-color: #E45D16; color: var(--ink); }
    .btn-accent:hover { color: var(--accent-ink); filter: brightness(.92); }
    .btn-ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--line-2); }
    .cta-band .btn-bjc:hover { background: rgba(255, 255, 255, .88); border-color: transparent; color: var(--ink); }
    .cta-band .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

    .link-arrow:hover { color: var(--brand-dark); }
    .link-arrow:hover span { transform: translateX(4px); }

    .tt-row:hover { background: var(--paper-2); }
    /* Uz caurspīdīgās kartītes necaurspīdīgs pelēks izskatītos kā plankums. */
    .hero-has-media .tt-row:hover { background: rgba(255, 255, 255, .5); }

    .tile:hover, .news-card:hover, .prog-card:hover {
        transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2);
    }
    .news-card:hover .news-thumb img,
    .prog-card:hover .prog-thumb img { transform: scale(1.04); }
    .news-card:hover .news-more::after { transform: translateX(4px); }

    .see-also:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
    .see-also:hover .see-also-arrow { transform: translateX(4px); }

    .person:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }
    .doc-row:hover, .event-row:hover { background: var(--paper-2); }

    .gallery-item:hover { box-shadow: var(--shadow-md); }
    .gallery-item:hover img { transform: scale(1.04); }
    .lightbox-close:hover { background: rgba(255, 255, 255, .22); }

    .crumbs a:hover { color: var(--brand); }
    .site-footer a:hover { color: #fff; }
}

/* =========================================================================
   Samazināta kustība: paliek opacity/krāsu pārejas, pazūd pārvietošanās
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .hero h1 .hl { animation: none; background-size: 100% 100%; }
    /* Saulīte nekustas, bet paliek redzama — rotājums, nevis kustība. */
    .hero-sun, .hero-sun img { animation: none; }
    .hero-sun { left: auto; right: 5%; top: 1.5rem; }
    /* Karuselis nerotē (to aptur main.js); pāreja izslēgta arī šeit, ja kāds
       kadrs tomēr tiktu pārslēgts. */
    .hero-slide { transition: none; }

    .js [data-reveal], .js [data-stagger-item] {
        transform: none; transition: opacity 260ms ease;
    }

    .tile:hover, .news-card:hover, .prog-card:hover,
    .link-arrow:hover span, .news-card:hover .news-more::after,
    .news-card:hover .news-thumb img, .prog-card:hover .prog-thumb img,
    .gallery-item:hover img { transform: none; }

    .nav-link::after { transition: none; }
    .lightbox img { transition: opacity 180ms ease; }
    .cookie-note-inner { transform: none; transition: opacity 200ms ease; }
}

/* =========================================================================
   Responsivitāte
   ========================================================================= */
@media (max-width: 1180px) {
    .footer-grid.has-social { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 991.98px) {
    .hero-grid { grid-template-columns: 1fr; }
    .footer-grid, .footer-grid.has-social { grid-template-columns: 1fr 1fr; }
}

/* Izvēlnes punktu skaitu nosaka admins, tāpēc pogas izvēlni ieslēdz nevis
   fiksēts ekrāna platums, bet mērījums main.js pusē: .nav-collapse.
   Bez JS izvēlne vienkārši pārlūzt vairākās rindās. */
html:not(.js) .nav-bar { flex-wrap: wrap; padding-bottom: .5rem; }
html:not(.js) .nav-links { flex-wrap: wrap; justify-content: flex-end; }

.nav-collapse .nav-toggle { display: flex; }
.nav-collapse .nav-bar { position: relative; min-height: 66px; }
.nav-collapse .nav-links {
    position: absolute; top: calc(100% + 1px); left: -1.25rem; right: -1.25rem;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: .5rem 1.25rem 1rem;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-8px); transform-origin: 100% 0;
    transition: opacity 190ms var(--ease-out), transform 190ms var(--ease-out), visibility 190ms;
}
.nav-collapse.nav-open .nav-links { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.nav-collapse .nav-link { padding: .7rem .2rem; font-size: 1rem; border-bottom: 1px solid var(--line); }
.nav-collapse .nav-link::after { display: none; }
.nav-collapse .nav-item-has-children > .nav-link::before { display: none; }
.nav-collapse .nav-sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-radius: 0;
    margin: 0 0 .2rem .2rem; padding: .2rem 0 .4rem; min-width: 0;
}
.nav-collapse .nav-sub a { font-size: .92rem; color: var(--ink-soft); }

@media (max-width: 640px) {
    .topbar-inner { gap: .9rem; font-size: .82rem; }
    .topbar-social { margin-left: 0; }
    .event-row { grid-template-columns: 62px 1fr; gap: 1rem; }
    .event-when { grid-column: 2; text-align: left; }
    .footer-grid, .footer-grid.has-social { grid-template-columns: 1fr; gap: 2rem; }
    .cta-band { flex-direction: column; align-items: flex-start; }
    .brand-name small { display: none; }
}
