/* ============================================================
   なんきょく工房 - サイト共通スタイル (ヘッダ / フッタ / ベース)
   ============================================================ */

:root {
  --color-text: #2b2f33;
  --color-text-muted: #6b7280;
  --color-heading: #071f39;       /* セクション見出しの濃紺 */
  --color-bg: #ffffff;
  --color-bg-soft: #f7f9fb;
  --color-bg-page: #f3f6f9;       /* ヘッダ以外のベース背景 */
  --color-border: #e3e8ee;
  --color-accent: #f5c84b;        /* タイトル下線の黄 */
  --color-link: #2b2f33;
  --color-link-hover: #1f6feb;

  --header-height: 96px;
  --max-content-width: 1600px;
  --side-col-width: 340px;        /* トップページ右サイドバー幅 */

  --font-base: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI",
               "Meiryo", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  /* 縦スクロールバー領域を常に確保し、100vw === documentElement.clientWidth とする。
     これにより .hero の calc(50% - 50vw) がスクロールバー幅分はみ出して横スクロールバーを
     生む現象を根本的に防ぐ。 */
  scrollbar-gutter: stable;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg-page);
  line-height: 1.7;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* .hero の calc(50% - 50vw) や、稀に発生する子要素のはみ出しで横スクロールバーが
     現れるのを防ぐ。clip は scroll container を作らないので sticky なヘッダに影響しない。 */
  overflow-x: clip;
}

a {
  color: var(--color-link);
  text-decoration: none;
}
a:hover {
  color: var(--color-link-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ------------------------------------------------------------
   Admin edit bar (AdminHost 判定で true のとき各ページの上部に出る)
   コンテンツ詳細・キャラクタープロフィールの両方で共通利用するため、
   ページ固有 CSS ではなく site.css 側に置いている。
   ------------------------------------------------------------ */
.admin-edit-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px 0;
  padding: 8px 14px;
  border: 1px dashed #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  font-size: 13px;
}
.admin-edit-bar__label {
  font-weight: 700;
  color: #92400e;
  letter-spacing: 0.04em;
}
.admin-edit-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fbbf24;
  color: #422006;
  text-decoration: none;
  font-weight: 600;
}
.admin-edit-bar__link:hover {
  background: #f59e0b;
  color: #1c1917;
}
/* キャプチャ撮影時に邪魔にならないよう右端に閉じるボタンを置く。
   sessionStorage に状態を保存し、同タブ内では再表示しない (タブを閉じるか別ブラウザで開けば復活)。 */
.admin-edit-bar__close {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #92400e;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.admin-edit-bar__close:hover {
  background: #fde68a;
  color: #1c1917;
}
.admin-edit-bar__close:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 1px;
}

/* ------------------------------------------------------------
   Content detail (/content/{id})
   ------------------------------------------------------------ */

/* iPentec.Document.Parser が出力する HTML を直接配置するためのスタイル。
   pre-wrap は付けない (パーサが <p> / <br> として改行を表現するため、付けると改行が二重に効く)。 */
.comment {
  overflow-wrap: anywhere;
}
.comment p {
  margin: 0 0 0.6em 0;
}
.comment p:last-child {
  margin-bottom: 0;
}
.comment ul,
.comment ol {
  margin: 0.4em 0 0.6em 0;
  padding-left: 1.6em;
}
.comment li {
  margin: 0;
}
.comment h1,
.comment h2,
.comment h3,
.comment h4 {
  margin: 1em 0 0.4em 0;
  line-height: 1.4;
}
.comment h1:first-child,
.comment h2:first-child,
.comment h3:first-child,
.comment h4:first-child {
  margin-top: 0;
}
/* #page(N) で挿入される画像。caption 無しは <img class="content-image"> 単体、
   caption ありは <figure class="content-image content-image--captioned"> でラップされる。
   どちらも max-width: 100% で親幅に収まる範囲で原寸表示する (拡大はしない)。 */
