/* ============================================================
   COMPONENTS — eine Sektion pro Komponente, Banner-Kommentare
   ============================================================ */

/* === hero === */
.hero {
    position: relative;
    display: grid;
    align-items: end;
    min-height: min(92vh, 900px);
    padding-block: calc(var(--header-h) + 80px) var(--space-section);
    overflow: hidden;
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

@media (prefers-reduced-motion: reduce) {
    .hero__video {
        display: none;
    }
}

/* Dunkler Verlauf wie auf der alten Seite: oben transparent → unten Seitenhintergrund */
.hero__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(20 20 20 / 0.25) 0%, rgb(20 20 20 / 0.55) 55%, var(--clr-bg) 100%);
}

.hero__content {
    width: 100%;
}

.hero__title {
    text-shadow: 0 2px 24px rgb(0 0 0 / 0.5);
}

/* Keyword-Subline innerhalb der h1 (SEO) — visuell kleinere zweite Zeile */
.hero__tagline {
    display: block;
    margin-top: 0.75rem;
    font-size: var(--fs-600);
    letter-spacing: 0.14em;
}

.hero__text {
    margin-top: 1rem;
    max-width: 60ch;
    text-shadow: 0 1px 12px rgb(0 0 0 / 0.6);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* Variante: Text mittig zentriert (z. B. Startseite) */
.hero--center {
    align-items: center;
    text-align: center;
}

.hero--center .hero__text {
    margin-inline: auto;
}

.hero--center .hero__actions {
    justify-content: center;
}

/* === instagram === */
.instagram__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

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

.instagram__link {
    position: relative;
    display: block;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.instagram__link img {
    width: 100%;
    height: auto;
    /* Instagram-Portrait 1080x1350 */
    aspect-ratio: 4 / 5;
    object-fit: cover;
    transition: transform var(--transition);
}

.instagram__link:hover img,
.instagram__link:focus-visible img {
    transform: scale(1.05);
}

.instagram__badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    background: rgb(0 0 0 / 0.6);
    border-radius: 50%;
    font-size: 0.8rem;
    color: var(--clr-text);
}

.instagram__fallback {
    margin-top: 1.5rem;
    padding: 2.5rem;
    background: var(--clr-glass-bg);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-card);
    text-align: center;
}

.instagram__fallback p {
    margin-inline: auto;
}

.instagram__fallback .btn {
    margin-top: 1rem;
}

/* === split (Bild/Text-Sektion) === */
.split__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
}

.split--flip .split__text {
    order: 2;
}

.split--flip .split__media {
    order: 1;
}

.split__text p {
    margin-top: 1rem;
}

.split__cta {
    margin-top: 1.5rem;
}

.split__img {
    width: 100%;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

@media (max-width: 992px) {
    .split__inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .split--flip .split__text {
        order: 0;
    }

    .split--flip .split__media {
        order: 0;
    }
}

/* === stats === */
.stats {
    background: var(--clr-bg-deep);
}

.stats__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    text-align: center;
}

@media (max-width: 600px) {
    .stats__list {
        grid-template-columns: 1fr;
    }
}

.stats__item {
    display: grid;
    gap: 0.25rem;
}

.stats__value {
    font-family: var(--ff-heading);
    font-size: var(--fs-800);
    line-height: var(--lh-heading);
    color: var(--clr-accent);
    text-shadow: 0 0 30px rgb(var(--clr-accent-rgb) / 0.35);
}

.stats__label {
    font-size: var(--fs-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--clr-text-muted);
}

/* === partners === */
.partners > .container {
    text-align: center;
}

.partners > .container > p {
    max-width: 60ch;
    margin-inline: auto;
}

.partners__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-block: 2.5rem;
}

.partners__item {
    display: grid;
    place-items: center;
    padding: 1.5rem;
    /* Dunkles Glas — die Partner-Logos sind weiße Varianten */
    background: var(--clr-glass-bg);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-card);
    min-height: 120px;
}

