@charset "UTF-8";
/* ==========================================================================
   誰でもブログ（Daredemo Blog）- メインスタイル
   清潔感・シンプル・柔らかい・目が疲れにくい。過度な装飾はしない。
   メインカラーはカスタマイザーで変更でき、--theme-primary 系の
   CSSカスタムプロパティとして inc/customizer.php から動的に出力される。
   ========================================================================== */

:root {
	/* メインカラー（PHPが inc/customizer.php で上書きする。ここはフォールバック）。
	   初期カラー #6CB6D9 と、そこから派生計算した値に合わせている。 */
	--theme-primary: #6cb6d9;
	--theme-primary-strong: #437187;
	--theme-primary-dark: #345768;
	--theme-primary-soft: #e5f2f8;

	/* 基本カラー */
	--theme-bg: #ffffff;
	--theme-bg-soft: #f5f9fb;
	--theme-text: #333333;
	--theme-text-muted: #6b7280;
	--theme-border: #e5e7eb;
	--theme-shadow: 0 4px 14px rgba(17, 24, 28, 0.06);

	--font-base: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Segoe UI", "Noto Sans JP", Meiryo, sans-serif;

	--container-width: 1120px;
	--content-width: 720px;
	--sidebar-width: 300px;

	--radius-sm: 4px;
	--radius-md: 8px;

	--space-1: 8px;
	--space-2: 16px;
	--space-3: 24px;
	--space-4: 40px;
	--space-5: 64px;

	--header-height: 76px;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--theme-bg);
	color: var(--theme-text);
	font-family: var(--font-base);
	font-size: 16px;
	line-height: 1.9;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img {
	max-width: 100%;
	height: auto;
}

figure {
	margin: 0;
}

a {
	color: var(--theme-primary-strong);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

a:hover {
	color: var(--theme-primary-dark);
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.5;
	font-weight: 700;
	margin: 0 0 var(--space-2);
	color: var(--theme-text);
}

p {
	margin: 0 0 var(--space-2);
}

ul, ol {
	padding-left: 1.4em;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button,
input[type="submit"],
input[type="button"] {
	cursor: pointer;
}

/* キーボード操作時のフォーカス表示 */
:focus-visible {
	outline: 2px solid var(--theme-primary-strong);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	padding: var(--space-1) var(--space-2);
	background: var(--theme-primary-strong);
	color: #fff;
	border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
	left: 0;
}

.container {
	width: 100%;
	max-width: var(--container-width);
	margin-inline: auto;
	padding-inline: var(--space-2);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn,
.wp-block-button__link {
	display: inline-block;
	padding: 0.7em 1.6em;
	border: 1px solid var(--theme-primary-strong);
	border-radius: var(--radius-sm);
	background: var(--theme-primary-strong);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.wp-block-button__link:hover {
	background: var(--theme-primary-dark);
	border-color: var(--theme-primary-dark);
	color: #fff;
	text-decoration: none;
	/* chiikoto 参考: 色が濃くなると同時に少し浮き上がる（-2px）＋淡い影。 */
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(17, 17, 17, 0.12);
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--theme-primary-strong);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--theme-primary-soft);
}

/* --------------------------------------------------------------------------
   Search form
   -------------------------------------------------------------------------- */
.search-form {
	display: flex;
	gap: var(--space-1);
}

.search-form__input,
.wp-block-search__input {
	flex: 1;
	min-width: 0;
	padding: 0.7em 1em;
	border: 1px solid var(--theme-border);
	border-radius: var(--radius-sm);
	background: #fff;
}

.search-form__submit {
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--theme-bg);
	border-bottom: 1px solid var(--theme-border);
}

.site-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	padding-block: var(--space-2);
}

.site-branding {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.site-branding .custom-logo {
	max-height: 50px;
	width: auto;
	/* 縦横比は max-height + width:auto で維持。max-width は
	   狭い幅で横長ロゴがはみ出さないための一般的な保険（固定幅は与えない）。 */
	max-width: 100%;
	height: auto;
}

.site-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
}

