/*
 * Nereus brand system (see the "Nereus Brand Guide" design manual).
 * Additive on top of site.css / Bootstrap — tokens, type, hero, buttons, footer.
 */

:root {
    --n-regatta: #0D3B66;
    --n-lane: #2C93B8;
    --n-ink: #0B1B2E;
    --n-gold: #FFCC00;
    --n-gold-ink: #0D3B66;
    --n-site-accent: #29B6E8; /* Škola — Shallow */
}

body {
    font-family: 'Public Sans', 'Segoe UI', -apple-system, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand {
    font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
    font-weight: 800;
    letter-spacing: .2px;
}

/* ---------- header ---------- */
#header .navbar {
    background: var(--n-regatta) !important;
}

.brand-crest {
    height: 34px;
    width: 34px;
    margin-right: .5rem;
    vertical-align: middle;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Bootstrap's .navbar-collapse defaults to flex-wrap: nowrap — fine when
   the expanded row only ever holds a short link list, but ours also
   carries the site-switch-group. At in-between widths (past the
   navbar-expand-md breakpoint where the hamburger disappears, but before
   there's room for everything on one line) nowrap didn't make the row
   wrap — it just squeezed the switch-group narrower than its 3 buttons
   need, and since that group clips its own overflow (for the rounded
   corners), the last button silently vanished instead of wrapping into
   view. Letting the row wrap fixes every in-between width at once instead
   of hand-tuning breakpoints. */
.navbar-collapse {
    flex-wrap: wrap;
    row-gap: .25rem;
}

/* ---------- header: utility nav (account + site switcher) ---------- */
.navbar-nav-utility {
    font-size: .9rem;
    flex-shrink: 0;
}

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

/* ---------- domain switch bar (own strip above the header) ---------- */
.domain-switch-bar {
    background: var(--n-ink);
    padding: .5rem 15px;
}

/* 3 independent rounded pills (not one connected segmented control): the
   full site names ("Žilinský triatlonový festival"...) are long enough
   that a shared pill with hard-clipped overflow would break badly on
   narrow screens — separate pills can wrap onto a second line instead. */
.site-switch-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .4rem;
}

.site-switch-btn {
    padding: .3rem .9rem;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    white-space: nowrap;
}

a.site-switch-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .1);
}

.site-switch-btn.active {
    border-color: var(--n-gold);
    background: var(--n-gold);
    color: var(--n-gold-ink);
}

/* ---------- hero banner (diagonal split, brand palette — no green) ---------- */
.hero-banner {
    background: linear-gradient(115deg, var(--n-regatta) 0 52%, var(--n-site-accent) 52% 100%);
    position: relative;
}

.hero-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at 85% 15%, rgba(255, 204, 0, .18), transparent 60%);
    pointer-events: none;
}

/* MainBanner (admin-uploaded homepage photo) behind a dark scrim, in place of the flat gradient. */
.hero-banner.has-photo {
    background-image: linear-gradient(115deg, rgba(8, 20, 24, .6), rgba(8, 20, 24, .4)), var(--hero-photo);
    background-size: cover;
    background-position: center;
}

.hero-banner::before {
    content: none;
}

.hero-banner h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.02;
}

.hero-lead {
    max-width: 520px;
}

/* ---------- buttons ---------- */
.btn-primary {
    background-color: var(--n-gold);
    border-color: var(--n-gold);
    color: var(--n-gold-ink);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #e6b800;
    border-color: #e6b800;
    color: var(--n-gold-ink);
}

.btn-outline-secondary {
    border-color: var(--n-regatta);
    color: var(--n-regatta);
}

.btn-outline-secondary:hover {
    background-color: var(--n-regatta);
    border-color: var(--n-regatta);
    color: #fff;
}

/* --n-regatta is a near-black teal — readable as text/border on the light
   background it was designed for, but close to invisible against the dark
   theme's near-black background. Swap to --n-lane (a much lighter blue)
   whenever dark mode is active. */
[data-bs-theme="dark"] .btn-outline-secondary {
    border-color: var(--n-lane);
    color: var(--n-lane);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--n-lane);
    border-color: var(--n-lane);
    color: var(--n-ink);
}

/* Course/article/benefit cards use border-0 + shadow-sm for separation —
   on a light page background the shadow reads fine, but in dark mode the
   card background is identical to the page background and the shadow is a
   ~black tint at 7% opacity, i.e. invisible on top of near-black — cards
   became indistinguishable from each other and from the page. Give them a
   slightly lighter surface + a subtle visible border instead, using
   Bootstrap's own dark-mode-aware tokens. */
