/*
Theme Name: うぇぶ、ひゃっくり
Theme URI: https://ua777.main.jp
Author: うぇぶ
Author URI: https://ua777.main.jp
Description: Web制作と学びの記録帳。投稿、カテゴリー、タグ、ウィジェット運用に対応したブログテーマ。
Version: 1.6.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: web-hyakkuri
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   CSS Custom Properties (Design System)
   ============================================================ */
:root {
  /* Colors — ナチュラルベージュUI */
  --color-primary:       #8b6347;
  --color-primary-dark:  #6b4a2e;
  --color-primary-light: #a07858;
  --color-beige:         #f2e6d8;
  --color-paper:         #f7f4ef;
  --color-text:          #4a3b31;
  --color-text-light:    #7A6358;
  --color-text-muted:    #A0918A;
  --color-accent-green:  #7E9A68;
  --color-accent-warm:   #C8956C;
  --color-white:         #FFFFFF;
  --color-border:        #E8E0D6;
  --color-border-light:  #F0EBE3;
  --color-shadow:        rgba(107, 68, 35, 0.06);
  --color-shadow-md:     rgba(107, 68, 35, 0.10);
  --color-overlay:       rgba(74, 52, 38, 0.4);

  /* Category Colors */
  --cat-webdesign:   #C8956C;
  --cat-learning:    #8B7355;
  --cat-ai:          #7E9A68;
  --cat-production:  #6B8FAF;
  --cat-summary:     #B8955A;
  --cat-thoughts:    #9B8EA0;

  /* Typography */
  --font-heading:  'Zen Maru Gothic', sans-serif;
  --font-body:     'Noto Sans JP', sans-serif;

  /* Font Sizes */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.0625rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadows — 柔らかく */
  --shadow-sm:  0 2px 10px rgba(0,0,0,.04);
  --shadow-md:  0 4px 20px rgba(0,0,0,.07);
  --shadow-lg:  0 8px 32px rgba(107, 68, 35, 0.08);
  --shadow-xl:  0 16px 48px rgba(107, 68, 35, 0.10);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Layout */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --sidebar-width: 320px;
  --header-h:      130px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
  line-height: 1.8;
  margin-bottom: var(--space-4);
}
p:last-child { margin-bottom: 0; }

/* ============================================================
   Layout Utilities
   ============================================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}


.container--wide {
  max-width: 1520px;
  padding: 0 24px;
}

/* ロゴ画像（site-logo）*/
.site-logo {
  display: block;
  max-width: 320px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.site-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--header-h); /* fixed header分の押し下げ */
}

.site-main {
  flex: 1;
}

/* Two-column layout */
.content-sidebar-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
  padding: 32px 0 var(--space-16);
}

.content-area {
  min-width: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 3px 12px rgba(107, 68, 35, 0.25);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(107, 68, 35, 0.3);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}

.btn--outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* ============================================================
   Section Headers
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  letter-spacing: 0.04em;
}

.section-title::before {
  content: '';
  display: block;
  width: 5px;
  height: 20px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.section-more {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.section-more:hover {
  color: var(--color-primary);
}

.section-more::after {
  content: '›';
  font-size: var(--text-lg);
  line-height: 1;
}

/* ============================================================
   Cards - Base
   ============================================================ */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   Category Badge
   ============================================================ */
.category-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--cat-webdesign);
  color: var(--color-white);
  line-height: 1.6;
  white-space: nowrap;
}

/* ============================================================
   Site Header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 253, 249, 0.97); /* 透明度を上げてblurなしでも見やすく */
  border-bottom: 1px solid var(--color-border-light);
  height: var(--header-h);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  /* backdrop-filterはiOSでwill-changeと競合しスクロールを重くするため削除 */
  /* will-changeはモバイルで削除 — デスクトップのみ必要 */
}

@media (min-width: 901px) {
  .site-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 253, 249, 0.96);
    will-change: transform;
  }
}

.site-header.header--hidden {
  transform: translateY(-100%);
}


.header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  width: 100%;
  padding: 20px 24px 0; /* 上に余白を追加して下方向に調整 */
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  text-decoration: none;
}


@media (max-width: 768px) {
  .site-logo {
    max-width: 240px;
    max-height: 80px;
  }
}


/* Navigation */
.header__nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.header__nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__nav-list > li > a {
  display: block;
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.header__nav-list > li > a:hover {
  color: var(--color-primary);
  background: var(--color-beige);
}

/* カレントページ：下線スタイル */
.header__nav-list > .current-menu-item > a {
  color: var(--color-primary);
  background: transparent;
  font-weight: 500;
  position: relative;
}

.header__nav-list > .current-menu-item > a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}

/* Search */
.header__search {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header__search-form {
  display: flex;
  align-items: center;
  background: var(--color-beige);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: border-color var(--transition-fast);
  height: 40px;
}

.header__search-form:focus-within {
  border-color: var(--color-primary);
}

.header__search-input {
  background: none;
  border: none;
  outline: none;
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  width: 190px;
  height: 100%;
}

.header__search-input::placeholder {
  color: var(--color-text-muted);
}

.header__search-btn {
  width: 44px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 0;
  font-size: var(--text-base);
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.header__search-btn:hover {
  background: var(--color-primary-dark);
}

/* Mobile hamburger */
.header__menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.header__menu-toggle:hover {
  background: var(--color-beige);
}

.header__menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-base);
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--color-paper);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero__bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(247, 244, 239, 0.92) 0%,
    rgba(247, 244, 239, 0.72) 40%,
    rgba(247, 244, 239, 0.10) 72%,
    rgba(247, 244, 239, 0.0) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 580px;
  padding: 72px 0 80px;
}

.hero__eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
  letter-spacing: 0.04em;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.55;
  color: var(--color-text);
  margin-bottom: var(--space-5);
  letter-spacing: 0.02em;
}


.hero__cta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ============================================================
   Category Navigation
   ============================================================ */
.category-nav {
  padding: var(--space-10) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.category-nav__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  justify-items: center;
}

.category-nav__card {
  border-radius: 20px;
  overflow: hidden;
  transition: transform var(--transition-base);
  cursor: pointer;
  text-decoration: none;
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.category-nav__card:hover {
  transform: translateY(-4px) scale(1.02);
}

.category-nav__icon {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  transition: transform var(--transition-base);
  max-width: 100%;
  padding: 4px;
  /* モバイルでの位置ずれ防止 */
  position: relative;
  z-index: 0;
}

.category-nav__card:hover .category-nav__icon {
  transform: scale(1.07);
}

/* ============================================================
   Article Cards
   ============================================================ */
.article-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--color-white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: 1.5px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
}

.article-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: var(--color-beige);
  flex-shrink: 0;
  display: block;
}

.article-card__thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

.article-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  display: block;
}

.article-card:hover .article-card__thumb img {
  transform: scale(1.04);
}

.article-card__cat {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
}

.article-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.article-card__title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-base), 1.3vw, var(--text-lg));
  font-weight: 700;
  line-height: 1.6;
  color: var(--color-text);
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.2em;
  margin: 0;
}

.article-card__title a:hover {
  color: var(--color-primary);
}

