/* =========================================================
   記事ページ共通スタイル（blog/ と surveys/ で共有）

   styles.css のトークンを前提にする。単体では使わないこと。
   設計方針: 数値を主役に。見出し・表・囲みは静かに保ち、
   ブランドの黄はデータ（バー・数値の下線）にだけ使う。
   ========================================================= */

/* ---------- 記事の器 ---------- */
.article-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 140px var(--s-5) var(--s-9);
}

.blog-content {
    margin-top: var(--s-6);
}

/* ---------- 記事見出し ---------- */
/* 中央揃えの日本語長文タイトルは折り返しの末尾が孤立して読みにくいため左揃え */
.blog-header {
    text-align: left;
    margin-bottom: var(--s-8);
    padding-bottom: var(--s-5);
    border-bottom: 2px solid var(--brand);
}

.blog-title {
    font-size: var(--t-xl);
    font-weight: 800;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: var(--s-4);
}

.blog-meta {
    color: var(--ink-faint);
    font-size: var(--t-sm);
}

/* ---------- 本文 ---------- */
.blog-body {
    line-height: var(--leading-body);
    color: var(--ink);
    font-size: var(--t-base);
}

/* セクションの切れ目はヘアラインと余白で示す。
   見出しそのものに色を敷くと、データの黄色と競合して主役がぼやける */
.blog-body h2 {
    font-size: var(--t-lg);
    font-weight: 800;
    color: var(--ink);
    margin: var(--s-9) 0 var(--s-5);
    padding-top: var(--s-6);
    border-top: 1px solid var(--line);
}

/* 記事冒頭の見出しは、上に区切るものがないので罫を出さない */
.blog-body h2:first-child,
.survey-note + h2 {
    margin-top: var(--s-6);
    padding-top: 0;
    border-top: none;
}

.blog-body h3 {
    font-size: var(--t-md);
    font-weight: 700;
    color: var(--ink);
    margin: var(--s-7) 0 var(--s-4);
}

.blog-body p {
    margin-bottom: var(--s-5);
}

.blog-body ul,
.blog-body ol {
    margin: var(--s-5) 0;
    padding-left: var(--s-5);
}

.blog-body li {
    margin-bottom: var(--s-3);
    padding-left: var(--s-2);
}

.blog-body li::marker {
    color: var(--brand-deep);
}

/* 強調は色ではなく太さで。色は数値にだけ使う */
.blog-body strong {
    color: var(--ink);
    font-weight: 700;
    background: linear-gradient(transparent 62%, var(--brand-tint) 62%);
}

.blog-body a {
    color: var(--brand-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 実験レポートの写真は原寸が大きいので、必ず段に収める */
.blog-body img {
    display: block;
    width: 100%;
    height: auto;
    margin: var(--s-6) 0 var(--s-3);
    border-radius: var(--r-lg);
}

/* 表など幅の広いものが本文からはみ出さないようにする */
.blog-body {
    overflow-wrap: anywhere;
}

/* ---------- 調査の出典表示 ---------- */
.survey-note {
    background: var(--brand-tint);
    border-left: 4px solid var(--brand);
    padding: var(--s-4) var(--s-5);
    margin: 0 0 var(--s-7);
    font-size: var(--t-sm);
    line-height: 1.8;
    color: var(--ink-soft);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ---------- 数値 ---------- */
/* この記事群の主役。大きな数字と、その下に引いた黄色の線だけで見せる */
.stat-box {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s-6) var(--s-5);
    margin: var(--s-6) 0;
    text-align: center;
}

.stat-box .stat-number {
    display: inline-block;
    font-size: var(--t-3xl);
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
    letter-spacing: -0.02em;
    padding-bottom: var(--s-2);
    border-bottom: 5px solid var(--brand);
}

.stat-box .stat-label {
    display: block;
    font-size: var(--t-sm);
    line-height: 1.7;
    color: var(--ink-soft);
    margin-top: var(--s-4);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--s-4);
    margin: var(--s-6) 0;
}

.stat-grid .stat-box {
    margin: 0;
}

.stat-grid .stat-number {
    font-size: var(--t-2xl);
}

/* ---------- データ表 ---------- */
/* 枠で囲わず、横罫だけで行を追わせる。バーと数値が図になる */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--s-5) 0 var(--s-6);
    font-size: var(--t-sm);
}

.data-table th,
.data-table td {
    padding: var(--s-3) var(--s-2);
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    font-size: var(--t-xs);
    font-weight: 700;
    color: var(--ink-soft);
    background: none;
    border-bottom: 2px solid var(--line-strong);
    white-space: nowrap;
}

