/* =============================================================
   single.css — 記事詳細ページ専用スタイル
   ============================================================= */

/* ─────────────────────────────────────────
   プログレスバー
───────────────────────────────────────── */
.progress-bar {
	position: fixed;
	top: var(--header-h);
	left: 0;
	right: 0;
	height: 4px;
	background: #e5ebf7;
	z-index: 100;
	transition: top 0.25s ease;
}
.progress-bar__fill {
	height: 100%;
	width: 0;
	background: var(--accent);
	transition: width 0.1s linear;
}

/* ─────────────────────────────────────────
   パンくずリスト
───────────────────────────────────────── */
.breadcrumb {
	background: #fff;
	height: 40px;
	display: flex;
	align-items: center;
	border-bottom: 1px solid var(--border-color);
}
.breadcrumb__inner {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
	font-size: 12px;
	color: #666;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.breadcrumb a {
	color: #666;
	text-decoration: none;
}
.breadcrumb a:hover {
	color: var(--accent);
}

/* ─────────────────────────────────────────
   記事ヘッダー
───────────────────────────────────────── */
.article-header {
	background: #fff;
}
.article-header__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 64px 24px 0;
	display: flex;
	flex-direction: column;
	gap: 24px;
}
.article-header-top {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* カテゴリ + NEW バッジ */
.article-meta-top {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.article-cat-group {
	display: flex;
	align-items: center;
	gap: 4px;
}
.article-cat {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	background: var(--bg-subtle);
	border: 1px solid var(--border-color);
	border-radius: 999px;
	font-size: 12px;
	color: var(--text-primary);
	text-decoration: none;
	transition: background 0.2s;
}
.article-cat:hover {
	background: var(--border-color);
}
.new-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	background: var(--accent);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	color: var(--btn-text, #fff);
	letter-spacing: 0.05em;
}

/* 記事タイトル */
.article-title {
	font-family: var(--font-heading);
	font-size: 36px;
	font-weight: 700;
	color: var(--text-primary);
	line-height: 1.2;
	margin: 0;
}

/* メタ情報 */
.article-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.article-meta__avatar {
	width: 32px !important;
	height: 32px !important;
	border-radius: 50% !important;
	object-fit: cover;
	vertical-align: middle;
}
.article-meta__author,
.article-meta__date,
.article-meta__readtime {
	font-size: 13px;
	color: #666;
}
.article-meta__update {
	font-size: 12px;
	color: rgba(37, 99, 235, 0.75);
}

/* SNS シェアボタン */
.sns-share {
	display: flex;
	align-items: center;
	gap: 8px;
}
.sns-share__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: #fff;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	cursor: pointer;
	color: #666;
	transition: border-color 0.2s, color 0.2s;
	padding: 0;
}
.sns-share__btn:hover {
	border-color: #999;
	color: #333;
}
.sns-share__btn--facebook {
	color: #1877f2;
}
.sns-share__btn--facebook:hover {
	border-color: #1877f2;
	color: #145dc4;
}
.sns-share__btn--line {
	color: #06c755;
}
.sns-share__btn--line:hover {
	border-color: #06c755;
	color: #04973f;
}
.sns-share__btn svg {
	width: 16px;
	height: 16px;
	display: block;
}
/* ブックマークボタン: 他のシェアアイコンと差別化（円形・アクセントカラー・押せる感） */
.sns-share .js-card-bookmark {
	border-radius: 50%;
	border-color: var(--accent);
	color: var(--accent);
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s ease;
}
.sns-share .js-card-bookmark .icon-bookmark-filled { display: none; }
.sns-share .js-card-bookmark:hover {
	background: rgba(37, 99, 235, 0.08);
	border-color: var(--accent);
	color: var(--accent);
	transform: scale(1.12);
}
.sns-share .js-card-bookmark.is-bookmarked {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--btn-text, #fff);
	animation: bookmark-pop 0.25s ease;
}
.sns-share .js-card-bookmark.is-bookmarked:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
	color: var(--btn-text, #fff);
}
.sns-share .js-card-bookmark.is-bookmarked .icon-bookmark { display: none; }
.sns-share .js-card-bookmark.is-bookmarked .icon-bookmark-filled { display: block; }

/* アイキャッチ画像 */
.article-featured-image {
	width: 100%;
	height: 480px;
	border-radius: 8px;
	overflow: hidden;
	background: #d0d0d0;
}
.article-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ─────────────────────────────────────────
   記事レイアウト（メイン + サイドバーラッパー）
───────────────────────────────────────── */
.article-layout {
	background: #fff;
}

/* ─────────────────────────────────────────
   記事メインエリア
   レイアウト（flex・幅）は page-main / page-layout として
   common.css に定義。ここは記事固有スタイルのみ。
───────────────────────────────────────── */

/* ─────────────────────────────────────────
   目次（TOC）
───────────────────────────────────────── */
.toc {
	background: #fff;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.toc__title {
	font-family: var(--font-heading);
	font-size: 14px;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0;
}
.toc__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	counter-reset: toc-counter;
}
.toc__item {
	display: flex;
	align-items: baseline;
	gap: 10px;
}
.toc__item--depth-1 {
	margin-left: 32px;
}
.toc__item--depth-2 {
	margin-left: 48px;
}
.toc__item--depth-3 {
	margin-left: 64px;
}
.toc__item--depth-4 {
	margin-left: 80px;
}
.toc__num {
	font-size: 14px;
	color: var(--text-muted);
	flex-shrink: 0;
}
.toc__text {
	font-size: 14px;
	color: #262633;
	text-decoration: none;
	line-height: 1.5;
}
.toc__text:hover {
	color: var(--accent);
	text-decoration: underline;
}

