/*
 * SV Frisch-Auf Wybelsum 1961 e.V. - site stylesheet
 * Replaces Bootstrap 3 + jQuery. No external dependencies, no webfonts.
 */

/* ---------------------------------------------------------------- tokens */
:root {
    --red: #b3121f;
    --red-dark: #8d0d18;
    --red-light: #fdf2f3;
    --ink: #1c1d20;
    --ink-soft: #4a4d52;
    --ink-faint: #6b6f76;
    --line: #dcdee2;
    --line-soft: #ebedf0;
    --surface: #ffffff;
    --surface-sunken: #f4f5f7;
    --page: #eceef1;

    --shell: 72rem;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 1px 2px rgb(28 29 32 / 6%), 0 6px 20px rgb(28 29 32 / 6%);
    --shadow-pop: 0 8px 28px rgb(28 29 32 / 16%);

    --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
    --step-1: clamp(1.15rem, 1.09rem + 0.3vw, 1.3rem);
    --step-2: clamp(1.35rem, 1.24rem + 0.5vw, 1.6rem);
    --step-3: clamp(1.6rem, 1.4rem + 0.9vw, 2.1rem);

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.6;
    text-underline-offset: 0.15em;
}

img,
picture,
video,
iframe {
    max-width: 100%;
    height: auto;
}

img {
    border-radius: var(--radius);
}

h1,
h2,
h3,
h4 {
    margin: 0 0 var(--space-3);
    line-height: 1.25;
    font-weight: 700;
    text-wrap: balance;
    color: var(--ink);
}

h1 {
    font-size: var(--step-3);
}

h2 {
    font-size: var(--step-2);
}

h3 {
    font-size: var(--step-1);
}

h4 {
    font-size: var(--step-0);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
}

p,
ul,
ol,
dl,
figure,
table,
blockquote {
    margin: 0 0 var(--space-4);
}

a {
    color: var(--red);
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--red-dark);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 2px;
    border-radius: var(--radius);
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: var(--space-6) 0;
}

small {
    font-size: 0.85em;
}

/* --------------------------------------------------------------- helpers */
.content-shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -4rem;
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    background: var(--surface);
    color: var(--red);
    font-weight: 600;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-pop);
    transition: top 0.15s ease-in;
}

.skip-link:focus {
    top: 0;
}

/* ---------------------------------------------------------------- header */
.site-header {
    background: var(--surface);
    border-bottom: 3px solid var(--red);
    box-shadow: var(--shadow);
}

.site-header__inner {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: inherit;
    text-decoration: none;
    margin-right: auto;
}

.brand__mark {
    display: block;
    flex: none;
    width: auto;
    height: 2.75rem;
    border-radius: 0;
}

@media (min-width: 62rem) {
    .brand {
        flex: none;
        padding-right: var(--space-3);
    }

    .brand__mark {
        height: 3rem;
    }

    .brand__name strong {
        font-size: 1.15rem;
    }
}

