/*
Theme Name: Kiryoku Dojo
Theme URI: https://kiryoku-dojo.berlin
Description: Glassmorphism theme for Kiryoku Dojo Berlin — Okinawa Kempo Karate. Integrates DMM/DEB natively. Inter + Roboto typography. Fully responsive.
Version: 1.1.1
Author: Dominik Lübben
Author URI: https://kiryoku-dojo.berlin
Requires at least: 6.0
Requires PHP: 8.1
Text Domain: kiryoku-dojo
License: Proprietary
*/

/* ═══ TOKENS ═══ */
:root {
    --kd-red: #c62828;
    --kd-red-light: rgba(198, 40, 40, .08);
    --kd-red-border: rgba(198, 40, 40, .15);
    --kd-bg: #ffffff;
    --kd-text: #1a1a1a;
    --kd-text-sec: #777;
    --kd-text-ter: #aaa;
    --kd-glass: rgba(255, 255, 255, .75);
    --kd-glass-border: rgba(255, 255, 255, .7);
    --kd-glass-blur: 20px;
    --kd-glass-dark: rgba(20, 22, 30, .9);
    --kd-glass-dark-border: rgba(255, 255, 255, .15);
    --kd-r: 16px;
    --kd-r-sm: 10px;
    --kd-r-pill: 99px;
    --kd-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --kd-body: 'Roboto', system-ui, -apple-system, sans-serif;
    --kd-max: 1600px;
    --kd-footer-bg: rgba(0, 0, 0, .92);
    /* Neutrales Schwarz */
}

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

html {
    scroll-behavior: smooth;
}

/* NEU: Flexbox am Body für den Sticky Footer */
body {
    margin: 0;
    padding: 0;
    font-family: var(--kd-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--kd-text);
    background: var(--kd-bg);
    -webkit-font-smoothing: antialiased;

    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

a {
    color: var(--kd-red);
    text-decoration: none;
    transition: opacity .2s;
}

a:hover {
    opacity: .8;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--kd-heading);
    font-weight: 700;
    line-height: 1.15;
    color: var(--kd-red);
    background: linear-gradient(135deg, #7a1515 0%, #e53935 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 {
    font-size: clamp(28px, 5vw, 52px);
    letter-spacing: -.5px;
}

h2 {
    font-size: clamp(22px, 3.5vw, 32px);
}

h3 {
    font-size: clamp(18px, 2.5vw, 22px);
}

p {
    margin: 0 0 1em;
}

/* ═══ GLASS ═══ */
.kd-glass {
    background: var(--kd-glass);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--kd-glass-border);
    border-radius: var(--kd-r);
    box-shadow: 0 2px 20px rgba(0, 0, 0, .03);
}

.kd-glass-dark {
    background: var(--kd-glass-dark);
    backdrop-filter: blur(var(--kd-glass-blur));
    -webkit-backdrop-filter: blur(var(--kd-glass-blur));
    border: 1px solid var(--kd-glass-dark-border);
    border-radius: var(--kd-r);
}

/* ═══ LAYOUT ═══ */
.kd-wrap {
    max-width: var(--kd-max);
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 48px);
}

.kd-section {
    padding: clamp(32px, 6vw, 80px) 0;
}

/* Background decor (Mitsudomoe circles) — NO overflow:hidden on body! */
.kd-bg-decor {
    position: relative;
}

.kd-bg-decor::before {
    content: '';
    position: fixed;
    top: -180px;
    right: -120px;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(198, 40, 40, .1) 0%, rgba(198, 40, 40, .03) 50%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.kd-bg-decor::after {
    content: '';
    position: fixed;
    bottom: -250px;
    left: -150px;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 195, 185, .15) 0%, rgba(200, 195, 185, .03) 50%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.kd-bg-decor>* {
    position: relative;
    z-index: 1;
}

/* ═══ HEADER — solid at top, glass on scroll ═══ */
.kd-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .98);
    /* Neutrales Schwarz */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    transition: background .3s, backdrop-filter .3s, -webkit-backdrop-filter .3s, border-color .3s;
}

.kd-header.is-scrolled {
    background: rgba(0, 0, 0, .65);
    /* Neutrales Schwarz */
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-bottom-color: rgba(255, 255, 255, .08);
}

