@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('../themes/jagu-srdcovka/assets/fonts/archivo-normal-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('../themes/jagu-srdcovka/assets/fonts/archivo-normal-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'STIX Two Text';
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url('../themes/jagu-srdcovka/assets/fonts/stix-two-text-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'STIX Two Text';
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url('../themes/jagu-srdcovka/assets/fonts/stix-two-text-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'STIX Two Text';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../themes/jagu-srdcovka/assets/fonts/stix-two-text-normal-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'STIX Two Text';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../themes/jagu-srdcovka/assets/fonts/stix-two-text-normal-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* Design tokens from the brand manual (92_Graficky_manual) and concept B "Tmavý les" */
:root {
    --color-forest: #4E6B45;
    --color-cream: #F4E8D0;
    /* Mauve and bell are a shade darker than in the concept, for 4.5:1 text contrast on cream */
    --color-mauve: #746081;
    --color-bell: #5C5F81;
    /* Link hover on the forest green, mauve would be unreadable there */
    --color-mauve-light: #EADFF2;
    --color-ink: #242723;
    --color-paper: #FBF8F1;
    --color-band: #ECDFC4;
    --color-sand: #DDD3BD;
    --color-line: rgb(108 112 152 / 0.35);
    --color-line-strong: rgb(108 112 152 / 0.45);
    --color-line-light: rgb(244 232 208 / 0.5);

    --font-serif: 'STIX Two Text', Georgia, 'Times New Roman', serif;
    --font-sans: Archivo, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --text-sm: 0.875rem;
    --text-base: 1.0625rem;
    --text-lg: 1.125rem;
    --text-h1: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
    --text-h2: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
    --text-h3: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);

    --gutter: clamp(1.25rem, 4vw, 3.5rem);
    --section-y: clamp(3rem, 7vw, 5.5rem);
    --content-max: 90rem;
    --measure: 44rem;
    --reading: 48rem;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--color-cream);
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    margin: 0 0 0.6em;
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.1;
    text-wrap: balance;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); line-height: 1.12; }
h3 { font-size: var(--text-h3); line-height: 1.2; }

p {
    margin: 0 0 1em;
    text-wrap: pretty;
}