.article-card__excerpt {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.article-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: auto;
}

.article-card__date {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ============================================================
   Article List (All Articles)
   ============================================================ */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--color-border-light);
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-white);
}

/* 最初・最後のアイテムに角丸を付与（overflowで隠れるので確実に） */
.article-list-item:first-child {
  border-radius: 14px 14px 0 0;
}
.article-list-item:last-child {
  border-radius: 0 0 14px 14px;
  border-bottom: 0;
}

.article-list-item {
  background: var(--color-white);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid var(--color-border-light);
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 0;
  transition: background var(--transition-fast), transform var(--transition-base);
  position: relative; /* カバーリンク用 */
}

/* カード全体をクリック可能にする疑似要素リンク */
.article-list-item__cover-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.article-list-item:hover {
  background: var(--color-paper);
  transform: translateX(2px);
}

.article-list-item__thumb {
  width: 140px;
  height: 90px;
  overflow: hidden;
  background: var(--color-beige);
  flex-shrink: 0;
  border-radius: var(--radius-md);
  margin: var(--space-3) 0 var(--space-3) var(--space-3);
}

.article-list-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.article-list-item:hover .article-list-item__thumb img {
  transform: scale(1.04);
}

.article-list-item__content {
  padding: 14px 16px 14px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.article-list-item__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-list-item__title a:hover {
  color: var(--color-primary);
}

.article-list-item__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-list-item__cat {
  text-decoration: none;
  display: inline-block;
}

.article-list-item__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ============================================================
   Home Sections
   ============================================================ */
.home-section {
  padding: 2.5rem 0;
}

.home-section + .home-section {
  border-top: 1px solid var(--color-border-light);
  padding-top: 2.5rem;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar__widget {
  background: var(--color-white);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--color-border-light);
}

.sidebar__widget-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 20px;
  padding-bottom: var(--space-3);
  border-bottom: 1.5px solid var(--color-border-light);
  letter-spacing: 0.04em;
}

/* Profile Widget */
.sidebar-profile {
  text-align: left;
}

.sidebar-profile__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.sidebar-profile__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0;
  border: 3px solid var(--color-beige);
  flex-shrink: 0;
}

.sidebar-profile__identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-profile__name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
}

.sidebar-profile__role {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.sidebar-profile__bio {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 14px;
}

.sidebar-profile__sns {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

/* 旧テキストリンク型SNSは非表示（新アイコン型に置き換え済み） */
.sidebar-profile__sns a:not(.sidebar-profile__sns-icon) {
  display: none;
}

/* Category Widget */
.sidebar-category__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-category__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  font-size: var(--text-sm);
}

.sidebar-category__item:hover {
  background: var(--color-beige);
}

.sidebar-category__item-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.sidebar-category__icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}

.sidebar-category__name {
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-category__count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.sidebar-category__arrow {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Popular Articles Widget */
.sidebar-popular__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar-popular__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  transition: opacity var(--transition-fast);
}

.sidebar-popular__item:hover {
  opacity: 0.8;
}

/* ランク番号：丸バッジ */
.sidebar-popular__rank {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.sidebar-popular__item:nth-child(1) .sidebar-popular__rank { background: var(--color-primary); }
.sidebar-popular__item:nth-child(2) .sidebar-popular__rank { background: var(--color-accent-warm); }
.sidebar-popular__item:nth-child(3) .sidebar-popular__rank { background: var(--color-accent-green); }

.sidebar-popular__thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-beige);
}

.sidebar-popular__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-popular__title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-popular__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* Tags（single.phpの投稿タグで使用） */
.sidebar-tags__tag {
  display: inline-block;
  padding: 8px 14px;
  background: var(--color-beige);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--color-text-light);
  transition: all var(--transition-fast);
  border: 1px solid var(--color-border);
  text-decoration: none;
}

.sidebar-tags__tag:hover {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* Archive widget */
.sidebar-archive__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-archive__item,
.sidebar-archive__list li {
  font-size: var(--text-sm);
}

.sidebar-archive__item a,
.sidebar-archive__list li a,
.sidebar-archive__list a {
  color: var(--color-text-light);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.sidebar-archive__list a:hover,
.sidebar-archive__list li a:hover {
  color: var(--color-primary);
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8) 0;
}

.pagination__item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: var(--font-heading);
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  transition: all var(--transition-fast);
  background: var(--color-white);
}

.pagination__item:hover,
.pagination__item.is-current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.pagination__item--dots {
  border-color: transparent;
  background: none;
  cursor: default;
}

.pagination__item--dots:hover {
  background: none;
  border-color: transparent;
  color: var(--color-text);
}

/* ============================================================
   Single Post
   ============================================================ */
/* post-header は single.php 内で使用 */

/* Post Content */
/* ============================================================
   Post Content — note風リデザイン
   ============================================================ */
.post-content {
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

/* br連打・空pによる余白を無効化 */
.post-content br + br { display: none; }
.post-content p:empty { display: none; }


/* 横長画像の高さ制御 */
.post-content .wp-block-image.size-large img {
  max-height: 480px;
  object-fit: cover;
  width: 100%;
}

/* キャプション */
.post-content figcaption,
.post-content .wp-block-image figcaption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 6px;
  line-height: 1.5;
}


/* 情報ボックスタイトル */
.post-content .box-point > p:first-child strong,
.post-content .box-attention > p:first-child strong,
.post-content .box-memo > p:first-child strong,
.post-content .box-ng > p:first-child strong,
.post-content .box-tips > p:first-child strong {
  display: block;
  font-size: var(--text-base);
  margin-bottom: 4px;
}


/* Post Tags — v2で定義済み */

/* Post Navigation コメント削除済み */

/* Related Posts */
.related-posts {
  margin-top: var(--space-16);
}

/* Comments */
.post-comments {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border-light);
}

/* ============================================================
   Archive / Category Page
   ============================================================ */
.archive-header {
  padding: var(--space-10) 0;
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border-light);
}

.archive-header__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.archive-header__title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.archive-header__desc {
  font-size: var(--text-base);
  color: var(--color-text-light);
  max-width: 600px;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

/* ============================================================
   Search Page
   ============================================================ */
.search-header {
  padding: var(--space-10) 0;
  margin-bottom: var(--space-8);
}

.search-header__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

.search-header__count {
  font-size: var(--text-base);
  color: var(--color-text-light);
}

.search-form--large {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.search-form--large input {
  flex: 1;
  padding: var(--space-3) var(--space-5);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-white);
  font-size: var(--text-base);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-form--large input:focus {
  border-color: var(--color-primary);
}

/* ============================================================
   404 Page
   ============================================================ */
.error-page {
  text-align: center;
  padding: var(--space-24) 0;
}

.error-page__number {
  font-family: var(--font-heading);
  font-size: 8rem;
  font-weight: 700;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: var(--space-4);
}

.error-page__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.error-page__desc {
  font-size: var(--text-base);
  color: var(--color-text-light);
  margin-bottom: var(--space-8);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.85);
  margin-top: var(--space-10);
  position: relative;
  overflow: hidden;
  max-width: 100%;
  overflow-x: hidden;
}

/* 上部の波形（paper色の切り抜き） */
.footer__wave {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--color-paper);
  clip-path: ellipse(55% 100% at 50% 0%);
}