.site-title a {
	color: var(--theme-text);
	text-decoration: none;
}

.site-title a:hover {
	color: var(--theme-primary-strong);
}

.site-description {
	margin: 0;
	font-size: 0.78rem;
	color: var(--theme-text-muted);
}

.header-controls {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

.main-navigation ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--space-3);
	margin: 0;
	padding: 0;
}

.main-navigation a {
	display: inline-block;
	padding: var(--space-1) 0;
	color: var(--theme-text);
	font-weight: 600;
	text-decoration: none;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-cat > a {
	color: var(--theme-primary-strong);
}

.search-toggle,
.menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-1);
	border: none;
	background: none;
	color: var(--theme-text);
	border-radius: var(--radius-sm);
}

.menu-toggle {
	display: none;
}

.menu-icon-line {
	transition: transform 0.25s ease, opacity 0.2s ease;
	transform-box: fill-box;
	transform-origin: center;
}

.menu-toggle[aria-expanded="true"] .menu-icon-line--top {
	transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-icon-line--middle {
	opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-icon-line--bottom {
	transform: translateY(-6px) rotate(-45deg);
}

.header-search {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
}

.header-search.is-open {
	max-height: 200px;
	opacity: 1;
	padding-block: var(--space-2);
	border-top: 1px solid var(--theme-border);
	background: var(--theme-bg-soft);
}

/* --------------------------------------------------------------------------
   Hero (front page)
   -------------------------------------------------------------------------- */
.hero {
	background: var(--theme-bg-soft);
	padding-block: var(--space-5);
	text-align: center;
}

/* メインビジュアルに背景画像を設定した場合（カスタマイザー）。
   画像URLは inc/customizer.php から .hero.has-hero-image へインラインで注入。 */
.hero.has-hero-image {
	position: relative;
	background-color: var(--theme-bg-soft);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* 文字可読性のための自動オーバーレイ（濃度の設定項目は増やさない）。
   本文の文字色が濃いグレーのため、薄い白を重ねてどんな写真でも読めるようにする。 */
.hero.has-hero-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.65);
	pointer-events: none;
}

.hero.has-hero-image .hero-inner {
	position: relative;
	z-index: 1;
}

.hero-inner {
	max-width: 680px;
}

.hero-title {
	position: relative;
	margin: 0 0 var(--space-3);
	padding-bottom: var(--space-2);
	font-size: 2.2rem;
	letter-spacing: 0.02em;
}

.hero-title::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: 40px;
	height: 3px;
	border-radius: 2px;
	background: var(--theme-primary);
}

.hero-catch {
	margin: 0;
	/* 背景画像ありでも読めるよう本文色を使用。タイトルとの強弱は
	   フォントサイズ（2.2rem vs 1.05rem）と太さで付ける。 */
	color: var(--theme-text);
	font-size: 1.05rem;
}

/* ヒーロー内の検索フォーム。タイトル／キャッチフレーズと同じ .hero-inner
   （背景画像ありのときは ::before オーバーレイより前面）に入れる。 */
.hero-search {
	max-width: 520px;
	margin: var(--space-4) auto 0;
}

/* --------------------------------------------------------------------------
   Sections (front page)
   -------------------------------------------------------------------------- */
.section {
	padding-block: var(--space-5);
}

.section--subtle {
	background: var(--theme-primary-soft);
}

.section--category {
	background: var(--theme-primary-soft);
}

.section-header {
	margin-bottom: var(--space-4);
	text-align: center;
}

.section-title {
	position: relative;
	display: inline-block;
	margin: 0;
	padding-bottom: var(--space-1);
	font-size: 1.5rem;
}

.section-title::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: 32px;
	height: 3px;
	border-radius: 2px;
	background: var(--theme-primary);
}

.section-more {
	margin: var(--space-4) 0 0;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Category cards (front page) — PC最大3列・左詰め
   -------------------------------------------------------------------------- */
.category-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-3);
	justify-content: start;
}