.brand__name {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand__name strong {
    font-size: var(--step-1);
    letter-spacing: -0.01em;
}

.brand__name small {
    color: var(--ink-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.7rem;
}

/* ------------------------------------------------------------ navigation */
.nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.nav-toggle:hover {
    background: var(--line-soft);
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
    display: block;
    width: 1.15rem;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.nav-toggle__bars {
    position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-toggle__bars::before {
    top: -6px;
}

.nav-toggle__bars::after {
    top: 6px;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--ink);
    text-decoration: none;
}

.nav-item__row {
    display: flex;
    align-items: center;
}

.submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
}

/*
 * The caret is a rotated square. Rotating shifts its visual centre, so it is
 * nudged back up by half its own diagonal to sit optically centred on the row.
 */
.submenu-toggle span {
    display: block;
    width: 0.45rem;
    height: 0.45rem;
    margin-top: -0.22rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease, margin-top 0.15s ease;
}

.submenu-toggle[aria-expanded="true"] span {
    margin-top: 0.16rem;
    transform: rotate(-135deg);
}

/* -- mobile navigation (default) -- */
@media (max-width: 61.99rem) {
    .main-navigation {
        display: none;
        flex-basis: 100%;
        border-top: 1px solid var(--line-soft);
        margin-top: var(--space-2);
        padding-top: var(--space-2);
    }

    .main-navigation.is-open {
        display: block;
    }

    .nav-item {
        border-bottom: 1px solid var(--line-soft);
    }

    .nav-item:last-child {
        border-bottom: 0;
    }

    .nav-item > a,
    .nav-item__row > a {
        display: block;
        flex: 1;
        padding: var(--space-3) var(--space-1);
        font-weight: 600;
    }

    .nav-item--level2 > a,
    .nav-item--level2 .nav-item__row > a {
        padding-left: var(--space-4);
        font-weight: 500;
    }

    .nav-item--level3 > a {
        padding-left: var(--space-6);
        font-weight: 400;
        color: var(--ink-soft);
    }

    .submenu {
        display: none;
        background: var(--surface-sunken);
        border-radius: var(--radius);
        margin-bottom: var(--space-2);
    }

    .submenu.is-open {
        display: block;
    }

    .nav-item.is-active > a,
    .nav-item.is-active > .nav-item__row > a {
        color: var(--red);
    }
}

/* -- desktop navigation -- */
@media (min-width: 62rem) {
    .nav-toggle {
        display: none;
    }

    /* The brand leads the menu row instead of sitting on a line of its own.
       Seven top-level entries next to the brand are tight at the shell width,
       so the menu runs a touch smaller here; it still wraps if a browser
       renders wider than expected. */
    .main-navigation {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.95rem;
    }

    .main-navigation__list {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        gap: var(--space-1) 0;
    }

    .nav-item--level1 {
        position: relative;
    }

    /*
     * The highlight lives on the row, not on the link, so hovering a parent
     * entry also covers its caret button instead of leaving it outside.
     */
    .nav-item--level1 > a,
    .nav-item--level1 > .nav-item__row {
        display: flex;
        align-items: center;
        border-radius: var(--radius) var(--radius) 0 0;
        border-bottom: 3px solid transparent;
    }

    .nav-item--level1 > a {
        padding: var(--space-3) var(--space-2);
        font-weight: 600;
    }

    .nav-item--level1 > .nav-item__row > a {
        padding: var(--space-3) var(--space-1) var(--space-3) var(--space-2);
        font-weight: 600;
        border: 0;
    }

    .nav-item--level1 > a:hover,
    .nav-item--level1 > .nav-item__row:hover,
    .nav-item--level1 > .nav-item__row:focus-within {
        background: var(--red-light);
        border-bottom-color: var(--red);
    }

    .nav-item--level1 > a:hover,
    .nav-item--level1 > .nav-item__row:hover > a,
    .nav-item--level1 > .nav-item__row:hover .submenu-toggle,
    .nav-item--level1 > .nav-item__row:focus-within > a {
        color: var(--red-dark);
    }

    .nav-item--level1.is-active > a,
    .nav-item--level1.is-active > .nav-item__row {
        border-bottom-color: var(--red);
    }

    .nav-item--level1.is-active > a,
    .nav-item--level1.is-active > .nav-item__row > a {
        color: var(--red);
    }

    /* The caret sits inside the highlighted row; the link stays clickable. */
    .nav-item--level1 > .nav-item__row .submenu-toggle {
        width: 1.4rem;
        height: 100%;
        padding-right: var(--space-1);
    }

    .submenu {
        position: absolute;
        z-index: 40;
        top: 100%;
        left: 0;
        min-width: 15rem;
        padding: var(--space-2);
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 0 var(--radius) var(--radius) var(--radius);
        box-shadow: var(--shadow-pop);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-0.35rem);
        transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
    }

    .nav-item:hover > .submenu,
    .nav-item:focus-within > .submenu,
    .submenu-toggle[aria-expanded="true"] + .submenu,
    .nav-item__row:has(.submenu-toggle[aria-expanded="true"]) + .submenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-item--level2 {
        position: relative;
    }

    /* Third level flies out to the side, like the legacy dropdown-submenu. */
    .submenu--level2 {
        top: calc(var(--space-2) * -1);
        left: 100%;
        border-radius: var(--radius);
    }

    .submenu a,
    .submenu .nav-item__row > a {
        display: block;
        flex: 1;
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius);
    }

    .submenu a:hover {
        background: var(--red-light);
        color: var(--red-dark);
    }

    .submenu .is-active > a,
    .submenu .is-active > .nav-item__row > a {
        color: var(--red);
        font-weight: 600;
    }

    .submenu .submenu-toggle {
        width: 2rem;
        height: 2rem;
    }

    .submenu--level1 .nav-item--level2.has-submenu > .nav-item__row .submenu-toggle span {
        transform: rotate(-45deg) translate(-1px, -1px);
    }
}