.footer__main {
  position: relative;
  background: linear-gradient(180deg, var(--color-primary-light) 0%, var(--color-primary-dark) 100%);
  padding: 120px 0 80px; /* 上を増やして波形との間隔を確保 */
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr auto;
  gap: var(--space-10);
  align-items: start; /* 上詰め — コンテンツ量の差による崩れ防止 */
  padding-bottom: 0;
}

/* footer__col--brand は末尾の修正追加CSSで定義 */

.footer__brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

/* フッタータイトル画像 */
.footer__title-image {
  display: block;
  max-width: 320px;
  max-height: 70px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

@media (max-width: 768px) {
  .footer__title-image {
    max-width: 240px;
    max-height: 70px;
  }
}

/* .site-footer スクロール制御 — 上のブロックに統合済み */
/* フッターは常時表示（iOSスクロール改善のためtransform廃止） */
.site-footer.footer--hidden {
  /* 非表示クラスは使用しない */
}
.site-footer.footer--visible {
  /* 常に表示状態 */
}


.footer__brand-desc {
  font-size: var(--text-sm);
  line-height: 1.7;
  opacity: 0.7;
  margin-bottom: var(--space-5);
}

.footer__social {
  display: flex;
  gap: var(--space-3);
}

.footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: background var(--transition-fast);
}

.footer__social-link:hover {
  background: rgba(255, 255, 255, 0.25);
}

.footer__col-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-white);
  margin-bottom: var(--space-4);
  letter-spacing: 0.06em;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__links a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--color-white);
}

/* フッターキャラクター（右下） —— 新構造では非表示 */
.footer__chara {
  display: none;
}

.footer__bottom {
  background: var(--color-primary-dark);
  padding: var(--space-5) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.55);
}

/* ============================================================
   Mobile Navigation Overlay
   ============================================================ */
.mobile-nav {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(74, 52, 38, 0.55);
  /* backdrop-filter削除 — iOSでのスクロール固まり対策 */
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-nav.is-open {
  visibility: visible;
  opacity: 1;
}

.mobile-nav__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 90vw);
  height: 100%;
  background: var(--color-paper);
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform var(--transition-base);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}

.mobile-nav.is-open .mobile-nav__panel {
  transform: translateX(0);
}

/* ── 閉じるボタン ── */
.mobile-nav__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  z-index: 1;
}

.mobile-nav__close:hover {
  background: var(--color-beige);
  color: var(--color-text);
}

/* ── ブランドロゴ ── */
.mobile-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--color-border-light);
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  padding-right: 52px; /* 閉じるボタンと重ならないよう */
}

.mobile-nav__brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── メインナビ ── */
.mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.mobile-nav__list li a {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  font-size: var(--text-sm);
  font-family: var(--font-heading);
  color: var(--color-text);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  letter-spacing: 0.03em;
}

.mobile-nav__list li a:hover,
.mobile-nav__list .current-menu-item > a {
  background: var(--color-beige);
  color: var(--color-primary);
  font-weight: 500;
}

/* ── セクションタイトル ── */
.mobile-nav__section-title {
  font-size: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  padding: 16px 20px 8px;
  margin: 0;
}

/* ── カテゴリーリスト ── */
.mobile-nav__cat-list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--color-border-light);
}

.mobile-nav__cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.mobile-nav__cat-link:hover {
  background: var(--color-beige);
  color: var(--color-primary);
}

.mobile-nav__cat-link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.85;
}

.mobile-nav__cat-link span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-nav__cat-link small {
  font-size: 11px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ── 検索フォーム ── */
.mobile-nav__search {
  display: flex;
  gap: 8px;
  margin: 16px 20px;
}

.mobile-nav__search input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-white);
  font-size: var(--text-sm);
  outline: none;
  transition: border-color var(--transition-fast);
}

.mobile-nav__search input:focus {
  border-color: var(--color-primary);
}

.mobile-nav__search button {
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.mobile-nav__search button:hover {
  opacity: 0.85;
}

/* ── SNSアイコン ── */
.mobile-nav__sns {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 20px 20px;
  margin-top: auto; /* 下部に押し下げる */
  border-top: 1px solid var(--color-border-light);
}

.mobile-nav__sns-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-beige);
  color: var(--color-text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.mobile-nav__sns-link:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb-wrap {
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-border-light);
}

.breadcrumb {
  padding: var(--space-3) 24px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  margin: 0 auto;
  max-width: 1440px;
  background: transparent;
}

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

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb span + span::before {
  content: '/';
  margin-right: var(--space-1);
  color: var(--color-border);
}

/* ============================================================
   Back to Top
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
  z-index: 50;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

/* ============================================================
   WordPress Core Classes
   ============================================================ */
.wp-block-image { margin: var(--space-6) 0; }
.aligncenter { text-align: center; }
.alignleft { float: left; margin-right: var(--space-5); }
.alignright { float: right; margin-left: var(--space-5); }
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px; word-wrap: normal !important;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .category-nav__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }

  .article-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-sidebar-wrap {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 110px;
  }

  .header__nav,
  .header__search {
    display: none;
  }

  .header__menu-toggle {
    display: flex;
    margin-left: auto;
  }

  .hero {
    min-height: 340px;
  }

  .hero__content {
    padding: 60px 0;
    max-width: 75%;
  }

  .hero__bg-img {
    object-position: 70% center;
  }

  .hero__bg-overlay {
    background: linear-gradient(
      90deg,
      rgba(247, 244, 239, 0.96) 0%,
      rgba(247, 244, 239, 0.88) 45%,
      rgba(247, 244, 239, 0.40) 80%,
      rgba(247, 244, 239, 0.10) 100%
    );
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
    padding-bottom: 0;
    /* イラスト列（auto）は .footer__chara-inline { display:none } で消える */
  }

  .footer__chara {
    display: none;
  }
}

@media (max-width: 760px) {
  .article-list-item {
    grid-template-columns: 96px 1fr;
  }

  .article-list-item__thumb {
    width: 96px;
    height: 72px;
  }

  .sidebar {
    display: flex;
  }
}

@media (max-width: 640px) {
  :root {
    --text-3xl: 1.625rem;
    --text-2xl: 1.375rem;
  }

  /* ヘッダーロゴを中央揃えに */
  .header__inner {
    justify-content: center;
    position: relative;
  }
  .header__logo {
    justify-content: center;
  }
  .header__menu-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .category-nav__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
  }

  .article-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .article-list-item {
    grid-template-columns: 96px 1fr;
  }

  .article-list-item__thumb {
    width: 96px;
    height: 72px;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    align-items: start;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  /* ヒーロー: 小画面では中央揃えに */
  .hero {
    min-height: 280px;
  }

  .hero__content {
    padding: 48px 0;
    max-width: 100%;
    position: relative;
    z-index: 2;
    text-align: center;
    margin: 0 auto;
  }

  .hero__bg-overlay {
    background: linear-gradient(
      180deg,
      rgba(247, 244, 239, 0.95) 0%,
      rgba(247, 244, 239, 0.90) 60%,
      rgba(247, 244, 239, 0.70) 100%
    );
  }

  .hero__cta {
    flex-direction: column;
    align-items: center;
  }

  .hero__cta .btn {
    width: 100%;
    justify-content: center;
    max-width: 280px;
  }
}

