/*
 * Žilinský triatlonový festival — the look of ztf.sk (the festival's own
 * race-day site, where this site will live): Exo 2, light blue canvas,
 * white rounded cards, navy + festival blue, the colour logo on white.
 * Yellow and green stay in the logo; the UI itself is blue.
 * On top of Bootstrap 5 (light theme).
 */

:root {
    --ztf-blue: #006da8;
    --ztf-blue-dark: #005584;
    --ztf-navy: #063b60;
    --ztf-ink: #0b2940;
    --ztf-sky: #00a3e0;
    --ztf-canvas: #eef6fb;
    --ztf-hairline: #d8e8f1;
    --ztf-muted: #64748b;
    --ztf-radius: 1.25rem;
    --ztf-shadow: 0 1px 2px rgba(6, 59, 96, .06), 0 8px 24px rgba(6, 59, 96, .07);

    --bs-body-font-family: 'Exo 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-color: var(--ztf-ink);
    --bs-body-color-rgb: 11, 41, 64;
    --bs-body-bg: var(--ztf-canvas);
    --bs-emphasis-color: var(--ztf-navy);
    --bs-secondary-color: var(--ztf-muted);
    --bs-tertiary-bg: #f5f9fc;
    --bs-border-color: var(--ztf-hairline);
    --bs-primary: var(--ztf-blue);
    --bs-primary-rgb: 0, 109, 168;
    --bs-primary-text-emphasis: var(--ztf-navy);
    --bs-primary-bg-subtle: #e6f2fb;
    --bs-primary-border-subtle: #b9d9e9;
    --bs-link-color: var(--ztf-blue);
    --bs-link-color-rgb: 0, 109, 168;
    --bs-link-hover-color: var(--ztf-navy);
    --bs-link-hover-color-rgb: 6, 59, 96;
    --bs-focus-ring-color: rgba(0, 109, 168, .25);
    --bs-heading-color: var(--ztf-navy);
}

body {
    background: var(--ztf-canvas);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .display-5, .display-6 {
    font-weight: 800;
    letter-spacing: -.01em;
}

.display-5, .display-6 {
    font-weight: 900;
}

main > .container {
    padding: 1.5rem 15px 1.25rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* ---------- Bootstrap components in festival blue ---------- */
.btn {
    font-weight: 600;
    border-radius: .75rem;
}

.btn-lg {
    border-radius: 1rem;
}

.btn-primary {
    --bs-btn-bg: var(--ztf-blue);
    --bs-btn-border-color: var(--ztf-blue);
    --bs-btn-hover-bg: var(--ztf-blue-dark);
    --bs-btn-hover-border-color: var(--ztf-blue-dark);
    --bs-btn-active-bg: var(--ztf-navy);
    --bs-btn-active-border-color: var(--ztf-navy);
    --bs-btn-disabled-bg: var(--ztf-blue);
    --bs-btn-disabled-border-color: var(--ztf-blue);
    --bs-btn-focus-shadow-rgb: 0, 109, 168;
}

.btn-outline-primary,
.btn-outline-secondary {
    --bs-btn-color: var(--ztf-blue);
    --bs-btn-border-color: var(--ztf-hairline);
    --bs-btn-bg: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--ztf-blue);
    --bs-btn-hover-border-color: var(--ztf-blue);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--ztf-navy);
    --bs-btn-active-border-color: var(--ztf-navy);
    --bs-btn-focus-shadow-rgb: 0, 109, 168;
}

.form-control,
.form-select {
    border-radius: .75rem;
    border-color: #c3d6e3;
    background-color: #fff;
}

/* radios and checkboxes on white cards need a visible ring */
.form-check-input {
    border-color: #8fadc4;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #7fbde0;
    box-shadow: 0 0 0 .25rem rgba(0, 109, 168, .18);
}

.form-check-input:checked {
    background-color: var(--ztf-blue);
    border-color: var(--ztf-blue);
}

.card {
    --bs-card-border-color: var(--ztf-hairline);
    --bs-card-border-radius: var(--ztf-radius);
    --bs-card-inner-border-radius: calc(var(--ztf-radius) - 1px);
    --bs-card-cap-bg: #f5f9fc;
}

/* cards with shadow-sm are the site's "panels" — white, hairline, soft shadow */
.card.shadow-sm {
    box-shadow: var(--ztf-shadow) !important;
}

.card.border-0 {
    border: 1px solid var(--ztf-hairline) !important;
}

.alert {
    border-radius: 1rem;
}

.alert-info {
    --bs-alert-bg: #e6f2fb;
    --bs-alert-border-color: #b9d9e9;
    --bs-alert-color: var(--ztf-navy);
}

.breadcrumb {
    font-size: .875rem;
    font-weight: 600;
}