.partners__item img {
    max-height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* === contact form === */
.contact__inner {
    display: grid;
    gap: 2.5rem;
    justify-items: center;
}

.contact__intro {
    max-width: 60ch;
    text-align: center;
}

.contact__intro p {
    margin-top: 1rem;
}

.form {
    display: grid;
    gap: 1.25rem;
    width: 100%;
    max-width: 720px;
    padding: 2rem;
    background: var(--clr-glass-bg);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-card);
}

.form__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
}

@media (max-width: 600px) {
    .form__row {
        grid-template-columns: 1fr;
    }
}

.form__field {
    display: grid;
    gap: 0.4rem;
}

.form__field label {
    font-size: var(--fs-500);
}

.form__field input,
.form__field select,
.form__field textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--clr-glass-bg);
    border: 1px solid var(--clr-glass-border-strong);
    border-radius: var(--radius-btn);
    color: var(--clr-text);
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.form__field input:hover,
.form__field select:hover,
.form__field textarea:hover {
    border-color: rgb(255 255 255 / 0.55);
}

/* Eigener, deutlich sichtbarer Fokus-Ring statt des globalen Outlines */
.form__field input:focus-visible,
.form__field select:focus-visible,
.form__field textarea:focus-visible {
    outline: none;
    border-color: rgb(255 255 255 / 0.75);
    box-shadow: 0 0 0 3px rgb(255 255 255 / 0.18);
}

.form__field ::placeholder {
    color: rgb(255 255 255 / 0.45);
}

/* Fehlerzustand: per JS (aria-invalid) und nativ nach Nutzereingabe (:user-invalid) */
.form__field input[aria-invalid="true"],
.form__field select[aria-invalid="true"],
.form__field textarea[aria-invalid="true"],
.form__field input:user-invalid,
.form__field select:user-invalid,
.form__field textarea:user-invalid {
    border-color: var(--clr-error);
}

.form__field select {
    appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
}

.form__field select option {
    background: var(--clr-bg);
    color: var(--clr-text);
}

.form__note {
    margin: 0;
    font-size: var(--fs-400);
    color: var(--clr-text-muted);
}

.form__required {
    color: var(--clr-accent);
}

.form__hint {
    font-size: var(--fs-400);
    color: var(--clr-text-muted);
}

.form__error-msg {
    font-size: var(--fs-400);
    color: var(--clr-error);
}

.form button[disabled] {
    opacity: 0.65;
    cursor: progress;
}

.form__field textarea {
    resize: vertical;
    min-height: 8rem;
}

.form__field--checkbox {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.6rem;
}

.form__field--checkbox input {
    /* 24px — Mindest-Zielgröße (WCAG 2.5.8) */
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.1rem;
    accent-color: var(--clr-accent);
}

.form__field--checkbox label {
    font-size: var(--fs-500);
}

/* Leer: unsichtbar, aber im Accessibility-Tree — display:none würde die
   aria-live-Region abmelden und Screenreader verpassen die erste Meldung. */