.kd-header__inner {
    max-width: 100%;
    /* Über die gesamte Breite */
    margin: 0 auto;
    padding: 10px clamp(16px, 4vw, 48px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Logo */
.kd-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.kd-logo img {
    height: 36px;
    width: auto;
    border-radius: 50%;
}

.kd-logo__fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
    font-size: 16px;
    color: var(--kd-red);
    font-family: var(--kd-heading);
    font-weight: 700;
}

.kd-logo__text {
    font-family: var(--kd-heading);
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* Navigation */
.kd-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    /* Schiebt das Menü ganz nach rechts */
}

.kd-nav .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2px;
    align-items: center;
}

.kd-nav .menu li {
    position: relative;
}

.kd-nav .menu li a {
    display: block;
    padding: 8px 14px;
    font-size: 14px;
    color: rgba(255, 255, 255, .7);
    font-weight: 400;
    text-decoration: none;
    border-radius: 8px;
    transition: background .15s, color .15s;
    font-family: var(--kd-body);
}

.kd-nav .menu li a:hover,
.kd-nav .menu li.current-menu-item a,
.kd-nav .menu li.current_page_item a {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.kd-nav .menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, .9);
    /* Neutrales Schwarz */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--kd-r-sm);
    padding: 8px;
    min-width: 200px;
    list-style: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
}

.kd-nav .menu li:hover>.sub-menu {
    display: block;
}

.kd-nav .menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 4px;
}

/* CTA */
.kd-nav__cta {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--kd-red);
    color: #fff !important;
    border: 1px solid var(--kd-red);
    border-radius: var(--kd-r-pill);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    margin-left: 8px;
    transition: background .2s;
    white-space: nowrap;
    font-family: var(--kd-body);
}

.kd-nav__cta:hover {
    background: #a51f1f;
    opacity: 1;
}

/* Member header elements — OUTSIDE of kd-nav, always visible */
.kd-header__member {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 12px;
    position: relative;
    flex-shrink: 0;
}

/* Next course button */
.kd-nav__next-course {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: var(--kd-r-pill);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--kd-body);
    transition: background .15s;
    white-space: nowrap;
}

.kd-nav__next-course:hover {
    background: rgba(255, 255, 255, .14);
}

/* Seminar (Lehrgang) — sanftes Gold */
.kd-nav__next-course--seminar {
    background: rgba(212, 160, 23, .18);
    border-color: rgba(212, 160, 23, .35);
}
.kd-nav__next-course--seminar:hover {
    background: rgba(212, 160, 23, .28);
}

/* Prüfung (Exam) — sanftes Rot */
.kd-nav__next-course--exam {
    background: rgba(198, 40, 40, .22);
    border-color: rgba(198, 40, 40, .4);
}
.kd-nav__next-course--exam:hover {
    background: rgba(198, 40, 40, .32);
}

/* Dropdown trigger + panel for combined Termine button */
.kd-nav__next-wrap {
    position: relative;
    display: inline-flex;
}

.kd-nav__next-trigger {
    gap: 8px;
}

.kd-nav__next-trigger-icons {
    letter-spacing: 1px;
    font-size: 13px;
}

.kd-nav__next-trigger-count {
    background: #c62828;
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
}

.kd-nav__next-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    max-width: 360px;
    padding: 8px;
    background: rgba(20, 18, 14, .95);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
    z-index: 9990;
    display: none;
}
.kd-nav__next-panel.is-open { display: block; }

.kd-nav__next-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background .15s;
}
.kd-nav__next-row + .kd-nav__next-row { margin-top: 2px; }
.kd-nav__next-row:hover { background: rgba(255, 255, 255, .06); }

.kd-nav__next-row--seminar { border-left: 2px solid rgba(212, 160, 23, .5); }
.kd-nav__next-row--exam    { border-left: 2px solid rgba(198, 40, 40, .6); }

.kd-nav__next-row-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.kd-nav__next-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.kd-nav__next-row-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kd-nav__next-row-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, .6);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kd-header__bell {
    position: relative;
    background: none;
    border: none;
    padding: 4px;
    color: rgba(255, 255, 255, .6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s;
}

.kd-header__bell:hover {
    color: #fff;
}

.kd-header__bell-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    background: var(--kd-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 99px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--kd-heading);
    border: 2px solid rgba(0, 0, 0, .95);
    /* Neutrales Schwarz */
}

/* Notification panel dropdown */
.kd-notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 340px;
    max-height: 400px;
    background: rgba(0, 0, 0, .95);
    /* Neutrales Schwarz */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
    overflow: hidden;
    z-index: 200;
}