a {
    color: var(--color-forest);
    text-decoration: none;
    transition: color 0.18s ease;

    &:hover {
        color: var(--color-mauve);
    }
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

:focus-visible {
    outline: 2px solid var(--color-mauve);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--gutter);
    z-index: 200;
    padding: 0.75rem 1.25rem;
    background: var(--color-forest);
    color: var(--color-cream);

    &:focus {
        top: 0.75rem;
        color: var(--color-cream);
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Rich text from the editor (unit intro, legal pages) */
.prose {
    max-width: var(--measure);

    & > :last-child { margin-bottom: 0; }
    & ul, & ol { padding-left: 1.25em; margin: 0 0 1em; }
    & li { margin-bottom: 0.35em; }
    & a { text-decoration: underline; text-underline-offset: 0.2em; }
    & h2 { font-size: var(--text-h3); margin-top: 1.6em; color: var(--color-forest); }
    & h3 { font-size: 1.25rem; margin-top: 1.4em; }

    & table {
        width: 100%;
        margin: 0 0 1.5em;
        border-collapse: collapse;
        font-size: var(--text-sm);
    }
    & th, & td {
        padding: 0.6em 0.9em;
        border-bottom: 1px solid var(--color-line);
        text-align: left;
        vertical-align: top;
    }
    & th, & thead td {
        background: var(--color-band);
        font-weight: 600;
    }
}
@media (max-width: 640px) {
    /* Wide tables (e.g. the list of cookies) scroll sideways instead of overflowing */
    .prose table {
        display: block;
        overflow-x: auto;
    }
}

/* Page sections and grids; sections are full width with a fluid gutter, as in concept B */
.section {
    padding: var(--section-y) var(--gutter);

    &.is-forest {
        background: var(--color-forest);
        color: var(--color-cream);

        & h1, & h2, & h3, & a { color: var(--color-cream); }
        & a:not(.btn):hover { color: var(--color-mauve-light); }
    }

    &.is-band {
        background: var(--color-band);
    }

    &.is-tight {
        padding-block: calc(var(--section-y) * 0.6);
    }
}

.container {
    max-width: var(--content-max);
    margin-inline: auto;
}

/* Centred reading column of text blocks on block pages */
.reading {
    max-width: var(--reading);
    margin-inline: auto;

    & .prose { max-width: none; }
}

.measure {
    max-width: var(--measure);
}

.heading-forest {
    color: var(--color-forest);
}

.eyebrow {
    margin: 0 0 1.1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.lead {
    font-size: var(--text-lg);
    line-height: 1.7;
}

.grid {
    display: grid;
    gap: clamp(1.5rem, 4vw, 5rem);

    &.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    &.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    &.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
    &.is-wide-left { grid-template-columns: 2fr 1fr; }
    &.is-centered { align-items: center; }
}

@media (max-width: 960px) {
    .grid.is-2, .grid.is-3, .grid.is-wide-left {
        grid-template-columns: minmax(0, 1fr);
    }

    .grid.is-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .grid.is-4 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Split hero: photo on the left, forest panel on the right */
.split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    min-height: min(45rem, 85vh);

    & > .split-media {
        position: relative;
        min-height: 18rem;
        background: var(--color-sand);

        & img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }

    & > .split-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: clamp(2.5rem, 5vw, 3.5rem) clamp(1.25rem, 3.5vw, 2.75rem);
        background: var(--color-forest);
        color: var(--color-cream);

        & h1, & h2 { color: var(--color-cream); }
        & a:not(.btn) { color: var(--color-cream); }
        & a:not(.btn):hover { color: var(--color-mauve-light); }
    }

    &.is-even {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 960px) {
    .split, .split.is-even {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }
}

/* Simple page header used by inner pages */
.page-header {
    padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(2rem, 4vw, 3rem);
    border-bottom: 1px solid var(--color-line);

    & h1 {
        max-width: 20ch;
        margin-bottom: 0.4em;
        color: var(--color-forest);
    }

    & .lead {
        max-width: var(--measure);
        margin: 0;
    }
}

/* Buttons: mauve marks the main action (brand manual), cream/outline variants sit on forest */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 1rem 1.75rem;
    border: 1px solid transparent;
    background: var(--color-mauve);
    color: var(--color-cream);
    font: 600 1rem/1.2 var(--font-sans);
    text-align: center;
    cursor: pointer;
    transition: opacity 0.18s ease, background-color 0.18s ease;

    &:hover {
        color: var(--color-cream);
        opacity: 0.92;
    }

    &.is-light {
        background: var(--color-cream);
        color: var(--color-forest);
    }

    &.is-forest {
        background: var(--color-forest);
        color: var(--color-cream);
    }

    &.is-outline-light {
        background: transparent;
        border-color: rgb(244 232 208 / 0.6);
        color: var(--color-cream);
    }

    &.is-outline {
        background: transparent;
        border-color: var(--color-forest);
        color: var(--color-forest);
    }

    &.is-small {
        padding: 0.75rem 1.375rem;
        font-size: 0.9375rem;
    }
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.125rem;
}

@media (max-width: 640px) {
    .btn-group {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Underlined text link, e.g. "Poznat projekt" */
.link-underline {
    align-self: flex-start;
    padding-bottom: 3px;
    border-bottom: 1px solid currentColor;
    font-weight: 600;
    transition: color 0.18s ease, box-shadow 0.18s ease;

    /* A second line under the border, without moving the layout */
    &:hover { box-shadow: 0 1px 0 currentColor; }
}

/* Header and navigation */
.site-header {
    position: relative;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.375rem var(--gutter);
    background: var(--color-cream);
    border-bottom: 1px solid var(--color-line);

    & .brand img {
        width: 224px;
    }
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.875rem;

    & a {
        font-size: 0.9375rem;
        font-weight: 600;
        color: var(--color-forest);

        &:hover, &[aria-current="page"] {
            color: var(--color-mauve);
        }

        &[aria-current="page"] {
            padding-bottom: 2px;
            border-bottom: 2px solid var(--color-mauve);
        }

        &.is-cta {
            padding: 0.75rem 1.375rem;
            border: 0;
            background: var(--color-mauve);
            color: var(--color-cream);
        }
    }
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 1px solid var(--color-line);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;

    & span {
        display: block;
        width: 22px;
        height: 2px;
        border-radius: 2px;
        background: var(--color-forest);
        transition: transform 0.22s ease, opacity 0.22s ease;
    }

    &[aria-expanded="true"] {
        & span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
        & span:nth-child(2) { opacity: 0; }
        & span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    }
}

@media (max-width: 960px) {
    .site-header {
        padding-block: 1rem;

        & .brand img {
            width: 175px;
            max-width: 55vw;
        }
    }

    .nav-toggle {
        display: flex;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.75rem var(--gutter) 1.5rem;
        background: var(--color-cream);
        border-bottom: 2px solid var(--color-line);
        box-shadow: 0 16px 36px rgb(36 39 35 / 0.15);

        &.is-open {
            display: flex;
        }

        & a {
            padding: 0.875rem 0.25rem;
            border-bottom: 1px solid rgb(108 112 152 / 0.2);
            font-size: 1rem;

            &[aria-current="page"] {
                border-bottom: 1px solid rgb(108 112 152 / 0.2);
            }

            &.is-cta {
                margin-top: 0.75rem;
                text-align: center;
            }
        }
    }
}

/* Footer */
.site-footer {
    padding: 3.5rem var(--gutter) 2rem;
    background: var(--color-forest);
    color: var(--color-cream);
    font-size: 0.9375rem;

    & a {
        color: var(--color-cream);

        &:hover {
            color: var(--color-mauve-light);
        }
    }

    & .brand img {
        width: 224px;
        margin-bottom: 1.125rem;
    }

    & ul {
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
        margin: 0;
        padding: 0;
        list-style: none;
    }
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem;
}

.footer-company {
    font-style: normal;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.socials {
    display: flex;
    gap: 1.125rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;

    .site-footer & {
        flex-direction: row;
    }

    a {
        display: inline-flex;
    }

    svg {
        width: 1.625rem;
        height: 1.625rem;
    }
}

/* The left footer column keeps the icons at the bottom, next to the bottom line */
.footer-brand {
    display: flex;
    flex-direction: column;

    .socials {
        margin-top: auto;
        padding-top: 1.5rem;
    }
}

.footer-title {
    margin: 0 0 1rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-cream);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-line-light);
    font-size: 0.8125rem;

    & p { margin: 0; }
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.footer-credit {
    margin-left: auto;
}

/* Jagu attribution icon, see the "JaguIcon do patičky" wiki page */
.jagulogo-jagu::before {
    position: relative;
    top: 5px;
    margin: 0 5px;
    font-size: 150%;
    transition: color 0.18s ease;
}

/* Jagu orange (fonts.jagu.cz/jagu-logo.css) */
.jagulogo-jagu:hover::before,
.jagulogo-jagu:focus-visible::before {
    color: #f8981d;
}

@media (max-width: 960px) {
    .footer-columns {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    .footer-credit {
        margin-left: 0;
    }
}

/* Breadcrumbs */
.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.375rem;
    padding: 0;
    list-style: none;
    font-size: var(--text-sm);

    & li + li::before {
        content: "/";
        margin-right: 0.5rem;
        opacity: 0.6;
    }
}

/* Unit status badge */
.status-badge {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--color-forest);
    color: var(--color-forest);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;

    &.is-pre_reserved, &.is-reserved {
        border-color: var(--color-line-strong);
        color: var(--color-bell);
    }

    &.is-sold {
        border-color: var(--color-line);
        color: rgb(36 39 35 / 0.7);
    }
}

/* Image with an optional caption */
.figure {
    margin: 0;

    & img {
        width: 100%;
        background: var(--color-sand);
    }

    & figcaption {
        margin-top: 0.5rem;
        font-size: var(--text-sm);
        opacity: 0.8;
    }
}

/* Enquiry form (partial forms/enquiry) */
.form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;

    a {
        color: inherit;
    }
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;

    label {
        font-size: var(--text-sm);
        font-weight: 600;
        color: var(--color-forest);
    }

    input,
    select,
    textarea {
        width: 100%;
        padding: 0.9rem 1rem;
        border: 1px solid var(--color-line-strong);
        border-radius: 0;
        background: var(--color-paper);
        color: var(--color-ink);
        font: 400 0.9375rem/1.4 var(--font-sans);
        transition: border-color 0.18s ease;

        &:focus {
            outline: 2px solid var(--color-forest);
            outline-offset: -1px;
            border-color: var(--color-forest);
        }
    }

    select {
        appearance: none;
        padding-right: 2.5rem;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234E6B45' stroke-width='1.5'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 1rem center;
    }

    textarea {
        min-height: 6rem;
        resize: vertical;
    }

    &:has(.form-error:not(:empty)) :is(input, select, textarea) {
        border-color: #A33A2B;
    }
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.8125rem;
    line-height: 1.55;

    input {
        flex: none;
        width: 1rem;
        height: 1rem;
        margin: 0.15rem 0 0;
        accent-color: var(--color-forest);
    }
}

.form-error {
    margin: 0;
    font-size: var(--text-sm);
    color: #A33A2B;

    &:empty {
        display: none;
    }
}

.form-submit {
    width: 100%;
    margin-top: 0.375rem;

    &[disabled] {
        opacity: 0.6;
        cursor: progress;
    }
}

.form-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-success {
    padding: 2rem;
    border: 1px solid var(--color-line-strong);
    background: var(--color-paper);

    p {
        margin: 0;
    }
}

/* Quick edit button for a signed in backend user (partial site/edit-bar) */
.edit-bar {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--color-mauve);
    color: var(--color-cream);
    box-shadow: 0 6px 24px rgb(36 39 35 / 0.25);
    transition: background-color 0.18s ease;

    &:hover {
        background: var(--color-forest);
        color: var(--color-cream);
    }

    @media print {
        display: none;
    }
}

/* Map of the project and places nearby (partial ui/map, assets/js/map.js) */
:root {
    --map-height: clamp(22rem, 60vh, 36rem);
}

.map {
    position: relative;
    height: var(--map-height);
    margin-top: 2.5rem;
    background: var(--color-sand);
    z-index: 0;

    &.is-failed {
        display: grid;
        place-items: center;
    }

    & .leaflet-container,
    &.leaflet-container {
        font: inherit;
        background: var(--color-sand);
    }

    & .leaflet-popup-content-wrapper {
        border-radius: 0;
    }
}

.map-consent {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: var(--gutter);
    text-align: center;

    & p {
        max-width: 32rem;
        margin: 0;
    }
}

.map-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 2px solid var(--color-forest);
    border-radius: 50%;
    background: var(--color-paper);
    color: var(--color-forest);
    box-shadow: 0 2px 6px rgb(36 39 35 / 0.35);
    cursor: pointer;

    &.is-main {
        width: 40px;
        height: 40px;
        border-color: var(--color-paper);
        background: var(--color-forest);
        color: var(--color-cream);
    }
}

