/* ==========================================================
   STSBW Offcanvas Navigation + Archivfilter V4
   ========================================================== */

.stsbw-nav-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.stsbw-nav-toggle span {
    display: block;
    width: 32px;
    height: 4px;
    border-radius: 0;
    background: #ADE4F8;
}

/* Offcanvas */
.stsbw-offcanvas {
    position: fixed;
    inset: 0;
    z-index: 999999;
    pointer-events: none;
    visibility: hidden;
}

.stsbw-offcanvas.is-open {
    pointer-events: auto;
    visibility: visible;
}

.stsbw-offcanvas__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.stsbw-offcanvas.is-open .stsbw-offcanvas__overlay {
    opacity: 1;
}

.stsbw-offcanvas__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100vh;
    overflow: hidden;
    background: #fff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.18);
    transform: translateX(16px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.stsbw-offcanvas.is-open .stsbw-offcanvas__panel {
    transform: translateX(0);
    opacity: 1;
}

body.stsbw-nav-open { overflow: hidden; }

.stsbw-offcanvas__topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 64px;
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
}

.stsbw-offcanvas__close,
.stsbw-offcanvas__back {
    border: 0;
    background: transparent;
    color: #000;
    cursor: pointer;
    font: inherit;
}

.stsbw-offcanvas__close {
    justify-self: end;
    font-size: 34px;
    line-height: 1;
}

.stsbw-offcanvas__back {
    justify-self: start;
    font-size: 16px;
    font-weight: 600;
}

.stsbw-offcanvas__slides { position: relative; overflow: hidden; }

.stsbw-offcanvas__slide {
    display: none;
    padding: 22px 20px 28px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
}

.stsbw-offcanvas__slide.is-active { display: block; }

.stsbw-offcanvas h3,
.stsbw-offcanvas__section-title {
    margin: 0 0 14px;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 800;
}

.stsbw-offcanvas__section-title { margin-top: 50px; }

.stsbw-nav-list { display: flex; flex-direction: column; gap: 14px; }
.stsbw-nav-list--basel-west { margin-bottom: 36px; }

.stsbw-nav-card,
.stsbw-nav-row,
.stsbw-nav-list--simple a,
.stsbw-nav-all {
    text-decoration: none;
    color: inherit;
}