.kd-notif-panel.is-open {
    display: block;
}

.kd-notif-panel__header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    font-family: var(--kd-heading);
}

.kd-notif-panel__body {
    overflow-y: auto;
    max-height: 340px;
}

.kd-notif-panel__empty {
    padding: 32px 16px;
    text-align: center;
}

.kd-notif-panel__empty p {
    font-size: 13px;
    color: rgba(255, 255, 255, .3);
    margin: 10px 0 0;
}

.kd-notif-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    transition: background .15s;
}

.kd-notif-item:hover {
    background: rgba(255, 255, 255, .06);
}

.kd-notif-item:last-child {
    border-bottom: none;
}

.kd-notif-item__icon {
    font-size: 18px;
    flex-shrink: 0;
}

.kd-notif-item__body {
    flex: 1;
    min-width: 0;
}

.kd-notif-item__title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kd-notif-item__text {
    font-size: 12px;
    color: rgba(255, 255, 255, .4);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kd-notif-item__badge {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--kd-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .kd-notif-panel {
        width: calc(100vw - 32px);
        right: -60px;
    }
}

.kd-header__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .2);
}

.kd-header__avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(198, 40, 40, .3);
    border: 2px solid rgba(198, 40, 40, .4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

/* Mobile hamburger */
.kd-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #fff;
}

/* ── Responsive nav ── */
@media (max-width: 900px) {
    .kd-nav .menu li a {
        padding: 8px 10px;
        font-size: 13px;
    }

    .kd-nav__cta {
        padding: 8px 16px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .kd-logo {
        order: 1;
    }

    .kd-header__member {
        margin-left: auto;
        gap: 8px;
        order: 2;
        /* Bleibt links vom Burger Menu */
    }

    .kd-menu-toggle {
        display: block;
        order: 3;
        /* Burger Menu ganz nach rechts */
    }

    .kd-logo__text {
        display: none;
    }

    .kd-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, .95);
        /* Neutrales Schwarz */
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
    }

    .kd-nav.is-open {
        display: flex;
    }

    .kd-nav .menu {
        flex-direction: column;
        gap: 0;
    }

    .kd-nav .menu li a {
        padding: 12px 16px;
        font-size: 15px;
    }

    .kd-nav__cta {
        margin: 8px 0 0;
        justify-content: center;
    }

    .kd-nav__next-course-text {
        display: none;
    }

    .kd-nav__next-course {
        padding: 6px 8px;
        font-size: 14px;
    }

    .kd-notif-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 14px 14px 0 0;
    }
}

/* ═══ HERO ═══ */
.kd-hero {
    padding: 0;
    margin: 0;
    width: 100%;
}

.kd-hero__img-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: clamp(250px, 40vw, 600px);
    background: #1a1810;
    /* Create a fresh stacking context so child z-index values are isolated.
       Without this, <video> can punch through and render above siblings on iOS Safari. */
    isolation: isolate;
}

.kd-hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Explicit z-index keeps the media below overlays even when the browser
       promotes <video> to its own GPU layer. */
    z-index: 0;
}

/* Logo overlay on hero image */
.kd-hero__logo {
    position: absolute;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    padding: clamp(16px, 2.5vw, 32px);
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(var(--kd-glass-blur)) saturate(1.2);
    -webkit-backdrop-filter: blur(var(--kd-glass-blur)) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--kd-r);
    box-shadow: 0 8px 40px rgba(0, 0, 0, .35);
}

.kd-hero__logo--center {
    left: 50%;
    transform: translate(-50%, -50%);
}

.kd-hero__logo--left {
    left: clamp(24px, 5vw, 80px);
}

.kd-hero__logo--right {
    right: clamp(24px, 5vw, 80px);
}

.kd-hero__logo img {
    /* ~60% of the hero height (which is clamp(250px, 40vw, 600px)),
       leaving roughly 1/5 padding above and below. */
    height: clamp(150px, 24vw, 360px);
    width: auto;
    max-width: 90vw;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, .4));
}

.kd-hero__logo-fallback {
    width: clamp(150px, 24vw, 360px);
    height: clamp(150px, 24vw, 360px);
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, .3);
}

.kd-hero__logo-fallback svg {
    width: 60%;
    height: 60%;
}

/* Search bar on hero */
.kd-hero__search {
    position: absolute;
    top: clamp(12px, 3vw, 24px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: min(80%, 500px);
}

.kd-hero__search-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
}