/* ============================================================
   Animations
   ============================================================ */



/* ============================================================
   フッター関連 追加定義
   ============================================================ */

/* ── フッター：ブランド列内のレイアウト ── */
/* ブランドカラムはテキストのみ（イラストは独立列へ） */
.footer__col--brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer__brand-text {
  min-width: 0;
}

/* キャラクター：フッター右端に独立配置 */
.footer__chara-inline {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding-bottom: 0;
  /* footer__inner の4列目として配置 */
  grid-column: 4;
  grid-row: 1;
  align-self: end;
}

.footer__chara-inline img {
  width: 180px;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.2));
}

/* ── フッター：旧chara-wrap を無効化 ── */
.footer__chara-wrap {
  display: none !important;
}

/* ── レスポンシブ：900px以下でイラスト非表示（スペース節約） ── */
@media (max-width: 900px) {
  .footer__chara-inline {
    display: none;
  }

  .footer__col--brand {
    grid-column: auto;
  }
}

/* ============================================================
   固定ページ レイアウト改善
   ============================================================ */

/* ラッパー：中央寄せ・最大幅制限 */
.page-content-wrap {
  max-width: 800px;
  margin: var(--space-10) auto var(--space-16);
}

/* カード：タイトル・アイキャッチ・本文をまとめて収容 */
.page-single.post-single {
  padding: 0;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  border: 1px solid #efe7df;
  overflow: hidden;
}

/* タイトルヘッダー */
.page-header {
  padding: var(--space-8) var(--space-8) var(--space-6);
  border-bottom: none;
  margin-bottom: 0;
}

.page-header__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--color-text);
  margin-bottom: 0;
}

/* アイキャッチ：カード幅いっぱい */
.page-eyecatch {
  margin: 0 0 var(--space-8) 0;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: none;
}

.page-eyecatch .post-eyecatch__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 本文エリア */
.page-post-content {
  padding: 0 var(--space-8) var(--space-10);
  max-width: 100%;
}

/* アイキャッチなしの場合は本文上にも余白 */
.page-single:not(:has(.page-eyecatch)) .page-post-content {
  padding-top: var(--space-2);
}

/* ── レスポンシブ ── */
@media (max-width: 768px) {
  .page-content-wrap {
    margin: var(--space-6) auto var(--space-10);
  }

  .page-header {
    padding: var(--space-5) var(--space-4) var(--space-4);
  }

  .page-header__title {
    font-size: 1.4rem;
  }

  .page-eyecatch {
    margin-bottom: var(--space-6);
  }

  .page-post-content {
    padding: 0 var(--space-4) var(--space-6);
  }
}

@media (max-width: 480px) {
  .page-header {
    padding: var(--space-4) var(--space-3) var(--space-3);
  }

  .page-post-content {
    padding: 0 var(--space-3) var(--space-5);
  }
}

/* ============================================================
   吹き出し（balloon shortcode）
   ============================================================ */

.balloon {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  line-height: 1.7;
}

/* 右向き */
.balloon--right {
  flex-direction: row-reverse;
}

/* ── アイコン列 ── */
.balloon__icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  width: 68px;
  margin: 0;
  padding: 0;
}

.balloon__icon {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--color-border-light);
  flex-shrink: 0;
  /* post-content img の margin: 24px 0 を打ち消す */
  margin: 0 !important;
  padding: 0;
}