.data-table td:first-child {
    color: var(--ink);
    padding-right: var(--s-4);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: var(--brand-tint);
}

.data-table strong {
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.data-bar {
    display: inline-block;
    height: 14px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-warm) 100%);
    border-radius: var(--r-pill);
    margin-right: var(--s-3);
    vertical-align: middle;
}

/* ---------- 記事末尾の誘導 ---------- */
.cta-section {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s-8) var(--s-6);
    text-align: center;
    margin: var(--s-9) 0 var(--s-6);
}

.cta-title {
    font-size: var(--t-lg);
    font-weight: 800;
    color: var(--ink);
    margin-bottom: var(--s-4);
}

.cta-description {
    color: var(--ink-soft);
    font-size: var(--t-sm);
    line-height: 1.9;
    margin: 0 auto var(--s-6);
    max-width: 30em;
}

/* .cta-button は styles.css の定義をそのまま使う（黄地に濃い文字）。
   記事内では登場アニメーションを外す */
.cta-section .cta-button {
    animation: none;
}

.back-to-blog {
    text-align: center;
    margin: var(--s-7) 0 var(--s-4);
}

.back-to-blog a {
    display: inline-block;
    padding: var(--s-3) var(--s-6);
    background: none;
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    text-decoration: none;
    border-radius: var(--r-pill);
    font-size: var(--t-sm);
    transition: border-color var(--transition), color var(--transition);
}

.back-to-blog a:hover {
    border-color: var(--brand-deep);
    color: var(--brand-deep);
}

.back-to-blog a:focus-visible {
    outline: 3px solid var(--brand-deep);
    outline-offset: 3px;
}

/* ---------- 記事内のパンくず ---------- */
.article-container .breadcrumb {
    font-size: var(--t-xs);
    margin-bottom: var(--s-6);
}

/* ---------- 狭い画面 ---------- */
@media (max-width: 768px) {
    .article-container {
        padding: 110px var(--s-4) var(--s-7);
    }

    .blog-title {
        font-size: var(--t-lg);
    }

    .blog-body h2 {
        font-size: var(--t-md);
        margin-top: var(--s-7);
        padding-top: var(--s-5);
    }

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

    .stat-box .stat-number,
    .stat-grid .stat-number {
        font-size: var(--t-xl);
    }

    /* 表は横スクロールさせ、本文側には溢れさせない */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .data-table td:first-child {
        white-space: normal;
        min-width: 9rem;
    }
}

/* =========================================================
   記事内の個別パーツ
   ========================================================= */

/* ---------- 実験レポート（isovaleric / skatole） ---------- */
.image-caption {
    text-align: center;
    font-size: var(--t-sm);
    color: var(--ink-faint);
    margin: calc(var(--s-2) * -1) 0 var(--s-6);
}

.warning-box {
    background: var(--alert-tint);
    border-left: 4px solid var(--alert);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    padding: var(--s-5);
    margin: var(--s-7) 0;
}

.warning-box p:last-child {
    margin-bottom: 0;
}

.concentration-table {
    margin: var(--s-6) 0;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
}

.concentration-table h3 {
    background: var(--paper-2);
    font-size: var(--t-base);
    padding: var(--s-3) var(--s-4);
    margin: 0;
    border-bottom: 1px solid var(--line);
}

.concentration-table ul {
    background: var(--paper);
    padding: var(--s-5) var(--s-5) var(--s-5) var(--s-8);
    margin: 0;
}

.concentration-table li:last-child {
    margin-bottom: 0;
}

/* ---------- 受診者の声（real-cases） ---------- */
/* 黄色の面に白文字は読めないため、地はクリーム・数字は ink で置く */
.stat-highlight {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s-7) var(--s-6);
    text-align: center;
    margin: var(--s-7) 0;
}

.stat-highlight .stat-number {
    display: inline-block;
    font-size: var(--t-2xl);
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
    padding-bottom: var(--s-2);
    border-bottom: 5px solid var(--brand);
}

.stat-highlight .stat-label {
    display: block;
    font-size: var(--t-sm);
    color: var(--ink-soft);
    margin-top: var(--s-4);
}

.case-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    margin: var(--s-6) 0;
}

.case-header {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-5);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--line);
}

.case-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.case-profile {
    font-weight: 700;
    font-size: var(--t-base);
    color: var(--ink);
}

.case-profile span {
    font-weight: 400;
    font-size: var(--t-xs);
    color: var(--ink-faint);
    display: block;
}