/* -------------------------------------------------------------- home hero */
.home-hero {
    position: relative;
    display: grid;
    isolation: isolate;
    min-height: clamp(8.5rem, 16vw, 13.5rem);
    background: var(--ink);
    overflow: hidden;
}

/*
 * Taken out of the flow on purpose: as a grid item with height:100% the photo
 * contributed its own 640px to the row size, so the min-height clamp above
 * never capped the band. Now only the caption block and the clamp decide how
 * tall the hero gets, and the photo just fills whatever that is.
 */
.home-hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 55%;
    border-radius: 0;
    display: block;
}

.home-hero__shade {
    grid-area: 1 / 1;
    background:
        linear-gradient(to top, rgb(15 16 18 / 78%) 0%, rgb(15 16 18 / 32%) 55%, rgb(15 16 18 / 12%) 100%);
}

.home-hero__content {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: end;
    gap: var(--space-3);
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    /* Extra room on top so the tilted crest is not clipped by overflow:hidden. */
    padding: var(--space-5) var(--space-4) var(--space-4);
}

/* Crest sits above the title, tilted slightly so it reads as a badge. */
.home-hero__crest {
    width: auto;
    height: clamp(4rem, 2.5rem + 6vw, 7rem);
    border-radius: 0;
    transform: rotate(-11deg);
    transform-origin: bottom left;
    filter: drop-shadow(0 3px 12px rgb(0 0 0 / 45%));
}

.home-hero__title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.6rem, 1.1rem + 3.1vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgb(0 0 0 / 45%);
    text-wrap: balance;
}

.home-hero__title span {
    display: block;
    margin-top: var(--space-2);
    font-size: 0.42em;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.92;
}

/* ------------------------------------------------------------ page intro */
.page-intro {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.page-intro:not(:has(*)) {
    display: none;
}

.page-intro .content-shell {
    padding-block: var(--space-5);
    text-align: center;
}

.page-intro :where(h1, h2, h3, p) {
    margin: 0;
}

.page-intro__title {
    font-size: var(--step-3);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.page-intro__sub {
    margin-top: var(--space-1);
    font-size: var(--step-1);
    font-weight: 500;
    color: var(--ink-faint);
}

.page-title {
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-5);
    border-bottom: 2px solid var(--red);
}

/* ------------------------------------------------------------------ main */
.site-main {
    padding-bottom: var(--space-7);
}

.site-main > .content-shell {
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: var(--space-6) var(--space-4);
    max-width: var(--shell);
}

@media (min-width: 48rem) {
    .site-main > .content-shell {
        padding: var(--space-7) var(--space-6);
    }
}

.site-main > .content-shell > *:last-child {
    margin-bottom: 0;
}

/* Three column layout, replaces the Bootstrap col-* grid. */
.column-grid {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
    .column-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 60rem) {
    .column-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.column-grid__col > *:last-child {
    margin-bottom: 0;
}

/* ------------------------------------------------- page overview (stubs) */
.page-overview__grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-overview__grid a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface-sunken);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.12s ease, border-color 0.12s ease;
}

.page-overview__grid a:hover {
    background: var(--red-light);
    border-color: var(--red);
    color: var(--red-dark);
}

/* ------------------------------------------------- content element tweaks */
.ce-gallery figure {
    margin: 0;
}

.ce-gallery img {
    display: block;
    box-shadow: var(--shadow);
}

.ce-row + .ce-row {
    margin-top: var(--space-4);
}

.ce-column + .ce-column {
    margin-top: var(--space-4);
}

@media (min-width: 40rem) {
    .ce-gallery[data-ce-columns="2"] .ce-row,
    .ce-gallery[data-ce-columns="3"] .ce-row,
    .ce-gallery[data-ce-columns="4"] .ce-row {
        display: grid;
        gap: var(--space-4);
    }

    .ce-gallery[data-ce-columns="2"] .ce-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ce-gallery[data-ce-columns="3"] .ce-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ce-gallery[data-ce-columns="4"] .ce-row {
        grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    }

    .ce-column + .ce-column {
        margin-top: 0;
    }

    .ce-intext.ce-right .ce-gallery {
        float: right;
        margin: 0 0 var(--space-4) var(--space-5);
        max-width: 45%;
    }

    .ce-intext.ce-left .ce-gallery {
        float: left;
        margin: 0 var(--space-5) var(--space-4) 0;
        max-width: 45%;
    }
}