/* ─────────────────────────────────────────
   記事本文（WP content スタイル）
───────────────────────────────────────── */
.article-body {
	display: flex;
	flex-direction: column;
}

/* 要素間スペーシング */
.article-body > * {
	margin: 0;
}
.article-body > * + * {
	margin-top: 24px;
}
.article-body > h2 {
	margin-top: 48px;
}
.article-body > h2:first-child {
	margin-top: 0;
}
.article-body > h2 + * {
	margin-top: 14px;
}
.article-body > h3,
.article-body > h4,
.article-body > h5,
.article-body > h6 {
	margin-top: 32px;
}
.article-body > h3 + *,
.article-body > h4 + *,
.article-body > h5 + *,
.article-body > h6 + * {
	margin-top: 12px;
}

/* H2 — 左ブルーバー付き */
.article-body h2 {
	font-family: var(--font-heading);
	font-size: 24px;
	font-weight: 700;
	color: var(--text-primary);
	line-height: 1.4;
	display: flex;
	align-items: center;
	gap: 12px;
	padding-left: 12px;
	scroll-margin-top: 96px;
}
.article-body h2::before {
	content: '';
	display: inline-block;
	flex-shrink: 0;
	align-self: stretch;
	width: 4px;
	background: var(--accent);
	border-radius: 2px;
	margin-left: -12px;
}

/* H3〜H6（同一デザイン） */
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
	font-family: var(--font-heading);
	font-size: 20px;
	font-weight: 700;
	color: #333;
	line-height: 1.4;
	scroll-margin-top: 96px;
}

/* 本文 */
.article-body p {
	font-size: 14px;
	color: #333;
	line-height: 1.6;
}

/* リンク */
.article-body a {
	color: var(--accent);
	text-decoration: underline;
}

/* リスト */
.article-body ul,
.article-body ol {
	font-size: 14px;
	color: #333;
	line-height: 1.6;
	padding: 20px 24px 20px 40px;
}
.article-body ul li,
.article-body ol li {
	margin-bottom: 8px;
}