.case-label {
    display: inline-block;
    font-size: var(--t-xs);
    font-weight: 700;
    padding: var(--s-1) var(--s-3);
    border-radius: var(--r-pill);
    margin-bottom: var(--s-2);
}

.label-worry  { background: var(--paper-3);  color: var(--brand-deep); }
.label-result { background: var(--ok-tint);   color: var(--ok); }
.label-voice  { background: var(--info-tint); color: var(--info); }

.case-section {
    margin-bottom: var(--s-3);
}

.case-section:last-child {
    margin-bottom: 0;
}

.insight-box {
    background: var(--brand-tint);
    border-left: 4px solid var(--brand);
    padding: var(--s-5);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    margin: var(--s-6) 0;
}

.insight-box h4 {
    font-size: var(--t-base);
    margin-bottom: var(--s-2);
    color: var(--ink);
}

.insight-box p {
    font-size: var(--t-sm);
    color: var(--ink-soft);
    margin-bottom: 0;
}

/* =========================================================
   記事一覧ページ（blog/index.html）
   ========================================================= */
.experiments-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 140px var(--s-5) var(--s-9);
}

.page-header {
    text-align: center;
    margin-bottom: var(--s-9);
}

.page-title {
    font-size: var(--t-2xl);
    font-weight: 800;
    color: var(--ink);
    margin-bottom: var(--s-4);
}

.page-title::after {
    content: '';
    display: block;
    width: 3rem;
    height: 4px;
    margin: var(--s-4) auto 0;
    background: var(--brand);
    border-radius: var(--r-pill);
}

.page-description {
    font-size: var(--t-base);
    color: var(--ink-soft);
    max-width: 34em;
    margin: 0 auto;
}

/* 記事群の見出し。一覧の中の区切りなので、記事本文の h2 と同じ扱いにする */
.section-label {
    font-size: var(--t-md);
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 var(--s-5);
    padding-bottom: var(--s-3);
    border-bottom: 2px solid var(--brand);
}

.experiments-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-5);
    margin-bottom: var(--s-9);
}

/* 影を敷き詰めず、暖色のヘアラインで区切る */
.experiment-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.experiment-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.experiment-image {
    width: 260px;
    flex-shrink: 0;
    overflow: hidden;
}

.experiment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.experiment-content {
    padding: var(--s-6);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.survey-badge {
    display: inline-block;
    align-self: flex-start;
    background: var(--brand);
    color: var(--ink);
    padding: var(--s-1) var(--s-3);
    border-radius: var(--r-pill);
    font-size: var(--t-xs);
    font-weight: 700;
    margin-bottom: var(--s-3);
}

.experiment-date {
    font-size: var(--t-xs);
    color: var(--ink-faint);
    margin-bottom: var(--s-2);
}

.experiment-title {
    font-size: var(--t-md);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: var(--s-3);
    line-height: 1.5;
}

.experiment-excerpt {
    color: var(--ink-soft);
    font-size: var(--t-sm);
    line-height: 1.9;
    margin-bottom: var(--s-5);
    flex: 1;
}

.experiment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-bottom: var(--s-5);
}

.experiment-tag {
    background: var(--paper-2);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    padding: var(--s-1) var(--s-3);
    border-radius: var(--r-pill);
    font-size: var(--t-xs);
}

.experiment-link {
    display: inline-block;
    color: var(--brand-deep);
    text-decoration: none;
    font-weight: 700;
    font-size: var(--t-sm);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.experiment-link:hover {
    border-bottom-color: var(--brand-deep);
}

.experiment-link:focus-visible {
    outline: 3px solid var(--brand-deep);
    outline-offset: 3px;
}

.experiment-card.no-image {
    flex-direction: column;
}

.back-to-home {
    text-align: center;
    margin-top: var(--s-9);
}

.back-btn {
    display: inline-block;
    padding: var(--s-3) var(--s-6);
    background: var(--brand);
    color: var(--ink);
    text-decoration: none;
    border-radius: var(--r-pill);
    font-weight: 700;
    font-size: var(--t-sm);
    transition: background var(--transition), transform var(--transition);
}

.back-btn:hover {
    background: #FFC800;
    color: var(--ink);
    transform: translateY(-2px);
}

.back-btn:focus-visible {
    outline: 3px solid var(--brand-deep);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .experiments-list {
        padding: 110px var(--s-4) var(--s-7);
    }

    .page-title {
        font-size: var(--t-xl);
    }

    .experiment-card {
        flex-direction: column;
    }

    .experiment-image {
        width: 100%;
        height: 200px;
    }

    .experiment-content {
        padding: var(--s-5);
    }

    .experiment-title {
        font-size: var(--t-base);
    }
}