.comment img.content-image,
.comment .content-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
/* caption 付きのみ figure として中央寄せ + 上下マージン */
.comment .content-image--captioned {
  margin: 0.8em 0;
  text-align: center;
}
.comment .content-image--captioned img {
  display: inline-block;
}
.comment .content-image--captioned figcaption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.header-logo img {
  display: block;
  height: 64px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
  justify-content: center;
}
.header-nav a {
  position: relative;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 2px;
  color: var(--color-text);
  white-space: nowrap;
}
.header-nav a:hover {
  color: var(--color-link-hover);
}
.header-nav a.is-active {
  color: var(--color-text);
}
.header-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-search {
  position: relative;
  flex: 0 1 220px;
  min-width: 0;
}
.header-search input {
  appearance: none;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 9px 16px 9px 38px;
  font: inherit;
  width: 100%;
  max-width: 220px;
  min-width: 0;
  background: var(--color-bg-soft);
  transition: border-color 0.15s, background-color 0.15s;
}
.header-search input:focus {
  outline: none;
  border-color: var(--color-link-hover);
  background: var(--color-bg);
}
.header-search::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--color-text);
  transition: background-color 0.15s, color 0.15s;
}
.header-icon:hover {
  background: var(--color-bg-soft);
  color: var(--color-link-hover);
}
.header-icon svg,
.header-icon img {
  width: 20px;
  height: 20px;
  display: block;
}

/* 単色 SVG (X など) を mask-image で表示し、currentColor で着色する。
   ホバー時の色変更や、将来別の SNS 単色アイコンを追加する際に再利用できる。 */
.header-icon-mask {
  display: block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
}
/* ヘッダ右側のドロップダウン (例: Pixiv のアカウント切り替え) */
.header-dropdown {
  position: relative;
}

.header-dropdown__trigger {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.header-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.18);
  z-index: 200;
}

.header-dropdown__menu a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.header-dropdown__menu a:hover,
.header-dropdown__menu a:focus-visible {
  background: var(--color-bg-soft);
  color: var(--color-link-hover);
  outline: none;
}

.header-icon-mask--x {
  -webkit-mask-image: url("/res/sns/x-logo.svg");
          mask-image: url("/res/sns/x-logo.svg");
  /* X のロゴは viewBox に余白がほぼ無いため、他アイコン (24x24 viewBox に内側 padding 込み)
     と並べると相対的に大きく見える。mask-size を 80% に縮めて視覚的サイズを揃える。 */
  -webkit-mask-size: 80%;
          mask-size: 80%;
}

/* ------------------------------------------------------------
   Main
   ------------------------------------------------------------ */

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ------------------------------------------------------------
   Hero (main visual)
   ------------------------------------------------------------ */

.hero {
  position: relative;
  margin: -32px calc(50% - 50vw) 24px;     /* .site-main の上 padding を打ち消し、ビューポート全幅へ拡張 */
  /* 左右は最低 4rem、ビューポートが --max-content-width より広い時はその差分を加算 */
  padding: 64px max(4rem, calc(50vw - 800px + 4rem)) 120px;
  /* SVG の上に白→透明のグラデーションを重ね、SVG 上端の段差をフェードでぼかす。
     gradient は手前 (上) のレイヤーに置く。 */
  background-image:
    linear-gradient(to bottom, #ffffff 0%, #ffffff 25%, rgba(255, 255, 255, 0) 75%),
    url("/res/hero/background.svg");
  background-repeat: no-repeat, no-repeat;
  background-position: top center, center bottom;
  background-size: 100% 100%, 100% auto;
  background-color: var(--color-bg-page);
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.hero-badge {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--color-text);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.6);
}

.hero-heading {
  margin: 0;
  font-size: clamp(32px, 3.6vw, 60px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--color-text);
}
.hero-mark {
  background-image: linear-gradient(transparent 62%, var(--color-accent) 62%, var(--color-accent) 92%, transparent 92%);
  padding: 0 4px;
}