.balloon__name {
  display: block;
  font-size: 10px;
  color: var(--color-text-light, #7a6a5a);
  text-align: center;
  line-height: 1.3;
  margin: 0;
  padding: 0;
  width: 100%;
  /* 改行させず、はみ出たら省略 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 吹き出し本体 ── */
.balloon__body {
  position: relative;
  display: flex;
  align-items: flex-start;
  flex: 1;
  min-width: 0; /* flex子要素のはみ出し防止 */
  margin-top: 6px;
}

.balloon__text {
  background: var(--color-beige, #f2e6d8);
  border: 1.5px solid var(--color-border-light, #e0d0c0);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: var(--text-sm, 0.9rem);
  color: var(--color-text, #4a3b31);
  min-width: 0;
  flex: 1;
  word-break: break-word;
  overflow-wrap: break-word;
}

.balloon__text p:last-child {
  margin-bottom: 0;
}

/* ── 三角矢印（左向き） ── */
.balloon--left .balloon__arrow {
  flex-shrink: 0;
  width: 0;
  height: 0;
  margin-top: 12px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid var(--color-border-light, #e0d0c0);
  position: relative;
}
.balloon--left .balloon__arrow::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 2px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid var(--color-beige, #f2e6d8);
}

/* ── 三角矢印（右向き） ── */
.balloon--right .balloon__body {
  flex-direction: row-reverse;
}
.balloon--right .balloon__arrow {
  flex-shrink: 0;
  width: 0;
  height: 0;
  margin-top: 12px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 9px solid var(--color-primary-light, #a07858);
  position: relative;
}
.balloon--right .balloon__arrow::after {
  content: '';
  position: absolute;
  top: -6px;
  right: 2px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #fff8f2;
}

/* 右向き吹き出しの色 */
.balloon--right .balloon__text {
  background: #fff8f2;
  border-color: var(--color-primary-light, #a07858);
}

/* ── 思考吹き出し（think） ── */
.balloon--think .balloon__text {
  border-radius: 20px;
  border-style: dashed;
}
.balloon--think .balloon__arrow {
  display: none;
}
.balloon--think .balloon__body::before,
.balloon--think .balloon__body::after {
  content: '';
  position: absolute;
  background: var(--color-beige, #f2e6d8);
  border: 1.5px solid var(--color-border-light, #e0d0c0);
  border-radius: 50%;
}
.balloon--left.balloon--think .balloon__body::before {
  width: 10px; height: 10px;
  top: 22px; left: -16px;
}
.balloon--left.balloon--think .balloon__body::after {
  width: 6px; height: 6px;
  top: 28px; left: -26px;
}
.balloon--right.balloon--think .balloon__body::before {
  width: 10px; height: 10px;
  top: 22px; right: -16px;
}
.balloon--right.balloon--think .balloon__body::after {
  width: 6px; height: 6px;
  top: 28px; right: -26px;
}

/* ── モバイル（600px以下） ── */
@media (max-width: 600px) {
  .balloon {
    gap: 10px;
  }
  .balloon__icon-wrap {
    width: 52px;
    gap: 4px;
  }
  .balloon__icon {
    width: 46px;
    height: 46px;
  }
  .balloon__name {
    font-size: 9px;
  }
  .balloon__body {
    margin-top: 4px;
  }
  .balloon__text {
    font-size: 0.84rem;
    padding: 9px 12px;
  }
  .balloon--left .balloon__arrow  { margin-top: 10px; }
  .balloon--right .balloon__arrow { margin-top: 10px; }
}

/* ── モバイル（400px以下） ── */
@media (max-width: 400px) {
  .balloon {
    gap: 8px;
  }
  .balloon__icon-wrap {
    width: 44px;
    gap: 3px;
  }
  .balloon__icon {
    width: 40px;
    height: 40px;
  }
  .balloon__name {
    font-size: 8px;
  }
  .balloon__text {
    font-size: 0.8rem;
    padding: 8px 10px;
  }
  .balloon--left .balloon__arrow  { margin-top: 8px; }
  .balloon--right .balloon__arrow { margin-top: 8px; }
}

/* ============================================================
   吹き出しキャラ管理：アイコン形状クラス
   ============================================================ */

/* 丸・枠あり（明示定義） */
.balloon--icon-circle .balloon__icon {
  border-radius: 50%;
}

/* 丸・枠なし */
.balloon--icon-circle-none .balloon__icon {
  border-radius: 50%;
  border: none;
}

/* 四角・枠あり */
.balloon--icon-square .balloon__icon {
  border-radius: 6px;
}

/* 四角・枠なし */
.balloon--icon-square-none .balloon__icon {
  border-radius: 6px;
  border: none;
}

/* フラットスタイル（背景グレー・枠なし） */
.balloon--flat .balloon__text {
  background: #f1f1f1;
  border-color: #f1f1f1;
}
.balloon--left.balloon--flat .balloon__arrow {
  border-right-color: #f1f1f1;
}
.balloon--left.balloon--flat .balloon__arrow::after {
  border-right-color: #f1f1f1;
}
.balloon--right.balloon--flat .balloon__text {
  background: #f1f1f1;
  border-color: #f1f1f1;
}
.balloon--right.balloon--flat .balloon__arrow {
  border-left-color: #f1f1f1;
}
.balloon--right.balloon--flat .balloon__arrow::after {
  border-left-color: #f1f1f1;
}

/* 強調スタイル（shout） */
.balloon--shout .balloon__text {
  background: #fff3cd;
  border-color: #e6a817;
  font-weight: 600;
}
.balloon--left.balloon--shout .balloon__arrow {
  border-right-color: #e6a817;
}
.balloon--left.balloon--shout .balloon__arrow::after {
  border-right-color: #fff3cd;
}
.balloon--right.balloon--shout .balloon__text {
  background: #fff3cd;
  border-color: #e6a817;
}
.balloon--right.balloon--shout .balloon__arrow {
  border-left-color: #e6a817;
}
.balloon--right.balloon--shout .balloon__arrow::after {
  border-left-color: #fff3cd;
}

/* ============================================================
   モバイルレイアウト総合修正
   ============================================================ */

/* ── container--wide: モバイルでpadding縮小 ── */
@media (max-width: 900px) {
  .container--wide {
    padding: 0 var(--space-5);
  }
}
@media (max-width: 640px) {
  .container--wide {
    padding: 0 var(--space-4);
  }
}
@media (max-width: 480px) {
  .container--wide {
    padding: 0 var(--space-3);
  }
}

/* ── content-sidebar-wrap: モバイルでpaddingTop縮小 ── */
@media (max-width: 1100px) {
  .content-sidebar-wrap {
    padding: var(--space-6) 0 var(--space-10);
  }
}
@media (max-width: 640px) {
  .content-sidebar-wrap {
    padding: var(--space-4) 0 var(--space-8);
    gap: var(--space-6);
  }
}

/* ── カテゴリーナビ: 480px以下でも3列維持 ── */
@media (max-width: 480px) {
  .category-nav__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }
  .category-nav {
    padding: var(--space-4) 0;
  }
}

/* ── section間余白: スマホで詰める ── */
@media (max-width: 640px) {
  .home-section {
    margin-bottom: var(--space-8);
  }
  .section-header {
    margin-bottom: var(--space-4);
  }
}

/* ── 吹き出し400px以下は上記@mediaに統合済み ── */

/* post-singleの最後の要素に下角丸を付与 */
.post-single > *:last-child,
.post-single .post-share:last-child,
.post-single .post-nav:last-child,
.post-single .post-ad--bottom:last-child {
  border-radius: 0 0 20px 20px;
  overflow: hidden;
}

/* post-adのみoverflow:hiddenで下角丸 */
.post-ad--bottom {
  margin: 0;
  border-radius: 0 0 20px 20px;
  overflow: hidden;
}

/* ── ヘッダー: SNS非表示時のレイアウト崩れ防止 ── */
@media (max-width: 900px) {
  .header__inner {
    gap: 0;
    min-height: var(--header-h);
    justify-content: space-between;
    padding: 0 16px;
  }
  .header__logo {
    flex: 1;
    min-width: 0;
  }
  .header__sns {
    display: none;
  }
}

/* ── サイドバー: モバイルで幅100%・ウィジェット間余白 ── */
@media (max-width: 1100px) {
  .sidebar {
    width: 100%;
  }
  .sidebar__widget {
    max-width: 100%;
  }
}

/* ── 記事リスト: 96px幅のサムネが小さすぎる場合 ── */
@media (max-width: 400px) {
  .article-list-item {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
  .article-list-item__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
  .article-list-item__content {
    padding: 12px 14px 14px;
  }
}

/* ── footer: 640px以下でさらに余白縮小 ── */
@media (max-width: 640px) {
  .footer__main {
    padding: 80px 0 48px; /* 上は波形分確保 */
  }
  .footer__inner {
    padding: var(--space-4) 0 var(--space-4);
  }
  .footer__bottom {
    padding: var(--space-4) 0;
    font-size: 0.72rem;
  }
}

/* ── 固定ページ: パディング調整 ── */
@media (max-width: 480px) {
  .page-content-wrap {
    margin: var(--space-4) auto var(--space-8);
  }
}

/* ── 横スクロール完全防止 ── */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}
.site-layout,
.site-header,
.site-main {
  max-width: 100%;
  overflow-x: hidden;
}


/* ============================================================
   記事エリア デザイン改善 v2
   ============================================================ */

/* ── 記事カード全体の見直し ── */
.post-single {
  background: var(--color-white);
  border-radius: 20px;
  box-shadow: 0 2px 24px rgba(107, 68, 35, 0.07), 0 1px 4px rgba(107,68,35,0.04);
  border: 1px solid #ede4d8;
  overflow: visible; /* テーブル・コードブロックの横スクロールを妨げない */
  /* アイキャッチの角丸はpost-eyecatch側で制御 */
}

/* ── ① タイトルヘッダーエリア 改善 ── */
.post-header {
  padding: 44px 52px 36px;
  border-bottom: none;
  margin-bottom: 0;
  background: linear-gradient(180deg, #faf7f3 0%, #ffffff 100%);
  position: relative;
  border-radius: 20px 20px 0 0; /* post-singleのoverflow:visible対応 */
  overflow: hidden;
}

.post-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 52px;
  right: 52px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-light), transparent);
}

/* No.XX ナンバリング */
.post-header__number {
  font-size: 0.72rem;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 99, 71, 0.08);
  padding: 3px 10px;
  border-radius: 100px;
}

/* タイトル */
.post-header__title {
  font-size: clamp(1.55rem, 3.2vw, 2.2rem);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--color-text);
  margin-bottom: 20px;
}

/* リード */
.post-header__lead {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-bottom: 14px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--color-border-light);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* メタ情報 */
.post-header__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.post-header__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-beige);
  padding: 4px 10px;
  border-radius: 100px;
}

.post-header__badge .category-badge {
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* ── ② アイキャッチ 改善 ── */
.post-eyecatch {
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: none;
  position: relative;
}

/* アイキャッチが最初の要素の場合（post-headerがない場合） */
.post-single > .post-eyecatch:first-child {
  border-radius: 20px 20px 0 0;
}

.post-eyecatch::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.15));
  pointer-events: none;
}

.post-eyecatch__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.post-single:hover .post-eyecatch__img {
  transform: scale(1.01);
}

/* ── ③ 本文エリア 改善 ── */
.post-single .post-content {
  padding: 40px 52px 48px;
  max-width: 100%;
  font-size: 1rem;
  line-height: 1.9;
  color: #3d2f25;
  letter-spacing: 0.025em;
}

/* H2 見出し：より印象的に */
.post-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 16px 22px 16px 22px;
  background: linear-gradient(135deg, rgba(242,230,216,0.9) 0%, rgba(247,244,239,0.6) 100%);
  border-left: 5px solid var(--color-primary);
  border-radius: 0 10px 10px 0;
  margin-top: 56px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(107,68,35,0.06), inset 0 0 0 1px rgba(139,99,71,0.08);
  line-height: 1.55;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-content h2::before {
  display: none; /* 旧スタイルを無効化 */
}

/* H3 見出し */
.post-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 2px 0 10px 16px;
  background: transparent;
  border-left: 3px solid var(--color-accent-warm);
  border-bottom: 1px solid var(--color-border-light);
  border-radius: 0;
  margin-top: 40px;
  margin-bottom: 18px;
  line-height: 1.55;
  color: var(--color-text);
}

