/* ==========================================================================
   個別記事ページ - リッチマガジン風デザイン
   ========================================================================== */

/* 読了進捗バー */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.reading-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-color, #0a192f), color-mix(in srgb, var(--accent-color, #0a192f) 70%, #fff));
    transition: width 0.1s ease-out;
}

/* 記事ヘッダー */
.article-header {
    padding: 40px 20px 60px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.article-header__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.article-header__category {
    display: inline-block;
    color: var(--accent-color, #0a192f);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 24px;
    padding: 6px 16px;
    background: color-mix(in srgb, var(--accent-color, #0a192f) 10%, transparent);
    border-radius: 4px;
    transition: all 0.2s;
}

.article-header__category:hover {
    background: color-mix(in srgb, var(--accent-color, #0a192f) 20%, transparent);
}

.article-header__title {
    font-family: 'Noto Serif JP', 'Georgia', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #111;
    margin-bottom: 32px;
}

.article-header__divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color, #0a192f), transparent);
    margin-bottom: 24px;
}

.article-header__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #6b7280;
    letter-spacing: 0.03em;
}

.article-header__meta-sep {
    color: #d1d5db;
}

.article-header__updated {
    color: #9ca3af;
}

/* アイキャッチ画像 */
.article-thumbnail {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 0;
    padding: 0 20px;
}

.article-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.article-thumbnail__caption {
    margin-top: 16px;
    font-size: 0.85rem;
    color: #9ca3af;
    text-align: center;
    font-style: italic;
}

/* リード文 */
.article-lead {
    padding: 60px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.article-lead__inner {
    max-width: 800px;
    margin: 0 auto;
}

.article-lead__text {
    font-family: 'Noto Serif JP', 'Georgia', serif;
    font-size: 1.25rem;
    line-height: 2;
    color: #374151;
    text-align: center;
    position: relative;
    padding: 0 40px;
}

.article-lead__text::before,
.article-lead__text::after {
    content: '\201C';
    position: absolute;
    font-family: 'Georgia', serif;
    font-size: 4rem;
    color: var(--accent-color, #0a192f);
    opacity: 0.2;
    line-height: 1;
}

.article-lead__text::before {
    top: -20px;
    left: 0;
}

.article-lead__text::after {
    content: '\201D';
    bottom: -40px;
    right: 0;
}

/* 記事コンテナ（サイドバー付き） */
.article-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* サイドバー */
.article-sidebar {
    position: relative;
}

.article-sidebar__sticky {
    position: sticky;
    top: 100px;
}

/* 目次 */
.article-toc {
    background: #f8fafc;
    border-radius: 4px;
    margin-bottom: 24px;
}

.article-toc__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
}

.article-toc__toggle-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-toc__toggle-inner svg {
    color: var(--accent-color, #0a192f);
}

.article-toc__chevron {
    transition: transform 0.3s;
    color: #9ca3af;
}

.article-toc__toggle[aria-expanded="false"] .article-toc__chevron {
    transform: rotate(-90deg);
}

.article-toc__body {
    padding: 0 24px 20px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.article-toc__body.collapsed {
    max-height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

/* 目次スクロールバー */
.article-toc__body::-webkit-scrollbar {
    width: 4px;
}

.article-toc__body::-webkit-scrollbar-track {
    background: transparent;
}

.article-toc__body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.article-toc__body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.article-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.article-toc__list li {
    counter-increment: toc-counter;
    margin-bottom: 12px;
}

.article-toc__list li:last-child {
    margin-bottom: 0;
}

.article-toc__list a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: #374151;
    text-decoration: none;
    line-height: 1.5;
    transition: all 0.2s;
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -12px;
}

.article-toc__list a::before {
    content: counter(toc-counter, decimal-leading-zero);
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    flex-shrink: 0;
    margin-top: 2px;
}

.article-toc__list a:hover,
.article-toc__list a.active {
    color: var(--accent-color, #0a192f);
    border-left-color: var(--accent-color, #0a192f);
}

.article-toc__list a.active::before {
    color: var(--accent-color, #0a192f);
}

/* 記事情報 */
.article-info {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 20px;
}

.article-info__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.article-info__item:last-child {
    border-bottom: none;
}

.article-info__label {
    font-size: 0.75rem;
    color: #9ca3af;
}

.article-info__value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

/* 記事本文 */
.article-body {
    min-width: 0;
}

.article-content {
    max-width: 720px;
}

/* 本文タイポグラフィ */
.article-body .entry-content {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.0625rem;
    line-height: 2;
    color: #374151;
    font-feature-settings: "palt";
}

.article-body .entry-content p {
    margin-bottom: 2rem;
}

/* 最初の段落のドロップキャップ */
.article-body .entry-content > p:first-of-type::first-letter {
    font-family: 'Noto Serif JP', 'Georgia', serif;
    font-size: 4rem;
    font-weight: 700;
    float: left;
    line-height: 1;
    margin-right: 16px;
    margin-top: 8px;
    color: var(--accent-color, #0a192f);
}

/* 見出し */
.article-body .entry-content h2 {
    font-family: 'Noto Serif JP', 'Georgia', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111;
    margin-top: 5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 16px;
    border-bottom: 2px solid #111827;
    position: relative;
    scroll-margin-top: 100px;
}

.article-body .entry-content h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-color, #0a192f);
}

.article-body .entry-content h3 {
    font-family: 'Noto Serif JP', 'Georgia', serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: #111;
    margin-top: 3.5rem;
    margin-bottom: 1rem;
    padding-left: 16px;
    border-left: 4px solid var(--accent-color, #0a192f);
    scroll-margin-top: 100px;
}

.article-body .entry-content h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #374151;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

/* リスト */
.article-body .entry-content ul,
.article-body .entry-content ol {
    margin: 2rem 0;
    padding-left: 0;
}

.article-body .entry-content ul {
    list-style: none;
}

.article-body .entry-content ul li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.article-body .entry-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 8px;
    height: 8px;
    background: var(--accent-color, #0a192f);
    border-radius: 2px;
    transform: rotate(45deg);
}

.article-body .entry-content ol {
    list-style: none;
    counter-reset: ol-counter;
}

.article-body .entry-content ol li {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1rem;
    counter-increment: ol-counter;
}

.article-body .entry-content ol li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Serif JP', 'Georgia', serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-color, #0a192f);
    border-radius: 50%;
}

/* 引用（通常） */
.article-body .entry-content blockquote {
    margin: 3rem 0;
    padding: 2rem 2.5rem;
    background: #f8fafc;
    border-left: 4px solid var(--accent-color, #0a192f);
    border-radius: 0 4px 4px 0;
    font-family: 'Noto Serif JP', 'Georgia', serif;
    font-size: 1.0625rem;
    color: #4b5563;
    line-height: 1.9;
    position: relative;
}

.article-body .entry-content blockquote::before {
    content: '\201C';
    position: absolute;
    top: 10px;
    left: 20px;
    font-family: 'Georgia', serif;
    font-size: 3rem;
    color: var(--accent-color, #0a192f);
    opacity: 0.3;
    line-height: 1;
}

.article-body .entry-content blockquote p {
    margin-bottom: 0;
}

/* プルクォート（大きな引用） */
.article-body .entry-content .pullquote,
.article-body .entry-content blockquote.is-style-large {
    margin: 4rem -60px;
    padding: 3rem;
    background: linear-gradient(135deg, var(--accent-color, #0a192f) 0%, color-mix(in srgb, var(--accent-color, #0a192f) 80%, #000) 100%);
    border-left: none;
    border-radius: 4px;
    text-align: center;
    color: #fff;
}

.article-body .entry-content .pullquote p,
.article-body .entry-content blockquote.is-style-large p {
    font-size: 1.5rem;
    line-height: 1.7;
    color: #fff;
}

.article-body .entry-content .pullquote::before,
.article-body .entry-content blockquote.is-style-large::before {
    color: rgba(255, 255, 255, 0.3);
}

/* キーポイントボックス */
.article-body .entry-content .keypoint,
.article-body .entry-content .wp-block-group.is-style-keypoint {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 4px;
    border: none;
}

.article-body .entry-content .keypoint::before,
.article-body .entry-content .wp-block-group.is-style-keypoint::before {
    content: 'Key Point';
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #92400e;
    margin-bottom: 12px;
}

/* 注意ボックス */
.article-body .entry-content .notice,
.article-body .entry-content .wp-block-group.is-style-notice {
    margin: 3rem 0;
    padding: 2rem;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    border-radius: 0 4px 4px 0;
}

.article-body .entry-content .notice::before {
    content: 'Notice';
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 12px;
}

/* 情報ボックス */
.article-body .entry-content .info-box,
.article-body .entry-content .wp-block-group.is-style-info {
    margin: 3rem 0;
    padding: 2rem;
    background: #eff6ff;
    border-left: 4px solid #0a192f;
    border-radius: 0 4px 4px 0;
}

.article-body .entry-content .info-box::before {
    content: 'Info';
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0a192f;
    margin-bottom: 12px;
}

/* コード */
.article-body .entry-content pre {
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: #1e293b;
    border-radius: 4px;
    overflow-x: auto;
    position: relative;
}

.article-body .entry-content pre::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 20px 0 0 #f59e0b, 40px 0 0 #22c55e;
}

.article-body .entry-content code {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.875em;
    background: #f3f4f6;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    color: #111;
}

.article-body .entry-content pre code {
    background: transparent;
    color: #e2e8f0;
    padding: 0;
    display: block;
    padding-top: 24px;
}

/* リンク */
.article-body .entry-content a {
    color: var(--accent-color, #0a192f);
    text-decoration: none;
    background: linear-gradient(to bottom, transparent 60%, color-mix(in srgb, var(--accent-color, #0a192f) 20%, transparent) 60%);
    transition: background 0.2s;
}

.article-body .entry-content a:hover {
    background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--accent-color, #0a192f) 30%, transparent) 0%);
}

/* 画像 */
.article-body .entry-content img {
    display: block;
    margin: 3rem auto;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.article-body .entry-content figure {
    margin: 3rem 0;
}

.article-body .entry-content figcaption {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #9ca3af;
    text-align: center;
}

/* 区切り線 */
.article-body .entry-content hr {
    border: none;
    text-align: center;
    margin: 5rem 0;
    position: relative;
}

.article-body .entry-content hr::before {
    content: '\25C6 \25C6 \25C6';
    letter-spacing: 0.5em;
    color: #d1d5db;
    font-size: 0.8rem;
}

/* 記事フッター */
.article-footer {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 2px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* タグ */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-tag {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 4px;
    transition: all 0.2s;
}

.article-tag:hover {
    color: #fff;
    background: var(--accent-color, #0a192f);
}

/* シェアボタン */
.article-share {
    display: flex;
    align-items: center;
    gap: 12px;
}

.article-share__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
}

.article-share__button {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.article-share__button:hover {
    color: #fff;
    background: var(--accent-color, #0a192f);
    transform: translateY(-2px);
}

.article-share__button.copied {
    background: #10b981;
    color: #fff;
}

/* 著者情報 */
.article-author {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 20px;
}

.article-author__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: #f8fafc;
    border-radius: 4px;
}

.article-author__avatar {
    flex-shrink: 0;
}

.article-author__avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.article-author__info {
    flex: 1;
}

.article-author__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 4px;
}

.article-author__name {
    font-family: 'Noto Serif JP', 'Georgia', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.article-author__bio {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #6b7280;
}

/* モバイル用目次（折りたたみ） */
.article-toc-mobile {
    display: none;
    order: 0;
}

.article-toc-mobile__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: #f8fafc;
    border: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
}

.article-toc-mobile__toggle-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-toc-mobile__toggle-inner svg {
    color: var(--accent-color, #0a192f);
}

.article-toc-mobile__chevron {
    transition: transform 0.3s;
    color: #9ca3af;
}

.article-toc-mobile__toggle[aria-expanded="false"] .article-toc-mobile__chevron {
    transform: rotate(-90deg);
}

.article-toc-mobile__body {
    background: #f8fafc;
    border-radius: 0 0 4px 4px;
    padding: 0 20px 20px;
    max-height: 50vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.article-toc-mobile__body.collapsed {
    max-height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

/* AdSense 広告枠 */
.article-adsense {
    margin-top: 20px;
}

/* 関連記事 */
.related-posts {
    padding: 80px 20px;
    background: #fff;
}

.related-posts__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.related-posts__title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
    color: #6b7280;
    margin-bottom: 48px;
    position: relative;
}

.related-posts__title::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--accent-color, #0a192f);
}

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

.related-post-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.related-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.related-post-card__thumb {
    margin: 0;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: #f3f4f6;
}

.related-post-card__thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-post-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.related-post-card:hover .related-post-card__thumb img {
    transform: scale(1.08);
}

.related-post-card__body {
    padding: 24px;
}

.related-post-card__category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-color, #0a192f);
    margin-bottom: 10px;
}

.related-post-card__title {
    font-family: 'Noto Serif JP', 'Georgia', serif;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #111;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-card:hover .related-post-card__title {
    color: var(--accent-color, #0a192f);
}

.related-post-card__date {
    font-size: 0.75rem;
    color: #9ca3af;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   ニュース記事 簡素版
   ========================================================================== */
.article-container--news {
    grid-template-columns: 1fr;
    max-width: 800px;
}

.article-container--news .article-content {
    max-width: 100%;
}

.article-body--news .entry-content > p:first-of-type::first-letter {
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    float: none;
    margin-right: 0;
    margin-top: 0;
    color: inherit;
}

/* レスポンシブ */
@media (max-width: 1024px) {
    .article-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .article-sidebar {
        display: none;
    }

    .article-toc-mobile {
        display: block;
        order: 0;
        margin-bottom: 24px;
    }

    .article-body {
        order: 1;
    }

    .article-content {
        max-width: 100%;
    }

    .article-body .entry-content .pullquote,
    .article-body .entry-content blockquote.is-style-large {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .article-header {
        padding: 20px 20px 40px;
    }

    .article-header__title {
        font-size: 1.75rem;
    }

    .article-lead__text {
        font-size: 1.0625rem;
        padding: 0 20px;
    }

    .article-lead__text::before,
    .article-lead__text::after {
        font-size: 2.5rem;
    }

    .article-sidebar__sticky {
        grid-template-columns: 1fr;
    }

    .article-body .entry-content > p:first-of-type::first-letter {
        font-size: 3rem;
        margin-right: 12px;
    }

    .article-body .entry-content h2 {
        font-size: 1.5rem;
        margin-top: 4rem;
    }

    .article-body .entry-content h3 {
        font-size: 1.25rem;
    }

    .article-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-author__inner {
        flex-direction: column;
        text-align: center;
    }

    .related-posts__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .article-header__title {
        font-size: 1.5rem;
    }

    .article-body .entry-content {
        font-size: 1rem;
    }

    .article-body .entry-content > p:first-of-type::first-letter {
        font-size: 2.5rem;
        margin-right: 8px;
    }
}