.map-popup {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: 0.9375rem;

    & span {
        font-size: var(--text-sm);
        opacity: 0.8;
    }

    /* The place's website (new tab), coloured like the site's links (forest, mauve on hover);
       :is() outweighs the map library's own link colour */
    &:is(div) a {
        align-self: flex-start;
        margin-top: 0.2rem;
        color: var(--color-forest);
        font-size: var(--text-sm);
        text-decoration: underline;
        text-underline-offset: 0.2em;

        &::after { content: " ↗"; }
        &:hover { color: var(--color-mauve); }
    }
}

.map-logo img {
    display: block;
}

/* Page sections from concept B; markup lives in partials/sections */

/* Hero without a photo: the forest panel across the full width */
.split.is-hero.is-plain {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;

    /* Content lines up with the centred reading column of the blocks below */
    & > .split-panel {
        --inline: max(var(--gutter), (100% - var(--reading)) / 2);
        padding: clamp(5rem, 9vw, 7rem) var(--inline) clamp(3rem, 6vw, 4.5rem);

        & h1 { max-width: none; }
        & .breadcrumbs { left: var(--inline); right: var(--inline); }
    }
}

.split.is-inner {
    min-height: min(38.75rem, 80vh);

    & h1 {
        font-size: clamp(2rem, 1.4rem + 1.6vw, 2.875rem);
        line-height: 1.1;
    }
}

/* Breadcrumbs sit at the top of the panel, the heading stays centred */
.split.is-inner > .split-panel {
    position: relative;
    padding-top: clamp(4.5rem, 8vw, 6rem);
}

.split-panel .breadcrumbs {
    position: absolute;
    top: clamp(1.5rem, 3vw, 2.25rem);
    left: clamp(1.25rem, 3.5vw, 2.75rem);
    right: clamp(1.25rem, 3.5vw, 2.75rem);
    color: var(--color-cream);

    & ol { margin: 0; }
    & a { color: var(--color-cream); }
}

.split-panel.is-roomy {
    padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3.5rem);
}

.split.is-even > .split-media {
    min-height: clamp(18rem, 40vw, 32.5rem);
}

.note {
    margin: 1.5rem 0 0;
    font-size: var(--text-sm);
    opacity: 0.8;
}

.section-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 2rem;
}

/* One photo, or a pair with the second one offset (concept B) */
.media-set {
    display: grid;
    gap: 1rem;

    & img {
        width: 100%;
        height: clamp(14rem, 25vw, 22.5rem);
        object-fit: cover;
    }

    &.is-pair {
        grid-template-columns: 1fr 1fr;

        & img { height: clamp(12rem, 22vw, 18.75rem); }
        & .figure:nth-child(2) { margin-top: 2.75rem; }
    }
}

/* Photo row under two text columns: wide + narrow */
.media-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-top: 3.5rem;

    & img {
        width: 100%;
        height: clamp(14rem, 30vw, 26.25rem);
        object-fit: cover;
    }
}

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

/* References (O nás): one row per reference, photo alternating sides */
.references .reference {
    margin-top: clamp(2.5rem, 5vw, 4rem);

    & img {
        width: 100%;
        height: clamp(14rem, 25vw, 22.5rem);
        object-fit: cover;
    }

    &.is-reversed > :first-child {
        order: 2;
    }
}

@media (max-width: 960px) {
    .references .reference.is-reversed > :first-child {
        order: 0;
    }
}

/* Places near the project, bordered tiles on the forest panel */
.places {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.375rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;

    & li {
        padding-top: 0.875rem;
        border-top: 1px solid var(--color-line-light);
    }

    & .place-name {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        font-family: var(--font-serif);
        font-size: 1.5rem;
        line-height: 1.2;
    }

    & a.place-name {
        color: inherit;
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 0.2em;

        &:hover { color: var(--color-mauve-light); }
    }

    & .place-name .place-icon {
        flex-shrink: 0;
        margin-top: 0.25em;
        opacity: 0.85;
    }

    & .place-meta {
        display: block;
        margin-top: 0.25rem;
        font-size: var(--text-sm);
    }

    /* One column on a light background, next to the map */
    &.is-stacked {
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        margin: 0;

        & li { border-top-color: var(--color-line-strong); }
        & .place-name { font-size: 1.25rem; }
        & .place-icon { color: var(--color-forest); opacity: 1; }

        /* Linked to the map by assets/js/map.js */
        & li.is-linked {
            cursor: pointer;

            &:hover .place-name, &.is-active .place-name { color: var(--color-forest); }
            &.is-active { border-top-color: var(--color-forest); }
            &:focus-visible { outline: 2px solid var(--color-forest); outline-offset: 4px; }
        }
    }
}