.hero-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
  color: var(--color-text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: #122941;
  color: #ffffff;
  border-color: #122941;
}
.btn--primary:hover {
  background: #0c1d2f;
  color: #ffffff;
}

.btn--outline {
  background: #ffffff;
  color: var(--color-text);
  border-color: var(--color-text);
}
.btn--outline:hover {
  background: var(--color-text);
  color: #ffffff;
}

.hero-visual {
  position: relative;
}
.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 960px) {
  .hero {
    padding: 32px 16px 80px;
    margin-bottom: 16px;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-heading {
    font-size: clamp(28px, 7vw, 44px);
  }
}

/* ------------------------------------------------------------
   Top page sections
   ------------------------------------------------------------ */

.top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-col-width);
  gap: 32px;
  align-items: start;
}

.top-grid__main,
.top-grid__side {
  min-width: 0;
}

.top-grid__side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* サイドカラム内では section の下マージンは不要 (gap で間隔を取るため) */
.top-grid__side .top-section {
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .top-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.top-section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header--compact {
  margin-bottom: 12px;
}

/* カード内に見出しを差し込むときのスタイル (例: .update-log-card 内のヘッダ)。
   カード自体の padding を活かしつつ、リストとの間に薄い区切りを入れる。 */
.section-header--inset {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.section-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.section-more:hover {
  color: var(--color-link-hover);
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--color-heading);
}

.top-grid__side .section-title {
  font-size: 17px;
}

.section-title-icon {
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-title-icon svg {
  width: 1em;
  height: 1em;
  display: block;
}

.section-title-image {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

/* セクションタイトル右の SVG バッジ (例: 「最新の漫画」横の NEW バッジ)。
   new.svg は viewBox 920x470.8 のため、高さ基準で width:auto に。 */
.section-title-badge {
  display: inline-block;
  height: 22px;
  width: auto;
  vertical-align: middle;
}

/* ------------------------------------------------------------
   Card grid
   ------------------------------------------------------------ */

.card-grid {
  display: grid;
  gap: 20px;
}

.card-grid--new-contents {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

/* 1025-1600px: 2カラムレイアウト時、左カラム幅でも 4 列を維持できるよう gap のみ詰める */
@media (max-width: 1600px) and (min-width: 1025px) {
  .card-grid--new-contents { gap: 12px; }
}
/* 1カラムに切り替わったあとは画面幅基準で従来どおり */
@media (max-width: 1024px) {
  .card-grid--new-contents { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 880px) {
  .card-grid--new-contents { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .card-grid--new-contents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .card-grid--new-contents { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.12);
  border-color: var(--color-link-hover);
  color: inherit;
}

.card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--color-bg-soft);
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.card:hover .card-thumb img {
  transform: scale(1.04);
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* タイトルリンクの ::after でカード全体を覆い、空白部分クリックでも詳細ページへ遷移させる。
   タグリンクは z-index で上に出して個別にクリック可能にする。 */
.card-title-link {
  text-decoration: none;
  color: inherit;
}
.card-title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-tag {
  color: var(--color-text-muted);
  text-decoration: none;
}
.card-tag:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}
.card-tag-sep {
  color: var(--color-text-muted);
  margin: 0 1px;
}

.card-date {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
  text-align: right;
}

/* ------------------------------------------------------------
   Update log (お知らせ・更新情報)
   ------------------------------------------------------------ */

.update-log-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 24px;
}

.update-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 2行レイアウト:
   1行目 [pill] [date]
   2行目 link (横一杯) */
.update-log-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--color-border);
}
.update-log-row:last-child {
  border-bottom: 0;
}

.update-log-date {
  font-size: 12.5px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.update-log-link {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--color-text);
  text-decoration: none;
  white-space: normal;
  line-height: 1.5;
}
.update-log-link:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.6;
  white-space: nowrap;
  text-align: center;
  min-width: 56px;
}
.pill--info {
  background: #d6f5dc;
  color: #1f7a3a;
}
.pill--update {
  background: #e0eefb;
  color: #1f5fa0;
}

.update-log-empty {
  color: var(--color-text-muted);
  margin: 0;
  padding: 8px 4px;
}

.update-log-footer {
  margin-top: 12px;
  padding-top: 8px;
}
.update-log-more {
  display: inline-block;
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
}
.update-log-more:hover {
  color: var(--color-link-hover);
}

@media (max-width: 720px) {
  .update-log-card { padding: 12px 14px; }
}

/* ------------------------------------------------------------
   Character intro (top page side)
   ------------------------------------------------------------ */

.character-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 20px;
}

