/* ════════════════════════════════════════════════════
   controls/signal-card.css — the shared signal card (AB#13100)
   ════════════════════════════════════════════════════
   Every selector is namespaced `.lp-signal-card*`; the card sets no width of its
   own — the grid that holds it decides. Colours and radii come from the skin
   tokens, never from literals (ui-design-scope.md). */

.lp-signal-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 14px 14px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.lp-signal-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.lp-signal-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lp-signal-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* The preview, when the card has one. No rule reserves space without it — the
   element is simply absent, so a preview-less card is shorter rather than
   topped by an empty frame. `container-type` and `position` are what the
   plugin's own absolutely-positioned thumbnail measures itself against. */
.lp-signal-card-preview {
    position: relative;
    container-type: inline-size;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    margin: -14px -14px 0;
    border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
    background: var(--bg-primary);
}
/* A rendered site expects a white page under it and its own markup may be
   transparent; a slide does not, and keeps the dark ground. Mirrors
   `.signal-card--website .signal-card-chrome-content:has(.signal-thumbnail)` in
   css/apps/signals.css — BOTH plugins emit .signal-thumbnail, so the type is
   what discriminates, not the presence of a frame. The literal is deliberate:
   this is the page's own ground, not a theme colour, and it is white in both. */
.lp-signal-card[data-signal-type="website"] .lp-signal-card-preview:has(.signal-thumbnail) {
    background: #fff;
}
.lp-signal-card-preview > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Title first, then the type icon directly beside it (AB#13556); the menu, when
   drawn, at the right edge. The title takes only the width its text needs and
   shrinks with an ellipsis, so the icon follows the text and stays visible. */
.lp-signal-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.lp-signal-card-title {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--fs-body-lg);
    font-weight: 600;
    line-height: var(--lh-snug);
}
.lp-signal-card-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
}
.lp-signal-card-icon svg { width: 16px; height: 16px; }
.lp-signal-card-menu {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: -4px -6px -4px auto;
    padding: 0;
    border: 0;
    border-radius: var(--radius, 8px);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 150ms ease, background 150ms ease, color 150ms ease;
}
.lp-signal-card:hover .lp-signal-card-menu,
.lp-signal-card:focus-within .lp-signal-card-menu { opacity: 1; }
.lp-signal-card-menu:hover { background: var(--bg-primary); color: var(--text-primary); }
.lp-signal-card-menu:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 1px; }

/* Below: the Space it belongs to, and when it was last modified. */
.lp-signal-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    font-size: var(--fs-ui);
    color: var(--text-secondary);
}
.lp-signal-card-space {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.lp-signal-card-space-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}
.lp-signal-card-space-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* The neutral placeholder for a Space the snapshot cannot resolve. */
.lp-signal-card-space.is-unresolved { color: var(--text-muted); }
.lp-signal-card-date {
    flex-shrink: 0;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

@media (hover: none) {
    /* No hover on touch: the menu button is always visible. */
    .lp-signal-card-menu { opacity: 1; }
}