/* Lokalita: the map with the list of places beside it */
.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem clamp(1.5rem, 4vw, 3rem);
    margin-top: 2.5rem;

    & .map { margin-top: 0; }

    /* Without a map (no API key yet) the places spread over the full width */
    &:not(:has(.map)) {
        grid-template-columns: minmax(0, 1fr);

        & .places.is-stacked { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
    }
}
/* A long list of places scrolls next to the map instead of outgrowing it */
@media (min-width: 961px) {
    .map-layout:has(.map) .places.is-stacked {
        max-height: var(--map-height);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 0.75rem;
        scrollbar-width: thin;
        mask-image: linear-gradient(to bottom, #000 calc(100% - 3rem), transparent);
    }
}
@media (max-width: 960px) {
    .map-layout { grid-template-columns: minmax(0, 1fr); }
}

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

/* Seasons: forest band on the homepage, cream band on Lokalita */
.seasons {
    &.is-forest {
        background: var(--color-forest);
        color: var(--color-cream);

        & .seasons-title { color: var(--color-cream); }
    }

    &.is-band {
        background: var(--color-band);

        & .seasons-title { color: var(--color-forest); }
    }

    & .seasons-title {
        max-width: 20ch;
        margin-bottom: 3.5rem;
        font-size: var(--text-h1);
        line-height: 1.08;
    }

    & .season img {
        width: 100%;
        height: 15rem;
        object-fit: cover;
        margin-bottom: 1.25rem;
    }

    & .season h3 {
        margin-bottom: 0.6rem;
        font-size: 1.625rem;
        text-transform: uppercase;
    }

    & .season p {
        margin: 0;
        line-height: 1.6;
    }
}

/* Technology tiles (O projektu) */
.tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 3rem 0 0;
    padding: 0;
    list-style: none;

    & li {
        padding: 1.375rem 1.5rem;
        border: 1px solid var(--color-bell);
    }

    & .tile-title {
        display: block;
        font-family: var(--font-serif);
        font-size: 1.375rem;
        color: var(--color-forest);
    }

    & .tile-meta {
        display: block;
        margin-top: 0.25rem;
        font-size: var(--text-sm);
    }
}

/* Project timeline: one row that scrolls sideways (scroll snap) */
.timeline {
    --visible: 4;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--visible) - 1) * 1.5rem) / var(--visible));
    gap: 1.5rem;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;

    &::-webkit-scrollbar {
        display: none;
    }

    & > li {
        scroll-snap-align: start;
    }

    & li {
        padding-top: 1.25rem;
        border-top: 6px solid var(--color-forest);
    }

    & .timeline-title {
        display: block;
        font-family: var(--font-serif);
        font-size: 1.375rem;
        color: var(--color-forest);
    }

    & .timeline-period {
        display: block;
        margin-top: 0.25rem;
        font-size: var(--text-sm);
        color: var(--color-bell);
    }

    & p {
        margin: 0.75rem 0 0;
        font-size: var(--text-sm);
    }

    & .timeline-photo {
        display: block;
        margin: 0 0 1rem;

        & img {
            aspect-ratio: 4 / 3;
            object-fit: cover;
        }

        & figcaption { display: none; }
    }

    /* Cards with a popup: the title button covers the whole card */
    & > li.has-detail {
        position: relative;
        cursor: pointer;

        & .timeline-title {
            padding: 0;
            border: 0;
            background: none;
            line-height: inherit;
            text-align: left;
            cursor: pointer;

            &::after {
                content: "";
                position: absolute;
                inset: 0;
            }
        }

        &:hover .timeline-title,
        &:focus-within .timeline-title {
            text-decoration: underline;
            text-underline-offset: 0.2em;
        }

        &:hover .timeline-photo-hint,
        &:focus-within .timeline-photo-hint {
            opacity: 1;
        }
    }

    & .timeline-photo {
        position: relative;
    }

    & .timeline-photo-hint {
        position: absolute;
        inset: auto 0 0;
        padding: 0.75rem 1rem;
        background: rgb(78 107 69 / 0.9);
        color: var(--color-cream);
        font: 600 0.875rem/1.3 var(--font-sans);
        opacity: 0;
        transition: opacity 0.18s ease;
    }
}

/* Detail dialog (native <dialog>) */
.dialog {
    --dialog-padding: clamp(1.5rem, 4vw, 2.5rem);
    width: min(60rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 0;
    background: var(--color-cream);
    color: var(--color-ink);
    overflow: auto;

    &::backdrop {
        background: rgb(36 39 35 / 0.6);
    }

    & .viewer-slide img {
        max-height: 60vh;
    }

    /* The photo runs edge to edge, caption and thumbnails keep the dialog margin */
    & .viewer-caption,
    & .viewer-thumbs {
        padding-inline: var(--dialog-padding);
    }

    & .dialog-body {
        padding: var(--dialog-padding);
    }

    & h3 {
        font-size: var(--text-h2);
    }
}

.dialog-close {
    position: sticky;
    top: 0.75rem;
    float: right;
    z-index: 1;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0.75rem 0.75rem -3.5rem 0;
    border: 0;
    border-radius: 50%;
    background: var(--color-cream);
    color: var(--color-forest);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

/* Tiles: four per row on desktop, more items wrap onto further rows */
@media (max-width: 960px) {
    .tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .timeline {
        --visible: 2;
    }
}

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

    .timeline {
        grid-auto-columns: 82%;
    }
}

.slider-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;

    & p { margin-bottom: 0; }
}

.slider-controls {
    display: flex;
    gap: 0.5rem;

    &[hidden] { display: none; }
}

.slider-button {
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--color-forest);
    background: transparent;
    color: var(--color-forest);
    font-size: 1.25rem;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;

    &:hover:not(:disabled) {
        background: var(--color-forest);
        color: var(--color-cream);
    }

    &:disabled {
        opacity: 0.35;
        cursor: default;
    }
}

/* Closing statement and the "coming soon" callout */
.statement {
    max-width: 55rem;

    &.is-callout {
        padding: 0.375rem 0 0.375rem 1.5rem;
        border-left: 3px solid var(--color-bell);
    }
}

/* Contact call to action: text left, enquiry form right */
.contact-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: clamp(2rem, 6vw, 5rem);
}

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


/* Units filter (Jednotky), the list is swapped in place by theme.js */
.units-filter {
    scroll-margin-top: 6rem;
    transition: opacity 0.15s ease;

    &[aria-busy="true"] {
        opacity: 0.5;
    }
}