.kd-hero__search-inner input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    color: rgba(255, 255, 255, .7);
    font-family: var(--kd-body);
}

.kd-hero__search-inner input::placeholder {
    color: rgba(255, 255, 255, .4);
}

/* Location pill */
.kd-hero__location {
    position: absolute;
    bottom: clamp(10px, 2vw, 18px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: 7px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, .6);
}

/* Hero text below image */
.kd-hero__text {
    text-align: center;
    padding: clamp(20px, 4vw, 40px) 0;
}

.kd-hero__tagline {
    display: inline-block;
    padding: 5px 18px;
    border-radius: var(--kd-r-pill);
    border: 1px solid rgba(0, 0, 0, .08);
    font-size: 13px;
    color: var(--kd-text-sec);
    background: rgba(255, 255, 255, .6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 16px;
    font-family: var(--kd-body);
}

.kd-hero__title {
    margin: 0 0 8px;
    color: #fff;
    background: none;
    -webkit-text-fill-color: #fff;
}

.kd-hero__sub {
    font-size: clamp(14px, 2vw, 17px);
    color: var(--kd-text-sec);
    max-width: 480px;
    margin: 0 auto;
    font-family: var(--kd-body);
}

/* ═══ CARDS ═══ */
.kd-card {
    position: relative;
}

.kd-card--hz {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 40px);
}

.kd-card--hz .kd-card__img {
    width: clamp(240px, 42%, 460px);
    flex-shrink: 0;
    margin: clamp(-48px, -4vw, -24px) 0 clamp(-48px, -4vw, -24px) clamp(-48px, -4vw, -24px);
    display: flex;
}

.kd-card--hz-flip .kd-card__img {
    margin: clamp(-48px, -4vw, -24px) clamp(-48px, -4vw, -24px) clamp(-48px, -4vw, -24px) 0;
}

.kd-card--hz .kd-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--kd-r);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}

.kd-card--hz .kd-card__body {
    flex: 1;
    padding: clamp(16px, 3vw, 32px);
}

.kd-card__body h2 {
    margin: 0 0 12px;
}

.kd-card--hz-flip {
    flex-direction: row-reverse;
}

@media (max-width: 600px) {
    .kd-card--hz {
        flex-direction: column;
    }

    .kd-card--hz-flip {
        flex-direction: column;
    }

    .kd-card--hz .kd-card__img,
    .kd-card--hz-flip .kd-card__img {
        width: 100%;
        aspect-ratio: 16/9;
        margin: clamp(-24px, -4vw, -12px) 0 0;
    }
}

/* Grid cards */
.kd-grid {
    display: grid;
    gap: 16px;
}

.kd-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.kd-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    .kd-grid--3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {

    .kd-grid--3,
    .kd-grid--2 {
        grid-template-columns: 1fr;
    }
}

.kd-grid-card {
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s;
}

.kd-grid-card:hover {
    transform: translateY(-2px);
}

.kd-grid-card__img {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.kd-grid-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.kd-grid-card:hover .kd-grid-card__img img {
    transform: scale(1.03);
}

.kd-grid-card__body {
    padding: 14px 16px;
}

.kd-grid-card__body h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.kd-grid-card__body p {
    font-size: 13px;
    color: var(--kd-text-sec);
    margin: 0;
}

/* ═══ BUTTONS ═══ */
.kd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    border-radius: var(--kd-r-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--kd-heading);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .1s;
}

.kd-btn:active {
    transform: scale(.98);
}

.kd-btn--red {
    background: var(--kd-red);
    color: #fff;
}

.kd-btn--red:hover {
    background: #a51f1f;
    opacity: 1;
    color: #fff;
}

.kd-btn--outline {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, .12);
    color: var(--kd-text-sec);
}

.kd-btn--outline:hover {
    background: rgba(0, 0, 0, .03);
    opacity: 1;
}

/* ═══ SCHEDULE ═══ */
.kd-schedule__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kd-schedule__row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.kd-schedule__row:last-child {
    border-bottom: none;
}

.kd-schedule__day {
    min-width: 48px;
    text-align: center;
}

.kd-schedule__day-name {
    font-size: 12px;
    color: var(--kd-red);
    font-weight: 600;
    font-family: var(--kd-heading);
}

.kd-schedule__day-num {
    font-size: 20px;
    font-weight: 600;
    font-family: var(--kd-heading);
}

