/* 記事共通の外観。本文の白い読み物面は維持し、サイト全体との連続性を整える。 */
:root {
    --article-accent: #3b82f6;
    --article-accent-dark: #2563eb;
    --article-accent-soft: #eff6ff;
}

body[data-blog-theme="dark"] {
    background: #0d1117;
}

body[data-blog-theme="light"] {
    background: #f6f8fa;
}

body[data-article-category="入門"] {
    --article-accent: #22c55e;
    --article-accent-dark: #15803d;
    --article-accent-soft: #ecfdf5;
}

body[data-article-category="攻略"] {
    --article-accent: #f59e0b;
    --article-accent-dark: #b45309;
    --article-accent-soft: #fffbeb;
}

body[data-article-category="活用術"] {
    --article-accent: #3b82f6;
    --article-accent-dark: #1d4ed8;
    --article-accent-soft: #eff6ff;
}

body[data-article-category="検証"] {
    --article-accent: #8b5cf6;
    --article-accent-dark: #6d28d9;
    --article-accent-soft: #f5f3ff;
}

body[data-article-category="トラブル対処"] {
    --article-accent: #ef4444;
    --article-accent-dark: #b91c1c;
    --article-accent-soft: #fef2f2;
}

body[data-article-category] {
    --accent: var(--article-accent);
    --accent-light: var(--article-accent-soft);
}

body[data-article-category] .hero,
body[data-article-category] .article-hero {
    background: linear-gradient(135deg, var(--article-accent-dark), var(--article-accent));
}