/* Contact details (Kontakt) */
.details {
    display: grid;
    grid-template-columns: 12rem 1fr;
    margin: 1.5rem 0 2rem;

    & dt, & dd {
        margin: 0;
        padding: 1rem 0;
        border-bottom: 1px solid rgb(108 112 152 / 0.3);
    }

    & dd { font-weight: 600; }
}

@media (max-width: 640px) {
    .details {
        grid-template-columns: minmax(0, 1fr);

        & dt { padding-bottom: 0; border-bottom: 0; }
        & dd { padding-top: 0.25rem; }
    }
}

/* Unit parameters and rooms: label and value on one row, the value right-aligned, on phones too */
.details.unit-params, .details.unit-rooms {
    & dt, & dd {
        padding: 1rem 0;
        border-bottom: 1px solid rgb(108 112 152 / 0.3);
    }

    & dd {
        padding-left: 1rem;
        text-align: right;
    }
}

/* Short labels, values may be longer (code / building, price with a note) and wrap */
.details.unit-params {
    grid-template-columns: auto minmax(0, 1fr);

    & dt { white-space: nowrap; }
}

/* Long room names wrap, the short area stays whole */
.details.unit-rooms {
    grid-template-columns: minmax(0, 1fr) auto;

    & dd { white-space: nowrap; }
}

.follow-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;

    & img {
        width: 100%;
        height: 9.375rem;
        object-fit: cover;
    }
}

/* Unit detail: parameters, price and status in the hero panel (cream on forest, never dimmed) */
.split-panel .unit-params {
    margin: 1.75rem 0 0;
    border-top: 1px solid var(--color-line-light);

    & dt, & dd {
        padding: 0.7rem 0;
        border-bottom-color: var(--color-line-light);
    }
}

/* Title with the status beside it: a free unit is a filled cream badge, the others stay outlined */
.split-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;

    & h1 { margin: 0; }

    & .status-badge {
        padding: 0.55rem 0.9rem;
        border-color: var(--color-cream);
        color: var(--color-cream);
        font-size: 0.875rem;
        font-weight: 700;
    }

    & .status-badge.is-available {
        background: var(--color-cream);
        color: var(--color-forest);
    }

    & .status-badge.is-sold { border-color: var(--color-line-light); }
}

.unit-offer-price {
    margin: 1.5rem 0 2rem;
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 1.2rem + 0.8vw, 1.875rem);
    line-height: 1.2;

    & small {
        font-family: var(--font-sans);
        font-size: var(--text-sm);
    }
}

/* Reserved unit: a short note between the price and the buttons */
.unit-note {
    max-width: 32rem;
    margin: -1rem 0 2rem;
    font-size: var(--text-sm);
    line-height: 1.6;
}

/* A sold unit has no price: the parameters keep their distance from the button */
.split-panel .unit-params + .btn-group {
    margin-top: 2rem;
}

/* Room number in a circle, the same label as on the floor plan */
.unit-rooms dt {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.room-number {
    flex: none;
    display: inline-grid;
    place-items: center;
    min-width: 1.875rem;
    height: 1.875rem;
    padding: 0 0.3rem;
    border: 1px solid var(--color-line-strong);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.unit-intro + .unit-rooms-title {
    margin-top: 2.5rem;
}

.unit-floorplan {
    margin-top: 1.5rem;
    background: #fff;

    & img {
        width: 100%;
        max-height: 32rem;
        object-fit: contain;
    }
}

.downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

/* Download list of a page block, one file per line with its type and size */
.downloads.is-list {
    flex-direction: column;

    & li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.75rem; }
}
.downloads-meta {
    font-size: var(--text-sm);
    opacity: 0.8;
}

/* Text blocks following each other read as one text */
.block-text:has(+ .block-text) {
    padding-bottom: 0;
}
.block-text + .block-text {
    padding-top: clamp(2rem, 4vw, 3rem);
}

/* Questions and answers (page block faq) */
.faq {
    margin-top: 1.5rem;
    border-top: 1px solid var(--color-line-strong);
}
.faq-item {
    border-bottom: 1px solid var(--color-line-strong);

    & summary {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 1.1rem 0;
        font-weight: 600;
        cursor: pointer;
        list-style: none;

        &::-webkit-details-marker { display: none; }
        &::after {
            content: '+';
            color: var(--color-forest);
            font-size: 1.5rem;
            line-height: 1;
        }
        &:hover { color: var(--color-forest); }
    }
    &[open] summary::after { content: '–'; }
    & .prose { padding-bottom: 1.25rem; }
}

/* Unit filter: one row of selects and the "available only" switch */
.units-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.25rem;
    margin-top: 2rem;

    & .form-field { min-width: 10rem; }

    & select { padding-block: 0.625rem; }

    @media (max-width: 640px) {
        & .form-field { flex: 1 1 100%; }
    }
}

.filter-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    color: var(--color-ink);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;

    &:hover { color: var(--color-forest); }

    & .filter-switch-track {
        position: relative;
        flex-shrink: 0;
        width: 2.75rem;
        height: 1.5rem;
        border: 1px solid var(--color-forest);
        border-radius: 1rem;
        background: var(--color-paper);
        transition: background 0.18s ease;

        &::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: calc(1.5rem - 8px);
            height: calc(1.5rem - 8px);
            border-radius: 50%;
            background: var(--color-forest);
            transition: transform 0.18s ease, background 0.18s ease;
        }
    }

    & input:focus-visible + .filter-switch-track {
        outline: 2px solid var(--color-forest);
        outline-offset: 2px;
    }

    & input:checked + .filter-switch-track {
        background: var(--color-forest);

        &::after {
            background: var(--color-cream);
            transform: translateX(1.25rem);
        }
    }
}

/* Units overview */
.unit-table {
    margin-top: 2.75rem;
    border-bottom: 1px solid rgb(108 112 152 / 0.4);
}

.unit-row {
    position: relative;
    display: grid;
    /* Status fits the longest badge (Předrezervovaná), actions only hold Mám zájem */
    grid-template-columns: 8rem 1.6fr 1fr 1fr 13rem 9rem;
    gap: 1.75rem;
    align-items: center;
    padding: 1.375rem 0;
    border-top: 1px solid rgb(108 112 152 / 0.4);
    transition: background-color 0.18s ease;

    /* The unit code links to the detail and covers the whole row */
    & .unit-code {
        font-family: var(--font-serif);
        font-size: 1.75rem;
        color: var(--color-ink);

        &::after {
            content: "";
            position: absolute;
            inset: 0;
        }
    }

    &:hover:not(.is-header) {
        background: rgb(78 107 69 / 0.06);

        & .unit-code { color: var(--color-forest); }
    }

    &.is-header {
        padding: 0 0 0.75rem;
        border-top: 0;
        font-size: 0.8125rem;
        font-weight: 600;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--color-bell);
    }

    & .unit-price {
        font-size: var(--text-lg);
        font-weight: 600;
    }

    /* Above the row-wide detail link */
    & .unit-actions {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 1.25rem;
        font-size: 0.9375rem;
        font-weight: 600;

        & a {
            color: var(--color-forest);
            text-decoration: underline;
            text-underline-offset: 0.25em;

            &:hover { color: var(--color-mauve); }
        }
    }
}