.form__status:empty {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.form__success {
    padding: 0.75rem 1rem;
    border: 1px solid var(--clr-success);
    border-radius: var(--radius-btn);
    color: var(--clr-success);
}

.form__error {
    padding: 0.75rem 1rem;
    border: 1px solid var(--clr-error);
    border-radius: var(--radius-btn);
    color: var(--clr-error);
}

.form__submit {
    margin: 0;
}

/* === Werbe-/Sponsoren-Banner (Slider) === */
.ad-banner {
    --banner-interval: 6s;
}

.ad-banner__subline {
    margin-top: 0.75rem;
    max-width: 70ch;
}

.ad-banner__track {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
}

.ad-banner__slide[hidden] {
    display: none;
}

.ad-banner__slide {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
    align-items: center;
    padding: clamp(1.75rem, 1rem + 2vw, 3rem);
    background: var(--clr-glass-bg);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

/* Optionaler Hintergrund pro Banner (data: "background").
   Dunkler Verlauf über dem Bild hält Text & CTA links lesbar. */
.ad-banner__slide--bg {
    background-image:
        linear-gradient(to right, rgb(0 0 0 / 0.82), rgb(0 0 0 / 0.45) 60%, rgb(0 0 0 / 0.3)),
        var(--banner-bg);
    background-size: cover;
    background-position: center;
    border-color: transparent;
}

.ad-banner__slide--bg .ad-banner__text {
    color: var(--clr-text);
}

.ad-banner__slide--bg .ad-banner__logo {
    background: rgb(0 0 0 / 0.4);
    border-color: rgb(255 255 255 / 0.3);
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    /* Auf Mobil läuft der Verlauf nach unten, damit der gestapelte Text lesbar bleibt. */
    .ad-banner__slide--bg {
        background-image:
            linear-gradient(to bottom, rgb(0 0 0 / 0.82), rgb(0 0 0 / 0.5)),
            var(--banner-bg);
    }
}

.ad-banner__tag {
    display: inline-block;
    margin-bottom: 0.85rem;
    padding: 0.2em 0.7em;
    font-size: var(--fs-300);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--clr-text-muted);
    background: rgb(255 255 255 / 0.08);
    border: 1px solid var(--clr-glass-border);
    border-radius: 999px;
}

.ad-banner__title {
    font-family: var(--ff-heading);
    font-size: var(--fs-700);
    line-height: var(--lh-heading);
    margin-bottom: 0.6rem;
}

.ad-banner__text {
    max-width: 52ch;
    margin-bottom: 1.5rem;
    color: var(--clr-text-muted);
}

.ad-banner__logo {
    display: grid;
    place-items: center;
    min-height: 130px;
    padding: 1.5rem;
    background: rgb(0 0 0 / 0.18);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-card);
}

.ad-banner__logo img {
    width: auto;
    max-width: 100%;
    max-height: 96px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .ad-banner__slide {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}

/* Steuerung: Pause/Play-Taste + Indikatorleiste. */
.ad-banner__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.75rem;
}

.ad-banner__controls[hidden] {
    display: none;
}

.ad-banner__toggle {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    color: var(--clr-text);
    background: var(--clr-glass-bg);
    border: 1px solid var(--clr-glass-border);
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition);
}

.ad-banner__toggle[hidden] {
    display: none;
}

.ad-banner__toggle:hover {
    background: rgb(255 255 255 / 0.2);
}

.ad-banner__toggle:focus-visible {
    outline: 2px solid var(--clr-text);
    outline-offset: 3px;
}

.ad-banner__toggle-icon {
    font-size: 1.15rem;
}

/* Pause-Icon im Abspiel-Zustand, Play-Icon wenn pausiert. */
.ad-banner__toggle .ad-banner__toggle-icon--play {
    display: none;
}

.ad-banner__toggle[aria-pressed="true"] .ad-banner__toggle-icon--pause {
    display: none;
}

.ad-banner__toggle[aria-pressed="true"] .ad-banner__toggle-icon--play {
    display: inline-block;
}

/* Indikatorleiste — die aktive Leiste füllt sich über --banner-interval. */
.ad-banner__indicators {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.ad-banner__dot {
    position: relative;
    width: 48px;
    height: 6px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--clr-glass-border);
    cursor: pointer;
    overflow: hidden;
    transition: background var(--transition);
}

.ad-banner__dot:hover {
    background: rgb(255 255 255 / 0.35);
}

.ad-banner__dot:focus-visible {
    outline: 2px solid var(--clr-text);
    outline-offset: 3px;
}

.ad-banner__progress {
    position: absolute;
    inset: 0;
    background: var(--clr-accent);
    transform: scaleX(0);
    transform-origin: left;
}

.ad-banner__dot.is-active .ad-banner__progress {
    animation: ad-progress var(--banner-interval) linear forwards;
}

.ad-banner.is-paused .ad-banner__dot.is-active .ad-banner__progress {
    animation-play-state: paused;
}

@keyframes ad-progress {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
    .ad-banner__dot.is-active .ad-banner__progress {
        animation: none;
        transform: scaleX(1);
    }
}
