/*
Theme Name: 世界史まとめ
Author: 船長
Description: 年表と構図で覚える歴史サイト用テーマ。トップは表紙の帯・大きな最新記事・新着・カテゴリー別の並び。記事ページはパンくず、読む時間、シェア、自動の目次、関連記事。アイキャッチのない記事はタイトルの1文字目を大きく使った表紙になる。wh- で始まる部品クラスで年表・対比・比較表を記事に組み込める。WordPress 4.7 以降、PHP 5.6 以降で動作。
Version: 3.1.0
Requires at least: 4.7
Tested up to: 6.5
Requires PHP: 5.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sekaishi-matome
*/

/* ============================================================
   色と文字（ここを変えるとサイト全体が変わる）
   ============================================================ */
:root {
  --wh-page: #F2F3EF;
  --wh-paper: #FFFFFF;
  --wh-ink: #1C2124;
  --wh-ink-2: #2A3034;
  --wh-body: #2E3538;
  --wh-sub: #5B6468;
  --wh-line: #D9DEDB;
  --wh-soft: #F3F5F2;

  --wh-mao: #B8321F;
  --wh-mao-bg: #FBEDEA;
  --wh-deng: #1F6E5A;
  --wh-deng-bg: #E3F1EB;
  --wh-sov: #3C3489;
  --wh-sov-bg: #EEEDFB;
  --wh-kmt: #1F5A96;
  --wh-kmt-bg: #E6EEF7;

  --wh-serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --wh-sans: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;

  --wh-wrap: 1180px;
  --wh-gutter: 16px;
  --wh-radius: 12px;
  --wh-stripe: linear-gradient(90deg, var(--wh-mao) 0 25%, var(--wh-kmt) 25% 50%, var(--wh-sov) 50% 75%, var(--wh-deng) 75% 100%);
  --wh-shadow: 0 1px 2px rgba(28, 33, 36, .06), 0 8px 24px rgba(28, 33, 36, .06);
  --wh-shadow-hover: 0 2px 4px rgba(28, 33, 36, .08), 0 14px 32px rgba(28, 33, 36, .12);
}

/* ============================================================
   土台
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wh-page);
  color: var(--wh-body);
  font-family: var(--wh-sans);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
body > .site-main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; }
a { color: var(--wh-deng); text-underline-offset: 3px; }
a:hover { color: var(--wh-ink); }
:focus-visible { outline: 2px solid var(--wh-ink); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; left: 8px; top: 8px; z-index: 1000;
  background: var(--wh-paper); padding: 8px 12px; color: var(--wh-ink);
}

/* ============================================================
   ヘッダー
   ============================================================ */