.unit-plan { scroll-margin-top: 6rem; }

.unit-downloads-title {
    margin: 2.5rem 0 0;
    color: var(--color-forest);
    font-size: 1.5rem;
}

/* Unit downloads: one row per file with its type and size, ruled like the rooms beside it */
.file-list {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-line);

    & li { border-bottom: 1px solid var(--color-line); }

    & a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.875rem 0;
        color: var(--color-forest);
        text-decoration: none;
        transition: color 0.18s ease;

        &:hover { color: var(--color-mauve); }
    }
}
.file-list-name { font-weight: 600; }
.file-list-meta {
    margin-left: auto;
    font-size: var(--text-sm);
    color: var(--color-ink);
    opacity: 0.8;
}
.file-list-icon { flex: none; }

/* Mid widths: narrower fixed columns and gaps leave the description room */
@media (max-width: 1200px) {
    .unit-row {
        grid-template-columns: 5.75rem 1.6fr 1fr 1fr 12rem 6.5rem;
        gap: 1.25rem;
    }
}

/* Narrow screens: a compact card – code + status, summary, area + price, links */
@media (max-width: 960px) {
    .unit-table { margin-top: 2rem; }

    .unit-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "code status"
            "summary summary"
            "area price"
            "actions actions";
        gap: 0.25rem 1rem;
        padding: 1.125rem 0 1.25rem;

        & > :nth-child(1) { grid-area: code; }
        & > :nth-child(5) { grid-area: status; justify-self: end; }
        & .unit-summary { grid-area: summary; color: rgb(36 39 35 / 0.8); font-size: 0.9375rem; line-height: 1.5; }
        & .unit-area { grid-area: area; align-self: baseline; margin-top: 0.5rem; font-weight: 600; }
        & .unit-price { grid-area: price; justify-self: end; align-self: baseline; margin-top: 0.5rem; }
        & .unit-actions { grid-area: actions; margin-top: 0.625rem; }
        /* The primary CTA (Mám zájem) sits on the right, under the price */
        & .unit-actions a[data-track] { margin-left: auto; }
        & .unit-actions:not(:has(a)) { display: none; }

        & .unit-code { font-size: 1.625rem; line-height: 1.2; }

        & .status-badge {
            padding: 0.3rem 0.55rem;
            font-size: 0.6875rem;
        }

        &.is-header { display: none; }
    }
}

/* Gallery tabs and grid */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;

    & button {
        padding: 0.625rem 1.125rem;
        border: 1px solid var(--color-forest);
        background: transparent;
        color: var(--color-forest);
        font: 600 0.9375rem/1.2 var(--font-sans);
        cursor: pointer;

        &[aria-selected="true"] {
            background: var(--color-forest);
            color: var(--color-cream);
        }
    }
}


/* Gallery viewer: large photo with arrows, thumbnails below, lightbox on click */
.viewer-stage {
    position: relative;
}

.viewer-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;

    &::-webkit-scrollbar { display: none; }
}

.viewer-slide {
    scroll-snap-align: start;

    & img {
        width: 100%;
        aspect-ratio: 3 / 2;
        max-height: 75vh;
        object-fit: cover;
    }
}

.viewer-arrow {
    position: absolute;
    top: 50%;
    width: 3rem;
    height: 3rem;
    border: 0;
    background: rgb(244 232 208 / 0.9);
    color: var(--color-forest);
    font-size: 1.25rem;
    transform: translateY(-50%);
    cursor: pointer;

    &.is-prev { left: 1rem; }
    &.is-next { right: 1rem; }
}

/* Caption bar under the large photo; per-slide captions are only a no-JS fallback */
.viewer-caption {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    min-height: 1.6em;
    margin-top: 0.75rem;
    font-size: 0.9375rem;
}

.viewer-count {
    flex: none;
    color: var(--color-bell);
    font-variant-numeric: tabular-nums;
}

.viewer-slide figcaption,
.viewer-caption {
    display: none;
}

.viewer.is-ready .viewer-caption {
    display: flex;
}

.viewer:not(.is-ready) .viewer-slide figcaption {
    display: block;
}

.viewer-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;

    &::-webkit-scrollbar { display: none; }
}

.viewer-thumb {
    flex: 0 0 auto;
    width: 7.5rem;
    padding: 0;
    border: 2px solid transparent;
    background: none;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.18s ease, border-color 0.18s ease;

    & img {
        width: 100%;
        aspect-ratio: 3 / 2;
        object-fit: cover;
    }

    &:hover { opacity: 1; }

    &[aria-current="true"] {
        border-color: var(--color-forest);
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .viewer-thumb { width: 5rem; }
    .viewer-arrow { display: none; }
}

/* Lightbox caption (PhotoSwipe) */
[data-lightbox] a {
    display: block;
    cursor: zoom-in;
}

.pswp__caption {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    max-width: min(48rem, calc(100% - 2rem));
    padding: 0.5rem 1rem;
    transform: translateX(-50%);
    background: rgb(36 39 35 / 0.7);
    color: var(--color-cream);
    font: 0.9375rem/1.5 var(--font-sans);
    text-align: center;

    &[hidden] { display: none; }
}

/* 
  Silktide Consent Manager - https://silktide.com/consent-manager/  
*/

/* --------------------------------
  Global Styles
-------------------------------- */
/* Wrapper (Global) */
#stcm-wrapper {
  --boxShadow: -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a;
  --fontFamily: Helvetica Neue, Segoe UI, Arial, sans-serif;
  --primaryColor: #F9D000;
  --backgroundColor: #050505;
  --textColor: #F4F0DF;
  --backdropBackgroundColor: #00000077;
  --backdropBackgroundBlur: 0px;
  --iconColor: #050505;
  --iconBackgroundColor: #F9D000;
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  pointer-events: none;
  border: 0px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --------------------------------
Links
-------------------------------- */
#stcm-wrapper a {
  all: unset;
  display: inline-block;
  color: var(--primaryColor);
  text-decoration: underline;
}