/* 引用ブロック */
.article-body blockquote,
.article-body .wp-block-quote {
	background: color-mix(in srgb, var(--accent) 6%, #fff);
	padding: 0 32px 24px;
	border-radius: 6px;
	box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 8%, transparent);
	border: none;
	margin: 24px 0 0;
}
.article-body blockquote::before {
	content: '\201C';
	display: block;
	font-family: var(--font-heading);
	font-size: 56px;
	font-weight: 700;
	color: color-mix(in srgb, var(--accent) 35%, transparent);
	line-height: 60px;
	margin-bottom: 4px;
}
.article-body blockquote::after {
	content: '\201D';
	display: block;
	font-family: var(--font-heading);
	font-size: 56px;
	font-weight: 700;
	color: color-mix(in srgb, var(--accent) 35%, transparent);
	line-height: 32px;
	text-align: right;
	margin-top: 8px;
}
.article-body blockquote p {
	font-size: 15px;
	color: #333347;
	line-height: 30px;
}
.article-body blockquote cite {
	display: block;
	font-size: 12px;
	color: #666680;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
	font-style: normal;
}

/* WP 画像ブロック */
.article-body figure,
.article-body .wp-block-image {
	width: 100%;
}
.article-body figure img,
.article-body .wp-block-image img {
	width: 100%;
	height: auto;
	max-height: 360px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}
.article-body figcaption,
.article-body .wp-block-image figcaption {
	font-size: 12px;
	color: #666;
	text-align: center;
	margin-top: 8px;
}

/* WP ギャラリー（新エディタのブロックギャラリーは、コアCSSが個々の画像にflexレイアウト用の
   width/flexを直接指定してくるため、通常の詳細度調整だけでは上書きしきれないことがある。
   レイアウト崩れを確実に防ぐため !important で2カラムグリッドに統一する） */
.article-body .wp-block-gallery,
.article-body .gallery {
	display: grid !important;
	grid-template-columns: repeat(2, 1fr) !important;
	gap: 16px;
	margin: 24px 0 0;
}
.article-body .wp-block-gallery .wp-block-image,
.article-body .gallery-item {
	width: 100% !important;
	margin: 0;
}
.article-body .wp-block-gallery .wp-block-image img,
.article-body .gallery-item img {
	width: 100% !important;
	height: 260px;
	object-fit: cover;
	border-radius: 4px;
}

/* ─────────────────────────────────────────
   記事本文カスタムブロック用クラス
   （Gutenberg カスタム HTML ブロックに class 指定）
───────────────────────────────────────── */

/* ─────────────────────────────────────────
   記事フッター
───────────────────────────────────────── */
.article-footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 32px;
}

/* SNS シェア（下部） */
.sns-share-footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	width: 100%;
}
.sns-share-footer__label {
	font-size: 13px;
	color: #666;
	margin: 0;
}

/* 記事タグ */
.article-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	width: 100%;
}
.article-tag {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	background: var(--bg-subtle);
	border: 1px solid var(--border-color);
	border-radius: 999px;
	font-size: 12px;
	color: var(--text-primary);
	text-decoration: none;
	transition: background 0.2s;
}
.article-tag:hover {
	background: var(--border-color);
}