/* H4 見出し */
.post-content h4 {
  font-size: 0.975rem;
  font-weight: 600;
  padding-left: 12px;
  border-left: 2px solid var(--color-accent-warm);
  color: var(--color-text);
  margin-top: 32px;
  margin-bottom: 12px;
  line-height: 1.55;
  opacity: 0.9;
}

/* 本文 p */
.post-content p {
  margin-bottom: 1.4em;
}

/* リスト */
.post-content ul,
.post-content ol {
  margin: 18px 0;
  padding-left: 0;
  list-style: none;
}

.post-content li {
  margin-bottom: 8px;
  line-height: 1.85;
  padding-left: 24px;
  position: relative;
}

.post-content ul > li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 11px;
  width: 7px;
  height: 7px;
  background: var(--color-primary);
  border-radius: 50%;
  opacity: 0.6;
}

.post-content ol {
  counter-reset: ol-counter;
}

.post-content ol > li {
  counter-increment: ol-counter;
}

.post-content ol > li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 引用 */
.post-content blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--color-beige);
  border-left: 4px solid var(--color-border);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: normal;
  color: var(--color-text-light);
  line-height: 1.85;
}

.post-content blockquote::before {
  content: none;
}

/* cite・出典 */
.post-content blockquote cite,
.post-content blockquote footer {
  display: block;
  margin-top: 10px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.post-content blockquote cite::before {
  content: '— ';
}

/* 画像 */
.post-content img,
.post-content .wp-block-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 24px 0;
  display: block;
  box-shadow: 0 4px 16px rgba(107,68,35,0.1);
}

/* 吹き出しアイコンはpost-content imgのスタイルを継承させない */
.post-content .balloon__icon {
  margin: 0 !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  display: block;
  width: 60px;
  height: 60px;
}

/* ── タグ・著者・CTA・ナビ：padding統一 改善 ── */
.post-tags,
.post-author,
.post-cta,
.post-nav {
  margin-left: 52px;
  margin-right: 52px;
}

/* タグ */
.post-tags {
  margin-bottom: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.post-tags::before {
  content: 'タグ：';
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}

/* CTA */
.post-cta {
  margin-top: 40px;
  margin-bottom: 32px;
  padding: 36px 40px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 16px;
  text-align: center;
  color: var(--color-white);
  box-shadow: 0 6px 24px rgba(107,68,35,0.18);
  position: relative;
  overflow: hidden;
}

.post-cta::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}

.post-cta::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 90px;
  height: 90px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}

.post-cta__text {
  font-size: 0.9375rem;
  opacity: 0.95;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
  line-height: 1.75;
  position: relative;
  z-index: 1;
}

.post-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-white);
  color: var(--color-primary);
  padding: 14px 36px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all var(--transition-base);
  letter-spacing: 0.04em;
  box-shadow: 0 4px 14px rgba(0,0,0,0.14);
  position: relative;
  z-index: 1;
}

.post-cta__btn:hover {
  background: #fff8f2;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

/* 前後ナビ */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 0;
  margin-bottom: 44px;
}

.post-nav__item {
  display: block;
  text-decoration: none;
  background: var(--color-white);
  border-radius: 12px;
  padding: 16px 18px;
  border: 1.5px solid var(--color-border-light);
  transition: all 0.2s ease;
}

.post-nav__item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(107,68,35,0.1);
  transform: translateY(-2px);
  background: #fffaf6;
}

