/* =====================================================================
   links.css — /links (相互リンク・気になったサイト一覧) 固有スタイル
   ===================================================================== */

/* 件数バッジは articles-count と同じ言語で薄く。 */
.links-count {
    margin: 6px 0 18px;
    color: var(--muted);
    font-size: 0.85rem;
}

/* リンクカード群。自動折り返しの 2〜3 列グリッド。 */
.links-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.links-item { display: flex; }

/* カード本体。favicon + 本文の 2 カラム構造。 */
.links-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.links-card:hover,
.links-card:focus-visible {
    outline: none;
    border-color: rgba(var(--accent-rgb), 0.55);
    background: var(--surface-2);
    transform: translateY(var(--lift-sm));
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

/* favicon スロット。実 favicon (24×24 img) と i-globe (SVG) 両方の
   サイズを揃える。上端寄せで、本文の複数行に対しても頭を合わせる。 */
.links-card-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 1.3rem;
    overflow: hidden;
    margin-top: 2px;
}

.links-card-icon img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}

/* 本文列: 名前 / URL / note を縦積み */
.links-card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
    line-height: 1.4;
    flex: 1 1 auto;
}

.links-card-name {
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
    /* サイト名は長くならないよう 1 行制限。あふれれば省略。 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.links-card-url {
    font-family: var(--font-mono, ui-monospace, monospace);
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.links-card-note {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.55;
    margin-top: 2px;
}

/* 準備中 (url 空 or 危険 scheme) のカード。クリック不可、彩度を落とす。 */
.links-card.is-pending {
    cursor: not-allowed;
    opacity: 0.55;
    background: transparent;
}

/* 準備中カードは <a> ではなく <div> (クリック不可) だが、hover の
   浮上・発光ルールは要素種別を問わず当たるため、押せそうに見えてしまって
   いた。opacity/cursor と同じ specificity で打ち消す。 */
.links-card.is-pending:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
    background: transparent;
}

/* 空表示 (links === []) */
.links-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    margin-top: 8px;
}

.links-empty-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 1.4rem;
}

.links-empty-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 480px の 1 カラム強制は削除済み: grid の auto-fill minmax がその幅では
   既に 1 カラムに畳んでおり効果ゼロの死メディアクエリだった (BP 規約 380/600/768/860 外)。 */