.character-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.character-row {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--color-border);
}
.character-row:last-child  { padding-bottom: 4px; border-bottom: 0; }

/* 行内のリンク (.character-name) を ::after で行全体に拡張し、
   テキスト/余白クリックでもプロフィールへ遷移させる。 */
.character-name::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}
.character-row:hover .character-name {
  color: var(--color-link-hover);
}

.character-avatar {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  overflow: hidden;
  flex-shrink: 0;
}
.character-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.character-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.character-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------
   Recommend section (top page main)
   ------------------------------------------------------------ */

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1600px) {
  .recommend-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 880px) {
  .recommend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 560px) {
  .recommend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.recommend-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 14px 14px 16px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.recommend-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.12);
  border-color: var(--color-link-hover);
  color: var(--color-text);
}
/* タイル全体がリンクなので、内部の見るボタンはタイルホバーで反転表示 */
.recommend-card:hover .recommend-card-link {
  background: var(--color-text);
  color: #ffffff;
  border-color: var(--color-text);
}

.recommend-card-thumb {
  aspect-ratio: 4 / 3;
  background: var(--color-bg-soft);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.recommend-card-emoji {
  font-size: 44px;
  line-height: 1;
}

.recommend-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.recommend-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.recommend-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.recommend-card-lead {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text-muted);
  flex: 1;
}

.recommend-card-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 4px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.recommend-card-link:hover {
  background: var(--color-text);
  color: #ffffff;
  border-color: var(--color-text);
}

/* ------------------------------------------------------------
   Other contents section (top page main)
   おすすめより一段控えめなタイル。アイコンを左、テキストを右、ボタンを下に配置。
   ------------------------------------------------------------ */

.other-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 880px) {
  .other-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .other-grid { grid-template-columns: 1fr; }
}

.other-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.other-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.10);
  border-color: var(--color-link-hover);
  color: var(--color-text);
}
.other-card:hover .other-card-link {
  background: var(--color-text);
  color: #ffffff;
  border-color: var(--color-text);
}

.other-card-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 1;
}

.other-card-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-bg-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.other-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.other-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.other-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.other-card-lead {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.other-card-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 12px;
  padding: 5px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

/* ------------------------------------------------------------
   Static pages (/privacy, /contact, /terms, etc.)
   ------------------------------------------------------------ */

.static-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px 4px 32px;
  color: var(--color-text);
  line-height: 1.85;
  font-size: 15px;
}

.static-page__header {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
}

.static-page__title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--color-heading);
}

.static-page__section {
  margin-bottom: 36px;
}

.static-page__section h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-heading);
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--color-accent);
}

.static-page__section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 20px 0 8px;
}

.static-page__section p {
  margin: 0 0 12px;
}

.static-page__section ul,
.static-page__section ol {
  margin: 0 0 12px;
  padding-left: 1.6em;
}

.static-page__section li {
  margin-bottom: 4px;
}

.static-page__table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

.static-page__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--color-bg);
}

.static-page__table th,
.static-page__table td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
}

.static-page__table thead th {
  background: var(--color-bg-soft);
  font-weight: 700;
  color: var(--color-heading);
  text-align: center;
}

.static-page__table--regulation tbody th {
  background: var(--color-bg-soft);
  text-align: center;
  width: 4em;
  font-weight: 700;
  color: var(--color-heading);
  font-variant-numeric: tabular-nums;
}

.static-page__table--regulation td {
  font-size: 13px;
  line-height: 1.7;
}