/* ─────────────────────────────────────────
   前後記事ナビ
───────────────────────────────────────── */
.prev-next-nav {
	background: #fff;
	border-top: 1px solid var(--border-color);
	border-bottom: 1px solid var(--border-color);
}
.prev-next-nav__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
	display: flex;
	align-items: center;
}
.prev-next-nav__divider {
	width: 1px;
	align-self: stretch;
	background: var(--border-color);
	flex-shrink: 0;
	margin: 0 40px;
}
.prev-article,
.next-article {
	display: flex;
	align-items: center;
	gap: 16px;
	flex: 1;
	text-decoration: none;
	overflow: hidden;
}
.prev-article--empty,
.next-article--empty {
	flex: 1;
}
.prev-article__thumb,
.next-article__thumb {
	width: 80px;
	height: 80px;
	border-radius: 4px;
	flex-shrink: 0;
	overflow: hidden;
	background: #d1d1d1;
}
.prev-article__thumb img,
.next-article__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.prev-article__text,
.next-article__text {
	display: flex;
	flex-direction: column;
	gap: 6px;
	overflow: hidden;
	flex: 1;
	min-width: 0;
}
.prev-article__label,
.next-article__label {
	font-size: 12px;
	font-weight: 600;
	color: #80808c;
}
.prev-article__title,
.next-article__title {
	font-size: 13px;
	color: #1a1a26;
	text-decoration: underline;
	line-height: 22px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.next-article {
	justify-content: flex-end;
	text-align: right;
}
.next-article .next-article__text {
	align-items: flex-end;
}

/* ─────────────────────────────────────────
   関連記事
───────────────────────────────────────── */
.related-articles {
	background: var(--bg-subtle);
}
.related-articles__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 60px 20px;
	display: flex;
	flex-direction: column;
	gap: 32px;
}
.related-articles .section-hd {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.related-articles .section-hd__title {
	font-family: var(--font-heading);
	font-size: 24px;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0;
}
.related-articles .section-hd__more {
	font-size: 14px;
	font-weight: 700;
	color: var(--accent);
	text-decoration: none;
}
.related-articles .section-hd__more:hover {
	text-decoration: underline;
}
.related-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}
.related-card {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 6px 9px rgba(0, 0, 0, 0.08);
	overflow: hidden;
}
.related-card__inner {
	display: flex;
	flex-direction: column;
	height: 340px;
	text-decoration: none;
}
.related-card__img {
	height: 180px;
	background: #d0d0d0;
	flex-shrink: 0;
	position: relative;
	overflow: hidden;
}
.related-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.related-card__img-placeholder {
	width: 100%;
	height: 100%;
	background: #d0d0d0;
}
.related-card .card__bookmark {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	background: rgba(255, 255, 255, 0.92);
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
	color: #595959;
	padding: 0;
}
.related-card__body {
	padding: 12px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}
.related-card__cat {
	display: inline-block;
	background: var(--accent);
	color: var(--btn-text, #fff);
	font-size: 12px;
	padding: 6px 12px;
	border-radius: 4px;
	align-self: flex-start;
}
.related-card__title {
	font-family: var(--font-heading);
	font-size: 18px;
	font-weight: 500;
	color: var(--text-primary);
	line-height: 1.4;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.related-card__date {
	font-size: 14px;
	color: #666;
	margin: 0;
	margin-top: auto;
}

/* ─────────────────────────────────────────
   記事下 CTA セクション
───────────────────────────────────────── */
.cta-section {
	background: #fff;
}
.cta-section__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 80px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 24px;
	text-align: center;
}
.cta-section__title {
	font-family: var(--font-heading);
	font-size: 28px;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0;
}
.cta-section__body {
	font-family: var(--font-heading);
	font-size: 16px;
	font-weight: 500;
	color: #333;
	line-height: 1.6;
	margin: 0;
}
.cta-section__btns {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
}

/* single.php 専用ボタン（common.css の .btn と競合しないよう .single-btn で定義） */
.single-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	min-width: 160px;
	padding: 0 24px;
	font-size: 14px;
	font-weight: 700;
	border-radius: 8px;
	text-decoration: none;
	cursor: pointer;
	border: none;
	transition: opacity 0.2s;
	white-space: nowrap;
}
.single-btn:hover {
	opacity: 0.85;
}
.single-btn--primary {
	background: var(--accent, #2563eb);
	color: var(--btn-text, #fff);
}
.single-btn--primary:hover {
	color: var(--btn-text, #fff);
}
.single-btn--outline {
	background: #fff;
	color: var(--accent, #2563eb);
	border: 1.5px solid var(--accent, #2563eb);
}
.single-btn--outline:hover {
	color: var(--accent, #2563eb);
}
.article-body .single-btn {
	text-decoration: none;
}
.article-body .single-btn--primary {
	color: var(--btn-text, #fff);
}

/* =============================================================
   本文内：画像・ギャラリー
   ============================================================= */

.article-img {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
}
.article-img__placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 16/7;
	background: #d0d0d0;
}
.article-img .article-img__caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.38) 50%, transparent 100%);
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
	padding: 28px 16px 14px;
	margin: 0;
	text-align: left;
}

.article-gallery {
	display: grid;
	gap: 12px;
}
.article-gallery--2col {
	grid-template-columns: 1fr 1fr;
}
.article-gallery__item {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
}
.article-gallery__placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 4/3;
	background: #d0d0d0 url('http://theme-project01.local/wp-content/uploads/2026/07/no-image-large.webp') center / cover no-repeat;
}
.article-gallery__item .article-gallery__caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.38) 50%, transparent 100%);
	color: #fff;
	font-size: 12px;
	line-height: 1.4;
	padding: 24px 12px 10px;
	margin: 0;
	text-align: center;
}