.stsbw-nav-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: 14px 16px;
    border: 0;
    border-radius: 0;
    background: var(--stsbw-bg, #eee);
    color: var(--stsbw-text, #000);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.stsbw-nav-card:hover {
    background: var(--stsbw-hover-bg, #000);
    color: var(--stsbw-hover-text, #fff);
    transform: translateX(2px);
}

.stsbw-nav-card__arrow,
.stsbw-nav-row__arrow,
.stsbw-nav-list--simple a span {
    font-size: 24px;
    line-height: 1;
}

.stsbw-nav-list--simple a,
.stsbw-nav-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    min-height: 56px;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    font-weight: 650;
}

/* Icons */
.stsbw-nav__icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
}

.stsbw-nav__icon-img {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.stsbw-nav__icon i,
.stsbw-nav__icon .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    line-height: 22px;
}

.stsbw-quartier-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 112px;
    margin: 0 0 28px;
    padding: 24px;
    background: var(--stsbw-active-bg, var(--stsbw-bg, #eee));
    color: var(--stsbw-active-text, var(--stsbw-text, #000));
    font-size: 24px;
    line-height: 1.1;
    text-align: center;
}

.stsbw-nav-all {
    display: block;
    padding: 16px;
    background: var(--stsbw-bg, #eef7ff);
    color: var(--stsbw-text, #000);
    text-align: center;
    font-weight: 700;
}

/* ==========================================================
   Archiv Hero V4 - Klare Hierarchie
   ========================================================== */

.stsbw-archive-hero {
    width: min(1500px, calc(100% - 64px)) !important;
    max-width: 1500px !important;
    margin: 20px auto 48px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    background: var(--stsbw-active-bg, var(--stsbw-bg, #3576D8)) !important;
    color: var(--stsbw-active-text, var(--stsbw-text, #fff)) !important;
    overflow: hidden !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08) !important;
}

.stsbw-archive-hero__inner,
.stsbw-archive-hero.no-icon .stsbw-archive-hero__inner {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 42px !important;
    width: 100% !important;
    max-width: none !important;
    padding: 56px 96px !important;
}

.stsbw-archive-hero.no-icon .stsbw-archive-hero__inner {
    grid-template-columns: minmax(0, 1fr) !important;
}

.stsbw-archive-hero__icon {
    width: 86px !important;
    height: 86px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.18) !important;
    border: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.stsbw-archive-hero__icon .stsbw-nav__icon,
.stsbw-archive-hero__icon .stsbw-nav__icon-img {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    object-fit: cover !important;
}

.stsbw-archive-hero__icon .dashicons,
.stsbw-archive-hero__icon i {
    font-size: 46px !important;
    width: 46px !important;
    height: 46px !important;
    line-height: 46px !important;
}

.stsbw-archive-hero__content {
    min-width: 0 !important;
}

.stsbw-archive-hero__title {
    margin: 0 0 8px !important;
    color: inherit !important;
    font-size: clamp(48px, 4vw, 72px) !important;
    line-height: 1 !important;
    font-weight: 850 !important;
    letter-spacing: -0.025em !important;
    white-space: normal !important;
}

.stsbw-archive-hero__subtitle {
    margin: 0 0 14px !important;
    color: inherit !important;
    font-size: clamp(25px, 2.25vw, 34px) !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
}

.stsbw-archive-intro {
    max-width: 820px !important;
    margin: 0 !important;
    color: inherit !important;
    font-size: 18px !important;
    line-height: 1.45 !important;
}

.stsbw-archive-intro p {
    margin: 0 !important;
}

/* ==========================================================
   Archiv Filter V4 - Quartier Dropdown + Inhaltstyp Textlinks
   ========================================================== */

.stsbw-archive-filter--v4 {
    width: min(1240px, calc(100% - 48px)) !important;
    margin: 0 auto 62px !important;
    display: grid !important;
    grid-template-columns: 370px minmax(0, 1fr) !important;
    gap: 70px !important;
    align-items: start !important;
}

.stsbw-filter-v4__quartier {
    position: relative !important;
    z-index: 10 !important;
}

.stsbw-filter-v4__current {
    width: 100% !important;
    min-height: 66px !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 0 28px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--stsbw-active-bg, var(--stsbw-bg, #3576D8)) !important;
    color: var(--stsbw-active-text, var(--stsbw-text, #fff)) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.13) !important;
    font-family: inherit !important;
    font-size: 22px !important;
    font-weight: 850 !important;
    line-height: 1.1 !important;
    text-align: left !important;
    cursor: pointer !important;
    appearance: none !important;
}

.stsbw-filter-v4__current .stsbw-nav__icon,
.stsbw-filter-v4__current .stsbw-nav__icon-img {
    width: 24px !important;
    height: 24px !important;
    flex-basis: 24px !important;
    color: inherit !important;
    object-fit: contain !important;
}

.stsbw-filter-v4__current .dashicons,
.stsbw-filter-v4__current i {
    font-size: 23px !important;
    width: 23px !important;
    height: 23px !important;
    line-height: 23px !important;
}

.stsbw-filter-v4__chevron {
    color: inherit !important;
    font-size: 26px !important;
    line-height: 1 !important;
}

.stsbw-filter-v4__dropdown {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: 8px !important;
    width: calc(100% - 16px) !important;
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 6px !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.15) !important;
    padding: 8px !important;
}

.stsbw-filter-v4__option {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    gap: 12px !important;
    align-items: center !important;
    min-height: 46px !important;
    padding: 10px 12px !important;
    border-radius: 4px !important;
    color: #111 !important;
    text-decoration: none !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.stsbw-filter-v4__option:hover,
.stsbw-filter-v4__option.is-active {
    background: color-mix(in srgb, var(--stsbw-active-bg, var(--stsbw-bg, #3576D8)) 12%, white) !important;
    color: color-mix(in srgb, var(--stsbw-active-bg, var(--stsbw-bg, #3576D8)) 70%, #000) !important;
}

.stsbw-filter-v4__option .stsbw-nav__icon,
.stsbw-filter-v4__option .stsbw-nav__icon-img {
    width: 24px !important;
    height: 24px !important;
    flex-basis: 24px !important;
    object-fit: contain !important;
}

.stsbw-filter-v4__check {
    color: var(--stsbw-active-bg, var(--stsbw-bg, #3576D8)) !important;
    visibility: hidden !important;
}

.stsbw-filter-v4__option.is-active .stsbw-filter-v4__check {
    visibility: visible !important;
}

.stsbw-filter-v4__types {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 36px !important;
    padding-top: 13px !important;
    border-bottom: 1px solid #e8e8e8 !important;
}

.stsbw-filter-v4__type {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-height: 52px !important;
    padding: 0 0 18px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #111 !important;
    text-decoration: none !important;
    font-size: 19px !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
}

.stsbw-filter-v4__type .stsbw-nav__icon,
.stsbw-filter-v4__type .stsbw-nav__icon-img {
    width: 22px !important;
    height: 22px !important;
    flex-basis: 22px !important;
    object-fit: contain !important;
}

.stsbw-filter-v4__type:hover,
.stsbw-filter-v4__type.is-active {
    color: var(--stsbw-active-bg, var(--stsbw-bg, #3576D8)) !important;
}

.stsbw-filter-v4__type.is-active {
    font-weight: 850 !important;
}

.stsbw-filter-v4__type.is-active::before {
    content: '' !important;
    position: absolute !important;
    top: -16px !important;
    left: 50% !important;
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: currentColor !important;
    transform: translateX(-50%) !important;
}

.stsbw-filter-v4__type.is-active::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: -1px !important;
    height: 3px !important;
    background: currentColor !important;
}

/* Legacy fallback */
.stsbw-filter-pill {
    text-decoration: none !important;
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 1100px) {
    .stsbw-archive-filter--v4 {
        grid-template-columns: 330px minmax(0, 1fr) !important;
        gap: 40px !important;
    }

    .stsbw-filter-v4__types {
        gap: 24px !important;
    }

    .stsbw-filter-v4__type {
        font-size: 17px !important;
    }
}

@media (max-width: 900px) {
    .stsbw-archive-hero,
    .stsbw-archive-filter--v4 {
        width: min(100% - 36px, 1240px) !important;
    }

    .stsbw-archive-hero__inner,
    .stsbw-archive-hero.no-icon .stsbw-archive-hero__inner {
        gap: 28px !important;
        padding: 44px 30px !important;
    }

    .stsbw-archive-hero__icon {
        width: 74px !important;
        height: 74px !important;
    }

    .stsbw-archive-hero__title {
        font-size: clamp(42px, 9vw, 64px) !important;
    }

    .stsbw-archive-filter--v4 {
        grid-template-columns: 1fr !important;
        gap: 22px !important;
    }

    .stsbw-filter-v4__types {
        justify-content: flex-start !important;
        overflow-x: auto !important;
        gap: 28px !important;
        padding-bottom: 0 !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-width: 767px) {
    .stsbw-offcanvas__panel {
        width: 100vw !important;
    }

    .stsbw-offcanvas__slide {
        padding: 20px 18px 28px !important;
    }

    .stsbw-quartier-header {
        margin: -20px -18px 20px !important;
    }
}

@media (max-width: 640px) {
    .stsbw-archive-hero__inner,
    .stsbw-archive-hero.no-icon .stsbw-archive-hero__inner {
        display: block !important;
        padding: 34px 24px !important;
    }

    .stsbw-archive-hero__icon {
        width: 64px !important;
        height: 64px !important;
        margin: 0 0 20px !important;
    }

    .stsbw-archive-hero__title {
        font-size: 42px !important;
        white-space: normal !important;
    }

    .stsbw-archive-hero__subtitle {
        font-size: 25px !important;
    }

    .stsbw-filter-v4__current {
        min-height: 58px !important;
        font-size: 18px !important;
        padding: 0 18px !important;
    }

    .stsbw-filter-v4__types {
        display: block !important;
        border: 1px solid #ddd !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        background: #fff !important;
    }

    .stsbw-filter-v4__type {
        display: flex !important;
        justify-content: flex-start !important;
        min-height: 48px !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        border-bottom: 1px solid #eee !important;
    }

    .stsbw-filter-v4__type:last-child {
        border-bottom: 0 !important;
    }

    .stsbw-filter-v4__type.is-active::before {
        display: none !important;
    }

    .stsbw-filter-v4__type.is-active::after {
        left: auto !important;
        right: 16px !important;
        top: 50% !important;
        bottom: auto !important;
        width: 8px !important;
        height: 8px !important;
        border-radius: 50% !important;
        transform: translateY(-50%) !important;
    }
}
