/* linked-items-panel.css
 * Horizontal strip below the editor body, above the attachments strip.
 * Visually matches .lp-attach-strip so the two related metadata blocks feel
 * like one column — uppercase label, border-top separator, no side rail.
 * All colors via theme variables — no hardcoded hex.
 */

.cn-linked-items {
    margin-top: 28px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-sans);
}

.cn-linked-items-head {
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Four horizontal columns: entities · research · other writing · inbound */
.cn-linked-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: start;
}

.cn-linked-items details {
    min-width: 0;
    padding: 0;
    border: none;
}

.cn-linked-items summary {
    font-size: 0.78em;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 0;
    cursor: pointer;
    list-style: none;
}

.cn-linked-items summary::-webkit-details-marker {
    display: none;
}

.cn-linked-items summary:hover {
    color: var(--text-primary);
}

.cn-linked-items details[open] summary {
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* Item rows — vertical stack within each column */
.cn-linked-item-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    font-size: 0.86em;
    line-height: 1.25;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.cn-linked-item-row:hover,
.cn-linked-item-row:focus {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    outline: none;
}

.cn-linked-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.cn-linked-items-empty {
    font-size: 0.82em;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 6px;
}

/* At narrow viewports collapse to a 2-column grid, then 1 for very small. */
@media (max-width: 1024px) {
    .cn-linked-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .cn-linked-items-grid {
        grid-template-columns: 1fr;
    }
}
