/**
 * Wortsalat-Generator
 *
 * Identisch gepflegt in Blocksy-Child und im MVC
 * (tempteria-mvc/public/assets/css/tools/word-salad-generator.css).
 * Aenderungen bitte immer in beide Dateien uebertragen.
 *
 * Farbquelle: erst Blocksy-Palette, dann MVC-Brandvariablen, dann Hex-Fallback.
 */

.wsg {
    --ws-accent: var(--theme-palette-color-1, var(--brand-blue, #2872fa));
    --ws-mark: var(--brand-yellow, #ffd800);
    --ws-ink: var(--theme-headings-color, var(--ink, #1f1f1f));
    --ws-text: var(--theme-text-color, var(--muted, #5a5a5a));
    --ws-surface: var(--surface, #fff);
    --ws-surface-2: var(--surface-2, #f4f6fb);
    --ws-line: var(--border, #e5e7ea);
    --ws-radius: 16px;
    --ws-radius-sm: 10px;

    margin: 2.5rem 0;
    color: var(--ws-text);
    container-type: inline-size;
}

html[data-theme="dark"] .wsg {
    --ws-surface: var(--surface, #111a2e);
    --ws-surface-2: var(--surface-2, #162038);
    --ws-line: var(--border, #1e2942);
    --ws-ink: var(--ink, #e8ecf4);
    --ws-text: var(--muted, #9aa7bd);
}

.wsg *,
.wsg *::before,
.wsg *::after {
    box-sizing: border-box;
}

.wsg__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@container (max-width: 720px) {
    .wsg__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@supports not (container-type: inline-size) {
    @media (max-width: 782px) {
        .wsg__grid {
            grid-template-columns: minmax(0, 1fr);
        }
    }
}

.wsg__panel,
.wsg__result {
    background: var(--ws-surface);
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius);
    padding: 1.4rem;
}

.wsg__result {
    display: block;
}

.wsg__legend {
    display: block;
    margin: 0 0 0.9rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ws-accent);
}

/* ------------------------------------------------------------- Modus-Chips */

.wsg__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
}

.wsg__chip {
    padding: 0.45rem 0.75rem;
    font: inherit;
    font-size: 0.85rem;
    line-height: 1.2;
    color: var(--ws-ink);
    background: var(--ws-surface-2);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wsg__chip:hover {
    border-color: var(--ws-accent);
}

.wsg__chip[aria-pressed="true"] {
    background: var(--ws-accent);
    border-color: var(--ws-accent);
    color: #fff;
}

.wsg__chip:focus-visible,
.wsg__textarea:focus-visible,
.wsg__select:focus-visible,
.wsg__copy:focus-visible,
.wsg__again:focus-visible,
.wsg__check input:focus-visible {
    outline: 2px solid var(--ws-accent);
    outline-offset: 2px;
}

/* -------------------------------------------------------------- Texteingabe */

.wsg__field > label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ws-ink);
}

.wsg__textarea {
    width: 100%;
    min-height: 9rem;
    padding: 0.85rem;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--ws-ink);
    background: var(--ws-surface-2);
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius-sm);
    resize: vertical;
    transition: border-color 0.15s;
}

.wsg__textarea:focus {
    border-color: var(--ws-accent);
}

.wsg__meter {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    opacity: 0.75;
}

.wsg__meter.is-full {
    color: var(--danger, #d63637);
    opacity: 1;
}

/* -------------------------------------------------------------- Einstellungen */

.wsg__options {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--ws-line);
}

.wsg__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.wsg__row label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ws-ink);
}

.wsg__select {
    width: 8rem;
    padding: 0.45rem 0.6rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--ws-ink);
    background: var(--ws-surface-2);
    border: 1px solid var(--ws-line);
    border-radius: var(--ws-radius-sm);
}

.wsg__check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.82rem;
    line-height: 1.45;
    cursor: pointer;
}

.wsg__check input {
    margin: 0.2rem 0 0;
    accent-color: var(--ws-accent);
    flex: none;
}

.wsg__again {
    width: 100%;
    margin-top: 1.2rem;
    padding: 0.8rem 1.2rem;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--ws-accent);
    border: 0;
    border-radius: var(--ws-radius-sm);
    cursor: pointer;
    transition: filter 0.15s;
}

.wsg__again:hover {
    filter: brightness(0.92);
}

.wsg__hint {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    line-height: 1.45;
    opacity: 0.75;
}

/* ------------------------------------------------------------------ Ergebnis */

.wsg__result-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--ws-line);
}

.wsg__result-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ws-ink);
}

.wsg__result-meta {
    font-size: 0.75rem;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}

.wsg__variants {
    display: grid;
    gap: 0.7rem;
}

.wsg__variant {
    padding: 0.9rem 1rem;
    background: var(--ws-surface-2);
    border-radius: var(--ws-radius-sm);
}

.wsg__variant-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.wsg__variant-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
}