/* =============================================================
   SP レスポンシブ（768px 以下）
   ============================================================= */
@media (max-width: 768px) {

	/* ── ヘッダー ── */
	.article-header__inner {
		padding: 32px 16px 0;
	}
	.article-header-top {
		gap: 16px;
	}
	.article-title {
		font-size: 24px;
		line-height: 1.3;
	}

	/* ── サムネイル ── */
	.article-featured-image {
		height: 220px;
		border-radius: 0;
	}

	/* ── サイドバー（author-bio の下に表示） ──
	   実際のflex/width上書きはcss/component/sidebar-article.cssの
	   同名セレクタ側に統一済み（sidebar-article.cssが後から読み込まれるため、
	   ここに書いても打ち消される）。 */

	/* ── 本文 ── */
	.toc {
		padding: 16px;
	}
	.article-body h2 {
		font-size: 22px;
		scroll-margin-top: 72px;
	}
	.article-body h3,
	.article-body h4,
	.article-body h5,
	.article-body h6 {
		font-size: 20px;
		scroll-margin-top: 72px;
	}
	.article-body blockquote,
	.article-body .wp-block-quote {
		padding: 0 16px 20px;
	}

	/* ── 前後記事 ── */
	.prev-next-nav__inner {
		flex-direction: column;
		gap: 0;
		padding: 0;
	}
	.prev-next-nav__divider {
		width: 100%;
		height: 1px;
		margin: 0;
	}
	.prev-article,
	.next-article {
		padding: 20px 16px;
	}
	.prev-article__thumb,
	.next-article__thumb {
		width: 56px;
		height: 56px;
	}
	.next-article {
		justify-content: flex-start;
		text-align: left;
	}
	.next-article .next-article__text {
		align-items: flex-start;
	}

	/* ── 関連記事 ── */
	.related-articles__inner {
		padding: 40px 16px;
	}
	.related-grid {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
	}
	.related-grid .card {
		flex: 0 1 calc(50% - 10px);
	}

	/* ── CTA ── */
	.cta-section__inner {
		padding: 48px 20px;
	}
	.cta-section__title {
		font-size: 22px;
	}
	.cta-section__btns {
		flex-direction: column;
		width: 100%;
	}
	.single-btn {
		width: 100%;
		max-width: 320px;
	}

	/* ── ブレッドクラム ── */
	.breadcrumb__inner {
		padding: 10px 16px;
		font-size: 11px;
	}

	/* ── ギャラリー：1カラム化 ── */
	.article-gallery--2col {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 540px) {
	/* ── 関連記事：1カラム化 ── */
	.related-grid .card {
		flex: 0 1 100%;
		max-width: 360px;
	}
}