/* セルの背景色で取り扱い区分を表現 */
.static-page__table .cell--normal     { background: #dceeff; }   /* 通常コンテンツ */
.static-page__table .cell--gray-zone  { background: #d8f0c2; }   /* 通常 (該当コンテンツは現在 0、グレーゾーン) */
.static-page__table .cell--warning    { background: #ffd9a8; }   /* ワーニング表示あり */
.static-page__table .cell--excluded   { background: #dcdcdc; }   /* 取扱いに含まれない */

/* 凡例テーブル: 色見本セルを正方形に */
.static-page__table--legend {
  margin-top: 12px;
  width: auto;
}
.static-page__table--legend td:first-child {
  width: 48px;
  padding: 0;
}
.static-page__table--legend td:last-child {
  font-size: 13px;
}

.static-page__citation {
  margin-top: 16px;
  padding-left: 1.6em;
  font-size: 12.5px;
  color: var(--color-text-muted);
}
.static-page__citation a {
  color: var(--color-text-muted);
  word-break: break-all;
}

@media (max-width: 720px) {
  .static-page { font-size: 14px; }
  .static-page__title { font-size: 24px; }
  .static-page__section h2 { font-size: 18px; }
  .static-page__table { font-size: 13px; }
  .static-page__table th,
  .static-page__table td { padding: 8px 10px; }
}

/* ------------------------------------------------------------
   List page (/list/{slug}, /list/search/{query})
   ------------------------------------------------------------ */

.list-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.list-page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--color-text);
}

.list-page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.list-page-meta {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.list-empty {
  padding: 48px 0;
  text-align: center;
  color: var(--color-text-muted);
}

.card-grid--list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1024px) {
  .card-grid--list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .card-grid--list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .card-grid--list { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   Pagination
   ------------------------------------------------------------ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.pagination-pages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-bg);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.pagination-link:hover:not(.is-disabled):not(.is-current) {
  border-color: var(--color-link-hover);
  color: var(--color-link-hover);
}
.pagination-link.is-current {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #ffffff;
}
.pagination-link.is-disabled {
  color: var(--color-text-muted);
  background: var(--color-bg-soft);
  cursor: default;
}
.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------
   Character index (/list/characters)
   ------------------------------------------------------------ */

.char-index {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.char-index-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(245, 200, 75, 0.08) 0%, rgba(31, 111, 235, 0.06) 100%),
    var(--color-bg);
  overflow: hidden;
}

.char-index-hero__title {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--color-heading);
}

.char-index-hero__title-accent {
  position: relative;
  margin-left: 4px;
}
.char-index-hero__title-accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 3px;
  transform: skewX(-12deg);
}

.char-index-hero__lead {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.char-index-hero__visual {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-soft);
  border-radius: 50%;
  border: 1px solid var(--color-border);
}
.char-index-hero__visual img {
  width: 56px;
  height: 56px;
  display: block;
}

@media (max-width: 640px) {
  .char-index-hero {
    padding: 20px 18px;
  }
  .char-index-hero__visual {
    display: none;
  }
}

.char-index-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

/* タグチップから遷移してきた際の絞り込み表示 (解除リンク付き) */
.char-index-tagfilter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text);
  background: rgba(31, 111, 235, 0.08);
  border: 1px solid rgba(31, 111, 235, 0.25);
  border-radius: 8px;
}
.char-index-tagfilter__label {
  color: var(--color-text-muted);
}
.char-index-tagfilter__value {
  font-weight: 700;
  color: #1f6feb;
}
.char-index-tagfilter__clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.char-index-tagfilter__clear:hover {
  color: var(--color-link-hover);
  border-color: var(--color-link-hover);
}
.char-index-tagfilter__clear svg {
  width: 12px;
  height: 12px;
}

.char-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 240px;
  display: flex;
  align-items: center;
}
.char-search__icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
}
.char-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.char-search input:focus {
  outline: none;
  border-color: var(--color-link-hover);
  box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.15);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row--categories {
  flex: 1 1 auto;
  justify-content: flex-start;
}

