/* コラム(記事)機能 共通スタイル — 一覧(/articles.html)・詳細(/articles/:slug) */

.article-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 一覧ページ ===== */

/* コンパクトヘッダー（stores.html と同型・帯なし） */
.articles-hero-lite {
    padding: 122px 0 26px;
    background: linear-gradient(180deg, #eef2f8 0%, #ffffff 100%);
}

.articles-hero-lite h1 {
    font-size: 30px;
    font-weight: 800;
    color: #1a3a6b;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
}

.articles-lead {
    font-size: 15px;
    color: #5a6675;
    line-height: 1.8;
    margin: 0;
}

.articles-section {
    padding: 30px 0 80px;
}

.articles-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.filter-pill {
    border: 1px solid #2c4f8d;
    background: #fff;
    color: #2c4f8d;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.filter-pill:hover {
    background: #eef2f9;
}

.filter-pill.active {
    background: #2c4f8d;
    color: #fff;
}

/* 一覧はSKC流: 3列グリッド・広めコンテナ（記事詳細の860pxは維持） */
.articles-list-page .article-container {
    max-width: 1000px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.article-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e8ee;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: #333;
    transition: box-shadow 0.2s, transform 0.2s;
}

.article-card:hover {
    box-shadow: 0 8px 24px rgba(44, 79, 141, 0.15);
    transform: translateY(-2px);
}

.article-card-thumb {
    height: 160px;
    background: #f2f4f8;
    overflow: hidden;
}

.article-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-card-noimage,
.related-card-noimage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a9b4c8;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    min-height: 120px;
}

.article-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.article-card-category,
.related-card-category,
.article-category {
    display: inline-block;
    background: #eef2f9;
    color: #2c4f8d;
    font-size: 12px;
    font-weight: bold;
    border-radius: 999px;
    padding: 3px 10px;
}

.article-card-date,
.related-card-date,
.article-date {
    color: #8a93a5;
    font-size: 12px;
}

.article-author {
    color: #5a6475;
    font-size: 12px;
}

.article-author::before {
    content: "｜";
    color: #c3cede;
    margin-right: 6px;
}

.article-card-title {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.5;
    color: #1f2a3d;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.article-card:hover .article-card-title {
    color: #2c4f8d;
}