#stcm-wrapper a:hover {
  cursor: pointer;
  color: var(--textColor);
}

/* --------------------------------
Focus Styles
-------------------------------- */
#stcm-wrapper a:focus,
#stcm-wrapper #stcm-banner button:focus,
#stcm-wrapper #stcm-modal button:focus,
#stcm-wrapper #stcm-icon:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--backgroundColor), 0 0 0 4px var(--textColor);
  border-radius: 5px;
}

#stcm-wrapper #stcm-icon:focus {
  border-radius: 50%;
}

/* --------------------------------
General Styles
-------------------------------- */
#stcm-wrapper .stcm-button {
  color: var(--backgroundColor);
  background-color: var(--primaryColor);
  border: 2px solid var(--primaryColor);
  padding: 10px 20px;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  border-radius: 5px;
}

#stcm-wrapper .stcm-button-primary:hover {
  background-color: var(--backgroundColor);
  color: var(--primaryColor);
}

#stcm-wrapper .stcm-button-secondary {
  background-color: var(--backgroundColor);
  color: var(--primaryColor);
}

#stcm-wrapper .stcm-button-secondary:hover {
  background-color: var(--primaryColor);
  color: var(--backgroundColor);
}

/* --------------------------------
Banner
-------------------------------- */
#stcm-banner {
  font-family: var(--fontFamily);
  color: var(--textColor);
  background-color: var(--backgroundColor);
  box-sizing: border-box;
  padding: 32px;
  border-radius: 12px;
  pointer-events: auto;
  border: 0px;
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 600px;
  overflow: auto;
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 32px);
  transform: translate(0, -20px);
  opacity: 0;
  animation: stcm-slide-down 350ms ease-out;
  animation-delay: 0.3s;
  box-shadow: -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a;
}

#stcm-banner.stcm-loaded {
  opacity: 1;
  transform: none;
  animation: none;
}

#stcm-banner:focus {
  border-radius: 50%;
}

#stcm-banner.stcm-pos-center {
  top: 50%;
  left: 50%;
  bottom: auto;
  right: auto;
  position: fixed;
  transform: translate(-50%, calc(-50% - 20px));
  animation: stcm-slide-down-center 350ms ease-out forwards;
}

#stcm-banner.stcm-pos-bottom-left {
  bottom: 16px;
  left: 16px;
  position: fixed;
}

#stcm-banner.stcm-pos-bottom-center {
  bottom: 16px;
  left: 50%;
  position: fixed;
  transform: translate(-50%, -20px);
  animation: stcm-slide-down-bottom-center 350ms ease-out forwards;
}

#stcm-banner .stcm-preferences-button {
  display: flex;
  gap: 5px;
  border: none;
  padding: 15px 0px;
  background-color: transparent;
  color: var(--primaryColor);
  cursor: pointer;
  font-size: 16px;
}

#stcm-banner .stcm-preferences-button span {
  display: block;
  white-space: nowrap;
  text-decoration: none;
}

#stcm-banner .stcm-preferences-button span:hover {
  color: var(--textColor);
}

#stcm-banner p {
  font-size: 16px;
  line-height: 24px;
  color: var(--textColor);
  margin: 0px 0px 15px;
}

#stcm-banner a {
  display: inline-block;
  color: var(--primaryColor);
  text-decoration: underline;
  background-color: var(--backgroundColor);
}

#stcm-banner a:hover {
  color: var(--textColor);
}

#stcm-banner a.stcm-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  fill: var(--primaryColor); /* passed down to svg > path */
  margin-left: auto;
  width: 48px;
  height: 48px;
  text-decoration: none;
}

#stcm-banner .stcm-actions {
  display: flex;
  gap: 16px;
  flex-direction: column;
  margin-top: 24px;
}

@media (min-width: 600px) {
  #stcm-banner .stcm-actions {
    flex-direction: row;
    align-items: center;
  }
}

#stcm-banner .stcm-actions-row {
  display: flex;
  gap: 16px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
}

/* --------------------------------
Modal
-------------------------------- */
#stcm-modal {
  display: none;
  pointer-events: auto;
  overflow: auto;
  width: 800px;
  max-width: 100%;
  max-height: 100%;
  border: 0px;
  transform: translate(0px, -20px);
  opacity: 0;
  animation: stcm-slide-up-center 350ms ease-out forwards;
  box-shadow: -5px 5px 10px 0px #00000012, 0px 0px 50px 0px #0000001a;
  font-family: var(--fontFamily);
  color: var(--textColor);
  flex-direction: column;
  padding: 30px;
  background-color: var(--backgroundColor);
  border-radius: 12px;
  box-sizing: border-box;
}

/* --------------------------------
Modal - Header
-------------------------------- */
#stcm-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

#stcm-modal h1 {
  font-family: var(--fontFamily);
  color: var(--textColor);
  font-size: 24px;
  font-weight: 500;
  margin: 0px;
}

#stcm-modal .stcm-modal-close {
  display: inline-flex;
  border: none;
  padding: 13px;
  cursor: pointer;
  background: var(--backgroundColor);
  color: var(--primaryColor);
}

#stcm-modal .stcm-modal-close svg {
  fill: var(--primaryColor);
}

/* --------------------------------
Modal - Content
-------------------------------- */
#stcm-modal section {
  flex: 1;
  margin-top: 32px;
}

#stcm-modal section::-webkit-scrollbar {
  display: block; /* Force scrollbars to show */
  width: 5px; /* Width of the scrollbar */
}

#stcm-modal section::-webkit-scrollbar-thumb {
  background-color: var(--textColor); /* Color of the scrollbar thumb */
  border-radius: 10px; /* Rounded corners for the thumb */
}

#stcm-modal p {
  font-size: 16px;
  line-height: 24px;
  color: var(--textColor);
  opacity: 0.8;
  margin: 0px 0px 15px;
}

#stcm-modal p:last-of-type {
  margin: 0px;
}

#stcm-modal fieldset {
  padding: 0px;
  border: none;
  margin: 0px 0px 32px;
}

#stcm-modal fieldset:last-of-type {
  margin: 0px;
}

#stcm-modal legend {
  padding: 0px;
  margin: 0px 0px 10px;
  font-weight: 700;
  color: var(--textColor);
  font-size: 16px;
}

#stcm-modal .stcm-consent-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;  
}

/* --------------------------------
Modal - Switches
-------------------------------- */
#stcm-modal .stcm-toggle {
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  height: 34px;
  width: 74px;
  cursor: pointer;
}

#stcm-modal .stcm-toggle:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px var(--backgroundColor), 0 0 0 4px var(--textColor);
  border-radius: 25px;
}

