/* =========================================================================
   Öffentliche Vereinswebseite
   Designvorlage: schuetzenverein-koenigshofen.de
   Serif-Typografie, hellgrauer Seitenhintergrund, weiße Inhaltsflächen,
   zentrierte Navigation und rote Kreis-Icons.
   ========================================================================= */

:root {
    --accent: #e03838;
    --accent-dark: #b82c2c;
    --page-bg: #e5e5e5;
    --panel-bg: #ffffff;
    --text: #333333;
    --text-muted: #666666;
    --heading: #444444;
    --heading-card: #3b3b3b;
    --link-active: #7c0000;
    --nav-active-bg: #dbdbdb;
    --border: #e0e0e0;
    --border-input: #cccccc;
    --btn-bg: #333333;
    --btn-text: #f8be2e;
    --container: 1080px;
    --font-serif: Georgia, "Times New Roman", Times, serif;
}

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

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font-family: var(--font-serif);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

a:hover,
a:focus-visible {
    color: var(--accent);
}

p {
    margin: 0 0 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: #fff;
    padding: 10px 16px;
}

.skip-link:focus {
    left: 12px;
    top: 12px;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------------- */

.nav-bar {
    background: var(--page-bg);
    border-bottom: 1px solid #d5d5d5;
}

.nav-bar__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 46px;
}

.nav-bar__brand {
    display: none;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    color: #000;
    margin-right: auto;
}

.primary-nav__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-nav__item {
    position: relative;
}

.primary-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    color: #000;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.primary-nav__link:hover,
.primary-nav__item:focus-within > .primary-nav__link {
    background: var(--nav-active-bg);
    color: var(--link-active);
}

.primary-nav__item.is-active > .primary-nav__link {
    background: var(--nav-active-bg);
    color: var(--link-active);
}

.primary-nav__icon {
    display: inline-flex;
    color: var(--accent);
}

.primary-nav__icon .icon {
    stroke-width: 1.8;
}

.submenu-toggle {
    display: none;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    min-width: 210px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.primary-nav__item.has-children:hover > .submenu,
.primary-nav__item.has-children:focus-within > .submenu,
.primary-nav__item.has-children.is-open > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu__item a {
    display: block;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #000;
    text-decoration: none;
}

.submenu__item a:hover,
.submenu__item.is-active a {
    background: var(--nav-active-bg);
    color: var(--link-active);
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 9px 14px;
    background: transparent;
    border: 1px solid #bdbdbd;
    border-radius: 3px;
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
}

.nav-toggle__bars {
    position: relative;
    width: 18px;
    height: 2px;
    background: #000;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: #000;
}

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

/* -------------------------------------------------------------------------
   Header mit Kopfbild-Slider
   ------------------------------------------------------------------------- */

.site-header {
    background: var(--panel-bg);
    padding: 0;
}

.site-header__stage {
    position: relative;
    overflow: hidden;
    aspect-ratio: 110 / 25;
    /* Mindesthöhe, damit der Titel im Overlay nie abgeschnitten wird */
    min-height: 165px;
    background: #2b2b2b;
}

.site-header--compact .site-header__stage {
    aspect-ratio: 110 / 16;
    min-height: 128px;
}

.site-header__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease;
}

.site-header__slide.is-active {
    opacity: 1;
}

.site-header__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-header__slide--fallback {
    background:
        radial-gradient(circle at 78% 45%, rgba(224, 56, 56, 0.35), transparent 55%),
        linear-gradient(135deg, #3f4a3c 0%, #2b3329 55%, #1d231c 100%);
}

.site-header__overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    padding: 22px 30px;
    max-width: 74%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}

