/*
 * Zitate im Guden Draht (Issue #394) – kompaktes Zitat über dem Antworttext,
 * Zitatvorschau über dem Eingabefeld der Konsole und die kurze Hervorhebung
 * der Originalzeile. Skript: `chat-zitat.js`. Gemeinsam für Hörerfläche,
 * Einbettung, Webplayer, Redaktion und Studio.
 *
 * Die Oberflächen des Guden Drahts sind durchgehend dunkel; das Zitat trägt
 * seine Farben deshalb selbst und bleibt im Hell- wie im Dunkelmodus des
 * Geräts lesbar.
 */

.rgz-zitat {
    display: flex;
    align-items: stretch;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 36px;
    margin: 4px 0 6px;
    padding: 4px 8px;
    border: 0;
    border-left: 3px solid #da0000;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8e8ee;
    font: inherit;
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
    overflow: hidden;
}
/* Die Konsolenzeile ist ein Raster mit der Werkzeugspalte rechts; das Zitat
   bleibt in der Textspalte unter der Kopfzeile. */
.chatk-nachricht > .rgz-zitat,
.chatk-nachricht > .rgz-hinweis { grid-column: 1; }
button.rgz-zitat { cursor: pointer; }
button.rgz-zitat:hover { background: rgba(255, 255, 255, 0.13); }
button.rgz-zitat:focus-visible { outline: 2px solid #ff3b30; outline-offset: 2px; }
/* Zitat mit Link im Ausschnitt: der Name ist der Sprungknopf. */
.rgz-zitat[data-links="1"] { cursor: pointer; }
.rgz-zitat[data-links="1"]:hover { background: rgba(255, 255, 255, 0.13); }
.rgz-zitat__sprung {
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.rgz-zitat__sprung:focus-visible { outline: 2px solid #ff3b30; outline-offset: 2px; }
.rgz-zitat__inhalt {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}
.rgz-zitat__name { font-weight: 600; color: #ff8a82; }
.rgz-zitat__marke {
    align-self: flex-start;
    padding: 0 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 11px;
}
/* Ein internes Original (Issue #397) – nur in Konsolen, gestrichelt wie die
   interne Zeile selbst. */
.rgz-zitat__marke--intern {
    border: 1px dashed currentColor;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* Höchstens zwei Zeilen – ein langes Zitat bleibt kompakt. */
.rgz-zitat__text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: #d4d4dc;
}
.rgz-zitat__text--bild { font-style: italic; }
.rgz-zitat__entfernt { font-style: italic; color: #b9b9c4; }
.rgz-zitat[data-entfernt="1"] { border-left-color: #6b6b76; }

.rgz-zitat__bild {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}
.rgz-zitat__bild img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rgz-hinweis {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    color: #ffb4ae;
}

/* Die Originalzeile nach dem Antippen des Zitats: kurz, aber deutlich. */
.rgz-treffer {
    outline: 2px solid #ff3b30;
    outline-offset: 2px;
    border-radius: 8px;
    animation: rgz-blinken 1.2s ease-in-out 2;
}
@keyframes rgz-blinken {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(255, 59, 48, 0.22); }
}
@media (prefers-reduced-motion: reduce) {
    .rgz-treffer { animation: none; background-color: rgba(255, 59, 48, 0.18); }
}

/* ── Die Vorschau über dem Eingabefeld ──────────────────────────────────── */
.rgz-vorschau {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    box-sizing: border-box;
    margin: 0 0 6px;
    padding: 6px 6px 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 3px solid #da0000;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: #f5f5f7;
    font-size: 13px;
}
.rgz-vorschau[hidden] { display: none; }
.rgz-vorschau[data-ungueltig="1"] { border-color: #ff9f0a; border-left-color: #ff9f0a; }
.rgz-vorschau__kopf { font-size: 11px; color: #b9b9c4; text-transform: none; }
.rgz-vorschau__zu {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #f5f5f7;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.rgz-vorschau__zu:hover { background: rgba(255, 255, 255, 0.12); }
.rgz-vorschau__zu:focus-visible { outline: 2px solid #ff3b30; outline-offset: 2px; }
.rgz-vorschau__inhalt {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.rgz-vorschau__hinweis {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    color: #ffcf8a;
    font-size: 12px;
}