.kd-schedule__events {
    flex: 1;
}

.kd-schedule__event {
    font-size: 14px;
    font-weight: 500;
}

.kd-schedule__event--clickable {
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 6px;
    transition: background .15s;
}

.kd-schedule__event--clickable:hover {
    background: rgba(198, 40, 40, .06);
}

.kd-schedule__event-time {
    font-weight: 400;
    color: var(--kd-text-ter);
    margin-left: 4px;
}

.kd-schedule__tags {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.kd-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--kd-r-pill);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .kd-schedule__row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .kd-schedule__tags {
        flex-direction: row;
        align-items: center;
        width: 100%;
        padding-left: 64px;
    }
}

/* ═══ NEWS (archive/blog pages) ═══ */
.kd-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .kd-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .kd-posts-grid {
        grid-template-columns: 1fr;
    }
}

.kd-post-card {
    overflow: hidden;
    transition: transform .2s;
}

.kd-post-card:hover {
    transform: translateY(-2px);
}

.kd-post-card__img {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #eae6df;
}

.kd-post-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kd-post-card__body {
    padding: 14px 16px;
}

.kd-post-card__title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px;
}

.kd-post-card__meta {
    font-size: 12px;
    color: var(--kd-text-ter);
}

/* Section headers */
.kd-section__header {
    text-align: center;
    margin-bottom: clamp(20px, 3vw, 40px);
}

.kd-section__header h2 {
    margin: 0 0 6px;
}

.kd-section__header p {
    color: var(--kd-text-sec);
    font-size: 14px;
    margin: 0;
}

/* ═══ FRONTPAGE WIDGETS — auto-grid for whatever the user drops in ═══ */
.kd-fpw__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}
.kd-fpw__item {
    padding: 20px;
    color: var(--kd-text-pri);
}
.kd-fpw__item iframe,
.kd-fpw__item img {
    max-width: 100%;
    border-radius: var(--kd-r-sm);
}
.kd-fpw__title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--kd-text-pri);
}

/* ═══ LANGUAGE SWITCHER (kd-multilingual plugin) — dark glass to match the header ═══ */
/* body-prefix raises specificity above the plugin's inline default styles. */
body .kd-ml-sw {
    --kd-ml-sw-radius: var(--kd-r);
    --kd-ml-sw-toggle-color: #fff;
    --kd-ml-sw-toggle-bg: rgba(255, 255, 255, .06);
    --kd-ml-sw-toggle-bd: rgba(255, 255, 255, .18);
    --kd-ml-sw-toggle-bg-hover: rgba(255, 255, 255, .12);
    --kd-ml-sw-toggle-bd-hover: rgba(255, 255, 255, .28);
    --kd-ml-sw-menu-bg: var(--kd-glass-dark);
    --kd-ml-sw-menu-bd: var(--kd-glass-dark-border);
    --kd-ml-sw-menu-shadow: 0 10px 28px rgba(0, 0, 0, .45);
    --kd-ml-sw-menu-blur: var(--kd-glass-blur);
    --kd-ml-sw-item-color: #fff;
    --kd-ml-sw-item-bg-hover: rgba(255, 255, 255, .10);
    --kd-ml-sw-item-active-bg: rgba(198, 40, 40, .25);
    --kd-ml-sw-item-active-color: #fff;
}
/* Match the visual weight of .kd-nav__next-course and friends. */
body .kd-ml-sw__toggle {
    padding: 6px 14px;
    font-family: var(--kd-body);
    font-size: 12px;
    font-weight: 500;
}

/* ═══ FOOTER ═══ */
/* NEU: margin-top: auto schiebt den Footer immer ans untere Ende */
.kd-footer {
    background: var(--kd-footer-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: rgba(255, 255, 255, .5);
    padding: 12px 0;
    margin-top: auto;
}

.kd-footer__inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 12px 0 clamp(16px, 4vw, 48px);
    display: flex;
    justify-content: flex-start;
    /* NEU: Das Menü rückt nach links an den Text heran */
    align-items: center;
    gap: 32px;
    /* NEU: Abstand zwischen dem Adress-Block und dem Menü */
    flex-wrap: wrap;
}

.kd-footer__info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.kd-footer__sep {
    color: rgba(255, 255, 255, .15);
    font-size: 12px;
}

