/* =====================================================================
   articles.css — Articles（記事一覧）ページ固有のスタイル
   一覧は他ページのカードとは別の顔: 特大アウトライン番号が立つ編集誌風の
   横長エントリ。ポインタに反応して
     - スポットライト（カーソル位置を淡い光が追う: --mx/--my）
     - 3Dチルト（カーソル方向へ最大±2.4°傾く: --tilt-x/--tilt-y）
   の2つが動く。CSS変数は script.js の initPointerTilt が [data-tilt] に
   書き込む（タッチ端末・reduced-motion では JS ごと無効＝静的に退化）。
   ===================================================================== */

/* 件数の注記（works-count と同じ控えめな声） */
.articles-count {
    margin: -6px 0 4px;
    color: var(--dim);
    font-size: 0.85rem;
}

/* ── 見出し行（タイトル + RSS購読）── */
.articles-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
}

/* ナビのチップ類と同じ語彙の小さなピル。カード/エントリとは別の「ユーティリティ」
   の見た目にして、記事一覧の主役（インデックス）を邪魔しない。 */
.articles-feed-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.articles-feed-link .fa-icon {
    width: 0.95em;
    height: 0.95em;
    color: var(--accent);
}

.articles-feed-link:hover,
.articles-feed-link:focus-visible {
    color: var(--text);
    border-color: var(--border-bright);
    background: var(--surface-2);
}

/* ── 記事インデックス ── */
.article-index {
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.article-entry-inner {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 26px;
    padding: 26px 28px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 55%), var(--surface);
    box-shadow: var(--glass-hilite);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    /* チルト: JS が書き込む変数を使う。未設定（タッチ/reduce/非JS）は 0deg で静止 */
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 0.18s var(--ease-out), border-color 0.2s ease, box-shadow 0.25s ease;
}

/* スポットライト: カーソル位置（--mx/--my）を中心に淡い光。ホバー中だけ灯る */
.article-entry-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 40%),
        rgba(var(--accent-rgb), 0.13), transparent 65%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* ── 特大のアウトライン番号 ── */
.article-no {
    font-size: clamp(2.4rem, 2rem + 3vw, 3.6rem);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(var(--accent-rgb), 0.45);
    transition: -webkit-text-stroke-color 0.2s ease;
    user-select: none;
}

/* text-stroke 非対応環境では透明文字にしない（安全側の実線） */
@supports not (-webkit-text-stroke: 1px red) {
    .article-no {
        color: var(--dim);
    }
}

.article-entry-meta {
    margin: 0 0 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    color: var(--muted);
    font-size: 0.85rem;
}

.article-entry-title {
    margin: 0;
    font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
    line-height: 1.55;
    color: var(--text);
    transition: color 0.15s ease;
}

.article-entry-excerpt {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.8;
    max-width: var(--measure);
}

.article-entry-main .tech-tags {
    margin-top: 14px;
}

/* ── 右端の丸チップ（リンク種別の矢印 / 準備中は砂時計） ── */
.article-entry-arrow {
    width: 46px;
    height: 46px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    transition: transform 0.2s var(--ease-out), background-color 0.2s ease,
                color 0.2s ease, border-color 0.2s ease;
}

.article-entry-arrow .fa-icon {
    width: 16px;
    height: 16px;
}

.article-entry-arrow.is-pending {
    color: var(--dim);
    border-style: dashed;
}

/* ── ホバー反応（ポインタ環境のみ。タッチの貼り付きを構造的に防ぐ） ── */
@media (hover: hover) {
    a.article-entry-inner:hover {
        border-color: rgba(var(--accent-rgb), 0.42);
        box-shadow: var(--glass-hilite), 0 14px 34px rgba(0, 0, 0, 0.35),
                    0 0 24px rgba(var(--accent-rgb), 0.10);
    }

    .article-entry-inner:hover::before {
        opacity: 1;
    }

    /* 番号: アウトライン → グラデ塗り */
    a.article-entry-inner:hover .article-no {
        background: var(--grad-text);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-stroke-color: rgba(var(--accent-rgb), 0.7);
    }

    a.article-entry-inner:hover .article-entry-title {
        color: var(--accent);
    }

    a.article-entry-inner:hover .article-entry-arrow {
        transform: translateX(4px);
        background: var(--accent-soft);
        border-color: rgba(var(--accent-rgb), 0.45);
        color: var(--accent);
    }
}

a.article-entry-inner:focus-visible .article-entry-arrow {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ── モバイル: 番号は右上の透かしに、本文を全幅に ── */
@media (max-width: 600px) {
    .article-entry-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 20px 18px;
    }

    .article-no {
        position: absolute;
        top: 14px;
        right: 16px;
        font-size: 2.1rem;
        opacity: 0.55;
    }

    .article-entry-arrow {
        width: 40px;
        height: 40px;
        align-self: end;
    }
}

/* ── 強制配色: 透明文字・光の演出を実線/非表示へ ── */
@media (forced-colors: active) {
    .article-no {
        -webkit-text-stroke: 0;
        color: CanvasText;
        background: none;
    }

    .article-entry-inner::before {
        display: none;
    }
}

/* ── 準備中（記事がまだ無いときだけ表示） ── */
.articles-empty {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 26px;
    padding: 26px;
    max-width: 560px;
}

.articles-empty-icon {
    width: 56px;
    height: 56px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--accent-soft);
    color: var(--accent);
}

.articles-empty-icon .fa-icon {
    width: 22px;
    height: 22px;
}

.articles-empty .card-title {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.articles-empty .card-text {
    margin: 0;
}

@media (max-width: 600px) {
    .articles-empty {
        flex-direction: column;
        align-items: flex-start;
    }
}
