/*
 * Viljandi Jäähall — what the theme adds to the design's style.css.
 *
 * style.css is the design's file as delivered and stays untouched, so a new
 * design delivery can replace it. This file holds only what running the
 * design as page-builder sections needs on top of it: the selectors the
 * design wrote for one element per page (#snow), the sticky header, the
 * headings demoted for the page's outline, and the accessibility floor.
 *
 * Served as-is; there is no build step.
 */

/* Visible focus everywhere, on top of whatever the browser does (WCAG 2.4.7). */
:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 2px;
}

.site-footer :focus-visible,
.topbar :focus-visible,
.calc :focus-visible,
.contact-card :focus-visible,
.aasa :focus-visible {
    outline-color: var(--sun);
}

/* The editors' margins scale with the design's own section padding, which
   drops from 6rem to 4.5rem under 992px. */
@media (max-width: 991.98px) {
    :root {
        --pc-section-scale: .75;
    }
}

/* The snow: a canvas per hero, so a class where the design had #snow. */
.snow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Over the photo, above it and its gradient (style.css `.hero-photo #snow`). */
.hero-photo .snow {
    z-index: 1;
}

/* The header sticks, not the menu bar inside it, and sticks the top bar's
   height above the viewport, so the top bar scrolls away. theme.js sets
   --topbar-h; without it the whole header sticks. */
.site-header {
    position: sticky;
    top: calc(-1 * var(--topbar-h, 0px));
    z-index: 1020;
}

/* The current page, styled from the attribute that announces it, so the cue
   on screen and the one a screen reader hears cannot drift (WCAG 1.4.1). */
.site-nav .nav-link[aria-current="page"],
.site-nav .dropdown-item[aria-current="page"] {
    background: var(--ice-50);
    color: var(--ice-600);
}

/* The design's coloured words: `.hl` is style.css's; the marker and navy are
   the editor's other two accents. */
.tilt {
    display: inline-block;
    background: var(--sun);
    padding: 0 .25em;
    border-radius: .2em;
    transform: rotate(-2deg);
}

.text-navy {
    color: var(--navy);
}

/* What the design wrote as inline styles. */
.photo-band-lead {
    color: #d6e7f7;
}

.calc-lead {
    color: #a9c3dc;
}

.lead-narrow {
    max-width: 40rem;
}

.footer-brand img {
    width: auto;
}

/* The week's days are a list. */
.week {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* The footer's column headings are <h2> for the page's outline, styled as
   the design's <h4>. */
.site-footer .footer-heading {
    color: #fff;
    font-size: 1rem;
    letter-spacing: -.01em;
    margin-bottom: 1rem;
}

/* The contact card's headings follow the page's outline (h2, h3); the design
   styled them as h3 and h4. */
.contact-card h2,
.contact-card h3 {
    color: #fff;
}

.contact-card .h4 {
    font-size: 1.05rem;
    margin-bottom: .9rem;
}

.contact-card strong {
    color: #fff;
}

.contact-card p {
    margin-bottom: .5rem;
}

.contact-card p:last-of-type {
    margin-bottom: 0;
}

/* A sponsor with a web address is a link, looking like the tile it was. */
a.sponsor {
    text-decoration: none;
}

a.sponsor:hover {
    color: var(--navy);
}

.sponsor .mono-logo {
    background: #fff;
    border: 2px solid var(--ice-100);
    padding: .3rem;
}

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

/* A logo is too wide for the initials' square: it goes over the name, across the tile. */
.sponsor-logo {
    flex-direction: column;
    justify-content: center;
    gap: .6rem;
    text-align: center;
}

/* Flex, not the square's grid: a grid's auto row leaves the logo's max-height: 100% unresolved. */
.sponsor-logo .mono-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 72px;
    border: 0;
}

/* A note's sentence beside its icon. */
.note > span {
    flex: 1;
}

/* A rule's or a price card's text may carry a link. */
.rule p a,
.info-box p a {
    font-weight: 600;
}

.prose ul,
.prose ol {
    color: #3b5168;
}

/* style.css hides every .reveal until theme.js shows it; without the script
   (head.php marks html.js) a section would never appear. */
html:not(.js) .reveal {
    opacity: 1;
    transform: none;
}

/* Bootstrap's .h3/.h4 classes set weight 500 and win over style.css's
   element rule; these headings are the design's h3 and h4. */
.contact-card .h3,
.contact-card .h4 {
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.08;
}

/* Core's cookie banner in the design's colours: navy buttons on white, the
   design's font and pill buttons. consent.css declares its palette on
   #silktide-wrapper and loads after this file, so `html` in front of the id
   wins the specificity tie. Silktide's --focus is its focus ring; it stays. */
html #silktide-wrapper {
    --fontFamily: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --primaryColor: #0b2a4a;
    --backgroundColor: #ffffff;
    --textColor: #16324f;
    --backdropBackgroundColor: rgba(11, 42, 74, .45);
    --cookieIconColor: #0b2a4a;
    --cookieIconBackgroundColor: #ffc83d;
    --boxShadow: 0 24px 48px -24px rgba(11, 42, 74, .4);
}

html #silktide-wrapper .st-button {
    border-radius: 999px;
    font-weight: 700;
}

html #silktide-wrapper #silktide-banner .st-button:focus,
html #silktide-wrapper #silktide-modal .st-button:focus {
    border-radius: 999px;
}

html #silktide-wrapper #silktide-banner,
html #silktide-wrapper #silktide-modal {
    border-radius: 1.5rem;
}

/* In core's high-contrast mode the banner goes black and yellow with the page. */
html body.a11y-contrast-high #silktide-wrapper {
    --primaryColor: #ff0;
    --backgroundColor: #000;
    --textColor: #ff0;
    --cookieIconColor: #000;
    --cookieIconBackgroundColor: #ff0;
}

html body.a11y-contrast-high #silktide-wrapper #silktide-banner,
html body.a11y-contrast-high #silktide-wrapper #silktide-modal {
    border: 1px solid #ff0;
}

/* Core's high-contrast mode (accessibility panel) turns every word yellow
   and the page black, but leaves the design's own surfaces — cards, chips,
   tiles, badges — white or coloured under the yellow words. They go black
   with a yellow edge; the marker stays a marker, yellow with black words.
   A sponsor's logo keeps its white plate: its own dark colours vanish on black. */
body.a11y-contrast-high :is(
    .eyebrow, .chip, .float-card, .tag, .pill, .pill-s, .cap, .prices > span, .extras > span,
    .value-card, .info-box, .mini-price, .price-card, .calc, .ribbon, .sponsor, .mono:not(.mono-logo), .ic,
    .rules-intro, .rule, .num, .contact-tile, .week .day,
    .site-nav .nav-link.active, .site-nav .dropdown-item.active
) {
    background: #000 !important;
    border: 1px solid #ff0 !important;
    color: #ff0 !important;
}

body.a11y-contrast-high .tilt {
    background: #ff0 !important;
    color: #000 !important;
}

/* Core's list of yellow words leaves out <small>, the design's grey notes. */
body.a11y-contrast-high small {
    color: #ff0 !important;
}