.ce-above .ce-gallery {
    margin-bottom: var(--space-4);
}

.ce-below .ce-gallery {
    margin-top: var(--space-4);
}

.ce-center .ce-gallery {
    margin-inline: auto;
}

.ce-textpic,
.ce-image,
.ce-text {
    overflow: hidden;
}

.ce-bodytext > *:last-child {
    margin-bottom: 0;
}

/* Content elements are separated by rhythm, not by boxes. */
.site-main [id^="c"]:not(:last-child) {
    margin-bottom: var(--space-6);
}

.align-center {
    text-align: center;
}

.note {
    padding: var(--space-4);
    background: var(--red-light);
    border-left: 4px solid var(--red);
    border-radius: var(--radius);
}

/* -------------------------------------------------------------- elements */
.button,
.link-button,
button.button,
.site-main a.button,
.ce-bodytext a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: var(--red);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.button:hover,
.site-main a.button:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    color: #fff;
}

.button--ghost {
    color: var(--red);
    background: transparent;
}

.button--ghost:hover {
    background: var(--red-light);
    color: var(--red-dark);
}

.link-button {
    padding: 0;
    color: var(--red);
    background: none;
    border: 0;
    font-weight: 500;
    text-decoration: underline;
}

.link-button:hover {
    color: var(--red-dark);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.table-wrap {
    overflow-x: auto;
    margin-bottom: var(--space-4);
    -webkit-overflow-scrolling: touch;
}

th,
td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: top;
}

thead th {
    background: var(--surface-sunken);
    border-bottom: 2px solid var(--line);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
}

caption {
    text-align: left;
    padding-bottom: var(--space-2);
    color: var(--ink-faint);
    font-size: 0.9rem;
}

.table-compact :where(th, td) {
    padding: var(--space-1) var(--space-2);
    font-size: 0.92rem;
}

/* ----------------------------------------------------------------- forms */
input,
select,
textarea,
button {
    font: inherit;
}

.site-main :where(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="url"], input[type="password"], select, textarea) {
    display: block;
    width: 100%;
    padding: var(--space-3);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.site-main :where(input, select, textarea):focus {
    border-color: var(--red);
}

.site-main textarea {
    min-height: 9rem;
    resize: vertical;
}

.site-main label {
    display: block;
    margin-bottom: var(--space-1);
    font-weight: 600;
}

.site-main :where(input, select, textarea)[aria-invalid="true"],
.site-main .has-error :where(input, select, textarea) {
    border-color: var(--red);
    background: var(--red-light);
}

/* TYPO3 form framework markup, Bootstrap class names replaced in Form YAML */
.site-main .form-field {
    margin-bottom: var(--space-4);
}

.site-main .form-field--choice label {
    display: flex;
    align-items: start;
    gap: var(--space-3);
    font-weight: 400;
}

.site-main .form-field--choice input {
    margin-top: 0.3rem;
}

.site-main .form-field__hint {
    margin-top: var(--space-1);
    margin-bottom: 0;
    font-size: 0.88rem;
    color: var(--ink-faint);
}

.site-main .form-field__error,
.site-main .error {
    display: block;
    margin-top: var(--space-1);
    color: var(--red-dark);
    font-size: 0.9rem;
    font-weight: 600;
}

.site-main .required::after {
    content: " *";
    color: var(--red);
}

.site-main .form-fieldset {
    margin-bottom: var(--space-5);
}

.site-main .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.site-main .form-actions ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-main .form-actions button,
.site-main button[type="submit"],
.site-main input[type="submit"] {
    display: inline-flex;
    align-items: center;
    padding: var(--space-3) var(--space-5);
    font-weight: 600;
    color: #fff;
    background: var(--red);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    cursor: pointer;
}

.site-main .form-actions button:hover,
.site-main button[type="submit"]:hover,
.site-main input[type="submit"]:hover {
    background: var(--red-dark);
}

.site-main :where(input[type="checkbox"], input[type="radio"]) {
    width: auto;
    accent-color: var(--red);
}

.site-main fieldset {
    margin: 0 0 var(--space-5);
    padding: 0;
    border: 0;
}

.site-main legend {
    padding: 0;
    font-size: var(--step-1);
    font-weight: 700;
}

/* ------------------------------------------------------------------ news */
.news-list-view .article {
    padding-bottom: var(--space-5);
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--line-soft);
}

.news-list-view .article:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.news-list-view .article .header h2 {
    font-size: var(--step-1);
    margin-bottom: var(--space-1);
}