.category-card {
	display: block;
	padding: var(--space-3);
	border: 1px solid var(--theme-border);
	border-radius: var(--radius-md);
	background: var(--theme-bg);
	color: var(--theme-text);
	text-align: center;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.category-card:hover {
	border-color: var(--theme-primary);
	box-shadow: var(--theme-shadow);
	transform: translateY(-2px);
	color: var(--theme-text);
	text-decoration: none;
}

.category-card__name {
	display: block;
	margin-bottom: var(--space-1);
	font-size: 1.05rem;
	font-weight: 700;
}

.category-card__desc {
	display: block;
	color: var(--theme-text-muted);
	font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Category label (記事カードの上の小ラベル)
   -------------------------------------------------------------------------- */
.category-label {
	align-self: flex-start;
	display: inline-block;
	padding: 0.25em 0.8em;
	border-radius: var(--radius-sm);
	background: var(--theme-primary-soft);
	color: var(--theme-primary-strong);
	font-size: 0.78rem;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.category-label:hover {
	background: var(--theme-primary-strong);
	color: #fff;
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   Card grid (最新記事・関連記事)
   -------------------------------------------------------------------------- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-3);
}

.card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--theme-border);
	border-radius: var(--radius-md);
	background: var(--theme-bg);
}

.card-thumb {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--theme-bg-soft);
}

.card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.card-thumb:hover img {
	transform: scale(1.06);
}

.card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-1);
	padding: var(--space-2);
}

.card-title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
}

.card-title a {
	color: var(--theme-text);
	text-decoration: none;
}

.card-title a:hover {
	color: var(--theme-primary-strong);
}

.card-excerpt {
	margin: 0;
	color: var(--theme-text-muted);
	font-size: 0.9rem;
}

.card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.2em 0.8em;
	margin-top: auto;
	padding-top: var(--space-1);
	color: var(--theme-text-muted);
	font-size: 0.8rem;
}

/* カードでは更新日をアクセント色で（記事ページ側は本文メタと同じ色のまま） */
.card-meta .updated-on {
	color: var(--theme-primary-strong);
}

/* --------------------------------------------------------------------------
   Post list (archive / search / blog index)
   -------------------------------------------------------------------------- */
.post-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.post-list .card {
	flex-direction: row;
}

.post-list .card .card-thumb {
	flex: none;
	width: 220px;
	aspect-ratio: 3 / 2;
}

.post-list .card .card-title {
	font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   Layout: content + sidebar
   -------------------------------------------------------------------------- */
.content-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
	gap: var(--space-4);
	align-items: start;
	padding-block: var(--space-4);
}

.content-layout.no-sidebar {
	grid-template-columns: minmax(0, 1fr);
	max-width: calc(var(--content-width) + var(--space-4) * 2);
}

.primary {
	min-width: 0;
}

/* --------------------------------------------------------------------------
   Sidebar / widgets
   -------------------------------------------------------------------------- */
.sidebar {
	min-width: 0;
}

.widget {
	margin-bottom: var(--space-3);
	padding-bottom: var(--space-3);
	border-bottom: 1px solid var(--theme-border);
}

.widget:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.widget-title {
	margin-bottom: var(--space-2);
	font-size: 1rem;
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}

.widget ul ul {
	margin-top: var(--space-1);
	margin-left: var(--space-2);
}

.widget a {
	color: var(--theme-text);
	text-decoration: none;
}

.widget a:hover {
	color: var(--theme-primary-strong);
	text-decoration: underline;
}

.widget .wp-block-search__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.widget .wp-block-search__inside-wrapper {
	display: flex;
	gap: var(--space-1);
}