.table {
    --bs-table-bg: #fff;
}

.dropdown-menu {
    --bs-dropdown-link-active-bg: var(--ztf-blue);
    --bs-dropdown-border-color: var(--ztf-hairline);
    --bs-dropdown-border-radius: 1rem;
    box-shadow: var(--ztf-shadow);
}

.badge.text-bg-primary {
    background-color: var(--ztf-blue) !important;
}

.not-set {
    color: var(--bs-danger);
    font-style: italic;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: var(--bs-secondary-color);
}

.error-summary {
    color: var(--bs-danger-text-emphasis);
    background: var(--bs-danger-bg-subtle);
    border-left: 3px solid var(--bs-danger-border-subtle);
    border-radius: .75rem;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* ---------- header: white bar, the colour logo, navy links ---------- */
#header .navbar {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--ztf-hairline);
    backdrop-filter: saturate(1.4) blur(8px);
    --bs-navbar-color: var(--ztf-navy);
    --bs-navbar-hover-color: var(--ztf-blue);
    --bs-navbar-active-color: var(--ztf-blue);
    --bs-navbar-brand-color: var(--ztf-navy);
    --bs-navbar-brand-hover-color: var(--ztf-navy);
    --bs-navbar-toggler-border-color: var(--ztf-hairline);
}

.navbar > .container,
.navbar > .container-fluid {
    align-items: center;
}

.navbar-brand {
    padding: .25rem 0;
}

.brand-logo {
    display: block;
    height: 3.25rem;
    width: auto;
}

@media (max-width: 575.98px) {
    .brand-logo { height: 2.75rem; }
}

#header .nav-link {
    font-weight: 700;
}

.navbar-collapse {
    flex-wrap: wrap;
    row-gap: .25rem;
}

.navbar-nav-utility {
    font-size: .9rem;
    flex-shrink: 0;
}

.navbar-nav-utility .nav-link {
    padding-top: .5rem;
    padding-bottom: .5rem;
}

/* "Prihláška" — out of the collapsed menu: next to the menu button on phones,
   at the far right of the bar on desktop */
.navbar-cta {
    margin-left: auto;
    margin-right: .6rem;
    padding: .45rem 1rem;
    font-weight: 800;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .navbar-cta {
        order: 3;
        margin: 0 0 0 .75rem;
    }
}

/* language switch — a round blue badge, as on ztf.sk */
#header .nav-link-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0 !important;
    border-radius: 50%;
    background: var(--ztf-blue);
    color: #fff;
    font-weight: 800;
    letter-spacing: .02em;
}

#header .nav-link-lang:hover,
#header .nav-link-lang:focus-visible {
    background: var(--ztf-navy);
    color: #fff;
}

@media (min-width: 992px) {
    #header .nav-link-lang { margin-left: .5rem; }
}

/* nested (3rd-level) dropdowns — common/assets/nesteddropdown */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -0.5rem;
    }
}

/* ---------- homepage hero — the race-day card of ztf.sk: navy → festival
   blue with soft rings, the text on the left, a real race photo on the right */
.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    overflow: hidden;
    border-radius: 1.75rem;
    color: #fff;
    background: linear-gradient(135deg, var(--ztf-navy) 0%, #0a4f7f 45%, var(--ztf-blue) 100%);
    box-shadow: 0 18px 40px rgba(6, 59, 96, .22);
}

/* the rings of ztf.sk's "now on" card */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    border: 2.5rem solid rgba(255, 255, 255, .06);
    pointer-events: none;
}

.hero::before {
    width: 22rem;
    height: 22rem;
    left: -7rem;
    bottom: -11rem;
}

.hero::after {
    width: 12rem;
    height: 12rem;
    left: 38%;
    top: -6rem;
    border-width: 1.5rem;
    border-color: rgba(0, 163, 224, .18);
}

.hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.75rem, 4vw, 3.5rem);
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #bfe6f7;
}

/* the pulsing dot of ztf.sk — here: registration is open */
.hero-dot {
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    background: #7fd3f5;
    box-shadow: 0 0 0 .3rem rgba(127, 211, 245, .25);
}

.hero h1 {
    color: #fff;
    font-size: clamp(2.1rem, 4.6vw, 3.5rem);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -.02em;
}

.hero-lead {
    max-width: 34rem;
    color: rgba(255, 255, 255, .85);
}

.hero-photo {
    position: relative;
    margin: .85rem .85rem .85rem 0;
    min-height: 21rem;
    overflow: hidden;
    border-radius: 1.25rem;
}

.hero-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* object-position: the focus point from admin, inline */
}

@media (max-width: 767.98px) {
    .hero { grid-template-columns: 1fr; }
    .hero-photo { order: -1; margin: .65rem .65rem 0; min-height: 0; aspect-ratio: 3 / 2; }
    .hero::after { display: none; }
}