.post-nav__label {
  font-size: 0.72rem;
  color: var(--color-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-nav__title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.55;
}

.post-nav__thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

/* ── 目次 (TOC) — toc.css に定義済み、ここでは上書きなし ── */

/* ── 情報ボックス 改善 ── */
.post-content .box-point,
.post-content .box-attention,
.post-content .box-memo,
.post-content .box-ng,
.post-content .box-tips {
  position: relative;
  margin: 24px 0;
  padding: 18px 20px 18px 56px;
  border-radius: 12px;
  font-size: 0.9375rem;
  line-height: 1.8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.post-content .box-point  {
  background: linear-gradient(135deg, rgba(126,154,104,0.1) 0%, rgba(126,154,104,0.04) 100%);
  border-left: 4px solid var(--color-accent-green);
  border-radius: 0 12px 12px 0;
}
.post-content .box-attention {
  background: linear-gradient(135deg, rgba(200,149,108,0.12) 0%, rgba(200,149,108,0.04) 100%);
  border-left: 4px solid var(--color-accent-warm);
  border-radius: 0 12px 12px 0;
}
.post-content .box-memo   {
  background: linear-gradient(135deg, rgba(242,230,216,0.8) 0%, rgba(247,244,239,0.5) 100%);
  border-left: 4px solid var(--color-primary-light);
  border-radius: 0 12px 12px 0;
}
.post-content .box-ng     {
  background: linear-gradient(135deg, rgba(220,80,80,0.08) 0%, rgba(220,80,80,0.03) 100%);
  border-left: 4px solid #d95555;
  border-radius: 0 12px 12px 0;
}
.post-content .box-tips   {
  background: linear-gradient(135deg, rgba(107,143,175,0.1) 0%, rgba(107,143,175,0.04) 100%);
  border-left: 4px solid #6B8FAF;
  border-radius: 0 12px 12px 0;
}

.post-content .box-point::before    { content: ''; position: absolute; left: 14px; top: 17px; width: 20px; height: 20px; background: var(--color-accent-green); border-radius: 50%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpolyline points='2,6 5,9 10,3' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 12px 12px; background-repeat: no-repeat; background-position: center; }
.post-content .box-attention::before{ content: '!'; position: absolute; left: 14px; top: 17px; width: 20px; height: 20px; background: var(--color-accent-warm); border-radius: 50%; color: white; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 20px; font-family: var(--font-heading); }
.post-content .box-memo::before     { content: ''; position: absolute; left: 14px; top: 17px; width: 20px; height: 20px; background: var(--color-primary-light); border-radius: 4px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M8.5 1.5 L10.5 3.5 L4 10 L1.5 10.5 L2 8 Z' fill='none' stroke='white' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 12px 12px; background-repeat: no-repeat; background-position: center; }
.post-content .box-ng::before       { content: ''; position: absolute; left: 14px; top: 17px; width: 20px; height: 20px; background: #d95555; border-radius: 50%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cline x1='3' y1='3' x2='9' y2='9' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3Cline x1='9' y1='3' x2='3' y2='9' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-size: 12px 12px; background-repeat: no-repeat; background-position: center; }
.post-content .box-tips::before     { content: ''; position: absolute; left: 14px; top: 17px; width: 20px; height: 20px; background: #6B8FAF; border-radius: 50%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='4.5' r='2.5' fill='none' stroke='white' stroke-width='1.4'/%3E%3Cpath d='M4.5 7 Q4 8.5 4.5 9 L7.5 9 Q8 8.5 7.5 7 Z' fill='white'/%3E%3Cline x1='4.8' y1='9.5' x2='7.2' y2='9.5' stroke='white' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E"); background-size: 12px 12px; background-repeat: no-repeat; background-position: center; }

/* ── テーブル 改善 ── */
.post-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 28px 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(107,68,35,0.07);
  /* モバイル基準：常にblock+横スクロール */
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.post-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}

.post-content th,
.post-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  border-right: 1px solid var(--color-border-light);
  text-align: left;
  font-size: 0.9rem;
}

.post-content th {
  background: linear-gradient(180deg, var(--color-beige) 0%, rgba(242,230,216,0.6) 100%);
  font-weight: 700;
  color: var(--color-text);
}

.post-content tr:last-child td {
  border-bottom: none;
}

.post-content td:last-child,
.post-content th:last-child {
  border-right: none;
}

.post-content tr:nth-child(even) td {
  background: rgba(242, 230, 216, 0.2);
}

/* ── コード 改善 ── */
.post-content code {
  background: rgba(139,99,71,0.08);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
  color: var(--color-primary-dark);
  border: 1px solid rgba(139,99,71,0.12);
}

.post-content pre {
  background: #2d1f14;
  color: #f0e6d6;
  padding: 24px 28px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 24px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  position: relative;
}

.post-content pre::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 18px 0 0 #ffbd2e, 36px 0 0 #28c941;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  border: none;
  font-size: 0.875rem;
  padding-top: 20px;
  display: block;
}

/* ── スマホ対応 改善版 ── */
@media (max-width: 768px) {
  .post-header {
    padding: 28px 24px 24px;
  }

  .post-header::after {
    left: 24px;
    right: 24px;
  }

  .post-header__title {
    font-size: 1.35rem;
    line-height: 1.55;
  }

  .post-single .post-content {
    padding: 28px 24px 36px;
    font-size: 0.9375rem;
  }

  .post-tags,
  .post-author,
  .post-cta,
  .post-nav {
    margin-left: 24px;
    margin-right: 24px;
  }

  .post-cta {
    padding: 28px 24px;
  }

  .post-nav {
    grid-template-columns: 1fr;
    margin-bottom: 32px;
  }

  .post-nav__item--next .post-nav__label {
    justify-content: flex-start;
  }

  .post-nav__item--next .post-nav__title {
    text-align: left;
  }

  .post-nav__card--reverse {
    flex-direction: row;
  }

  .post-eyecatch {
    aspect-ratio: 16 / 9;
  }

  .post-content h2 {
    font-size: 1.05rem;
    padding: 14px 16px 14px 16px;
    margin-top: 40px;
  }

  .post-content h3 {
    font-size: 0.975rem;
    margin-top: 32px;
  }

  .post-content pre {
    padding: 20px 16px 16px;
  }

  .post-content pre::before {
    left: 12px;
  }
}

@media (max-width: 480px) {
  .post-header {
    padding: 22px 18px 20px;
  }

  .post-header::after {
    left: 18px;
    right: 18px;
  }

  .post-single .post-content {
    padding: 22px 18px 28px;
  }

  .post-tags,
  .post-author,
  .post-cta,
  .post-nav {
    margin-left: 18px;
    margin-right: 18px;
  }
}



/* ============================================================
   SNSシェアボタン（記事エリア下）
   ============================================================ */
.post-share {
  margin: var(--space-6) 52px var(--space-8);
  padding: var(--space-6);
  background: var(--color-beige, #f5ece2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
}

.post-share__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  text-align: center;
  letter-spacing: 0.05em;
}

.post-share__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

.post-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font-heading);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.post-share__btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.post-share__btn--x {
  background: #000;
  color: #fff;
}

.post-share__btn--line {
  background: #06C755;
  color: #fff;
}

.post-share__btn--fb {
  background: #1877F2;
  color: #fff;
}

.post-share__btn--copy {
  background: var(--color-white);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

@media (max-width: 768px) {
  .post-share {
    margin-left: 24px;
    margin-right: 24px;
  }
}

@media (max-width: 480px) {
  .post-share {
    margin-left: 18px;
    margin-right: 18px;
  }

  .post-share__buttons {
    gap: var(--space-2);
  }

  .post-share__btn {
    font-size: 0.8rem;
    padding: 7px 12px;
  }
}

/* ============================================================
   モバイル追加修正（480px以下）
   ============================================================ */
@media (max-width: 480px) {
  /* ヘッダー高さを詰める */
  :root {
    --header-h: 90px;
  }

  /* ヒーロータイトルを小さく */
  .hero__title {
    font-size: 1.4rem;
    line-height: 1.5;
  }

  .hero__eyebrow {
    font-size: 0.78rem;
  }

  .hero {
    min-height: 240px;
  }

  .hero__content {
    padding: 36px 0;
    text-align: center;
  }

  .hero__cta {
    align-items: center;
  }

  /* カテゴリーナビ余白詰め */
  .category-nav {
    padding: var(--space-5) 0;
  }

  .category-nav__grid {
    gap: var(--space-2);
  }

  /* サイトロゴ縮小 */
  .site-logo {
    max-width: 180px;
    max-height: 60px;
  }

  /* section余白縮め */
  .home-section {
    padding: var(--space-5) 0;
  }

  /* 記事カードのpaddingを縮小 */
  .article-card__body {
    padding: 16px;
    gap: 8px;
  }

  /* post-navの前後記事サムネ非表示 */
  .post-nav__thumb {
    display: none;
  }
}

/* ============================================================
   横スクロール完全防止（追加強化）
   ============================================================ */
.post-content img,
.post-content .wp-block-image img,
.post-content figure img {
  max-width: 100%;
  height: auto;
}

/* テーブルはベースで block + overflow-x: auto に統合済み */

@media (max-width: 640px) {
  /* post-content内のpreコードブロック */
  .post-content pre {
    padding: 18px 14px 14px;
    font-size: 0.8rem;
  }

  /* ボックス系パディング縮小 */
  .post-content .box-point,
  .post-content .box-attention,
  .post-content .box-memo,
  .post-content .box-ng,
  .post-content .box-tips {
    padding: 14px 14px 14px 46px;
  }

  /* SNSシェアボタン 小画面で2列に */
  .post-share__buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

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

/* ============================================================
   アクセシビリティ・パフォーマンス
   ============================================================ */

/* アニメーション無効化（ユーザー設定） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* タッチデバイスでhoverのtransformを無効化（タップ時の跳ね防止） */
@media (hover: none) {
  .card:hover,
  .article-card:hover,
  .article-list-item:hover,
  .category-nav__card:hover,
  .btn--primary:hover,
  .post-nav__item:hover,
  .back-to-top:hover {
    transform: none;
  }
}

/* ============================================================
   印刷スタイル
   ============================================================ */
@media print {
  .site-header,
  .mobile-nav,
  .back-to-top,
  .post-share,
  .post-cta,
  .sidebar {
    display: none !important;
  }
  .site-layout {
    padding-top: 0;
  }
  .post-single {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ============================================================
   アクセシビリティ強化
   ============================================================ */

/* スキップナビゲーション */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-primary-dark);
  outline-offset: 2px;
}

/* キーボード操作時のフォーカスリング（outline:none を上書き） */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.header__search-input:focus-visible,
.search-form--large input:focus-visible,
.mobile-nav__search input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* マウス操作時はフォーカスリングを非表示（UX 維持） */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   2026-09 添削対応：SNSアイコン・検索欄
   ============================================================ */

/* ── SNSアイコン：ヘッダー・サイドバー・スマホメニューで同じ丸ボタンにそろえる ──
   ・押せる範囲を 38px 以上に（指でもマウスでも押しやすい大きさ）
   ・X は塗りの形で大きく見えるので、少し小さくして他と見た目の大きさをそろえる */
.header__sns,
.sidebar-profile__sns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.header__sns-link,
.sidebar-profile__sns-icon,
.mobile-nav__sns-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-beige);
  color: var(--color-primary);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.header__sns-link svg,
.sidebar-profile__sns-icon svg,
.mobile-nav__sns-link svg {
  width: 18px;
  height: 18px;
}
.header__sns-link[aria-label^="X"] svg,
.sidebar-profile__sns-icon--x svg,
.mobile-nav__sns-link[aria-label^="X"] svg {
  width: 15px;
  height: 15px;
}
.header__sns-link:hover,
.sidebar-profile__sns-icon:hover,
.mobile-nav__sns-link:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}
.header__sns-link:focus-visible,
.sidebar-profile__sns-icon:focus-visible,
.mobile-nav__sns-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
/* 横幅が足りない画面：検索欄を少し短く。さらに狭い画面では、ヘッダーのSNSは隠す
   （サイドバーのプロフィールとスマホメニューにも同じリンクがあるため） */
@media (max-width: 1180px) {
  .header__search-input { width: 140px; }
}
@media (max-width: 1100px) {
  .header__sns { display: none; }
}

/* ── 検索欄：マウスを乗せたとき・入力中が分かるように ── */
.header__search-form {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.header__search-form:hover {
  border-color: var(--color-primary);
  background: var(--color-white);
}
.header__search-form:focus-within {
  border-color: var(--color-primary);
  background: var(--color-white);
  box-shadow: 0 0 0 3px rgba(139, 99, 71, .18);
}
.header__search-input { cursor: text; }
.header__search-btn { cursor: pointer; }
.header__search-btn:hover .search-icon,
.header__search-btn:hover svg { transform: scale(1.1); }
.header__search-btn svg { transition: transform var(--transition-fast); }

.mobile-nav__search input {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.mobile-nav__search input:hover { border-color: var(--color-primary); }
.mobile-nav__search input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 99, 71, .18);
}
.search-form--large input:hover { border-color: var(--color-primary); }

/* 検索欄の入力中：入力欄そのものの四角い線は消し、丸い枠（枠線の色＋外側の薄い縁取り）だけで示す
   （線が2重・3重に見えて、角の形もそろわないため） */
.header__search-input:focus,
.header__search-input:focus-visible,
.mobile-nav__search input:focus-visible,
.search-form--large input:focus-visible {
  outline: none;
}
.search-form--large input:focus {
  box-shadow: 0 0 0 3px rgba(139, 99, 71, .18);
}

/* ============================================================
   2026-09 スマホではみ出す部分の修正
   ============================================================ */
/* キャプション付きの画像（本文の width="700" 指定）を画面幅に収める */
.post-content .wp-caption,
.post-content figure {
  max-width: 100% !important;
  height: auto;
}
.post-content .wp-caption img,
.post-content figure img {
  max-width: 100%;
  height: auto;
}
.post-content .wp-caption-text {
  font-size: .8125rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 8px;
}

/* お問い合わせフォーム（Contact Form 7）：入力欄を画面幅に収め、サイトの見た目にそろえる */
.wpcf7 form { max-width: 100%; }
.wpcf7 label { display: block; font-weight: 700; font-size: var(--text-sm); }
.wpcf7-form-control-wrap { display: block; margin-top: 6px; }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-white);
  font-size: 16px; /* iPhone で入力時に画面が拡大されないように 16px 以上 */
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.wpcf7 input:focus,
.wpcf7 textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 99, 71, .18);
}
.wpcf7 input[type="submit"] {
  display: block;
  margin: 8px auto 0;
  padding: 14px 40px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.wpcf7 input[type="submit"]:hover { background: var(--color-primary-dark); }

/* ── サイドバーのタグ一覧（アーカイブの下） ── */
.sidebar-tags__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sidebar-tags__list .sidebar-tags__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.4;
}
.sidebar-tags__count {
  min-width: 1.6em;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--color-white);
  font-size: 10px;
  text-align: center;
  color: var(--color-text-muted);
}
.sidebar-tags__tag:hover .sidebar-tags__count {
  color: var(--color-primary);
}

/* 本文リンクを見分けやすく（2026-10-22 追加。元に戻すときはこのまとまりを消す） */
.post-content a:not(.toc-widget a, .site-title a, [class*="button"], :has(img)) {
	color: #a0522d;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: rgba(160, 82, 45, 0.55);
	font-weight: 500;
	transition: color 0.2s;
}
.post-content a:not(.toc-widget a, .site-title a, [class*="button"], :has(img)):hover {
	color: #7a3a1a;
	text-decoration-color: currentColor;
	text-decoration-thickness: 2px;
}