.chip-row--initials {
  justify-content: center;
  padding: 4px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1.2;
}
.chip:hover {
  border-color: var(--color-link-hover);
  color: var(--color-link-hover);
}
.chip.is-active {
  background: var(--color-heading);
  border-color: var(--color-heading);
  color: #ffffff;
}
.chip.is-active:hover {
  background: var(--color-heading);
  color: #ffffff;
  border-color: var(--color-heading);
}

.chip--pill {
  border-radius: 999px;
}

.chip--round {
  border-radius: 999px;
  min-width: 40px;
  padding: 6px 12px;
}

.char-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1024px) {
  .char-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .char-grid { grid-template-columns: 1fr; }
}

.char-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.char-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.12);
  border-color: var(--color-link-hover);
}

.char-card__thumb {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.char-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.char-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.char-card__name-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.char-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}
/* 名前リンクの ::after でカード全体を覆い、空白部分クリックでもプロフィールへ遷移させる。 */
.char-card__name::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}
.char-card:hover .char-card__name {
  color: var(--color-link-hover);
}

.char-card__name-en {
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.char-card__work {
  margin: 0;
  font-size: 12.5px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.char-card__tag {
  /* .char-card__name::after がカード全体を覆ってクリックを奪うため、
     タグリンクは relative + z-index でその上に出す。 */
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.char-card__tag:hover {
  color: var(--color-link-hover);
  background: rgba(31, 111, 235, 0.08);
  border-color: var(--color-link-hover);
}

/* ------------------------------------------------------------
   Profile detail (/profile/{id})
   ------------------------------------------------------------ */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.breadcrumb a {
  color: var(--color-text-muted);
}
.breadcrumb a:hover {
  color: var(--color-link-hover);
}
.breadcrumb__sep {
  color: var(--color-text-muted);
}
.breadcrumb__current {
  color: var(--color-text);
  font-weight: 600;
}

.profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 28px 32px;
  margin-bottom: 24px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(245, 200, 75, 0.08) 0%, rgba(31, 111, 235, 0.06) 100%),
    var(--color-bg);
  overflow: hidden;
}

@media (max-width: 720px) {
  .profile-hero {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 20px;
    text-align: center;
  }
}

.profile-hero__avatar {
  width: 240px;
  height: 240px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  justify-self: center;
}
.profile-hero__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 720px) {
  .profile-hero__avatar {
    width: 180px;
    height: 180px;
  }
}

.profile-hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

@media (max-width: 720px) {
  .profile-hero__text {
    align-items: center;
  }
}

.profile-hero__yomi {
  margin: 0 0 4px;
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--color-text-muted);
  letter-spacing: 0.4em;
  font-weight: 600;
}
.profile-hero__yomi span {
  display: inline-block;
}

.profile-hero__name {
  margin: 0;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--color-heading);
  line-height: 1.15;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.profile-hero__name-family {
  display: inline-block;
}

.profile-hero__name-given {
  display: inline-block;
  position: relative;
}
.profile-hero__name-given::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 4px;
  transform: skewX(-12deg);
  z-index: -1;
}

.profile-hero__english {
  margin: 4px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
}

.profile-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.profile-chip svg {
  width: 13px;
  height: 13px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.profile-chip--tag:hover {
  border-color: var(--color-link-hover);
  color: var(--color-link-hover);
}
.profile-chip--tag:hover svg {
  color: var(--color-link-hover);
}

/* 登場作品はクリックできないラベル。タグチップ (pill) と区別するため角丸を抑え、
   背景・枠線を弱めて「メタ情報の見出し」的な見た目にする。 */
.profile-chip--work {
  padding: 4px 10px 4px 8px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--color-text-muted);
  background: var(--color-bg-soft);
  border: 1px dashed var(--color-border);
  cursor: default;
}
.profile-chip--work svg {
  width: 12px;
  height: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .profile-card--related { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card--related { grid-column: auto; }
}

.profile-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.profile-card__icon {
  width: 18px;
  height: 18px;
  color: var(--color-heading);
  flex-shrink: 0;
}

.profile-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-heading);
}

