/* qth-explorer.php — mobil-first, schlanke Landing */

body.qex-body {
    line-height: 1.45;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(56, 189, 248, 0.18), transparent 55%),
        radial-gradient(circle at 85% 15%, rgba(14, 165, 233, 0.12), transparent 40%),
        linear-gradient(165deg, #020617 0%, #0f172a 38%, #0c1929 100%);
    background-attachment: fixed;
}

body.qex-body .top-area {
    display: none;
}

/* Schlanker Mobile-Header */
.qex-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: max(10px, env(safe-area-inset-top, 0)) var(--page-gutter) 8px;
    max-width: 42rem;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.qex-brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    color: #e2e8f0 !important;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 0.04em;
}

.qex-brand-icon {
    font-size: 16px;
    line-height: 1;
}

.qex-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qex-topbar-link {
    padding: 7px 11px;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8 !important;
    border: 1px solid rgba(100, 116, 139, 0.45);
    background: rgba(15, 23, 42, 0.55);
}

.qex-topbar-lang {
    padding: 7px 12px;
    border-radius: 999px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 850;
    color: #7dd3fc !important;
    border: 1px solid rgba(125, 211, 252, 0.45);
    background: rgba(12, 74, 110, 0.35);
}

.qex-page {
    flex: 1;
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
    padding: 4px var(--page-gutter) calc(16px + env(safe-area-inset-bottom, 0));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.qex-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    border: 1px solid rgba(125, 211, 252, 0.38);
    background:
        radial-gradient(ellipse 95% 50% at 50% 0%, rgba(56, 189, 248, 0.2), transparent 58%),
        linear-gradient(168deg, rgba(12, 25, 41, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Suche zuerst auf dem Handy */
.qex-card-inner {
    display: flex;
    flex-direction: column;
}

.qex-search-block {
    order: 1;
    padding: 18px 16px 16px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.16);
    background: rgba(2, 6, 23, 0.42);
}

.qex-hero-block {
    order: 2;
    padding: 18px 16px 14px;
    text-align: center;
}

.qex-foot-block {
    order: 3;
    margin-top: auto;
    padding: 0 16px 14px;
    text-align: center;
}

.qex-kicker {
    margin: 0 0 10px;
    font-size: clamp(0.82rem, 3.2vw, 1rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #7dd3fc;
}

.qex-card h1 {
    margin: 0 0 8px;
    font-size: clamp(1.55rem, 6.5vw, 2.35rem);
    font-weight: 950;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: #f0f9ff;
    text-shadow: 0 2px 24px rgba(56, 189, 248, 0.35);
}

.qex-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 850;
    color: #bae6fd;
    background: rgba(2, 132, 199, 0.22);
    border: 1px solid rgba(125, 211, 252, 0.35);
}

.qex-lead {
    margin: 0 auto;
    max-width: 30rem;
    font-size: clamp(0.92rem, 3.6vw, 1.04rem);
    line-height: 1.48;
    color: #cbd5e1;
}

.qex-lead--full {
    display: none;
}

.qex-lead--short {
    display: block;
}

.qex-chips-wrap {
    margin: 12px -16px 0;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.qex-chips-wrap::-webkit-scrollbar {
    display: none;
}

.qex-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0;
    padding: 2px 0 4px;
    list-style: none;
    width: max-content;
    min-width: 100%;
    justify-content: flex-start;
}

.qex-chips li {
    flex: 0 0 auto;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    color: #e0f2fe;
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(125, 211, 252, 0.28);
}

.qex-field label {
    display: block;
    margin: 0 0 8px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7dd3fc;
}

.qex-field--search {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.qex-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid rgba(125, 211, 252, 0.5);
    background: rgba(2, 6, 23, 0.9);
    color: #f8fafc;
    font: inherit;
    font-size: 16px; /* verhindert iOS-Zoom */
    -webkit-appearance: none;
    appearance: none;
}

.qex-field input::placeholder {
    color: #64748b;
}

.qex-field input:focus {
    outline: 2px solid rgba(125, 211, 252, 0.85);
    outline-offset: 2px;
    border-color: rgba(186, 230, 253, 0.75);
}

.qex-suggest {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    max-height: min(14rem, 38vh);
    overflow: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    text-align: left;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.98);
    border: 1px solid rgba(125, 211, 252, 0.55);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

.qex-suggest.is-open {
    display: block;
}

.qex-suggest li {
    margin: 0;
}

.qex-suggest-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 12px 11px;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    background: transparent;
    color: #e2e8f0;
    font: inherit;
    line-height: 1.35;
    -webkit-tap-highlight-color: transparent;
}

.qex-suggest-btn:hover,
.qex-suggest-btn:focus-visible {
    background: rgba(12, 74, 110, 0.55);
    outline: none;
}

.qex-suggest-btn[aria-selected="true"] {
    background: rgba(14, 116, 144, 0.55);
}

.qex-suggest-foot {
    margin: 4px 0 0;
    padding: 8px 10px 4px;
    border-top: 1px solid rgba(100, 116, 139, 0.35);
    font-size: clamp(10px, 2.7vw, 11px);
    line-height: 1.45;
    color: #94a3b8;
}

.qex-suggest-foot a {
    color: #7dd3fc;
}

.qex-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
}