.kd-footer__brand {
    font-size: 13px;
    color: rgba(255, 255, 255, .6);
    font-weight: 600;
    font-family: var(--kd-heading);
}

.kd-footer__text {
    font-size: 12px;
    color: rgba(255, 255, 255, .4);
}

.kd-footer__copy {
    font-size: 12px;
    color: rgba(255, 255, 255, .3);
}

.kd-footer a {
    color: rgba(255, 255, 255, .5);
}

.kd-footer a:hover {
    color: rgba(255, 255, 255, .8);
    opacity: 1;
}

.kd-footer .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.kd-footer .menu li a {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: rgba(255, 255, 255, .4);
    text-decoration: none;
}

.kd-footer .menu li a:hover {
    color: rgba(255, 255, 255, .7);
}

@media (max-width: 768px) {
    .kd-footer__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        justify-content: center;
        gap: 12px;
        padding-right: clamp(16px, 4vw, 48px);
    }

    .kd-footer__info {
        justify-content: center;
    }

    .kd-footer .menu {
        gap: 12px;
        justify-content: center;
    }
}

/* ═══ PAGE CONTENT ═══ */
.kd-page-header {
    width: 100%;
    padding: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #1a1810;
}

.kd-page-header__media {
    width: 100%;
    height: clamp(250px, 40vw, 600px);
    object-fit: cover;
    display: block;
    z-index: 0;
}

/* Logo overlay on page headers — same glass treatment as front-page hero */
.kd-page-header__logo {
    position: absolute;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    padding: clamp(16px, 2.5vw, 32px);
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(var(--kd-glass-blur)) saturate(1.2);
    -webkit-backdrop-filter: blur(var(--kd-glass-blur)) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--kd-r);
    box-shadow: 0 8px 40px rgba(0, 0, 0, .35);
}

.kd-page-header__logo img {
    height: clamp(150px, 24vw, 360px);
    width: auto;
    max-width: 90vw;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, .4));
}

.kd-page-header__logo-fb {
    width: clamp(150px, 24vw, 360px);
    height: clamp(150px, 24vw, 360px);
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, .3);
}

.kd-page-header__logo-fb svg {
    width: 60%;
    height: 60%;
}

/* Position variants */
.kd-page-header__logo--center {
    left: 50%;
    transform: translate(-50%, -50%);
}

.kd-page-header__logo--left {
    left: clamp(24px, 5vw, 80px);
}

.kd-page-header__logo--right {
    right: clamp(24px, 5vw, 80px);
}

/* Main page wrapper: glass-morphism panel matching the home page (.kd-glass),
   sitting on the body's .kd-bg-decor radial gradients. */
.kd-page-content {
    width: 100%;
    max-width: var(--kd-max);
    box-sizing: border-box;
    margin: clamp(16px, 3vw, 32px) auto;
    /* Symmetrical: left/right equal, top/bottom half of left/right */
    padding: clamp(20px, 3vw, 40px) clamp(32px, 5vw, 80px);
    text-align: justify;
    hyphens: auto;
    background: var(--kd-glass);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--kd-glass-border);
    border-radius: var(--kd-r);
    box-shadow: 0 2px 20px rgba(0, 0, 0, .03);
    position: relative;
    z-index: 1;
    align-self: center;
}

/* Variant for pages rendered by plugin shortcodes (DMM, DEB, KOC, KDV).
   Same outer max-width as a normal page (--kd-max), but tighter side padding,
   left-aligned text and no hyphenation so widget/dashboard layouts have room
   without being stretched to viewport edges. */
.kd-page-content--full {
    padding-left: clamp(16px, 2vw, 32px);
    padding-right: clamp(16px, 2vw, 32px);
    text-align: left;
    hyphens: manual;
}

/* Top-level plugin shortcode wrappers stretch to 100% of the container so they
   match the surrounding page content width. Descendant combinator (no `>`) so
   they're caught even when wrapped by a Gutenberg block container. */