[data-bs-theme="dark"] {
    /* Bootstrap's dark theme defaults to a near-black neutral gray — swap
       the page background for a deep navy blue (closer to the club's own
       water/underwater identity than plain gray) with a couple of soft
       radial glows for depth, no repeating texture. */
    --bs-body-bg: #0A1B2E;
    --bs-tertiary-bg: #11273E;
    --bs-secondary-bg: #0D2237;
}

[data-bs-theme="dark"] body {
    background-image:
        radial-gradient(1100px circle at 12% -15%, rgba(44, 147, 184, .28), transparent 55%),
        radial-gradient(900px circle at 105% 10%, rgba(255, 204, 0, .08), transparent 45%);
    background-attachment: fixed;
}

[data-bs-theme="dark"] .card {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid rgba(44, 147, 184, .25);
}

/* ---------- pill badges (course price/capacity, highlighted labels) ---------- */
.badge-pill-info {
    background: rgba(44, 147, 184, .12);
    color: var(--n-regatta);
    border: 1px solid rgba(44, 147, 184, .35);
    font-weight: 600;
}

[data-bs-theme="dark"] .badge-pill-info {
    background: rgba(44, 147, 184, .18);
    color: var(--n-lane);
    border-color: rgba(44, 147, 184, .4);
}

.badge-pill-gold {
    background: var(--n-gold);
    color: var(--n-gold-ink);
    border: none;
    font-weight: 700;
}

.section-heading {
    color: var(--n-gold);
}

/* Hand-authored Page/Article content (data-bs-theme="dark" scoped in the
   view, see page/view.php) always sits on its own dark surface, whatever
   theme the rest of the site is in — it was designed against one and reads
   as broken without it (near-invisible "glass" cards, white text with
   nothing behind it) on the light theme. */
.page-body-rich {
    background: var(--n-regatta);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .12);
}


/* ---------- wave divider (echoes the crest's wave lines) ---------- */
.wave-divider {
    display: block;
    width: 100%;
    height: 28px;
    margin-block: 1.5rem;
}

/* ---------- footer ---------- */
#footer {
    background: var(--n-regatta) !important;
    color: #BFD8DA;
}

#footer a {
    color: #BFD8DA;
}

#footer .footer-crest {
    height: 22px;
    width: 22px;
    margin-right: .4rem;
    vertical-align: text-bottom;
}

/* Nested (3rd-level) dropdown positioning — JS toggle in
   common/assets/nesteddropdown/js/nested-dropdown.js, since Bootstrap 5s own
   Dropdown component only manages one level. Desktop only: on mobile the
   navbar-collapse already stacks dropdown-menus statically, so a nested one
   just needs to show/hide, not reposition. */
@media (min-width: 768px) {
    .navbar-nav .dropdown-menu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -0.5rem;
    }
}

/* Plain <hr> with no inline styling of its own (most legacy content sets
   its own border color) — fall back to a theme-aware divider instead of
   Bootstrap's default, which reads as invisible on the dark theme. */
.page-body hr,
.article-body hr {
    border: 0;
    border-top: 1px solid var(--bs-border-color);
}

/* ---------- Aktuality tiles (article/_tile.php) ---------- */
/* Portrait at any column width (mobile single column, desktop col-lg-3) —
   found live: a fixed pixel height read as landscape once the column got
   wide on desktop. The row uses align-items-start (see project/view.php,
   article/index.php) instead of stretching cards to match row height, so
   this ratio isn't fought by a forced 100% height. */
.article-tile-photo {
    aspect-ratio: 2 / 3;
}

/* .card-img-overlay is already position:absolute/inset:0 (Bootstrap) — the
   image needs the same treatment so text and photo cover the full tile
   instead of sitting in-flow above the overlay. */
.article-tile .card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* A gradient wash over the whole photo either hid too much of it or still
   wasn't dark enough on light/white source images (found live: some poster-
   style article photos have their own light background right where the
   caption sits). A dedicated "chip" behind just the caption text guarantees
   contrast on any photo without dimming the rest of it. */
/* No backdrop-filter here on purpose: it establishes a new containing block
   for absolutely-positioned descendants, which quietly shrank the title's
   .stretched-link (nested inside this chip) down to the chip's own small
   box instead of the full tile — found live: only the caption text was
   clickable, not the photo above it. */
.article-tile-caption {
    background: linear-gradient(180deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, .5));
    border-radius: .5rem;
    padding: .5rem .75rem;
}