.news-list-view .article .header a {
    color: var(--ink);
    text-decoration: none;
}

.news-list-view .article .header a:hover {
    color: var(--red);
    text-decoration: underline;
}

.news-list-date,
.news-list-category,
.news-list-tags,
.news-list-author {
    font-size: 0.85rem;
    color: var(--ink-faint);
}

.news-list-category {
    display: inline-block;
    padding: 0 var(--space-2);
    margin-left: var(--space-2);
    background: var(--red-light);
    color: var(--red-dark);
    border-radius: var(--radius);
}

.article .footer p {
    margin: 0;
}

.article .teaser-text {
    margin-bottom: var(--space-2);
}

.article .teaser-text > div > *:last-child {
    margin-bottom: var(--space-2);
}

/* "weiterlesen" is the primary action of a teaser, so it reads as a button. */
a.more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    color: #fff;
    background: var(--red);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease;
}

a.more:hover,
a.more:focus-visible {
    background: var(--red-dark);
    border-color: var(--red-dark);
    color: #fff;
}

a.more::after {
    content: "→";
}

.news-img-wrap {
    margin-bottom: var(--space-3);
}

.news-img-wrap a {
    display: block;
}

.news-img-wrap img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: var(--shadow);
}

@media (min-width: 34rem) {
    .news-list-view .article {
        display: grid;
        grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
        grid-template-areas:
            "media header"
            "media teaser"
            "media footer";
        gap: 0 var(--space-5);
        align-items: start;
    }

    .news-list-view .article:not(:has(.news-img-wrap)) {
        display: block;
    }

    .news-list-view .article .news-img-wrap {
        grid-area: media;
        margin-bottom: 0;
    }

    .news-list-view .article .header {
        grid-area: header;
    }

    .news-list-view .article .teaser-text {
        grid-area: teaser;
    }

    .news-list-view .article .footer {
        grid-area: footer;
    }
}

.news-single .news-img-wrap img,
.news-text-wrap img {
    border-radius: 0;
}

.news-single .news-list-date {
    display: block;
    margin-bottom: var(--space-4);
}

.news-text-wrap {
    margin-bottom: var(--space-5);
}

.news-related-wrap {
    margin-top: var(--space-6);
}

.news-related {
    padding: var(--space-4);
    background: var(--surface-sunken);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

.news-related h4 {
    margin-bottom: var(--space-2);
}

.news-related-files-size {
    color: var(--ink-faint);
    font-size: 0.85rem;
}

.no-news-found {
    padding: var(--space-4);
    background: var(--surface-sunken);
    border-radius: var(--radius);
    color: var(--ink-soft);
}

.news-backlink-wrap {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line-soft);
}

.pagination,
.pager,
.f3-widget-paginator {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    list-style: none;
    margin: var(--space-5) 0 0;
    padding: 0;
}

.pagination > li,
.pager > li,
.f3-widget-paginator > li {
    display: inline-flex;
    align-items: stretch;
    justify-content: center;
    min-width: 2.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    font-variant-numeric: tabular-nums;
}

.pagination > li > :where(a, span),
.pager > li > :where(a, span),
.f3-widget-paginator > li > :where(a, span) {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
}

.pagination > li > a:hover,
.pager > li > a:hover,
.f3-widget-paginator > li > a:hover {
    background: var(--red-light);
    color: var(--red-dark);
}

.f3-widget-paginator > li.ellipsis {
    border-color: transparent;
    color: var(--ink-faint);
}

.pagination > li.current,
.pager > li.current,
.f3-widget-paginator > li.current {
    background: var(--red);
    border-color: var(--red);
}

.pagination > li.current > span,
.pager > li.current > span,
.f3-widget-paginator > li.current > span {
    color: #fff;
    font-weight: 700;
}

.pager > li.disabled,
.pagination > li.disabled {
    background: var(--surface-sunken);
}

.pager > li.disabled > span,
.pagination > li.disabled > span {
    color: var(--ink-faint);
}

.pagination-nav {
    margin-top: var(--space-6);
}

.address-card__line {
    display: block;
}

/* -------------------------------------------------------------- adresses */
.address-list {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.address-card {
    padding: var(--space-4);
    background: var(--surface-sunken);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
}

.address-card h3 {
    margin-bottom: var(--space-1);
    font-size: var(--step-0);
}

.address-card__role {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--red);
    font-weight: 600;
}

