/* Gesamter Bereich */
.sp-wrapper {
    --sp-ink: #171717;
    --sp-paper: #fff;
    --sp-line: rgba(0, 0, 0, 0.28);
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Shuffle + Schlagwortauswahl: auch auf Mobile immer nebeneinander. */
.sp-controls {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 25px;
}

.sp-shuffle-button,
.sp-tag-select {
    min-height: 50px;
    border: 1px solid var(--sp-ink);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    box-sizing: border-box;
}

.sp-shuffle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 180px;
    background: var(--sp-ink);
    color: var(--sp-paper);
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: transform .2s ease, opacity .2s ease, background .2s ease, color .2s ease;
}

.sp-shuffle-icon {
    font-size: 22px;
    line-height: 1;
}

.sp-shuffle-button:hover,
.sp-shuffle-button:focus-visible {
    background: transparent;
    color: var(--sp-ink);
    transform: translateY(-2px);
}

.sp-select-wrap {
    position: relative;
    display: inline-flex;
    min-width: 170px;
    max-width: 260px;
    flex: 0 1 220px;
}

.sp-tag-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    color: inherit;
    padding: 12px 42px 12px 18px;
    border-color: var(--sp-line);
    border-radius: 999px;
    line-height: 1.2;
    text-overflow: ellipsis;
    transition: border-color .2s ease;
}

.sp-select-wrap::after {
    content: "⌄";
    position: absolute;
    right: 17px;
    top: 50%;
    transform: translateY(-56%);
    pointer-events: none;
    font-size: 18px;
    line-height: 1;
}

.sp-tag-select:hover,
.sp-tag-select:focus-visible {
    border-color: var(--sp-ink);
}

.sp-shuffle-button:focus-visible,
.sp-tag-select:focus-visible {
    outline: 2px solid var(--sp-ink);
    outline-offset: 3px;
}

.sp-shuffle-button:disabled,
.sp-shuffle-button.loading,
.sp-tag-select:disabled {
    opacity: .55;
    cursor: wait;
    transform: none;
}

/* Beitrag */
.sp-post {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sp-image { width: 100%; line-height: 0; }
.sp-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: cover;
}

.sp-content { padding: 25px; }
.sp-title { margin: 0 0 15px; font-size: 28px; line-height: 1.2; }
.sp-text { font-size: 17px; line-height: 1.7; color: #444; }

.sp-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.sp-tag { display: inline-block; background: #f1f1f1; color: #555; padding: 5px 10px; border-radius: 15px; font-size: 13px; }

.sp-post-container { transition: opacity 0.2s ease; }
.sp-post-container.sp-changing { opacity: 0.3; }
.sp-no-posts { padding: 40px 20px; text-align: center; background: #f7f7f7; border-radius: 10px; }

/* Mobile: Controls bleiben nebeneinander; Beitrag nutzt fast die ganze Breite. */
@media (max-width: 600px) {
    .sp-wrapper {
        width: calc(100% + 24px);
        max-width: none;
        margin-left: -12px;
        margin-right: -12px;
        padding: 6px;
    }

    .sp-controls {
        flex-wrap: nowrap;
        gap: 6px;
        padding: 0 4px;
        margin-bottom: 18px;
    }

    .sp-shuffle-button,
    .sp-tag-select {
        min-height: 46px;
        font-size: 14px;
    }

    .sp-shuffle-button {
        min-width: 0;
        flex: 0 0 auto;
        padding: 10px 16px;
        gap: 7px;
    }

    .sp-shuffle-icon { font-size: 19px; }

    .sp-select-wrap {
        min-width: 0;
        max-width: none;
        flex: 1 1 auto;
    }

    .sp-tag-select {
        min-width: 0;
        padding: 10px 34px 10px 13px;
    }

    .sp-select-wrap::after { right: 13px; }

    .sp-content { padding: 16px; }
    .sp-title { font-size: 23px; }
    .sp-text { font-size: 16px; line-height: 1.6; }
}