/* the call to action on the blue card — white, so it stands out */
.btn-hero {
    --bs-btn-bg: #fff;
    --bs-btn-color: var(--ztf-navy);
    --bs-btn-border-color: #fff;
    --bs-btn-hover-bg: #e6f2fb;
    --bs-btn-hover-color: var(--ztf-navy);
    --bs-btn-hover-border-color: #e6f2fb;
    --bs-btn-active-bg: #d9f3ff;
    --bs-btn-active-color: var(--ztf-navy);
    font-weight: 800;
}

.btn-hero-ghost {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, .45);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, .12);
    --bs-btn-hover-border-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: rgba(255, 255, 255, .2);
}

/* key facts under the hero — the "conditions" tiles of ztf.sk */
.hero-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}



.hero-fact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--ztf-hairline);
    border-radius: 1.25rem;
    box-shadow: var(--ztf-shadow);
}

.hero-fact-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: #e6f2fb;
    color: var(--ztf-blue);
}

.hero-fact-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ztf-muted);
}

.hero-fact-value {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--ztf-navy);
}

/* tablets: icon above the text, so three tiles fit side by side */
@media (max-width: 991.98px) {
    .hero-fact { flex-direction: column; align-items: flex-start; gap: .6rem; padding: .9rem 1rem; }
    .hero-fact-value { font-size: 1rem; }
}

/* phones: one compact column */
@media (max-width: 575.98px) {
    .hero-facts { grid-template-columns: 1fr; gap: .6rem; }
    .hero-fact { flex-direction: row; align-items: center; }
    .hero-fact-icon { width: 2.5rem; height: 2.5rem; }
}

/* ---------- section headings ---------- */
.section-heading {
    color: var(--ztf-blue);
}

/* ---------- content from the CMS ---------- */
.page-body img,
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: .75rem;
}

.page-body hr,
.article-body hr {
    border: 0;
    border-top: 1px solid var(--bs-border-color);
}

/* hand-authored HTML with inline white text / "glass" cards was made for a
   dark backdrop — it gets the festival navy (see page/view.php) */
.page-body-rich {
    background: var(--ztf-navy);
    color: #fff;
    box-shadow: 0 12px 32px rgba(6, 59, 96, .18);
}

/* Hand-authored content was laid out for desktop with inline styles —
   fixed 2–3 column grids, 34 px headings, side gutters. On phones those
   inline styles are overridden (only !important beats them) so nothing
   sticks out of the screen. */
.page-body,
.article-body {
    overflow-wrap: break-word;
}

@media (max-width: 575.98px) {
    .page-body-rich {
        padding: 1rem !important;
    }

    .page-body [style*="grid-template-columns"],
    .article-body [style*="grid-template-columns"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .page-body [style*="display: flex"],
    .article-body [style*="display: flex"],
    .page-body [style*="display:flex"],
    .article-body [style*="display:flex"] {
        flex-wrap: wrap !important;
    }

    .page-body [style*="calc(100% -"],
    .article-body [style*="calc(100% -"] {
        width: 100% !important;
    }

    .page-body [style*="padding"],
    .article-body [style*="padding"] {
        padding-left: min(1rem, 4vw) !important;
        padding-right: min(1rem, 4vw) !important;
    }

    .page-body :is(h1, h2, h3, h4)[style*="font-size"],
    .article-body :is(h1, h2, h3, h4)[style*="font-size"] {
        font-size: clamp(1.35rem, 6.5vw, 1.75rem) !important;
        overflow-wrap: anywhere;
    }

    .page-body :is(div, p, span)[style*="font-size: 28px"],
    .page-body :is(div, p, span)[style*="font-size: 32px"],
    .page-body :is(div, p, span)[style*="font-size: 36px"] {
        font-size: 1.4rem !important;
    }

    .page-body table,
    .article-body table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    .page-body iframe,
    .article-body iframe {
        max-width: 100%;
    }
}

/* ---------- photo albums on the "Galéria" page (CMS content) ----------
   Small cards; the cover photo is always shown whole (contain), never cropped. */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 575.98px) {
    .album-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .album-card-body { padding: .5rem .65rem .7rem; }
    .album-card-title { font-size: .9rem; }
}

.album-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ztf-hairline);
    border-radius: 1rem;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--ztf-shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}

.album-card:hover,
.album-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(6, 59, 96, .16);
}

.album-card-photo {
    display: block;
    aspect-ratio: 3 / 2;
    background: #e6f2fb;
}

.page-body .album-card-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

.album-card-body {
    display: block;
    padding: .75rem 1rem 1rem;
}

.album-card-label {
    display: block;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ztf-blue);
}

.album-card-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--ztf-navy);
}