body[data-blog-theme="dark"] .main-card {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

/* 前後記事ナビは全記事で同じカードUIにする。 */
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.article-nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    min-height: 72px;
    padding: 0.9rem 1rem;
    background: #f8fafc;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    text-decoration: none;
    color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.article-nav-link:hover {
    border-color: var(--article-accent);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.article-nav-link.next {
    text-align: right;
}

.article-nav-label {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
}

.article-nav-title {
    color: var(--article-accent-dark);
    font-size: 0.9rem;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-nav-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 記事の責任主体と検証方針を本文直後に明示する。 */
.author-box {
    margin: 2rem 0 0;
    padding: 1.15rem 1.25rem;
    border: 1px solid #dbe2ea;
    border-left: 4px solid var(--article-accent);
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
}

.author-box-label {
    margin: 0 0 0.25rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
}

.author-box-name {
    margin: 0;
    font-weight: 800;
}

.author-box p {
    margin: 0.35rem 0 0;
}

.author-box a {
    color: var(--article-accent-dark);
    font-weight: 700;
}

.article-calculator-prompt {
    margin: 1.5rem 0 2rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid #dbe2ea;
    border-left: 4px solid var(--article-accent);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--article-accent-soft), #ffffff);
    color: #1f2937;
}

.article-calculator-prompt__label {
    margin: 0 0 0.35rem;
    color: var(--article-accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.article-calculator-prompt h2 {
    margin: 0 0 0.45rem;
    border: 0;
    color: #111827;
    font-size: 1.12rem;
}

.article-calculator-prompt p {
    margin: 0.4rem 0 0;
}

.article-calculator-prompt__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 0.8rem;
    padding: 0 1rem;
    border-radius: 8px;
    background: var(--article-accent-dark);
    color: #ffffff !important;
    font-weight: 800;
    text-decoration: none !important;
}

.article-calculator-prompt__button:hover {
    filter: brightness(0.95);
}

.article-next-step-cta {
    margin: 2rem 0 0;
    padding: 1.2rem 1.25rem;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #f8fafc;
    color: #1f2937;
}

.article-next-step-cta__label {
    margin: 0 0 0.35rem;
    color: var(--article-accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.article-next-step-cta h2 {
    margin: 0 0 0.45rem;
    border: 0;
    color: #111827;
    font-size: 1.1rem;
}

.article-next-step-cta p {
    margin: 0.45rem 0 0;
    color: #334155;
}

.article-next-step-cta__links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.article-next-step-cta__links a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.2rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: var(--article-accent-dark);
    font-weight: 800;
    text-align: center;
    text-decoration: none !important;
}

.article-next-step-cta__links a:first-child {
    border-color: var(--article-accent-dark);
    background: var(--article-accent-dark);
    color: #ffffff;
}

.article-next-step-cta__links a:hover {
    filter: brightness(0.97);
}

/* 既存記事のCTAは導線を残しつつ、広告枠ではなく確認メモに近い見た目へ寄せる。 */
.content .cta-box {
    margin: 2rem 0;
    padding: 1.2rem 1.25rem;
    border: 1px solid #dbe2ea;
    border-left: 4px solid var(--article-accent);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--article-accent-soft), #ffffff);
    color: #1f2937;
    text-align: left;
}

.content .cta-box h3 {
    margin: 0 0 0.5rem;
    color: #111827;
    font-size: 1.08rem;
}

.content .cta-box p {
    margin: 0.45rem 0 0;
    color: #334155;
    opacity: 1;
}

.content .cta-box .cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 0.85rem;
    padding: 0 1rem;
    border-radius: 8px;
    background: var(--article-accent-dark);
    color: #ffffff !important;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: none;
}

.content .cta-box .cta-btn:hover {
    filter: brightness(0.95);
    transform: none;
}

.content .cta-box .small a {
    color: var(--article-accent-dark);
    font-weight: 700;
}

/* 小さなテキストリンクもタッチ操作可能な高さを確保する。 */
.content a,
.cta-button,
.back-to-top,
.site-footer a {
    min-height: 44px;
}

.content a:not(.article-nav-link),
.site-footer a {
    display: inline-flex;
    align-items: center;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--article-accent);
    outline-offset: 3px;
}

@media (max-width: 600px) {
    .main-card {
        margin: 0.75rem;
        border-radius: 14px;
    }

    .article-nav {
        flex-direction: column;
        margin-top: 2rem;
        padding-top: 1.25rem;
    }

    .article-nav-link.next {
        text-align: left;
    }

    .author-box {
        padding: 1rem;
    }

    .article-next-step-cta {
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-nav-link {
        transition: none;
    }
}


/* 2026-07 content quality pass: reading flow, mobile tables and stable controls */
body[data-blog-theme="light"] .main-card {
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
}

.content {
    line-height: 1.9;
}

.content .intro {
    text-align: left;
    border: 1px solid #dbe2ea;
    border-left: 4px solid var(--article-accent);
    background: var(--article-accent-soft);
}

.content .summary-box {
    border: 1px solid #dbe2ea;
    background: #f8fafc;
}

.content .section > h2 {
    scroll-margin-top: 76px;
}

.table-card {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-card table {
    min-width: 520px;
}

.content p,
.content li {
    overflow-wrap: anywhere;
}

.content p a,
.content li a,
.official-source-note a {
    min-height: auto;
    display: inline;
}

.contextual-guide-links {
    margin: 2rem 0 0;
    padding: 1.15rem 1.25rem;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #ffffff;
}

.contextual-guide-links h2 {
    margin: 0 0 0.65rem;
    border: 0;
    color: #111827;
    font-size: 1.05rem;
}

.contextual-guide-links ul {
    margin: 0;
    padding-left: 1.2rem;
}

.contextual-guide-links li + li {
    margin-top: 0.4rem;
}

.contextual-guide-links a {
    color: var(--article-accent-dark);
    font-weight: 700;
    text-underline-offset: 0.18em;
}

@media (max-width: 600px) {
    .content {
        padding: 1.25rem;
    }

    .content .intro,
    .content .summary-box {
        padding: 1rem;
    }

    .table-card {
        margin-right: -0.25rem;
    }

    .table-card::after {
        content: "表は横にスクロールできます";
        display: block;
        padding: 0.45rem 0.75rem;
        color: #64748b;
        font-size: 0.75rem;
    }
}