.widget .wp-block-search__button {
	margin: 0;
	padding: 0.7em 1.2em;
	border: 1px solid var(--theme-primary-strong);
	border-radius: var(--radius-sm);
	background: var(--theme-primary-strong);
	color: #fff;
	font-weight: 700;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
/* 参考サイト（chiikoto-labo）に合わせた配置ルール:
   - ヘッダーから 40px（--space-4）下げ、下は 24px（--space-3）空ける
   - 投稿記事・固定ページ・404・フォールバック = 本文と同じ 720px 幅の枠内で
     左寄せ（記事タイトル・本文と左端を揃える）
   - アーカイブ・投稿一覧・検索結果 = .archive-header の中に入れ、見出しと同じ
     コンテナ幅いっぱい・中央寄せ */
.breadcrumb {
	max-width: var(--content-width);
	margin-left: auto;
	margin-right: auto;
	padding-top: var(--space-4);
	margin-bottom: var(--space-3);
	color: var(--theme-text-muted);
	font-size: 0.8rem;
}

/* アーカイブ系は .archive-header（コンテナ幅・中央寄せ）の内側に入れる。
   上余白は .archive-header の padding-top が担当するので打ち消し、
   幅は 720px 制限を外してコンテナ幅いっぱいに戻す。 */
.archive-header .breadcrumb {
	max-width: none;
	padding-top: 0;
}

.breadcrumb ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em;
	margin: 0;
	padding: 0;
}

/* アーカイブ見出しは中央寄せなので、パンくずも中央に揃える（参考サイト準拠） */
.archive-header .breadcrumb ol {
	justify-content: center;
}

.breadcrumb li {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
}

.breadcrumb li:not(:last-child)::after {
	content: "＞";
	color: var(--theme-text-muted);
}

.breadcrumb a {
	color: var(--theme-text-muted);
	text-decoration: none;
}

.breadcrumb a:hover {
	color: var(--theme-primary-strong);
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Archive header
   -------------------------------------------------------------------------- */
.archive-header {
	padding-top: var(--space-4);
	text-align: center;
}

.archive-title {
	margin-bottom: var(--space-1);
	font-size: 1.6rem;
}

.archive-description {
	max-width: var(--content-width);
	margin-inline: auto;
	color: var(--theme-text-muted);
}

/* --------------------------------------------------------------------------
   Single article
   -------------------------------------------------------------------------- */
/* 投稿ページ全体の縦余白だけを持つラッパー。横幅は制限しない
   （中の .container / .related-posts / .post-nav が各自で幅を決める）。
   上端の余白は .breadcrumb の padding-top（--space-4）に任せ、下だけ確保する。 */
.single-main {
	padding-bottom: var(--space-5);
}

/* .single-article はテーマ独自クラス。WordPress の body_class() が出力する
   .single-post とは別名にして、記事本文だけを本文幅へ収める（ヘッダー・
   フッターは全ページ共通の .container 幅のまま）。 */
.single-article,
.page-article {
	max-width: var(--content-width);
	margin-inline: auto;
}

.entry-header {
	margin-bottom: var(--space-3);
}

.entry-header__category {
	margin-bottom: var(--space-2);
}

.entry-title {
	margin: 0 0 var(--space-2);
	font-size: 1.8rem;
	line-height: 1.5;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	color: var(--theme-text-muted);
	font-size: 0.85rem;
}

.entry-thumbnail {
	margin: 0 0 var(--space-4);
	border-radius: var(--radius-md);
	overflow: hidden;
}

.entry-thumbnail img {
	width: 100%;
}

/* --------------------------------------------------------------------------
   Table of contents
   -------------------------------------------------------------------------- */
.toc {
	margin: 0 0 var(--space-4);
	padding: var(--space-3);
	border: 1px solid var(--theme-border);
	border-radius: var(--radius-md);
	background: var(--theme-bg-soft);
}

.toc-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	width: 100%;
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	font-size: 1rem;
	font-weight: 700;
	color: var(--theme-text);
}

.toc-title::after {
	content: "";
	width: 8px;
	height: 8px;
	flex: none;
	border-right: 2px solid var(--theme-text-muted);
	border-bottom: 2px solid var(--theme-text-muted);
	transform: rotate(45deg);
	transition: transform 0.25s ease;
}