#stcm-modal .stcm-toggle input {
  opacity: 0;
  position: absolute;
}

/* Unchecked Switch Styles */
#stcm-modal .stcm-toggle-track {
  position: relative;
  display: block;
  height: 34px;
  width: 74px;
  background: var(--textColor);
  border-radius: 25px;
}

#stcm-modal .stcm-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  display: block;
  height: 30px;
  width: 30px;
  background: var(--backgroundColor);
  border-radius: 50%;
  transition: left 150ms ease-out;
}

#stcm-modal .stcm-toggle-off,
#stcm-modal .stcm-toggle-on {
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 500;
  color: var(--backgroundColor);
  position: absolute;
  top: 8px;
  right: 8px;
  transition: right 150ms ease-out, opacity 150ms ease-out;
}

#stcm-modal .stcm-toggle-off {
  opacity: 1;
}

#stcm-modal .stcm-toggle-on {
  opacity: 0;
}

/* Checked Switch Styles */
#stcm-modal .stcm-toggle input:checked + .stcm-toggle-track {
  background: var(--primaryColor);
}

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-thumb {
  left: calc(100% - 32px);
}

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-off {
  right: calc(100% - 32px);
  opacity: 0;
}

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-on {
  right: calc(100% - 34px);
  opacity: 1;
}

#stcm-modal .stcm-toggle input:disabled + .stcm-toggle-track {
  opacity: 0.6;
  filter: grayscale(100%);
  cursor: not-allowed;
}

/* --------------------------------
Modal - Footer
-------------------------------- */
#stcm-modal footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

@media (min-width: 600px) {
  #stcm-modal footer {
    flex-direction: row;
    align-items: center;
  }
}

#stcm-modal footer a {
  margin-left: auto;
  padding: 0;
}

#stcm-modal footer a.stcm-credit-link {
  text-decoration: none;
}

#stcm-modal footer a.stcm-credit-link:hover {
  text-decoration: underline;
}

/* Cookie Icon */
#stcm-icon {
  display: none;
  position: fixed;
  bottom: 10px;
  left: 10px;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 0px;
  border: none;
  background-color: var(--iconColor);
  cursor: pointer;
  box-shadow: 0px 0px 6px 0px #0000001a;
  pointer-events: auto;
  animation: stcm-fade-in 0.3s ease-in-out forwards;
}

#stcm-icon.stcm-pos-bottom-right {
  left: auto;
  right: 10px;
}

#stcm-icon svg {
  fill: var(--iconBackgroundColor);
}

/* --------------------------------
Backdrop
-------------------------------- */
#stcm-backdrop {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--backdropBackgroundColor);
  backdrop-filter: blur(var(--backdropBackgroundBlur));
  pointer-events: all;
}

/* --------------------------------
Animations
-------------------------------- */
@keyframes stcm-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes stcm-slide-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stcm-slide-down-center {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 20px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes stcm-slide-down-bottom-center {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes stcm-slide-up-center {
  from {
    opacity: 0;
    transform: translate(0px, 20px);
  }
  to {
    opacity: 1;
    transform: translate(0px, 0px);
  }
}

/* --------------------------------
Animation - backdrop click feedback
-------------------------------- */
@keyframes stcm-nudge {
  0%, 100% { right: 16px; }
  10%, 30%, 50%, 70%, 90% { right: 20px; }
  20%, 40%, 60%, 80% { right: 12px; }
}

/* Apply to banner */
#stcm-banner.stcm-nudge {
  animation: stcm-nudge 1s ease-in-out;
}

/* Apply to modal */
#stcm-modal.stcm-nudge {
  animation: stcm-nudge 0.5s ease-in-out;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  #stcm-banner.stcm-nudge,
  #stcm-modal.stcm-nudge {
    animation: stcm-pulse 0.5s ease-in-out;
  }
  
  @keyframes stcm-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
  }
}

/* Cookie consent manager (Silktide, assets/vendor/silktide) in the theme colours */
#stcm-wrapper {
    --fontFamily: var(--font-sans);
    --primaryColor: var(--color-forest);
    --backgroundColor: var(--color-paper);
    --textColor: var(--color-ink);
    --boxShadow: 0 0.5rem 2rem rgb(36 39 35 / 0.18);
    --backdropBackgroundColor: rgb(36 39 35 / 0.45);
    --iconColor: var(--color-paper);
    --iconBackgroundColor: var(--color-forest);
}

#stcm-wrapper .stcm-button {
    font-weight: 600;
    border-radius: 0;
}

#stcm-wrapper #stcm-banner,
#stcm-wrapper #stcm-modal {
    border-radius: 0;
}

/* Phones: a compact strip at the very bottom so the hero (tagline, CTA) stays visible –
   smaller text, Přijmout/Odmítnout side by side, Nastavení on one short line */
@media (max-width: 599px) {
    #stcm-wrapper #stcm-banner {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: 60vh;
        padding: 1rem 1rem 0.5rem;
    }

    #stcm-wrapper #stcm-banner p {
        margin-bottom: 0;
        font-size: 0.875rem;
        line-height: 1.45;
    }

    #stcm-wrapper #stcm-banner .stcm-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    #stcm-wrapper #stcm-banner .stcm-actions > .stcm-button {
        flex: 1 1 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.9375rem;
    }

    #stcm-wrapper #stcm-banner .stcm-actions-row { flex-basis: 100%; }

    #stcm-wrapper #stcm-banner .stcm-preferences-button {
        padding: 0.375rem 0;
        font-size: 0.875rem;
    }

    #stcm-wrapper #stcm-banner a.stcm-logo {
        width: 2rem;
        height: 2rem;
    }
}

/* Switch labels: Silktide writes English "On/Off" into its markup (aria-hidden spans),
   the Czech words come from here, centred vertically in the track */
#stcm-modal .stcm-toggle-off,
#stcm-modal .stcm-toggle-on {
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    font-size: 0;
}
#stcm-modal .stcm-toggle-off::after,
#stcm-modal .stcm-toggle-on::after {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
#stcm-modal .stcm-toggle-off::after { content: 'Ne'; }
#stcm-modal .stcm-toggle-on::after { content: 'Ano'; }
#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-on { right: 36px; }

/* Silktide locks the page while its settings are open (position: fixed and overflow: hidden on
   <body>), which throws the page to the top and hides the scrollbar. The settings are an overlay,
   so the page stays as it is. The selector has no space in it, the CSS combiner would remove it
   from the attribute value */
body[style*="fixed"] {
    position: static !important;
    width: auto !important;
    overflow-y: auto !important;
}