.kd-page-content--full .deb-event-list,
.kd-page-content--full .deb-public-list,
.kd-page-content--full .deb-public-event,
.kd-page-content--full .deb-my-bookings,
.kd-page-content--full .dmm-news,
.kd-page-content--full .dmm-children,
.kd-page-content--full .dmm-payments,
.kd-page-content--full .dmm-pay,
.kd-page-content--full .dmm-p,
.kd-page-content--full .dmm-profile,
.kd-page-content--full #dmm-scope,
.kd-page-content--full .koc-courses,
.kd-page-content--full .koc-course,
.kd-page-content--full .kdv-container {
    background: transparent !important;
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Frosted glass treatment for DMM news cards — matches .kd-glass on the homepage. */
.dd-news__card {
    background: var(--kd-glass) !important;
    backdrop-filter: blur(var(--kd-glass-blur)) saturate(1.3) !important;
    -webkit-backdrop-filter: blur(var(--kd-glass-blur)) saturate(1.3) !important;
    border: 1px solid var(--kd-glass-border) !important;
    border-radius: var(--kd-r) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, .03) !important;
    transition: border-color .2s, transform .2s, box-shadow .2s !important;
}
.dd-news__card:hover {
    border-color: rgba(255, 255, 255, .8) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .08) !important;
}
.dd-news__card .dd-news__img {
    background: rgba(255, 255, 255, .15);
}
.dd-news__card .dd-comment-wrap {
    border-top-color: var(--kd-glass-border) !important;
}

/* Round the video player's bottom corners properly. mediaelement.js inserts
   wrappers (.wp-video, .mejs-container, .mejs-overlay) inside .kdv-player-wrapper
   that escape `overflow: hidden`. clip-path with rounded inset clips reliably
   regardless of inner positioning/transforms. Uses theme radius token. */
.kdv-player-wrapper {
    clip-path: inset(0 round var(--kd-r)) !important;
    -webkit-clip-path: inset(0 round var(--kd-r)) !important;
}
.kdv-player-wrapper > *,
.kdv-player-wrapper .wp-video,
.kdv-player-wrapper .mejs-container,
.kdv-player-wrapper video {
    border-radius: var(--kd-r);
}

.kd-page-content h1 {
    margin: 0 0 16px;
}

.kd-page-content img {
    border-radius: var(--kd-r-sm);
    margin: 16px 0;
}

.kd-page-content ul,
.kd-page-content ol {
    padding-left: 24px;
}

.kd-page-content blockquote {
    border-left: 3px solid var(--kd-red);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--kd-red-light);
    border-radius: 0 var(--kd-r-sm) var(--kd-r-sm) 0;
    font-style: italic;
    color: var(--kd-text-sec);
}

/* Clear floats after content blocks */
.kd-page-content::after {
    content: '';
    display: table;
    clear: both;
}

/* ═══ WP COMPAT — Classic + Gutenberg Image Alignment ═══ */
.alignleft,
.wp-block-image.alignleft,
.wp-block-image .alignleft {
    float: left;
    margin: 4px 24px 16px 0;
    max-width: 50%;
}

.alignright,
.wp-block-image.alignright,
.wp-block-image .alignright {
    float: right;
    margin: 4px 0 16px 24px;
    max-width: 50%;
}

.aligncenter,
.wp-block-image.aligncenter {
    display: block;
    margin: 24px auto;
    text-align: center;
}

/* Gutenberg images without explicit alignment → centered full width */
.kd-page-content .wp-block-image:not(.alignleft):not(.alignright):not(.aligncenter) {
    margin: 24px 0;
}

.kd-page-content .wp-block-image img {
    border-radius: var(--kd-r-sm);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.kd-page-content .wp-block-image figcaption {
    font-size: 13px;
    color: var(--kd-text-sec);
    text-align: center;
    margin-top: 8px;
}

/* Gutenberg columns with images */
.kd-page-content .wp-block-columns {
    gap: 24px;
}

/* Mobile: No floats, images go full width */
@media (max-width: 600px) {

    .alignleft,
    .wp-block-image.alignleft,
    .wp-block-image .alignleft,
    .alignright,
    .wp-block-image.alignright,
    .wp-block-image .alignright {
        float: none;
        margin: 16px 0;
        max-width: 100%;
    }

    .kd-page-content .wp-block-image img {
        width: 100%;
    }
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 12px;
    color: var(--kd-text-ter);
    text-align: center;
    margin-top: 6px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.gallery img {
    border-radius: 8px;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ═══ DMM/DEB OVERRIDES ═══ */
.dmm-p {
    font-family: var(--kd-body);
}

.dmm-p__btn--red {
    background: var(--kd-red);
    border-radius: var(--kd-r-sm);
}

.deb-card {
    background: var(--kd-glass) !important;
    backdrop-filter: blur(var(--kd-glass-blur));
    -webkit-backdrop-filter: blur(var(--kd-glass-blur));
    border: 1px solid var(--kd-glass-border) !important;
    border-radius: var(--kd-r) !important;
}

/* Force DEB lightbox positioning — something on this site overrides DEB's
   position:fixed (cascade investigation inconclusive). ID selector + !important
   beats any plausible class-based override. */
#deb-lb-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 100000 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px 20px !important;
    overflow-y: auto !important;
    background: rgba(0,0,0,.45) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
}
#deb-lb-overlay:not(.deb-lb-open) { display: none !important; }
#deb-lb-overlay.deb-lb-open { display: flex !important; }

/* ═══ ADMIN BAR ═══ */
body.admin-bar .kd-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .kd-header {
        top: 46px;
    }
}

/* ═══ PROBETRAINING SECTION ═══ */
.kd-probe {
    padding: clamp(48px, 8vw, 100px) 0;
}

.kd-probe__head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 36px;
}