.address-card address {
    font-style: normal;
    color: var(--ink-soft);
}

.address-card img {
    margin-bottom: var(--space-3);
}

/* ---------------------------------------------------- external embeds */
.external-embed {
    margin-bottom: var(--space-4);
}

.external-embed iframe {
    display: block;
    width: 100%;
    min-height: 24rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.external-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 14rem;
    padding: var(--space-5);
    text-align: center;
    background: var(--surface-sunken);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.external-placeholder p {
    max-width: 34rem;
    margin: var(--space-2) auto var(--space-4);
    color: var(--ink-soft);
}

.external-placeholder__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
    align-items: center;
}

.external-placeholder__actions button {
    padding: var(--space-3) var(--space-5);
    font-weight: 600;
    color: #fff;
    background: var(--red);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    cursor: pointer;
}

.external-placeholder__actions button:hover {
    background: var(--red-dark);
}

.location-card {
    display: grid;
    gap: var(--space-4);
    align-items: start;
    padding: var(--space-4);
    background: var(--surface-sunken);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

@media (min-width: 40rem) {
    .location-card {
        grid-template-columns: auto 1fr;
    }

    .location-card .external-embed {
        grid-column: 1 / -1;
    }
}

.location-card__marker {
    color: var(--red);
}

.location-card address {
    font-style: normal;
    line-height: 1.5;
}

/* race result widgets render their own tables; keep them scrollable. */
.RRPublish,
.RRRegStart,
#divRRPublish,
#divRRRegStart {
    overflow-x: auto;
}

/* ---------------------------------------------------------------- footer */
.site-footer {
    background: var(--surface);
    border-top: 3px solid var(--red);
}

.site-footer__sponsors .content-shell {
    padding-block: var(--space-6);
}

.site-footer__sponsors h2,
.site-footer__sponsors h3,
.site-footer__sponsors h4,
.site-footer__sponsors h5 {
    text-align: center;
    font-size: var(--step-1);
    margin-bottom: var(--space-5);
}

/* Sponsor logo strips: even, calm rows regardless of source image size. */
.site-footer__sponsors .ce-gallery .ce-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-6);
    align-items: center;
    justify-content: center;
}

.site-footer__sponsors .ce-column {
    margin: 0;
}

.site-footer__sponsors img {
    width: auto;
    max-height: 3.5rem;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    transition: opacity 0.15s ease;
}

.site-footer__sponsors a:hover img,
.site-footer__sponsors a:focus-visible img {
    opacity: 0.75;
}

.site-footer__meta {
    background: var(--ink);
    color: #e9eaec;
}

.site-footer__meta-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    padding-block: var(--space-4);
    font-size: 0.9rem;
}

.site-footer__club {
    margin: 0;
    margin-right: auto;
}

.meta-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__meta a,
.site-footer__meta .link-button {
    color: #e9eaec;
    text-decoration: none;
}

.site-footer__meta a:hover,
.site-footer__meta .link-button:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer__meta .link-button {
    text-decoration: underline;
}

.site-footer__meta :focus-visible {
    outline-color: #fff;
}

/* --------------------------------------------------------------- consent */
.consent-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 60;
    background: var(--surface);
    border-top: 3px solid var(--red);
    box-shadow: 0 -8px 28px rgb(28 29 32 / 18%);
}

.consent-banner[hidden] {
    display: none;
}

.consent-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    padding-block: var(--space-4);
}

.consent-banner p {
    flex: 1 1 22rem;
    margin: 0;
    font-size: 0.92rem;
    color: var(--ink-soft);
}

.consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
}

.consent-dialog {
    max-width: 34rem;
    width: calc(100% - 2rem);
    padding: var(--space-5);
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    color: var(--ink);
}

.consent-dialog::backdrop {
    background: rgb(28 29 32 / 55%);
}

.consent-option {
    padding: var(--space-3);
    background: var(--surface-sunken);
    border-radius: var(--radius);
}

.consent-option label {
    display: flex;
    gap: var(--space-3);
    align-items: start;
    font-weight: 400;
    cursor: pointer;
}

.consent-option input {
    margin-top: 0.3rem;
    accent-color: var(--red);
}

.consent-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .site-header,
    .site-footer__meta,
    .consent-banner,
    .nav-toggle,
    .main-navigation {
        display: none;
    }

    body {
        background: #fff;
    }

    .site-main > .content-shell {
        box-shadow: none;
        padding: 0;
    }
}