.site-header__title {
    margin: 0;
    color: #fff;
    font-size: clamp(19px, 2.9vw, 36px);
    font-weight: 400;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.site-header__tagline {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(12px, 1.3vw, 16px);
    font-style: italic;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

/* Auf Unterseiten ist der Kopfbereich flacher, daher kleinere Schrift */
.site-header--compact .site-header__overlay {
    padding: 14px 26px;
}

.site-header--compact .site-header__title {
    font-size: clamp(16px, 2vw, 25px);
}

.site-header--compact .site-header__tagline {
    font-size: clamp(11px, 1vw, 13px);
}

.site-header__logo {
    position: absolute;
    top: 50%;
    right: 4%;
    transform: translateY(-50%);
    width: clamp(64px, 11vw, 132px);
    height: auto;
    border-radius: 50%;
}

.site-header__logo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.site-header__logo--placeholder .icon {
    width: 60%;
    height: 60%;
}

.site-header__dots {
    position: absolute;
    right: 16px;
    bottom: 14px;
    display: flex;
    gap: 8px;
}

.site-header__dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.site-header__dot.is-active {
    background: #fff;
}

/* -------------------------------------------------------------------------
   Inhaltsflächen
   ------------------------------------------------------------------------- */

.site-main {
    display: block;
    padding: 0 0 40px;
}

.content-panel {
    background: var(--panel-bg);
    padding: 40px 40px 48px;
}

.page-title {
    margin: 0 0 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    color: var(--heading);
    font-size: 26px;
    font-weight: 500;
    line-height: 1.38;
    letter-spacing: 1px;
    text-align: center;
    text-transform: uppercase;
}

.page-meta {
    margin: 36px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    font-style: italic;
    color: #999;
}

.preview-banner {
    margin: 0 0 24px;
    padding: 10px 16px;
    background: #fff8e1;
    border: 1px solid #f0d68a;
    border-radius: 3px;
    color: #7a5c00;
    font-size: 13px;
    text-align: center;
}

.empty-hint,
.empty-state {
    color: var(--text-muted);
    text-align: center;
}

.empty-state {
    padding: 30px 0;
}

.empty-state .circle-icon {
    margin: 0 auto 18px;
}

.empty-state__title {
    margin: 0 0 12px;
    color: var(--heading);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Rote Kreis-Icons wie auf der Vorlage */
.circle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    flex-shrink: 0;
}

.circle-icon--lg {
    width: 82px;
    height: 82px;
}

a .circle-icon {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

a:hover .circle-icon {
    background: var(--accent-dark);
    transform: scale(1.04);
}

/* -------------------------------------------------------------------------
   Teaser-Karten (Startseite / Template „Teaser-Karten“)
   ------------------------------------------------------------------------- */

.teaser-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.teaser {
    text-align: center;
}

.teaser__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.teaser__icon a {
    text-decoration: none;
    border-radius: 50%;
    display: inline-flex;
}

.teaser__title {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--heading-card);
}

.teaser__title a {
    color: inherit;
    text-decoration: none;
}

.teaser__title a:hover {
    color: var(--accent);
}

.teaser__text {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--text-muted);
}

.teaser__more {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

/* -------------------------------------------------------------------------
   Template: Standardseite (Kreis-Icon links, Text rechts)
   ------------------------------------------------------------------------- */

.entry--iconized {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 24px;
    align-items: start;
}

.entry__icon {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.entry__intro {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.entry__lead {
    max-width: 760px;
    margin: 0 auto 32px;
    text-align: center;
}

.entry__figure {
    margin: 24px 0 0;
}

.entry__figure figcaption,
.gallery figcaption {
    margin-top: 8px;
    font-size: 12px;
    font-style: italic;
    color: #8a8a8a;
}

/* Überschriften und Listen aus dem Rich-Text der Redaktion */

.content-panel h2,
.content-panel h3,
.content-panel h4 {
    margin: 28px 0 10px;
    color: var(--heading-card);
    font-weight: 700;
    line-height: 1.35;
}

.content-panel h2 {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-size: 19px;
}

.content-panel h3 {
    font-size: 16px;
}

.content-panel h4 {
    margin-top: 22px;
    font-size: 14px;
}

.content-panel :is(h2, h3, h4):first-child {
    margin-top: 0;
}

.rte-list {
    margin: 0 0 14px;
    padding-left: 22px;
    color: var(--text-muted);
}

.rte-list li {
    margin-bottom: 6px;
}

/* Template: Text mit Bild */

.media-text {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.media-text--right {
    grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
}

.media-text__figure {
    margin: 0;
}

/* Template: Zwei Spalten */

.columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
}

.columns__title,
.contact__heading,
.link-groups__title {
    margin: 0 0 14px;
    color: var(--heading-card);
    font-size: 17px;
    font-weight: 700;
}

/* Template: Tabelle */

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #f2f2f2;
    color: var(--heading-card);
    font-weight: 700;
}

.data-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.table-note {
    margin-top: 16px;
    font-size: 12px;
    font-style: italic;
}

/* Template: Galerie */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.gallery__item {
    margin: 0;
}

.gallery__item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* Template: Kontakt */

.contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 44px;
    align-items: start;
}

.contact__address {
    font-style: normal;
    color: var(--text-muted);
}

.contact__channels {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 14px;
    margin: 0 0 20px;
    color: var(--text-muted);
}

.contact__channels dt {
    font-weight: 700;
    color: var(--heading-card);
}

.contact__channels dd {
    margin: 0;
}

.contact__list {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.contact__person {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.contact__person:last-child {
    border-bottom: none;
}

.contact__role {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #999;
}

.contact__name {
    display: block;
    font-weight: 700;
    color: var(--heading-card);
}

.contact__link,
.contact__phone {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

/* Template: Downloads */

.download-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.download-list__item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.download-list__item:last-child {
    border-bottom: none;
}

.download-list__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
}

.download-list__title {
    display: block;
    font-weight: 700;
    color: var(--heading-card);
}

.download-list__desc {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

/* Template: Linkliste */

.link-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
}

.link-groups__list {
    margin: 0;
    padding: 0 0 0 18px;
}

.link-groups__list li {
    margin-bottom: 8px;
    color: var(--text-muted);
}

/* -------------------------------------------------------------------------
   Formulare und Buttons
   ------------------------------------------------------------------------- */

.site-form__row {
    margin-bottom: 16px;
}

.site-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--heading-card);
}

.site-form input,
.site-form textarea {
    width: 100%;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border-input);
    border-radius: 3px;
    font-family: var(--font-serif);
    font-size: 13px;
    color: var(--text);
}

.site-form input:focus,
.site-form textarea:focus {
    border-color: var(--accent);
    outline: none;
}

.site-form textarea {
    resize: vertical;
}

.site-form__hint {
    font-size: 12px;
    font-style: italic;
    color: #999;
}

.site-form__feedback {
    margin: 14px 0 0;
    font-size: 13px;
}

.site-form__feedback.is-success { color: #1e7a34; }
.site-form__feedback.is-error { color: var(--accent-dark); }

.btn {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid var(--btn-bg);
    border-radius: 5px;
    background: var(--btn-bg);
    color: var(--btn-text);
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    background: #1f1f1f;
    color: var(--btn-text);
}

.btn--accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn--accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}

.btn--ghost {
    background: transparent;
    border-color: #b5b5b5;
    color: var(--text);
}

.btn--ghost:hover {
    background: #f0f0f0;
    color: var(--text);
}

.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* -------------------------------------------------------------------------
   Mitglieder-Hinweis auf der Startseite
   ------------------------------------------------------------------------- */

.member-cta {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    margin-top: 24px;
    padding: 28px 40px;
    background: var(--panel-bg);
    border-top: 3px solid var(--accent);
}

.member-cta__title {
    margin: 0 0 6px;
    color: var(--heading-card);
    font-size: 17px;
    font-weight: 700;
}

.member-cta__text {
    margin: 0;
}

.member-cta__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

.site-footer {
    background: var(--page-bg);
    border-top: 1px solid #d5d5d5;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 30px;
    padding-bottom: 30px;
}

.site-footer__text {
    margin: 0;
    font-size: 13px;
    color: var(--text);
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.site-footer__links a {
    text-decoration: none;
}

.site-footer__links a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .teaser-grid {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .columns,
    .contact,
    .media-text,
    .media-text--right {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .entry--iconized {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: left;
    }

    .entry__icon {
        justify-content: flex-start;
        width: 100%;
    }

    .member-cta {
        grid-template-columns: 1fr;
        text-align: left;
    }
}

@media (max-width: 780px) {
    .nav-bar__inner {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .nav-bar__brand {
        display: block;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .primary-nav {
        display: none;
        width: 100%;
        padding-bottom: 10px;
    }

    .primary-nav.is-open {
        display: block;
    }

    .primary-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .primary-nav__item {
        border-top: 1px solid #d5d5d5;
    }

    .primary-nav__link {
        padding: 13px 4px;
    }

    .submenu-toggle {
        position: absolute;
        top: 4px;
        right: 0;
        display: block;
        width: 42px;
        height: 40px;
        background: transparent;
        border: none;
        font-size: 14px;
        cursor: pointer;
    }

    .submenu {
        position: static;
        min-width: 0;
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 0 0 8px 18px;
        opacity: 1;
        visibility: hidden;
        transform: none;
        display: none;
    }

    .primary-nav__item.has-children.is-open > .submenu {
        display: block;
        visibility: visible;
    }

    .primary-nav__item.has-children:hover > .submenu,
    .primary-nav__item.has-children:focus-within > .submenu {
        display: none;
    }

    .primary-nav__item.has-children.is-open:hover > .submenu {
        display: block;
    }

    .content-panel {
        padding: 28px 22px 32px;
    }

    .page-title {
        font-size: 21px;
    }

    .member-cta {
        padding: 24px 22px;
    }

    .site-header__overlay {
        padding: 14px 18px;
        max-width: 78%;
    }

    .site-header__stage,
    .site-header--compact .site-header__stage {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .circle-icon {
        width: 56px;
        height: 56px;
    }
}

@media print {
    .nav-bar,
    .site-header__dots,
    .member-cta__actions,
    .site-footer__links {
        display: none;
    }

    body {
        background: #fff;
    }
}