.qex-submit {
    width: 100%;
    min-height: 48px;
    padding: 14px 20px;
    border-radius: 14px;
    border: 1px solid rgba(186, 230, 253, 0.85);
    background: linear-gradient(180deg, #e0f2fe 0%, #38bdf8 48%, #0284c7 100%);
    color: #0c4a6e;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 950;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(56, 189, 248, 0.35);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.qex-submit:active {
    transform: scale(0.985);
    filter: brightness(0.97);
}

.qex-lang {
    display: none;
}

.qex-recent {
    margin: 0 0 14px;
    padding-top: 4px;
}

.qex-recent-title {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.qex-recent-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.qex-recent-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
    text-decoration: none !important;
    color: #cbd5e1 !important;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(100, 116, 139, 0.45);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qex-recent-link:hover {
    color: #e0f2fe !important;
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(12, 74, 110, 0.38);
}

.qex-links-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    margin: 0 0 8px;
    font-size: 12px;
}

.qex-links-row a {
    color: #fde68a;
    font-weight: 750;
    text-decoration: none;
}

.qex-links-row a:hover {
    text-decoration: underline;
}

.dc1as-osm-notice {
    margin: 10px 0 0;
    padding: 9px 11px;
    border-radius: 9px;
    font-size: clamp(11px, 2.9vw, 12px);
    font-weight: 600;
    line-height: 1.48;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(100, 116, 139, 0.32);
    text-align: left;
}

.dc1as-osm-notice a {
    color: #7dd3fc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dc1as-osm-notice a:hover {
    color: #bae6fd;
}

.qex-field--search .dc1as-osm-notice {
    margin-top: 8px;
}

.qex-pick {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
    text-align: left;
}

.qex-pick li {
    margin: 0;
}

.qex-pick-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 14px 14px;
    min-height: 48px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid rgba(125, 211, 252, 0.35);
    background: rgba(2, 6, 23, 0.6);
    color: #e2e8f0;
    font: inherit;
    line-height: 1.35;
    -webkit-tap-highlight-color: transparent;
}

.qex-pick-btn:active {
    background: rgba(12, 74, 110, 0.55);
}

.qex-pick-btn strong {
    display: block;
    color: #f8fafc;
    font-weight: 800;
}

.qex-pick-kicker {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    color: #94a3b8;
    text-align: left;
}

.qex-err {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.35);
    border: 1px solid rgba(248, 113, 113, 0.45);
    text-align: left;
}

/* Desktop: klassischer Aufbau, volle Nav sichtbar */
@media (min-width: 640px) {
    body.qex-body {
        align-items: center;
        justify-content: center;
    }

    body.qex-body .top-area {
        display: block;
        width: 100%;
        max-width: 42rem;
        margin: 0 auto;
        padding: 10px var(--page-gutter) 0;
        background: transparent;
        border-bottom: 0;
    }

    body.qex-body .top-area > nav.top-nav {
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        max-width: 42rem;
    }

    .qex-topbar {
        display: none;
    }

    .qex-page {
        padding: 8px var(--page-gutter) calc(28px + env(safe-area-inset-bottom, 0));
    }

    .qex-card-inner {
        display: flex;
        flex-direction: column;
    }

    .qex-hero-block {
        order: 1;
        padding: 28px 24px 18px;
    }

    .qex-search-block {
        order: 2;
        padding: 20px 22px 22px;
        border-top: 1px solid rgba(125, 211, 252, 0.22);
        border-bottom: 0;
    }

    .qex-foot-block {
        order: 3;
        padding: 0 22px 18px;
    }

    .qex-lead--full {
        display: block;
    }

    .qex-lead--short {
        display: none;
    }

    .qex-chips-wrap {
        margin: 14px 0 0;
        padding: 0;
        mask-image: none;
        -webkit-mask-image: none;
        overflow: visible;
    }

    .qex-chips {
        flex-wrap: wrap;
        justify-content: center;
        width: auto;
        min-width: 0;
    }

    .qex-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }

    .qex-submit {
        width: auto;
        min-width: 10rem;
        border-radius: 999px;
    }

    .qex-submit:hover {
        filter: brightness(1.08);
        transform: translateY(-1px);
    }

    .qex-lang {
        display: inline-block;
        padding: 12px 18px;
        border-radius: 999px;
        text-decoration: none !important;
        color: #7dd3fc !important;
        border: 1px solid rgba(125, 211, 252, 0.55);
        font-weight: 800;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qex-submit:active,
    .qex-submit:hover {
        transform: none;
    }
}