/* プロフィール定義リスト */
.profile-info {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.profile-info__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 13.5px;
}
.profile-info__row:last-child {
  border-bottom: 0;
}
.profile-info__row dt {
  margin: 0;
  color: var(--color-text-muted);
  font-weight: 600;
}
.profile-info__row dd {
  margin: 0;
  color: var(--color-text);
  word-break: break-word;
}

.profile-info__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.profile-info__tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #1f6feb;
  background: rgba(31, 111, 235, 0.08);
  border-radius: 4px;
  text-decoration: none;
}
.profile-info__tag:hover {
  background: rgba(31, 111, 235, 0.16);
  color: #1f6feb;
}

/* 設定・メモ */
.profile-memo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.profile-memo__empty {
  margin: 0;
  font-size: 14px;
  color: var(--color-text);
}

.profile-memo__body {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
/* iPentec.Document.Parser が出力する HTML 要素のマージンを引き締める。
   ブラウザ既定の <p> マージン (約 1em) とソース改行が重なって行間がスカスカになるのを防ぐ。 */
.profile-memo__body p {
  margin: 0 0 0.6em 0;
}
.profile-memo__body p:last-child {
  margin-bottom: 0;
}
.profile-memo__body ul,
.profile-memo__body ol {
  margin: 0.4em 0 0.6em 0;
  padding-left: 1.6em;
}
.profile-memo__body li {
  margin: 0;
}
.profile-memo__body h1,
.profile-memo__body h2,
.profile-memo__body h3,
.profile-memo__body h4 {
  margin: 1em 0 0.4em 0;
  line-height: 1.4;
}
.profile-memo__body h1:first-child,
.profile-memo__body h2:first-child,
.profile-memo__body h3:first-child,
.profile-memo__body h4:first-child {
  margin-top: 0;
}

.profile-memo__note {
  margin: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* 関連コンテンツ */
.profile-related-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.profile-related-group__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-heading);
}

.profile-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.profile-related-list li {
  border-top: 1px dashed var(--color-border);
}
.profile-related-list li:first-child {
  border-top: 0;
}

.profile-related-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.15s;
}
.profile-related-link:hover {
  color: var(--color-link-hover);
}
.profile-related-link svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.profile-related-link:hover svg {
  color: var(--color-link-hover);
}

.profile-related-empty {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* 他のおすすめキャラクター */
.profile-recommend {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-recommend__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-recommend__title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-heading);
}
.profile-recommend__title svg {
  width: 18px;
  height: 18px;
}

.profile-recommend__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.profile-recommend__more:hover {
  color: var(--color-link-hover);
  border-color: var(--color-link-hover);
}
.profile-recommend__more svg {
  width: 14px;
  height: 14px;
}

.profile-recommend__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1024px) {
  .profile-recommend__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .profile-recommend__list { grid-template-columns: 1fr; }
}

.profile-recommend__card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.profile-recommend__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.12);
  border-color: var(--color-link-hover);
}

.profile-recommend__thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.profile-recommend__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-recommend__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-recommend__name-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-recommend__name {
  font-size: 14px;
  font-weight: 700;
}