.toc.is-open .toc-title::after {
	transform: rotate(-135deg);
}

.toc-list {
	list-style: none;
	max-height: 0;
	margin: 0;
	padding-left: 0;
	overflow: hidden;
	opacity: 0;
	counter-reset: toc-h2;
	transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.3s ease;
}

.toc.is-open .toc-list {
	max-height: none;
	margin-top: var(--space-2);
	opacity: 1;
}

.toc-item {
	margin-top: var(--space-1);
	line-height: 1.6;
}

.toc-item--h2 {
	counter-increment: toc-h2;
}

.toc-item--h2 > a::before {
	content: counter(toc-h2) ". ";
	color: var(--theme-primary-strong);
	font-weight: 700;
}

.toc-item--h3 {
	padding-left: 1.4em;
	font-size: 0.92rem;
}

.toc a {
	color: var(--theme-text);
	text-decoration: none;
}

.toc a:hover {
	color: var(--theme-primary-strong);
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Entry content (block editor output)
   -------------------------------------------------------------------------- */
.entry-content > * {
	margin-bottom: var(--space-3);
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

.entry-content h2 {
	margin-top: var(--space-5);
	padding-bottom: var(--space-1);
	border-bottom: 2px solid var(--theme-primary);
	font-size: 1.4rem;
	scroll-margin-top: calc(var(--header-height) + var(--space-2));
}

.entry-content h3 {
	margin-top: var(--space-4);
	padding-left: var(--space-2);
	border-left: 4px solid var(--theme-primary);
	font-size: 1.15rem;
	scroll-margin-top: calc(var(--header-height) + var(--space-2));
}

.entry-content h4 {
	margin-top: var(--space-3);
	font-size: 1rem;
}

.entry-content p {
	line-height: 2;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.6em;
}

.entry-content li {
	margin-bottom: 0.4em;
}

.entry-content li > ul,
.entry-content li > ol {
	margin-top: 0.4em;
}

/* 強調（太字）：文字色は本文のまま、下側 40% にテーマカラーの淡いマーカーを敷く。
   マーカー色は --theme-primary-soft なので、メインカラー変更に追従する。 */
.entry-content strong,
.entry-content b {
	font-weight: 700;
	background-image: linear-gradient(transparent 60%, var(--theme-primary-soft) 60%);
}

/* 見出しの中の強調にはマーカーを敷かない */
.entry-content :is(h1, h2, h3, h4, h5, h6) strong,
.entry-content :is(h1, h2, h3, h4, h5, h6) b {
	background-image: none;
}

.entry-content a {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.entry-content blockquote {
	margin: 0 0 var(--space-3);
	padding: var(--space-2) var(--space-3);
	border-left: 4px solid var(--theme-primary);
	background: var(--theme-bg-soft);
	color: var(--theme-text-muted);
}

.entry-content blockquote > *:last-child {
	margin-bottom: 0;
}

.entry-content figure {
	margin: 0 0 var(--space-3);
}

.entry-content img {
	border-radius: var(--radius-sm);
}

.entry-content .wp-block-image img {
	display: block;
	margin-inline: auto;
}

.entry-content figcaption,
.wp-element-caption {
	margin-top: 0.5em;
	color: var(--theme-text-muted);
	font-size: 0.8rem;
	text-align: center;
}

/* テーブル：thead / tfoot に太線を付けず、全セルを 1px 枠線で均一に見せる。
   スマホでは幅を保ったまま枠内で横スクロールさせ、列を潰さない（参考サイト準拠）。 */
.entry-content .wp-block-table,
.entry-content .wp-block-table.aligncenter,
.entry-content .wp-block-table.alignleft,
.entry-content .wp-block-table.alignright {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.entry-content th,
.entry-content td {
	padding: 0.6em 0.8em;
	border: 1px solid var(--theme-border);
	text-align: left;
}

.entry-content th {
	background: var(--theme-bg-soft);
}

/* WordPress標準ブロックCSS（wp-block-styles）が thead / tfoot に付ける
   3px の太線を打ち消す。thead は特別扱いせず、セル枠線だけで見せる。 */
.entry-content .wp-block-table thead,
.entry-content .wp-block-table tfoot {
	border: 0;
}

@media (max-width: 700px) {
	.entry-content .wp-block-table table {
		min-width: 700px;
	}
}

.entry-content pre {
	overflow-x: auto;
	padding: var(--space-3);
	border-radius: var(--radius-md);
	background: #1f2933;
	color: #e6edf3;
	font-size: 0.9rem;
	line-height: 1.7;
}

.entry-content code {
	padding: 0.15em 0.4em;
	border-radius: var(--radius-sm);
	background: var(--theme-bg-soft);
	font-size: 0.92em;
}

.entry-content pre code {
	padding: 0;
	background: none;
	color: inherit;
}

.entry-content .wp-block-columns {
	gap: var(--space-3);
}

.entry-content .wp-block-gallery {
	gap: var(--space-1);
}

/* 全幅・幅広ブロック */
.entry-content .alignwide {
	width: min(100%, calc(var(--content-width) + 160px));
	margin-inline: calc(50% - min(50%, calc(var(--content-width) / 2 + 80px)));
}

.entry-content .alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.entry-content .alignleft {
	float: left;
	margin: 0 var(--space-3) var(--space-2) 0;
}

.entry-content .alignright {
	float: right;
	margin: 0 0 var(--space-2) var(--space-3);
}

.entry-content .aligncenter {
	margin-inline: auto;
}

.page-links {
	margin-top: var(--space-3);
	font-weight: 700;
}

.page-links a {
	display: inline-block;
	margin: 0 0.2em;
	padding: 0.2em 0.7em;
	border: 1px solid var(--theme-primary-strong);
	border-radius: var(--radius-sm);
	text-decoration: none;
}

.entry-footer {
	margin-top: var(--space-4);
}

.entry-tags {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1);
	margin: 0;
	padding: 0;
}

.entry-tags a {
	display: inline-block;
	padding: 0.3em 0.9em;
	border: 1px solid var(--theme-border);
	border-radius: 999px;
	color: var(--theme-text-muted);
	font-size: 0.8rem;
	text-decoration: none;
}

.entry-tags a:hover {
	border-color: var(--theme-primary);
	color: var(--theme-primary-strong);
}

/* --------------------------------------------------------------------------
   Share buttons（薄いグレーの枠で囲む・参考サイト準拠）
   -------------------------------------------------------------------------- */
.share-buttons {
	max-width: var(--content-width);
	margin: var(--space-5) auto 0;
	padding: var(--space-3);
	border: 1px solid var(--theme-border);
	border-radius: var(--radius-md);
	background: var(--theme-bg-soft);
}

.share-buttons__title {
	margin: 0 0 var(--space-2);
	font-size: 0.95rem;
	font-weight: 700;
}

.share-buttons__list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1);
	margin: 0;
	padding: 0;
}

.share-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.55em 1.1em;
	border: 1px solid var(--theme-border);
	border-radius: var(--radius-md);
	background: var(--theme-bg);
	color: var(--theme-text);
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
	transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.share-button:hover {
	border-color: var(--theme-primary);
	background: var(--theme-primary-soft);
	color: var(--theme-primary-strong);
	text-decoration: none;
}

.share-buttons__feedback {
	display: inline-block;
	margin-top: var(--space-2);
	padding: 0 0.2em;
	color: var(--theme-primary-strong);
	font-size: 0.85rem;
	font-weight: 700;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.share-buttons__feedback.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Related posts（本文より広く、コンテナ幅いっぱいで3枚横並び）
   .related-posts は .container クラスも持つ（幅・左右padding・中央寄せはそちら）
   -------------------------------------------------------------------------- */
.related-posts {
	margin-top: var(--space-5);
	padding-bottom: var(--space-4);
}

.related-posts__title {
	margin: 0 0 var(--space-3);
	padding-left: var(--space-2);
	border-left: 4px solid var(--theme-primary);
	font-size: 1.25rem;
	line-height: 1.4;
}

.card-grid--related {
	grid-template-columns: repeat(3, 1fr);
}

/* タイトルが長くてもカード高さが極端に崩れないよう3行で省略 */
.card-grid--related .card-title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Post navigation (前の記事 / 一覧に戻る / 次の記事)
   記事タイトルは表示せず、文言のみ。3セルはボタンで統一。
   記事本文と同じ幅（720px）・中央寄せ。.container の内側に置く。
   -------------------------------------------------------------------------- */
.post-nav {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-3);
	align-items: center;
	max-width: var(--content-width);
	margin: var(--space-5) auto 0;
	padding-top: var(--space-4);
	border-top: 1px solid var(--theme-border);
}

.post-nav__cell {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

/* 正常時：テーマカラーで塗りつぶし。ホバー時：反転（背景を抜いて枠線＋文字色） */
.post-nav__link,
.post-nav__archive-link {
	display: inline-block;
	padding: 0.6em 1.4em;
	border: 1px solid var(--theme-primary-strong);
	border-radius: var(--radius-sm);
	background: var(--theme-primary-strong);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.post-nav__link:hover,
.post-nav__archive-link:hover {
	background: transparent;
	color: var(--theme-primary-strong);
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   About section (front page)
   -------------------------------------------------------------------------- */
.about-section {
	max-width: var(--content-width);
	margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
	margin-top: var(--space-4);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-1);
}

/* 数字・「＜」・「＞」すべて同じ 2.4em 角の四角。nav-links の align-items:center と
   固定 height で、数字の四角と矢印の四角が水平にズレない。 */
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4em;
	height: 2.4em;
	padding: 0 0.5em;
	border: 1px solid var(--theme-primary-strong);
	color: var(--theme-primary-strong);
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
}

.pagination .page-numbers.current {
	background: var(--theme-primary-strong);
	color: #fff;
}

.pagination .page-numbers.dots {
	border: none;
	color: var(--theme-text-muted);
}

.pagination .page-numbers:not(.current):not(.dots):hover {
	background: var(--theme-primary-soft);
}

/* 「＜」「＞」は文字ではなく、右下2辺だけの小さな四角を回転させた山形で描く。
   リンク内にテキストが無いので、フォント差による上下ズレが起きない。
   線色は currentColor（リンクの文字色＝テーマカラー）に追従する。 */
.pagination .prev::after,
.pagination .next::after {
	content: "";
	display: block;
	width: 6px;
	height: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
}

.pagination .next::after {
	transform: rotate(-45deg);
}

.pagination .prev::after {
	transform: rotate(135deg);
}

/* --------------------------------------------------------------------------
   404 / no results
   -------------------------------------------------------------------------- */
.error-404,
.no-results {
	max-width: var(--content-width);
	margin-inline: auto;
	padding-block: var(--space-4);
	text-align: center;
}

.error-404__search,
.no-results__search {
	max-width: 480px;
	margin: var(--space-3) auto;
}

.error-404 .page-title,
.no-results .page-title {
	font-size: 1.5rem;
}

/* --------------------------------------------------------------------------
   Comments
   -------------------------------------------------------------------------- */
.comments-area {
	max-width: var(--content-width);
	margin: var(--space-5) auto 0;
	padding-top: var(--space-4);
	border-top: 1px solid var(--theme-border);
}

.comments-title,
.comment-reply-title {
	font-size: 1.2rem;
	margin-bottom: var(--space-3);
}

.comment-list {
	list-style: none;
	margin: 0 0 var(--space-4);
	padding: 0;
}

.comment-list ol.children {
	list-style: none;
	margin-left: var(--space-3);
	padding-left: var(--space-2);
	border-left: 1px solid var(--theme-border);
}

.comment-body {
	padding: var(--space-2) 0;
	border-bottom: 1px solid var(--theme-border);
}

.comment-author {
	display: flex;
	align-items: center;
	gap: var(--space-1);
	font-size: 0.9rem;
}

.comment-author .avatar {
	border-radius: 50%;
}

.comment-metadata {
	color: var(--theme-text-muted);
	font-size: 0.78rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 0.7em 1em;
	border: 1px solid var(--theme-border);
	border-radius: var(--radius-sm);
	background: #fff;
}

.comment-form textarea {
	min-height: 140px;
}

.comment-form .form-submit {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
	margin-top: var(--space-5);
	padding: var(--space-4) 0 var(--space-3);
	border-top: 1px solid var(--theme-border);
	background: var(--theme-bg-soft);
}

.footer-brand {
	margin-bottom: var(--space-1);
	font-weight: 700;
}

.footer-brand a {
	color: var(--theme-text);
	text-decoration: none;
}

.footer-nav ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1) var(--space-3);
	margin: var(--space-2) 0;
	padding: 0;
}