.wsg__variant-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--ws-ink);
    overflow-wrap: break-word;
}

/* Woerter, die zufaellig an ihrer alten Stelle geblieben sind. */
.wsg__stay {
    border-bottom: 2px solid var(--ws-mark);
}

.wsg__copy {
    padding: 0.3rem 0.7rem;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ws-ink);
    background: var(--ws-surface);
    border: 1px solid var(--ws-line);
    border-radius: 999px;
    cursor: pointer;
    flex: none;
    transition: border-color 0.15s, color 0.15s;
}

.wsg__copy:hover {
    border-color: var(--ws-accent);
    color: var(--ws-accent);
}

.wsg__copy.is-done {
    border-color: var(--ws-accent);
    background: var(--ws-accent);
    color: #fff;
}

.wsg__empty {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.88rem;
    opacity: 0.7;
}

.wsg__note {
    margin: 1rem 0 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--ws-line);
    font-size: 0.75rem;
    line-height: 1.5;
    opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
    .wsg *,
    .wsg *::before,
    .wsg *::after {
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================================
   Beitragsinhalt (.ws-prose)
   Gleiche Struktur wie bei den anderen Rechnern.
   ========================================================================= */

.ws-prose {
    --ws-accent: var(--theme-palette-color-1, var(--brand-blue, #2872fa));
    --ws-mark: var(--brand-yellow, #ffd800);
    --ws-ink: var(--theme-headings-color, var(--ink, #1f1f1f));
    --ws-text: var(--theme-text-color, var(--muted, #5a5a5a));
    --ws-surface-2: var(--surface-2, #f7f8fb);
    --ws-line: var(--border, #e5e7ea);
    --ws-soft: var(--soft-blue, #eaf1ff);

    max-width: none;
    color: var(--ws-text);
}

html[data-theme="dark"] .ws-prose {
    --ws-surface-2: var(--surface-2, #162038);
    --ws-line: var(--border, #1e2942);
    --ws-ink: var(--ink, #e8ecf4);
    --ws-text: var(--muted, #9aa7bd);
    --ws-soft: var(--soft-blue, #14213f);
}

.ws-prose p {
    margin: 0 0 16px;
    line-height: 1.72;
    color: var(--ws-text);
}

.ws-prose h3 {
    margin: 0 0 8px;
    font-size: 17px;
    color: var(--ws-ink);
}

.ws-prose b,
.ws-prose strong {
    color: var(--ws-ink);
}

.ws-prose .ws-callout {
    margin: 26px 0;
    padding: 18px 22px;
    background: var(--ws-soft);
    border-left: 4px solid var(--ws-accent);
    border-radius: 0 12px 12px 0;
}

.ws-prose .ws-sample {
    margin: 0 0 10px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ws-ink);
}

.ws-prose .ws-sample:last-child {
    margin-bottom: 0;
}

.ws-prose .ws-sample b {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    opacity: 0.7;
    font-weight: 700;
}

.ws-prose .ws-table-wrap {
    overflow-x: auto;
    margin: 0 0 8px;
}

.ws-prose .ws-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.ws-prose .ws-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 12.5px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--ws-text);
    border-bottom: 1px solid var(--ws-line);
}

.ws-prose .ws-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--ws-line);
    color: var(--ws-text);
}

.ws-prose .ws-table td:first-child {
    font-weight: 700;
    color: var(--ws-ink);
    white-space: nowrap;
}

.ws-prose .ws-table tr:last-child td {
    border-bottom: 0;
}

.ws-prose .ws-table tr.is-marked td:first-child {
    box-shadow: inset 3px 0 0 var(--ws-mark);
    padding-left: 18px;
}

.ws-prose .ws-compare {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 24px 0 8px;
}

.ws-prose .ws-compare-card {
    padding: 22px;
    background: var(--ws-surface-2);
    border: 1px solid var(--ws-line);
    border-radius: 15px;
}

.ws-prose .ws-compare-card p:last-child {
    margin: 0;
    font-size: 14.5px;
}

.ws-prose .ws-figure {
    margin-bottom: 12px !important;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: var(--ws-accent) !important;
}

.ws-prose .ws-faq details {
    border-bottom: 1px solid var(--ws-line);
}

.ws-prose .ws-faq summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    font-weight: 700;
    color: var(--ws-ink);
    cursor: pointer;
    list-style: none;
}

.ws-prose .ws-faq summary::-webkit-details-marker {
    display: none;
}

.ws-prose .ws-faq summary::after {
    content: "+";
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 400;
    color: var(--ws-accent);
    transition: transform 0.2s;
}

.ws-prose .ws-faq details[open] summary::after {
    transform: rotate(45deg);
}

.ws-prose .ws-faq details p {
    margin: 0 0 18px;
    padding-right: 36px;
}

@media (prefers-reduced-motion: reduce) {
    .ws-prose .ws-faq summary::after {
        transition: none;
    }
}