.kd-probe__head h2 {
    color: #fff;
    background: none;
    -webkit-text-fill-color: #fff;
    margin-bottom: 12px;
}

.kd-probe__head p {
    color: var(--kd-text-sec);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* Black glassmorphism — blurs whatever scrolls behind it */
.kd-probe__card {
    max-width: 640px;
    margin: 0 auto;
    background: rgba(15, 15, 15, .55);
    color: #fff;
    border-radius: 20px;
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
}

/* Form overrides — scoped to the Probetraining card */
.kd-probe__card .kkp-form-container input[type="text"],
.kd-probe__card .kkp-form-container input[type="email"],
.kd-probe__card .kkp-form-container input[type="number"],
.kd-probe__card .kkp-form-container select {
    width: 100%;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
    border-radius: 0;
    background: transparent;
    font-family: var(--kd-body);
    font-size: 15px;
    color: #fff;
    transition: border-color .2s;
}

.kd-probe__card .kkp-form-container input::placeholder {
    color: rgba(255, 255, 255, .45);
}

.kd-probe__card .kkp-form-container select option {
    color: var(--kd-text);
}

.kd-probe__card .kkp-form-container input:focus,
.kd-probe__card .kkp-form-container select:focus {
    outline: none;
    border-bottom-color: var(--kd-red);
}

.kd-probe__card .kkp-form-group {
    margin-bottom: 22px;
}

.kd-probe__card .kkp-form-group > label {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: .2px;
}

.kd-probe__card .kkp-form-group small {
    font-weight: 400;
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
    margin-left: 4px;
}

.kd-probe__card .row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.kd-probe__card .row > .kkp-form-group {
    flex: 1 1 200px;
    min-width: 0;
}

.kd-probe__card .kkp-radio-group {
    gap: 12px;
    margin-top: 8px;
}

.kd-probe__card .kkp-radio-group label {
    flex: 1;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--kd-r-sm);
    background: rgba(255, 255, 255, .04);
    color: #fff;
    font-weight: 500;
    transition: all .2s ease;
}

.kd-probe__card .kkp-radio-group label:hover {
    border-color: var(--kd-red);
    background: rgba(198, 40, 40, .12);
}

.kd-probe__card .kkp-captcha-group {
    background: rgba(255, 255, 255, .04);
    border-left: 3px solid var(--kd-red);
    border-radius: var(--kd-r-sm);
    padding: 14px 16px;
}

.kd-probe__card .kkp-captcha-group > label {
    margin-bottom: 8px;
}

.kd-probe__card button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    padding: 13px 34px;
    background: #fff;
    color: #111;
    border: none;
    border-radius: var(--kd-r-sm);
    font-family: var(--kd-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .4px;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s, color .2s;
}

.kd-probe__card button[type="submit"]:hover {
    background: var(--kd-red);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(198, 40, 40, .28);
}

.kd-probe__card button[type="submit"]:active {
    transform: scale(.98);
}

@media (max-width: 600px) {
    .kd-probe__card .row {
        gap: 0;
    }
    .kd-probe__card .kkp-radio-group {
        flex-direction: column;
    }
}

/* ═══ DMM CHAT BUBBLE FIX ═══ */
.dmm-chat-bubble {
    position: fixed !important;
    bottom: 40px !important;
    right: 40px !important;
    left: auto !important;
    width: max-content !important;
    z-index: 99998 !important;
}

@media (max-width: 480px) {
    .dmm-chat-bubble {
        right: 16px !important;
        bottom: 24px !important;
    }
}