.site-header { background: var(--wh-paper); position: sticky; top: 0; z-index: 50; }
.site-header::after { content: ""; display: block; height: 4px; background: var(--wh-stripe); }
.admin-bar .site-header { top: 46px; }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.site-header__inner {
  max-width: var(--wh-wrap); margin: 0 auto; padding: 10px var(--wh-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.site-brand { min-width: 0; }
.site-title {
  margin: 0; font-family: var(--wh-serif); font-weight: 800; font-size: 21px; line-height: 1.3; letter-spacing: .03em;
}
.site-title a { color: var(--wh-ink); text-decoration: none; }
.site-description { display: none; margin: 2px 0 0; font-size: 12px; color: var(--wh-sub); line-height: 1.5; }
.custom-logo { display: block; max-height: 48px; width: auto; }

.menu-toggle {
  flex-shrink: 0; display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 48px; min-height: 48px; justify-content: center;
  background: transparent; border: 0; border-radius: 8px; cursor: pointer; padding: 6px 8px;
}
.menu-toggle__bars { display: flex; flex-direction: column; gap: 4px; }
.menu-toggle__bars span { display: block; width: 22px; height: 2px; background: var(--wh-ink); border-radius: 1px; transition: transform .2s, opacity .2s; }
.menu-toggle__label { font-size: 10px; line-height: 1; color: var(--wh-ink); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* スマホのメニュー（ヘッダーの下に開く） */
.site-nav { background: var(--wh-ink); }
.has-js .site-nav { display: none; }
.has-js .site-nav.is-open { display: block; position: sticky; top: 72px; z-index: 49; max-height: calc(100vh - 72px); overflow-y: auto; }
.site-nav__inner { max-width: var(--wh-wrap); margin: 0 auto; padding: 6px var(--wh-gutter) 16px; }
.site-nav .menu { list-style: none; margin: 0; padding: 0; }
.site-nav .menu a {
  display: block; padding: 12px 2px; color: #FFFFFF; text-decoration: none; font-size: 15px; font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.site-nav .menu a:hover { color: #FFFFFF; text-decoration: underline; }
.site-nav .current-menu-item > a, .site-nav .current-cat > a { color: #FFFFFF; }
.site-nav .sub-menu { list-style: none; margin: 0; padding: 0 0 0 16px; }
.site-nav .sub-menu a { font-size: 14px; font-weight: 400; }

.nav-search { display: flex; align-items: center; margin-top: 14px; background: var(--wh-ink-2); border-radius: 999px; padding: 0 4px 0 16px; border: 1px solid rgba(255, 255, 255, .14); }
.nav-search__input { flex: 1; min-width: 0; background: transparent; border: 0; color: #FFFFFF; font-size: 16px; padding: 9px 0; }
.nav-search__input::placeholder { color: #AEB6B9; }
.nav-search__input:focus { outline: none; }
.nav-search:focus-within { border-color: rgba(255, 255, 255, .5); }
.nav-search__button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #FFFFFF; cursor: pointer; }

@media (min-width: 900px) {
  .site-header { position: static; }
  .site-header::after { display: none; }
  .site-header__inner { padding: 18px var(--wh-gutter) 16px; }
  .site-title { font-size: 26px; }
  .site-description { display: block; }
  .menu-toggle { display: none; }

  .has-js .site-nav, .site-nav { display: block; position: sticky; top: 0; z-index: 50; }
  .admin-bar .site-nav { top: 32px; }
  .site-nav::after { content: ""; display: block; height: 4px; background: var(--wh-stripe); }
  .site-nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 var(--wh-gutter); }
  .site-nav .menu { display: flex; flex-wrap: wrap; }
  .site-nav .menu > li { position: relative; }
  .site-nav .menu a { border-bottom: 0; padding: 15px 16px; font-size: 14px; font-weight: 700; letter-spacing: .04em; }
  .site-nav .menu > li:first-child > a { padding-left: 0; }
  .site-nav .menu > li > a:hover { text-decoration: none; box-shadow: inset 0 -3px 0 #FFFFFF; }
  .site-nav .menu > li:first-child > a:hover { box-shadow: none; text-decoration: underline; }
  .site-nav .sub-menu {
    display: none; position: absolute; left: 0; top: 100%; z-index: 20; min-width: 220px;
    background: var(--wh-ink); padding: 6px 0; box-shadow: 0 12px 24px rgba(0, 0, 0, .2);
  }
  .site-nav .menu > li:hover > .sub-menu, .site-nav .menu > li:focus-within > .sub-menu { display: block; }
  .site-nav .sub-menu a { padding: 9px 16px; font-weight: 500; }
  .nav-search { margin: 0; width: 260px; flex-shrink: 0; }
  .nav-search__input { font-size: 14px; padding: 6px 0; }
  .nav-search__button { width: 34px; height: 34px; }
}

/* ============================================================
   トップの表紙の帯
   ============================================================ */
.hero { position: relative; overflow: hidden; background: var(--wh-ink); color: #FFFFFF; }
.hero__bg {
  position: absolute; inset: 0; background-color: var(--wh-ink);
  background-repeat: no-repeat; background-size: cover; background-position: 72% center;
}
.hero__bg::after {
  /* 文字を読みやすくするための影（左ほど濃い） */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(28, 33, 36, .96) 0%, rgba(28, 33, 36, .9) 38%, rgba(28, 33, 36, .45) 62%, rgba(28, 33, 36, .08) 100%);
}
.hero__inner { position: relative; max-width: var(--wh-wrap); margin: 0 auto; padding: 40px var(--wh-gutter) 34px; }
.hero__kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .12em; color: #C9D0D3; }
.hero__title {
  margin: 8px 0 0; font-family: var(--wh-serif); font-weight: 800; color: #FFFFFF;
  font-size: 36px; line-height: 1.3; letter-spacing: .04em; text-wrap: balance;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .35);
}
.hero__routes { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 0; font-size: 12px; color: #C9D0D3; letter-spacing: .06em; }
.hero__route { display: inline-flex; align-items: center; gap: 8px; }
.hero__route::before { content: ""; width: 22px; height: 0; border-top: 3px solid; }
.hero__route--silk::before { border-color: #E0715E; }
.hero__route--sea::before { border-top-style: dotted; border-color: #5DC3A6; }
.hero__route--ken::before { border-top-style: dashed; border-color: #EFB35A; }
.hero__cats { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.hero__cats a {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 14px; min-height: 44px;
  background: rgba(28, 33, 36, .55); border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px;
  color: #FFFFFF; text-decoration: none; font-weight: 700; font-size: 14px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.hero__cats a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cat, #FFFFFF); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.hero__cats a:hover { background: rgba(255, 255, 255, .16); color: #FFFFFF; }
.hero__cat-count { font-weight: 400; font-size: 12px; color: #C9D0D3; }
@media (max-width: 899px) {
  .hero__bg { background-position: 78% center; }
  .hero__bg::after { background: linear-gradient(180deg, rgba(28, 33, 36, .55) 0%, rgba(28, 33, 36, .82) 100%); }
}
@media (min-width: 900px) {
  .hero { min-height: 440px; display: flex; align-items: center; }
  .hero__inner { width: 100%; padding: 64px var(--wh-gutter) 56px; }
  .hero__title { font-size: 54px; }
  .hero__kicker { font-size: 14px; }
}

/* ============================================================
   一覧ページの見出し帯・パンくず
   ============================================================ */
.page-head { position: relative; overflow: hidden; background: var(--wh-ink); color: #FFFFFF; }
.page-head__bg { background-position: 85% 40%; }
.page-head__inner { position: relative; max-width: var(--wh-wrap); margin: 0 auto; padding: 14px var(--wh-gutter) 26px; }
.page-head__kicker { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 12px; font-weight: 700; color: #C9D0D3; letter-spacing: .06em; }
.page-head__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cat, #FFFFFF); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.page-head__title { margin: 4px 0 0; font-family: var(--wh-serif); font-weight: 800; color: #FFFFFF; font-size: 28px; line-height: 1.35; }
.page-head__desc { font-size: 14px; margin-top: 6px; color: #D9DEDB; }
.page-head .breadcrumb ol, .page-head .breadcrumb a, .page-head .breadcrumb [aria-current] { color: #C9D0D3; }
.page-head .breadcrumb a:hover { color: #FFFFFF; }
.page-head__desc p { margin: 0; }
@media (min-width: 900px) { .page-head__title { font-size: 36px; } .page-head__inner { padding: 18px var(--wh-gutter) 40px; } }

.crumb-bar__inner { max-width: var(--wh-wrap); margin: 0 auto; padding: 12px var(--wh-gutter) 0; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; font-size: 12px; color: var(--wh-sub); line-height: 1.6; }
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; color: #9AA3A6; }
.breadcrumb a { color: var(--wh-sub); text-decoration: none; }
.breadcrumb a:hover { color: var(--wh-ink); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--wh-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28em; }

/* ============================================================
   本体の枠（PCはメイン＋サイドバー）
   ============================================================ */
.site-main { padding: 0 0 56px; }
.layout {
  max-width: var(--wh-wrap); margin: 0 auto; padding: 24px var(--wh-gutter) 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px;
}
.layout__main { min-width: 0; }
@media (min-width: 1100px) {
  :root { --wh-gutter: 24px; }
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; padding-top: 32px; }
  .sidebar { position: sticky; top: 72px; }
  .admin-bar .sidebar { top: 104px; }
}

/* ============================================================
   セクション見出し
   ============================================================ */
.home-section { margin-top: 44px; }
.section-title {
  display: flex; align-items: center; gap: 14px; margin: 0 0 18px;
  font-family: var(--wh-serif); font-weight: 800; color: var(--wh-ink); font-size: 22px; line-height: 1.4;
}
.section-title::before { content: ""; flex-shrink: 0; width: 12px; height: 12px; background: var(--cat, var(--wh-ink)); transform: rotate(45deg); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--wh-line); }
.section-title--cat span { color: var(--wh-ink); }
.more-link { margin: 18px 0 0; text-align: right; }
.more-link a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 18px;
  border: 1.5px solid var(--wh-ink); border-radius: 999px; color: var(--wh-ink); text-decoration: none; font-size: 14px; font-weight: 700;
  background: var(--wh-paper);
}
.more-link a::after { content: "→"; }
.more-link a:hover { background: var(--wh-ink); color: #FFFFFF; }

/* ============================================================
   画像部分（アイキャッチ／漢字の表紙）
   ============================================================ */
.media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--cat, var(--wh-ink)); text-decoration: none; }
.media__img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.media__cover { position: absolute; inset: 0; display: block; background: var(--cat, var(--wh-ink)); }
.media__cover::before {
  /* 斜めの細い線で紙の地を出す */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 14px);
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .media--tone1, .media--tone1 .media__cover { background: color-mix(in srgb, var(--cat) 78%, #000000); }
  .media--tone2, .media--tone2 .media__cover { background: color-mix(in srgb, var(--cat) 86%, #FFFFFF); }
}
.media__char {
  position: absolute; right: 6%; top: 50%; transform: translateY(-54%);
  font-family: var(--wh-serif); font-weight: 800; color: #FFFFFF; font-size: 7.5em; line-height: 1; opacity: .92;
}

.badge {
  display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.8;
  background: var(--cat, var(--wh-ink)); color: #FFFFFF; text-decoration: none; letter-spacing: .04em;
}
.badge:hover { color: #FFFFFF; filter: brightness(1.15); }
.new-mark {
  position: absolute; left: 10px; top: 10px; z-index: 2; padding: 1px 8px; border-radius: 4px;
  background: #FFFFFF; color: var(--wh-mao); font-size: 11px; font-weight: 800; letter-spacing: .1em; line-height: 1.7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.new-mark--inline { position: static; display: inline-block; margin-left: 8px; box-shadow: none; border: 1px solid var(--wh-mao); vertical-align: 1px; }

/* ============================================================
   トップの大きな記事
   ============================================================ */
.feature {
  display: grid; grid-template-columns: minmax(0, 1fr); background: var(--wh-paper); border-radius: var(--wh-radius);
  overflow: hidden; box-shadow: var(--wh-shadow);
}
.feature__media { position: relative; }
.feature__media .media { height: 100%; }
.feature__media .media__char { font-size: 10em; }
.feature__body { padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 8px; }
.feature__kicker { margin: 0; display: flex; align-items: center; font-size: 12px; font-weight: 700; color: var(--wh-sub); letter-spacing: .1em; }
.feature__kicker::before { content: ""; width: 24px; height: 2px; background: var(--wh-mao); margin-right: 10px; }
.feature__title { margin: 0; font-family: var(--wh-serif); font-weight: 800; font-size: 23px; line-height: 1.45; }
.feature__title a { color: var(--wh-ink); text-decoration: none; }
.feature__title a:hover { text-decoration: underline; }
.feature__excerpt {
  margin: 0; font-size: 14px; line-height: 1.8; color: var(--wh-body);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.feature__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--wh-sub); }
.feature__more {
  align-self: flex-start; margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 20px;
  background: var(--wh-ink); color: #FFFFFF; text-decoration: none; border-radius: 999px; font-size: 14px; font-weight: 700;
}
.feature__more::after { content: "→"; }
.feature__more:hover { background: var(--wh-mao); color: #FFFFFF; }
.feature:hover .media__img { transform: scale(1.03); }
@media (min-width: 760px) {
  .feature { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .feature__media .media { aspect-ratio: auto; min-height: 300px; }
  .feature__body { padding: 28px 30px; justify-content: center; }
  .feature__title { font-size: 27px; }
}

/* ============================================================
   記事カード
   ============================================================ */
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 600px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card {
  position: relative; background: var(--wh-paper); border-radius: var(--wh-radius); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--wh-shadow); transition: box-shadow .25s, transform .25s;
}
.card:hover { box-shadow: var(--wh-shadow-hover); transform: translateY(-2px); }
.card:hover .media__img { transform: scale(1.04); }
.card__media { position: relative; }
.card__body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--wh-sub); }
.card__title { margin: 0; font-family: var(--wh-serif); font-weight: 800; font-size: 18px; line-height: 1.5; }
.card__title a { color: var(--wh-ink); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__title a:hover { text-decoration: underline; }
.card__meta .badge { position: relative; z-index: 2; }
.card__excerpt {
  margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--wh-body);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card__date { font-size: 12px; color: var(--wh-sub); }
@media (prefers-reduced-motion: reduce) {
  .card, .media__img { transition: none; }
  .card:hover { transform: none; }
  .card:hover .media__img, .feature:hover .media__img { transform: none; }
}

/* 小さいカード：画像を左に置いた横長 */
.card-grid--mini { gap: 14px; }
.card--mini { flex-direction: row; align-items: stretch; box-shadow: none; border: 1px solid var(--wh-line); }
.card--mini:hover { transform: none; box-shadow: var(--wh-shadow); }
.card--mini .card__media { flex: 0 0 38%; max-width: 160px; }
.card--mini .media { height: 100%; aspect-ratio: auto; min-height: 88px; }
.card--mini .media__char { font-size: 3.4em; right: 50%; transform: translate(50%, -54%); }
.card--mini .card__body { padding: 10px 14px; justify-content: center; gap: 4px; }
.card--mini .card__title { font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ページ送り */
.pagination, .comments-pagination { margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-links .page-numbers, .nav-links a {
  display: inline-block; min-width: 44px; padding: 9px 12px; text-align: center; line-height: 1.4;
  background: var(--wh-paper); border: 1px solid var(--wh-line); border-radius: 8px; color: var(--wh-ink); text-decoration: none;
}
.nav-links a:hover { border-color: var(--wh-ink); }
.nav-links .current { background: var(--wh-ink); color: #FFFFFF; border-color: var(--wh-ink); }
.nav-links .dots { background: transparent; border-color: transparent; }
.empty { background: var(--wh-paper); border-radius: var(--wh-radius); padding: 20px; }

/* ============================================================
   記事ページ
   ============================================================ */
.article { position: relative; background: var(--wh-paper); border-radius: var(--wh-radius); padding: 26px 18px 32px; overflow: hidden; box-shadow: var(--wh-shadow); }
.article::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--cat, var(--wh-ink)); }
.article__header { margin-bottom: 22px; }
.article__badges { display: flex; align-items: center; gap: 6px; }
.article__title {
  margin: 10px 0 10px; font-family: var(--wh-serif); font-weight: 800; color: var(--wh-ink);
  font-size: 27px; line-height: 1.45; text-wrap: balance;
}
.article__meta { font-size: 12.5px; color: var(--wh-sub); }
.article__header .share { margin-top: 14px; }
.article__thumb { margin: 0 0 26px; }
.article__thumb img { display: block; width: 100%; border-radius: 8px; }
.article__footer { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--wh-line); display: grid; gap: 16px; }
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.article__tags a {
  font-size: 13px; padding: 4px 12px; border: 1px solid var(--wh-line); border-radius: 999px;
  color: var(--wh-ink); text-decoration: none; background: var(--wh-soft);
}
.article__tags a::before { content: "#"; color: var(--wh-sub); margin-right: 2px; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share__label { font-size: 12px; font-weight: 700; color: var(--wh-sub); margin-right: 2px; }
.share__btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 5px 14px;
  border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; color: #FFFFFF; border: 0; cursor: pointer; line-height: 1.4;
}
.share__btn:hover { color: #FFFFFF; filter: brightness(1.12); }
.share__btn--x { background: #111111; }
.share__btn--line { background: #06803E; }
.share__btn--fb { background: #1877F2; }
.share__btn--copy { background: var(--wh-paper); color: var(--wh-ink); border: 1px solid var(--wh-line); }
.share__btn--copy:hover { color: var(--wh-ink); border-color: var(--wh-ink); filter: none; }

.related { margin-top: 36px; }

.post-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 28px; }
@media (min-width: 640px) { .post-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.post-nav__link {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; background: var(--wh-paper);
  border: 1px solid var(--wh-line); border-radius: var(--wh-radius); text-decoration: none; color: var(--wh-ink);
}
.post-nav__link:hover { border-color: var(--wh-ink); color: var(--wh-ink); }
.post-nav__link--next { text-align: right; grid-column: -2; }
.post-nav__label { font-size: 12px; color: var(--wh-sub); font-weight: 700; }
.post-nav__link--prev .post-nav__label::before { content: "← "; }
.post-nav__link--next .post-nav__label::after { content: " →"; }
.post-nav__title { font-size: 14px; font-weight: 500; line-height: 1.5; }

/* 目次 */
.toc[hidden] { display: none !important; }
.toc--inline { margin: 0 0 26px; }
.toc--inline details { border: 1px solid var(--wh-line); border-radius: 10px; background: var(--wh-soft); padding: 12px 16px; }
.toc--inline summary { cursor: pointer; font-weight: 700; color: var(--wh-ink); font-size: 15px; }
.toc__list { margin: 8px 0 2px; padding-left: 1.5em; font-size: 14px; }
.toc__list li { margin: 5px 0; line-height: 1.5; }
.toc__list a { color: var(--wh-body); text-decoration: none; }
.toc__list a:hover, .toc__list a.is-current { color: var(--wh-ink); text-decoration: underline; font-weight: 700; }
.toc--side { display: none; }
@media (min-width: 1100px) {
  .toc--inline { display: none !important; }
  .toc--side { display: block; }
  .toc--side[hidden] { display: none; }
  .toc--side .toc__list { margin-top: 0; }
}

/* ============================================================
   本文（既存の記事もここで整える）
   ============================================================ */
.entry-content { font-size: 16px; line-height: 1.95; }
.entry-content > * { margin-top: 0; margin-bottom: 20px; }
.entry-content > *:last-child { margin-bottom: 0; }
/* 本文の基本は :where で弱くし、wh- 部品の指定が必ず勝つようにする */
.entry-content :where(p) { margin: 0 0 1.4em; }
.entry-content :where(h2) {
  position: relative; margin: 2.6em 0 1em; padding: 12px 16px 12px 20px;
  font-family: var(--wh-serif); font-weight: 800; color: #FFFFFF; background: var(--wh-ink);
  font-size: 21px; line-height: 1.5; border-radius: 6px; text-wrap: balance;
}
.entry-content :where(h2)::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--cat, var(--wh-mao)); border-radius: 6px 0 0 6px; }
.entry-content > :where(h2):first-child { margin-top: 0; }
.entry-content :where(h3) {
  margin: 2.2em 0 .8em; font-size: 18.5px; line-height: 1.55; color: var(--wh-ink); font-weight: 700;
  padding: 0 0 8px; border-bottom: 2px solid var(--wh-ink);
}
.entry-content :where(h4) { margin: 1.8em 0 .6em; font-size: 16.5px; color: var(--wh-ink); font-weight: 700; }
.entry-content :where(h4)::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; background: var(--cat, var(--wh-ink)); transform: rotate(45deg) translateY(-2px); }
.entry-content :where(h5, h6) { margin: 1.4em 0 .4em; font-size: 15px; color: var(--wh-ink); font-weight: 700; }
.entry-content :where(ul, ol) { padding-left: 1.5em; margin: 0 0 1.4em; }
.entry-content :where(li) { margin: .35em 0; }
.entry-content :where(li)::marker { color: var(--cat, var(--wh-sub)); }
.entry-content :where(strong, b) { color: var(--wh-ink); font-weight: 700; }
.entry-content > :where(p, ul, ol) :where(strong, b) { background: linear-gradient(transparent 62%, rgba(239, 159, 39, .32) 62%); }
.entry-content :where(hr) { border: 0; height: 4px; background: var(--wh-stripe); opacity: .5; margin: 2.8em auto; width: 120px; border-radius: 2px; }
.entry-content :where(blockquote) {
  position: relative; margin: 0 0 1.4em; padding: 18px 20px 18px 52px; background: var(--wh-soft); border-radius: 10px; color: var(--wh-body); font-size: 15px;
}
.entry-content :where(blockquote)::before { content: "“"; position: absolute; left: 14px; top: 2px; font-family: var(--wh-serif); font-size: 52px; line-height: 1; color: #B4BCBF; }
.entry-content :where(blockquote) p:last-child { margin-bottom: 0; }
.entry-content :where(blockquote cite) { display: block; margin-top: 6px; font-size: 13px; color: var(--wh-sub); font-style: normal; }
.entry-content :where(table) {
  width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 14.5px; line-height: 1.6;
  background: var(--wh-paper);
}
.entry-content :where(th, td) { border: 1px solid var(--wh-line); padding: 9px 11px; text-align: left; vertical-align: top; }
.entry-content :where(th, thead td) { background: var(--wh-ink); color: #FFFFFF; font-weight: 700; border-color: var(--wh-ink); }
.entry-content :where(tbody tr:nth-child(even)) { background: var(--wh-soft); }
@media (max-width: 639px) {
  /* スマホで表がはみ出す場合は、表の中だけ横スクロール */
  .entry-content :where(table) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.entry-content :where(pre) {
  background: var(--wh-ink); color: #F3F5F2; padding: 14px 16px; border-radius: 8px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.6;
}
.entry-content :where(code) { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.entry-content :where(:not(pre) > code) { background: var(--wh-soft); padding: 1px 5px; border-radius: 4px; }
.entry-content :where(img) { border-radius: 6px; }
.entry-content :where(figure) { margin: 0 0 1.4em; }
.entry-content :where(figcaption), .wp-caption-text, .gallery-caption {
  font-size: 13px; color: var(--wh-sub); line-height: 1.6; margin-top: 6px; text-align: center;
}
.wp-caption { max-width: 100%; margin-bottom: 1.4em; }
.wp-caption img { display: block; margin: 0 auto; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content::after { content: ""; display: table; clear: both; }
@media (max-width: 639px) {
  .alignleft, .alignright { float: none; margin: 0 auto 1.4em; max-width: 100%; display: block; }
}
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 1.4em; }
@media (min-width: 640px) { .gallery-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .gallery-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gallery-item { margin: 0; }
.gallery-item img { display: block; width: 100%; height: auto; }
.entry-content :where(iframe[src*="youtube"], iframe[src*="youtu.be"]) { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.page-links { margin-top: 20px; font-size: 14px; }

/* ============================================================
   サイドバーとウィジェット
   ============================================================ */
.sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; min-width: 0; }
.sidebar > * { min-width: 0; }
.widget { background: var(--wh-paper); border-radius: var(--wh-radius); padding: 18px 20px; font-size: 14px; box-shadow: var(--wh-shadow); }
.widget-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-family: var(--wh-serif); font-weight: 800; font-size: 16px; color: var(--wh-ink); line-height: 1.4;
}
.widget-title::before { content: ""; width: 8px; height: 8px; background: var(--wh-ink); transform: rotate(45deg); flex-shrink: 0; }
.widget-title::after { content: ""; flex: 1; height: 1px; background: var(--wh-line); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px dashed var(--wh-line); line-height: 1.55; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--wh-ink); text-decoration: none; }
.widget li a:hover { text-decoration: underline; }
.widget .children { padding-left: 12px; margin-top: 6px; }
.widget select { width: 100%; padding: 8px; border: 1px solid var(--wh-line); border-radius: 8px; background: #FFFFFF; }
.widget img { height: auto; }
.toc--side .toc__list { padding-left: 1.4em; }
.toc--side .toc__list li { padding: 0; border: 0; margin: 7px 0; }

/* 検索フォーム（本文・サイドバー） */
.search-form { display: flex; gap: 6px; }
.search-form__input {
  flex: 1; min-width: 0; font-size: 16px; padding: 8px 12px;
  border: 1px solid var(--wh-line); border-radius: 999px; background: var(--wh-paper);
}
.search-form__button {
  flex-shrink: 0; font-size: 14px; padding: 8px 16px; border-radius: 999px; font-weight: 700;
  border: 1px solid var(--wh-ink); background: var(--wh-ink); color: #FFFFFF; cursor: pointer;
}

/* ============================================================
   コメント
   ============================================================ */
.comments { margin-top: 28px; background: var(--wh-paper); border-radius: var(--wh-radius); padding: 22px 18px; box-shadow: var(--wh-shadow); }
.comments__title { margin: 0 0 12px; font-family: var(--wh-serif); font-weight: 800; font-size: 19px; color: var(--wh-ink); }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: 20px; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--wh-line); font-size: 14.5px; }
.comment-author { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--wh-ink); }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata { font-size: 12px; }
.comment-metadata a { color: var(--wh-sub); text-decoration: none; }
.comment-content p { margin: 8px 0; }
.reply a { font-size: 13px; }
.comment-respond { margin-top: 16px; }
.comment-form p { margin: 0 0 12px; }
.comment-form label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; font-size: 16px; padding: 8px 10px; border: 1px solid var(--wh-line); border-radius: 8px; background: #FFFFFF;
}
.comment-form .form-submit input, .comment-form input[type="submit"] {
  font-size: 15px; font-weight: 700; padding: 10px 22px; border-radius: 999px; border: 0; background: var(--wh-ink); color: #FFFFFF; cursor: pointer;
}
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ============================================================
   フッター
   ============================================================ */
.site-footer { background: var(--wh-ink); color: #C9D0D3; margin-top: 8px; }
.site-footer::before { content: ""; display: block; height: 4px; background: var(--wh-stripe); }
.site-footer__inner { max-width: var(--wh-wrap); margin: 0 auto; padding: 0 var(--wh-gutter); }
.site-footer__top { padding: 40px 0 28px; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; } }
.footer-brand__name { margin: 0; font-family: var(--wh-serif); font-weight: 800; font-size: 24px; line-height: 1.3; }
.footer-brand__name a { color: #FFFFFF; text-decoration: none; }
.footer-brand__desc { margin: 8px 0 0; font-size: 13px; color: #AEB6B9; }
.footer-heading { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: #FFFFFF; letter-spacing: .08em; }
.footer-cats ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.footer-cats li { padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer-cats a { color: #FFFFFF; text-decoration: none; }
.footer-cats a:hover { text-decoration: underline; }
.footer-widgets .widget { background: transparent; box-shadow: none; padding: 0; color: #C9D0D3; }
.footer-widgets .widget-title { color: #FFFFFF; font-family: var(--wh-sans); font-size: 13px; letter-spacing: .08em; }
.footer-widgets .widget-title::before { background: #FFFFFF; }
.footer-widgets .widget-title::after { background: rgba(255, 255, 255, .2); }
.footer-widgets .widget li { border-bottom-color: rgba(255, 255, 255, .12); }
.footer-widgets .widget li a { color: #FFFFFF; }
.site-footer__bottom { background: #121618; padding: 16px 0; }
.site-footer__bottom .site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; }
.footer-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; }
.footer-nav a { color: #FFFFFF; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.site-footer__copy { margin: 0; color: #8E989B; font-size: 12px; }

.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 60; width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--wh-ink); color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s, transform .25s, visibility .25s;
}
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: #FFFFFF; background: var(--wh-mao); }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* ============================================================
   画面幅ごとの調整
   ============================================================ */
@media (max-width: 639px) {
  .layout--single { padding: 12px 0 0; gap: 24px; }
  .layout--single .article { border-radius: 0; padding: 24px 16px 32px; box-shadow: none; }
  .layout--single .related, .layout--single .post-nav, .layout--single .comments, .layout--single .sidebar { margin-left: var(--wh-gutter); margin-right: var(--wh-gutter); }
  .crumb-bar__inner { padding-bottom: 2px; }
}
@media (min-width: 640px) {
  .article { padding: 40px 44px 48px; }
  .article__title { font-size: 33px; }
  .entry-content :where(h2) { font-size: 23px; }
  .comments { padding: 26px 44px; }
}
@media (min-width: 640px) and (max-width: 1099px) {
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   印刷
   ============================================================ */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #FFFFFF; font-size: 10.5pt; display: block; }
  .site-header, .site-nav, .site-footer, .sidebar, .toc, .post-nav, .comments, .wh-quiz, .pagination,
  .crumb-bar, .share, .related, .to-top, .hero { display: none !important; }
  .site-main { padding: 0; }
  .layout { display: block; max-width: none; padding: 0; }
  .article { padding: 0; border-radius: 0; box-shadow: none; }
  .article::before { display: none; }
  .article__title { font-size: 20pt; }
  .entry-content :where(h2) { break-after: avoid; margin-top: 24px; }
  a { color: inherit; text-decoration: none; }
}
