/* ── linkvorschau – Vorschau-Karte ─────────────────────────────────────── */

/* Unser leerer oembed-Platzhalter soll nie sichtbar sein.
   Die eigentliche Vorschau wird per JS als Geschwisterelement eingefügt. */
.oembed_snippet.lp-oembed-preview {
    display: none !important;
}

.lp-card {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 10px;
    background: #fff;
    text-decoration: none !important;
    color: inherit !important;
    transition: box-shadow 0.15s ease;
    max-width: 560px;
}

.lp-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Bild-Bereich (links) */
.lp-card__image {
    flex: 0 0 120px;
    width: 120px;
    min-height: 90px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lp-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lp-card__image--placeholder {
    color: #bbb;
    font-size: 32px;
}

/* Text-Bereich (rechts) */
.lp-card__body {
    flex: 1;
    padding: 10px 12px;
    overflow: hidden;
    min-width: 0;
}

.lp-card__site {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lp-card__favicon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.lp-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin: 0 0 4px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-card__desc {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Schließen-Button (im Formular-Modus) */
.lp-card__close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    display: none;
}

.lp-card-wrapper {
    position: relative;
    display: inline-block; /* shrink to card width */
}

.lp-card-wrapper:hover .lp-card__close {
    display: block;
}

/* Lade-Spinner */
.lp-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

.lp-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #ddd;
    border-top-color: #888;
    border-radius: 50%;
    animation: lp-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes lp-spin {
    to { transform: rotate(360deg); }
}

/* Dark-Mode-Anpassung (falls HumHub ein Dark-Theme nutzt) */
@media (prefers-color-scheme: dark) {
    .lp-card {
        background: #2a2a2a;
        border-color: #444;
    }
    .lp-card__title { color: #eee; }
    .lp-card__desc  { color: #aaa; }
    .lp-card__site  { color: #777; }
    .lp-card__image { background: #333; }
}
