/* Globale Suche — Icon + Popup */

.mk-search {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    font-family: 'DM Sans', sans-serif;
}

.mk-search__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #efcc5c;
    cursor: pointer;
    box-shadow: none;
    transition: none;
}

.mk-search__trigger:hover,
.mk-search__trigger:focus,
.mk-search__trigger:focus-visible,
.mk-search__trigger:active {
    color: #efcc5c;
    background: transparent;
    outline: none;
    box-shadow: none;
    transform: none;
    opacity: 1;
}

.mk-search__icon,
.mk-search__bar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #efcc5c;
    line-height: 0;
}

.mk-search__icon svg,
.mk-search__bar-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

.mk-search__popup[hidden] {
    display: none !important;
}

.mk-search__popup {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem) clamp(0.75rem, 3vw, 1.5rem);
    box-sizing: border-box;
}

.mk-search__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 30, 38, 0.72);
    cursor: pointer;
}

.mk-search__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(640px, 100%);
    max-height: min(80dvh, 720px);
    margin-top: clamp(0.5rem, 8vh, 4rem);
    background: #00576a;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    color: #fff;
}

.mk-search__bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.mk-search__bar-icon {
    display: inline-flex;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #fff;
}

.mk-search__input {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0.35rem 0;
    border: 0;
    background: transparent;
    color: #fff !important;
    font-family: inherit;
    font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.25rem);
    font-weight: 500;
    line-height: 1.3;
    outline: none;
    box-shadow: none;
    -webkit-text-fill-color: #fff;
}

.mk-search__input::placeholder {
    color: rgba(255, 255, 255, 0.55);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.55);
}

.mk-search__input::-webkit-search-decoration,
.mk-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.mk-search__close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.mk-search__close:hover,
.mk-search__close:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.mk-search__status {
    padding: 0.65rem 1rem 0;
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.9rem;
    min-height: 1.4em;
}

.mk-search__status:empty {
    display: none;
}

.mk-search__results {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 0.75rem;
    overflow-y: auto;
    flex: 1 1 auto;
    background: #00576a;
    scrollbar-width: thin;
    scrollbar-color: #efcc5c #00576a;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mk-search__results::-webkit-scrollbar {
    width: 10px;
}

.mk-search__results::-webkit-scrollbar-track {
    background: #00576a;
    border-radius: 0 0 12px 0;
}

.mk-search__results::-webkit-scrollbar-thumb {
    background: #efcc5c;
    border-radius: 8px;
    border: 2px solid #00576a;
}

.mk-search__results::-webkit-scrollbar-thumb:hover {
    background: #f5d76a;
}

.mk-search__results::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.mk-search__panel {
    scrollbar-width: thin;
    scrollbar-color: #efcc5c #00576a;
}

.mk-search__panel::-webkit-scrollbar {
    width: 10px;
}

.mk-search__panel::-webkit-scrollbar-track {
    background: #00576a;
}

.mk-search__panel::-webkit-scrollbar-thumb {
    background: #efcc5c;
    border-radius: 8px;
    border: 2px solid #00576a;
}

.mk-search__result {
    margin: 0;
    padding: 0;
    border: 0;
    position: relative;
}

.mk-search__result::after {
    display: none;
}

.mk-search__result a,
.mk-search__result a:visited,
.mk-search__result a:hover,
.mk-search__result a:focus,
.mk-search__result a:active {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: calc(0.45rem + 10px); /* Badge → Titel +10px */
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 1.1rem 1rem; /* oben/unten gleich */
    color: #fff !important;
    text-align: left;
    text-decoration: none !important;
    border: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.22); /* Divider 100% */
    border-left: 3px solid transparent;
    background: transparent;
    transition: background-color 0.15s ease, border-left-color 0.15s ease;
}

.mk-search__result:last-child a {
    border-bottom: none;
}

.mk-search__result a:hover,
.mk-search__result a:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: #efcc5c;
    outline: none;
}

/* CPT-Label: Badge, gelb transparent */
.mk-search__result-type {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(239, 204, 92, 0.28);
    color: #efcc5c !important;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
}

/* Beitragstitel: weiß, linksbündig */
.mk-search__result-title {
    display: block;
    margin: 0;
    color: #fff !important;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
}

.mk-search__result-excerpt {
    display: none !important;
}

html.mk-search-open,
html.mk-search-open body {
    overflow: hidden;
}

html.mk-search-open {
    padding-right: var(--mk-scrollbar-compensate, 0px);
}

html.mk-search-open .breakdance .bde-header-builder,
html.mk-search-open .bde-header-builder {
    padding-right: var(--mk-scrollbar-compensate, 0px);
}

@media (max-width: 520px) {
    .mk-search__popup {
        padding: 0;
        align-items: stretch;
    }

    .mk-search__panel {
        width: 100%;
        max-height: 100dvh;
        margin-top: 0;
        border-radius: 0;
    }
}