/* ---------- Aktuality tiles (article/_tile.php) ---------- */
.article-tile {
    transition: transform .15s ease, box-shadow .15s ease;
}

.article-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(6, 59, 96, .16) !important;
}

.article-tile-photo {
    aspect-ratio: 2 / 3;
}


.article-tile-photo {
    background: var(--ztf-navy);
}

/* the card's overflow:hidden rounds the photo — its own radius would differ
   from the card's and let the background show in the corners */
.article-tile .card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.article-tile-caption {
    background: linear-gradient(180deg, rgba(6, 59, 96, .55), rgba(6, 59, 96, .85));
    border-radius: .85rem;
    padding: .6rem .8rem;
}

.article-tile-perex {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* below the 4-column desktop row the tiles are landscape, not towering portraits */
@media (max-width: 991.98px) {
    .article-tile-photo { aspect-ratio: 4 / 3; }
    .article-tile-perex { -webkit-line-clamp: 2; }
}

/* ---------- account / contact cards ---------- */
.auth-card {
    width: 100%;
    max-width: 460px;
    border-radius: 1.5rem;
    background: #fff;
    border: 1px solid var(--ztf-hairline) !important;
    box-shadow: var(--ztf-shadow);
}

.auth-card-wide {
    max-width: 640px;
}

.auth-card-logo {
    height: 4rem;
    width: auto;
}

.site-contact textarea.form-control {
    height: 140px;
}

.site-login,
.site-signup,
.site-request-password-reset,
.site-reset-password,
.site-index,
.site-error {
    flex: 1;
}

/* ---------- partners ----------
   Logos are made for white backgrounds — each sits on its own white tile. */
.partner-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 8rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid var(--ztf-hairline);
    border-radius: 1rem;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

a.partner-logo:hover,
a.partner-logo:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(6, 59, 96, .14);
}

.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.partner-logo-name {
    color: var(--ztf-ink);
    font-weight: 700;
    text-align: center;
}

.partner-logo-lg { height: 11rem; padding: 1.75rem 2.25rem; }
.partner-logo-sm { height: 6.5rem; padding: 1rem 1.25rem; }

@media (max-width: 575.98px) {
    .partner-logo-lg { height: 8rem; padding: 1.25rem; }
    .partner-logo, .partner-logo-sm { height: 5.5rem; padding: .75rem 1rem; }
}

.partner-thanks {
    background: #fff;
    border: 1px solid var(--ztf-hairline);
    box-shadow: var(--ztf-shadow);
}

.partner-thanks p:last-child { margin-bottom: 0; }

/* homepage: tiers pinned above the strip — they don't move */
.partner-pinned-title {
    margin-bottom: .6rem;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ztf-muted);
}

.partner-pinned {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 22rem));
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.partner-logo-pinned {
    height: 7.5rem;
}

@media (max-width: 575.98px) {
    .partner-pinned { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .partner-logo-pinned { height: 5rem; padding: .6rem .75rem; }
}

/* homepage strip — two identical sets, slid by one set's width */
.partner-slider-viewport {
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}

.partner-slider-track {
    display: flex;
    width: max-content;
    animation: partner-slide var(--partner-slider-duration, 40s) linear infinite;
}

.partner-slider-viewport:hover .partner-slider-track,
.partner-slider-viewport:focus-within .partner-slider-track,
.partner-slider-track.is-paused,
.partner-slider-track.is-waiting {
    animation-play-state: paused;
}

.partner-slider-set {
    display: flex;
    gap: 1rem;
    margin: 0;
    padding-right: 1rem;
}

.partner-logo-slide {
    width: 11rem;
    height: 5.5rem;
    padding: .75rem 1rem;
}

@keyframes partner-slide {
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .partner-slider-viewport { overflow-x: auto; mask-image: none; }
    .partner-slider-track { animation: none; }
    .partner-slider-set[aria-hidden="true"] { display: none; }
}

/* ---------- newsletter band above the footer ---------- */
.newsletter-band {
    margin-top: 2.5rem;
    background: #fff;
    border-top: 1px solid var(--ztf-hairline);
}

/* honeypot: present for bots, invisible for people */
.newsletter-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- footer: navy, like the race-day app's bottom bar ---------- */
#footer {
    background: var(--ztf-navy);
    color: #bfd5e4;
}

#footer a {
    color: #fff;
    text-decoration: none;
}

#footer a:hover,
#footer a:focus-visible {
    text-decoration: underline;
}

#footer .footer-nav .nav-link {
    padding: .25rem .5rem;
}

/* gridview sort arrows */
a.asc:after, a.desc:after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
}

a.asc:after {
    border-bottom: solid 7px var(--bs-body-color);
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px var(--bs-body-color);
    border-bottom-width: 0;
}