.footer-nav a {
	color: var(--theme-text-muted);
	font-size: 0.85rem;
	text-decoration: none;
}

.footer-nav a:hover {
	color: var(--theme-primary-strong);
	text-decoration: underline;
}

.footer-copyright {
	margin: var(--space-2) 0 0;
	color: var(--theme-text-muted);
	font-size: 0.8rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
	.card-grid,
	.card-grid--related,
	.category-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.content-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sidebar {
		order: 2;
		margin-top: var(--space-4);
		padding-top: var(--space-4);
		border-top: 1px solid var(--theme-border);
	}

	.primary {
		order: 1;
	}
}

@media (max-width: 782px) {
	:root {
		--header-height: 68px;
	}

	.site-description {
		display: none;
	}

	/* スマホでは検索アイコン・ハンバーガー・ヘッダーを圧迫しないよう少し下げる。
	   固定幅は与えず、max-height の上限だけ下げる（縦横比は width:auto で維持）。 */
	.site-branding .custom-logo {
		max-height: 40px;
	}

	.menu-toggle {
		display: inline-flex;
	}

	.site-header-inner {
		position: relative;
	}

	/* スマホ: サイトタイトルは左寄せのまま、右側に [虫眼鏡 ハンバーガー] を並べる
	   （並び順は header.php の DOM 順 = nav → search-toggle → menu-toggle）。 */
	.header-controls {
		gap: 0;
	}

	.main-navigation {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 200;
		max-height: 0;
		overflow: hidden;
		opacity: 0;
		background: var(--theme-bg-soft);
		border-bottom: 1px solid var(--theme-border);
		transition: max-height 0.3s ease, opacity 0.25s ease;
		pointer-events: none;
	}

	.main-navigation.is-open {
		max-height: 80vh;
		overflow-y: auto;
		opacity: 1;
		padding: var(--space-1) var(--space-2);
		pointer-events: auto;
	}

	.main-navigation ul {
		flex-direction: column;
		justify-content: flex-start;
		gap: 0;
	}

	.main-navigation li {
		border-bottom: 1px solid var(--theme-border);
	}

	.main-navigation li:last-child {
		border-bottom: none;
	}

	.main-navigation a {
		display: block;
		padding: var(--space-2) 0;
		text-align: center;
	}
}

@media (max-width: 600px) {
	:root {
		--space-5: 48px;
	}

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

	.post-list .card {
		flex-direction: column;
	}

	.post-list .card .card-thumb {
		width: 100%;
	}

	.hero-title {
		font-size: 1.7rem;
	}

	.entry-title {
		font-size: 1.4rem;
	}

	.section-title {
		font-size: 1.3rem;
	}

	/* スマホでは 前の記事 → 一覧に戻る → 次の記事 を縦並び・全幅ボタンに */
	.post-nav {
		grid-template-columns: 1fr;
		gap: var(--space-2);
	}

	.post-nav__cell {
		justify-content: center;
	}

	.post-nav__link,
	.post-nav__archive-link {
		width: 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