.article-card-excerpt {
    font-size: 13px;
    line-height: 1.7;
    color: #5a6475;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.articles-empty,
.article-loading,
.article-error {
    grid-column: 1 / -1;
    text-align: center;
    color: #8a93a5;
    padding: 60px 0;
    font-size: 14px;
}

.article-error {
    color: #c0392b;
}

/* ===== 詳細ページ ===== */

.article-page {
    padding: 140px 0 80px;
    background: #fff;
}

.article-breadcrumb {
    font-size: 12px;
    color: #8a93a5;
    margin-bottom: 28px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.article-breadcrumb a {
    color: #2c4f8d;
    text-decoration: none;
}

.article-breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-current {
    color: #5a6475;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

.article-header {
    margin-bottom: 24px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.article-title {
    font-size: 30px;
    line-height: 1.4;
    color: #1f2a3d;
    margin: 0;
}

.article-thumbnail {
    margin-bottom: 28px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f7fa;
    border: 1px solid #e5e8ee;
    text-align: center;
}

.article-thumbnail img {
    max-width: 100%;
    max-height: 420px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

/* 目次（TOC） */
.article-toc {
    background: #f5f7fa;
    border: 1px solid #e5e8ee;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 32px;
}

.toc-title {
    font-size: 15px;
    font-weight: bold;
    color: #1f2a3d;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #2c4f8d;
    border-radius: 2px;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-item {
    margin: 0;
    line-height: 1.7;
}

.toc-item a {
    color: #2c4f8d;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    padding: 2px 0;
}

.toc-item a:hover {
    text-decoration: underline;
}

.toc-level-3 {
    padding-left: 18px;
    position: relative;
}

.toc-level-3 a {
    font-size: 13px;
    color: #5a6475;
}

/* 目次リンクでスクロールした際、上に隠れないよう余白を確保 */
.article-body h2,
.article-body h3 {
    scroll-margin-top: 90px;
}

/* 本文（Markdown描画結果） */
.article-body {
    font-size: 16px;
    line-height: 1.9;
    color: #333;
}

.article-body h2 {
    font-size: 22px;
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2c4f8d;
    color: #1f2a3d;
}

.article-body h3 {
    font-size: 18px;
    margin: 32px 0 12px;
    padding-left: 10px;
    border-left: 4px solid #2c4f8d;
    color: #1f2a3d;
}

.article-body p {
    margin: 0 0 18px;
}

.article-body ul,
.article-body ol {
    margin: 0 0 18px;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 6px;
}

.article-body img {
    display: block;
    max-width: 100%;
    max-height: 460px;
    width: auto;
    margin: 20px auto;
    border-radius: 10px;
    border: 1px solid #e5e8ee;
    box-shadow: 0 3px 14px rgba(20, 40, 75, 0.07);
}

/* 記事内の画像横並び（アプリスクショ等） */
.article-body .article-img-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.article-body .article-img-row img {
    margin: 0;
    max-height: 400px;
    width: auto;
    max-width: calc(50% - 8px);
}

.article-body a {
    color: #2c4f8d;
    text-decoration: underline;
}

.article-body blockquote {
    margin: 0 0 18px;
    padding: 12px 18px;
    background: #f5f7fa;
    border-left: 4px solid #c3cede;
    color: #5a6475;
}

.article-body code {
    background: #f2f4f8;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 14px;
}

.article-body pre {
    background: #1f2a3d;
    color: #e8ecf3;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 0 0 18px;
}

.article-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* テーブルの横スクロールラッパー（article-page.js が挿入） */
.article-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 18px;
}

.article-table-wrap .article-body table,
.article-table-wrap table {
    margin: 0;
}

.article-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 18px;
    font-size: 14px;
}

.article-body th,
.article-body td {
    border: 1px solid #dfe4ec;
    padding: 8px 12px;
    text-align: left;
}

.article-body th {
    background: #eef2f9;
    color: #1f2a3d;
}

.article-body-fallback {
    white-space: pre-wrap;
    font-family: inherit;
}

/* 関連記事 */
.article-related {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid #e5e8ee;
}

.related-title {
    font-size: 20px;
    color: #1f2a3d;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.related-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e8ee;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: #333;
    transition: box-shadow 0.2s;
}

.related-card:hover {
    box-shadow: 0 6px 18px rgba(44, 79, 141, 0.15);
}

.related-card-thumb {
    aspect-ratio: 16 / 9;
    background: #f2f4f8;
    overflow: hidden;
}

.related-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-card-body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.related-card-title {
    font-size: 14px;
    line-height: 1.5;
    color: #1f2a3d;
}

.article-back {
    margin-top: 40px;
    text-align: center;
}

.article-back-link {
    color: #2c4f8d;
    text-decoration: none;
    font-weight: bold;
}

.article-back-link:hover {
    text-decoration: underline;
}

/* ===== レスポンシブ ===== */

@media (max-width: 768px) {
    .articles-hero {
        padding: 80px 20px 40px;
    }

    .articles-hero-lite {
        padding: 108px 0 20px;
    }

    .articles-hero-lite h1 {
        font-size: 24px;
    }

    .articles-section {
        padding-top: 24px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .article-title {
        font-size: 22px;
    }

    .article-page {
        padding: 110px 0 60px;
    }

    .breadcrumb-current {
        max-width: 180px;
    }

    /* 目次リンクのタップ領域を確保（行全体をタップ可能に、44px以上） */
    .toc-item a {
        display: block;
        padding: 11px 0;
    }

    /* カテゴリ絞り込みピルもタップしやすい高さに */
    .filter-pill {
        box-sizing: border-box;
        min-height: 44px;
        padding: 11px 18px;
    }

}

/* 画像横並び（article-img-row）はモバイルでは縦積みにして読めるサイズを確保 */
@media (max-width: 560px) {
    .article-body .article-img-row {
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .article-body .article-img-row img {
        max-width: min(100%, 320px);
        max-height: 620px;
    }
}

/* 共通ヘッダーは幅≤1440pxで2段に折り返し高さ約124pxになる。
   ヒーロー見出し／記事本文がヘッダーに隠れないよう上余白を補償する。
   （このブロックは最後に置き、上の768pxブロックの padding-top も上書きする） */
@media screen and (max-width: 1440px) {
    .articles-hero {
        padding-top: 160px;
    }

    .article-page {
        padding-top: 150px;
    }
}

/* 注目記事（一覧上部の固定4本） */
.articles-featured { margin-bottom: 34px; }
.articles-featured-title {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 16px; font-size: 19px; font-weight: 800; color: #1a3a6b;
}
.articles-featured-title::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: #BF0101; flex: none; }
.articles-featured .articles-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) {
    .articles-featured .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .articles-featured .articles-grid { grid-template-columns: 1fr; }
}

/* 記事下部の商品一覧導線 */
.article-shop-links {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin: 30px 0 6px; padding: 14px 16px;
    border: 1px solid #e3e9f2; background: #fff;
    font-size: 13px;
}
.article-shop-links-label { font-weight: 700; color: #1a3a6b; }
.article-shop-links a {
    display: inline-flex; padding: 4px 12px; border: 1px solid #c9d6ea; border-radius: 999px;
    color: #1a3a6b; text-decoration: none; font-weight: 500;
}
.article-shop-links a:hover { background: #f4f8fd; }

/* モバイル: 商品導線チップのタップ領域を確保（基底ルールより後に置き上書きする） */
@media (max-width: 768px) {
    .article-shop-links a {
        box-sizing: border-box;
        min-height: 44px;
        align-items: center;
        padding: 8px 16px;
    }
}