.profile-recommend__name-en {
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

.profile-recommend__chevron {
  margin-left: auto;
  color: var(--color-text-muted);
  display: inline-flex;
}
.profile-recommend__chevron svg {
  width: 14px;
  height: 14px;
}

.profile-recommend__desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-recommend__tag {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  line-height: 1.4;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

.site-footer {
  --footer-bg: #122941;
  --footer-text: #ffffff;
  --footer-text-muted: rgba(255, 255, 255, 0.7);
  --footer-border: rgba(255, 255, 255, 0.18);

  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 28px 0;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
}
.footer-logo img {
  display: block;
  height: 48px;
  width: auto;
}

.footer-nav {
  display: flex;
  gap: 32px;
  justify-content: center;
}
.footer-nav a {
  color: var(--footer-text-muted);
  font-size: 14px;
}
.footer-nav a:hover {
  color: var(--footer-text);
}

.footer-copyright {
  color: var(--footer-text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.scroll-top {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--footer-border);
  background: transparent;
  color: var(--footer-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.scroll-top:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--footer-text);
}
.scroll-top svg {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

/* 中間幅 (1080-1280px): ナビは表示するがギャップ・検索ボックスを詰めて自然に収める */
@media (max-width: 1280px) {
  .header-inner { padding: 0 16px; }
  .header-nav { gap: 16px; }
  .header-nav a { font-size: 14px; }
  .header-actions { gap: 8px; }
  .header-search { flex: 0 1 180px; }
  .header-search input { max-width: 180px; }
}

/* ナビが収まらない幅 (~1080px 以下) ではナビを非表示にする。
   旧 960px だと 6 リンク + 検索 + アイコン 3 個が中間幅でオーバーフローしていた。 */
@media (max-width: 1080px) {
  :root { --header-height: 80px; }

  .header-inner { gap: 12px; padding: 0 16px; }
  .header-logo img { height: 48px; }
  .header-nav { display: none; }
  .header-search { flex: 0 1 160px; }
  .header-search input { max-width: 160px; }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    gap: 12px;
    padding: 0 16px;
  }
  .footer-nav { flex-wrap: wrap; gap: 16px; }
}

@media (max-width: 560px) {
  .header-search { display: none; }
}

/* ------------------------------------------------------------
   Mailform (お問い合わせ)
   ------------------------------------------------------------ */

.mailform-section {
  max-width: 760px;
  margin: 0 auto 48px;
}

.mailform-lead {
  margin: 0 0 24px;
  color: var(--color-text);
}

.mailform-required-note {
  display: inline-block;
  font-size: 13px;
  color: var(--color-text-muted);
}

.mailform-required-mark {
  color: #d6332e;
  font-weight: 700;
  margin-left: 4px;
}

.mailform {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mailform-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mailform-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.mailform-input,
.mailform-textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--color-text);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.mailform-input:focus,
.mailform-textarea:focus {
  outline: none;
  border-color: var(--color-link-hover);
  box-shadow: 0 0 0 3px rgba(43, 127, 255, 0.15);
}

.mailform-textarea {
  resize: vertical;
  min-height: 200px;
  line-height: 1.6;
}

.mailform-validation {
  font-size: 12px;
  color: #d6332e;
  min-height: 1em;
}

.mailform-error {
  padding: 12px 16px;
  background: #fdecec;
  border: 1px solid #f5b9b7;
  border-radius: 6px;
  color: #a32623;
  font-size: 14px;
}

.mailform-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Honeypot: 人間とスクリーンリーダーから完全に隠す */
.mailform-honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.mailform-complete {
  text-align: center;
  padding: 48px 24px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.mailform-complete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #2f9e5b;
  color: #ffffff;
  font-size: 32px;
  font-weight: 700;
}

.mailform-complete-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
}

.mailform-complete-text {
  margin: 0 0 24px;
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------
   About (なんきょく工房について)
   ------------------------------------------------------------ */

.about-section {
  max-width: 760px;
  margin: 0 auto 48px;
}

.about-block {
  margin-bottom: 32px;
}

.about-block:last-child {
  margin-bottom: 0;
}

.about-lead {
  margin: 0;
  line-height: 1.9;
  color: var(--color-text);
}

.about-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-heading);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.about-define {
  margin: 0;
}

.about-define-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--color-border);
}

.about-define-row:last-child {
  border-bottom: none;
}

.about-define-term {
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.about-define-desc {
  margin: 0;
  color: var(--color-text);
}

.about-define-desc--note {
  color: var(--color-text-muted);
  font-size: 14px;
}

@media (max-width: 560px) {
  .about-define-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
