/*
Theme Name: kenjiagata
Theme URI: https://example.com/kenjiagata
Author: Kenji Agata
Author URI: https://example.com
Description: Kenji Agataのための独自WordPressテーマ
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kenjiagata
Tags: custom, responsive, blog
*/

:root {
  --container-max: 1280px;
  --container-pad: 15px;
}

html {
  font-size: 62.5%;
  visibility: visible; /* ローダー制御に任せる */
}

body {
  margin: 0;
  padding: 0;
  padding-top: 120px; /* 固定ヘッダーとの距離を縮めてコンテンツを上へ */
  /* ヘッダーの高さに合わせて */
  background-color: rgb(128, 128, 128);
  color: #e6e6e6;
  /* 本文フォントは指定どおりに限定 */
  font-family: fot-tsukuaoldmin-pr6n, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-feature-settings: "palt" 1;
  font-size: 1.6rem;
  letter-spacing: 0.1rem;
}

/* 見出しはデフォルトで太字を解除（本文側で指定された場合のみ太字） */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 400;
}

/* ローディングは最初のペイントから可視（ページ遷移時のFOUT隠蔽） */
#global-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 9999;
  display: flex; /* 常時flex。可視状態はopacityで制御 */
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #333;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* 初期表示は即時（フェードインなし） */
  transition: opacity 240ms ease, visibility 0s linear 0s;
}
/* 非表示時はフェードアウトし、その後にvisibilityを切り替え */
#global-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}

/* ページ遷移用の白フェードオーバーレイ */
#page-transition {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 2000; /* すべてのUIより前面 */
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}
#page-transition.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms ease, visibility 0s linear 0s;
}

/* Loader: SVG dots + label */
#global-loading .loader-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#global-loading .loader-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  color: #333;
  letter-spacing: 0.04em;
  transition: opacity 240ms ease;
}
#global-loading .dots.spin {
  transform-origin: 50% 50%;
  transform-box: fill-box;
  /* 秒針と同程度の速度（1周=60s） */
  animation: loader-rotate 60s linear 1;
}
/* 時計回り */
@keyframes loader-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

a,
a:visited,
a:hover,
a:active {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.entry-content .scaled-image {
  width: min(100%, 46rem);
  height: auto;
  opacity: 0;
  transition: opacity 180ms ease;
}
.entry-content .scaled-image.is-scaled-ready {
  opacity: 1;
}

/* ヘッダー */
.site-header {
  /* ヘッダーの全体高さを縮める */
  height: auto;
  /* 必要に応じて調整 */
  padding: 0;
  position: fixed;
  top: 22px; /* 上部余白を従来比-20%に縮小（28px→22px） */
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #ffffff00;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* ベースコンテナと同じ幅・余白に揃える */
  width: 90%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 15px; /* 垂直パディングを少し増やす */
  min-height: 40px; /* タイトルが小さい場合でも最低高さを確保 */
  /* 60pxから40pxに縮小 */
  position: relative; /* オーバーレイ上でもタイトルを前面に */
  /* Ensure header content sits above nav overlay */
  z-index: 1401;
}

/* ナビゲーションメニュー */
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* メニュー開ボタン */
.menu-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  /* position: absolute; は外して、.header-container 内で整列させる */
  z-index: 1100;
  color: #e6e6e6;
  height: 100%; /* タイトルと高さを揃える */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ハンバーガーの三本線 */
.menu-toggle .burger {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 16px;
}
.menu-toggle .burger span {
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 200ms ease, opacity 200ms ease, top 200ms ease;
  transform-origin: center center;
}
.menu-toggle .burger span:nth-child(1) {
  top: 0;
}
.menu-toggle .burger span:nth-child(2) {
  top: 7px;
}
.menu-toggle .burger span:nth-child(3) {
  top: 14px;
}

/* メニュー開時にXにモーフィング */
.menu-open .menu-toggle .burger span:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}
.menu-open .menu-toggle .burger span:nth-child(2) {
  opacity: 0;
}
.menu-open .menu-toggle .burger span:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

/* ヘッダー内のクローズボタン（新規） */
.menu-close-header {
  background: none;
  border: none;
  font-size: 34px; /* 視覚サイズを34pxに調整 */
  cursor: pointer;
  color: inherit; /* ヘッダーの文字色に追従 */
  display: none; /* 初期は非表示 */
  position: relative; /* 視覚的な縦位置を微調整 */
  top: 2px; /* 2px上げる */
}

/* メニューを閉じるボタン（初期は非表示） */
.menu-close {
  display: none;
  background: none;
  border: none;
  font-size: 3rem;
  cursor: pointer;
  position: fixed; /* ビューポート基準で正確に配置 */
  /* ヘッダー位置に合わせて配置 */
  top: 20px;
  right: calc((100vw - min(1280px, 90vw)) / 2 + 15px);
  z-index: 1300; /* 常に前面でクリック可能に */
  color: #676767;
}

/* メインナビゲーション */
.main-navigation {
  /* フェードアニメーション対応のため display は常時 block */
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #fff; /* 背景は白（最下層は白を維持） */
  z-index: 1300; /* ヘッダーよりも上にして操作性を確保 */
  /* ヘッダー下端より下からリンク領域が始まるよう余白（50%削減） */
  padding-top: 65px; /* 130px→65px */
  /* ベースコンテナ幅（min(var(--container-max), 90vw)）と左右端を揃える */
  padding-left: calc((100vw - min(var(--container-max), 90vw)) / 2);
  padding-right: calc((100vw - min(var(--container-max), 90vw)) / 2);
  box-sizing: border-box; /* パディングを含めて100%に収め、はみ出し防止 */
  /* フェードイン/アウト制御 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms ease;
}

/* メニューが開いた時 */
.menu-open .main-navigation {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* === Floating thumbnails inside menu overlay === */
.main-navigation .nav-floating-thumbs {
  position: absolute;
  /* ヘッダー高さ分は表示しない（余白50%削減に追随） */
  top: 70px;
  /* ベースコンテナ左右に揃え、右側はメニュー幅300px分を避ける */
  left: calc((100vw - min(var(--container-max), 90vw)) / 2);
  right: calc((100vw - min(var(--container-max), 90vw)) / 2 + 300px);
  bottom: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 220ms ease;
  /* クリック可能。重なり時の優先度はz-indexで制御 */
  z-index: 1;
}
.menu-open .main-navigation .nav-floating-thumbs {
  opacity: 1;
}

.nav-floating-thumbs .floating-thumb {
  position: absolute;
  display: block;
  width: var(--w, 160px);
  /* 高さは画像比率に追従 */
  height: auto;
  border-radius: 0; /* 角丸なし */
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translate3d(0, 0, 0);
  pointer-events: auto; /* 画像はクリック可能 */
  will-change: transform, left, top;
  animation: none; /* 視差制御に切り替え */
}
.nav-floating-thumbs .floating-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes floatY {
  from {
    transform: translateY(-10px);
  }
  to {
    transform: translateY(10px);
  }
}
@keyframes swayX {
  from {
    transform: translateX(-8px);
  }
  to {
    transform: translateX(8px);
  }
}

@media (max-width: 680px) {
  /* モバイルは機能自体を無効化（描画しない） */
  .main-navigation .nav-floating-thumbs {
    display: none;
  }
}

/* 閉じるときのフェードアウト専用（可視のまま不透明度だけ下げる） */
.menu-closing .main-navigation {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
}

/* モーフィング化により、開時もトグルボタンは表示のまま */
.menu-open .menu-toggle {
  display: inline-block;
  color: #676767; /* 白背景上で視認性を確保 */
}

.menu-open .menu-close {
  display: block;
}

/* クローズ専用ボタンはモーフィングに統一するため非表示 */
.menu-close-header {
  display: none !important;
}

/* 展開中は背面のスクロールを抑止 */
body.menu-open {
  overflow: hidden;
}

/* メニューリスト */
.nav-menu {
  list-style: none;
  padding: 40px;
  margin: 0;
  text-align: right;
  /* 右側に出すパネル（幅300px）をベースコンテナの右端に揃える */
  width: 300px;
  height: 100%;
  margin-left: auto;
  background: transparent; /* 背景を透明に */
  color: #676767;
  /* パネル自体も僅かにフェード */
  opacity: 0;
  transition: opacity 220ms ease;
  position: relative; /* サムネより前面に */
  z-index: 2;
}

/* モバイル時は左余白をやや詰める */
@media (max-width: 680px) {
  .main-navigation .nav-menu {
    padding: 24px 20px 24px 16px;
  }
}

/* クローズボタンはベースコンテナ右端基準に揃える */
.menu-close {
  right: calc((100vw - min(1280px, 90vw)) / 2 + 15px);
  /* 安全のため上書き */
  z-index: 1300;
}

/* ナビ内の従来クローズボタンは使わない（誤クリック防止） */
#primary-menu .menu-close {
  display: none !important;
}

/* メニュー展開時はヘッダーとフッターを最前面にし、文字色を反転（白背景上で#676767） */
/* メニュー展開時もヘッダーは前面にして、背景透過で下のサムネが見えるように */
.menu-open .site-header {
  z-index: 1500;
}
.menu-open .site-footer {
  z-index: 1500; /* メニューオーバーレイより前面に */
}
/* ヘッダーのクリックを無効化し、背面のメニュー項目をクリック可能にする */
.menu-open .site-header {
  pointer-events: none;
}
.menu-open .site-header .menu-toggle {
  pointer-events: auto;
}
.menu-open .site-header .site-branding,
.menu-open .site-header .site-branding a {
  pointer-events: auto;
}
.menu-open .nav-menu {
  opacity: 1;
}

/* 閉じるときもパネルをフェードアウト */
.menu-closing .nav-menu {
  opacity: 0;
}
.menu-open .site-header,
.menu-open .site-header a,
.menu-open .site-header h1,
.menu-open .site-footer,
.menu-open .site-footer .site-info,
.menu-open .site-footer p {
  color: #676767;
}

/* メニューリスト項目 */
.nav-menu li {
  padding: 0;
}

/* 固定ページリンクのみ上下余白をさらに増やす（確実に効かせる） */
.main-navigation .nav-menu li.menu-item-object-page > a {
  display: block; /* クリック範囲をブロック化 */
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
}
/* アイテム間の見た目の間隔も確保（アンカーのパディングに加えて） */
.main-navigation .nav-menu li.menu-item-object-page {
  margin: 0.4rem 0;
}

.site-footer {
  position: fixed;
  top: 95%;
  left: 0;
  width: 100%;
  z-index: 1000;
  /* 必要に応じて調整 */
  background-color: #67676700;
  /* ヘッダーの背景色 */

  font-size: 1.2rem;
}

/* フッター内側をベースコンテナ幅に合わせる */
.site-footer .site-info {
  width: 90%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 15px;
  text-align: left;
}

/* コンテナ設定：サイト全体を90%の幅に */
.container {
  width: 90%;
  max-width: 1280px;
  /* 必要なら最大幅を調整 */
  margin: 0 auto;
  padding: 0 15px;
  padding-bottom: 4rem;
}

/* レスポンシブ対応（例：幅768px以下の場合） */
@media screen and (max-width: 768px) {
  body {
    padding-top: 96px; /* さらに縮小してコンテンツを上へ */
  }

  .container {
    width: 80%;
  }

  .header-container {
    /* すでに flex で横並び＆縦中央揃え */
    position: relative;
    width: 80%;
    margin: 0 auto;
    padding: 8px 15px; /* デスクトップと同様に上下余白を持たせる */
    min-height: 44px; /* タイトルとボタンの高さ合わせ */
  }

  .menu-toggle {
    /* 絶対配置をやめ、flexで右端＆縦中央に揃える */
    position: static;
    right: auto;
    top: auto;
    transform: none;
  }

  /* モバイル時、closeをopenと同じ基準で右端に固定 */
  .menu-close-header {
    position: absolute;
    right: 10px;
    top: 13px; /* 視覚中心を合わせるため少し上げる */
    transform: none;
  }

  .menu-close {
    top: 15px;
    /* 例：15px に調整 */
    right: 12px;
    /* 例：10px に調整 */
  }

  .site-footer {
    top: 94%; /* モバイル時は少し上に配置して余白を確保 */
    left: 0;
  }

  .site-footer .site-info {
    width: 80%;
  }
}

/* 必要に応じて追加スタイルを記述 */

/* === Price & Contact cards === */
#price-contact {
  --accent: #e6e6e6;
  --border: #e6e6e6;
  --bg: transparent;
  --muted: #e6e6e6;
  --ring: rgba(0, 0, 0, 0.05);
  font-size: 16px;
  line-height: 1.75;
  color: #e6e6e6;
}
#price-contact h2 {
  margin: 1.6rem 0 0.8rem;
  font-size: clamp(2rem, 1.4rem + 1vw, 2.6rem);
  color: #e6e6e6;
  letter-spacing: 0.02em;
}
#price-contact p.lead {
  margin: 0.4rem 0 0.8rem;
  color: #e6e6e6;
  font-size: 1.5rem;
}
#price-contact .grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin: 6px 0 12px;
}
@media (min-width: 640px) {
  #price-contact .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 960px) {
  #price-contact .grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 12px;
    column-gap: 24px;
  }
}
#price-contact .grid {
  justify-items: center;
  align-items: start;
}
#price-contact .card {
  width: 100%;
  max-width: 560px;
}
#price-contact .card {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 6px;
  color: #e6e6e6;
}
#price-contact .card-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}
#price-contact .card-body {
  flex: 1 1 auto;
  min-width: 0;
}
#price-contact .card-media {
  flex: 0 0 auto;
  width: 100%;
  max-width: 500px;
  align-self: flex-start;
  margin: 0 0 0 0 !important;
  text-align: left;
  padding-top: 0 !important;
}
#price-contact .card-media img {
  width: 100%;
  height: auto;
  opacity: 1;
  transition: none;
  display: block;
  margin: 0;
  object-fit: contain;
  border: none;
  border-radius: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
#price-contact .card-media a {
  display: block;
}
#price-contact .card-media {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
/* remove trailing margin from text block so gap controls spacing precisely */
#price-contact .card-body > *:last-child {
  margin-bottom: 0 !important;
}
/* hard reset any default margins inside media */
#price-contact figure,
#price-contact .wp-block-image,
#price-contact .card-media,
#price-contact .card-media *,
#price-contact img,
#price-contact .wp-post-image,
#price-contact .scaled-image {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
/* normalize text block vertical rhythm inside card */
#price-contact .card-body h3,
#price-contact .card-body p,
#price-contact .card-body ul,
#price-contact .card-body .price {
  margin-top: 0 !important;
  margin-bottom: 4px !important;
}
@media (max-width: 960px) {
  #price-contact .card-media {
    max-width: 100%;
  }
}
#price-contact .eyebrow {
  display: inline-block;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: #e6e6e6;
  margin-bottom: 0.35rem;
  opacity: 0.9;
}
#price-contact .card h3 {
  margin: 0.1rem 0 0.3rem;
  font-size: clamp(1.6rem, 1.2rem + 0.8vw, 2rem);
  color: #e6e6e6;
}
#price-contact .price {
  font-weight: 400;
  color: #e6e6e6;
  margin: 0.1rem 0 0.2rem;
}
#price-contact .price .sub {
  font-weight: 400;
  color: #e6e6e6;
  font-size: 0.95rem;
}
#price-contact ul.features {
  list-style: none;
  margin: 0.1rem 0 0;
  padding: 0;
}
#price-contact ul.features li {
  position: relative;
  padding-left: 1.2rem;
  margin: 0.15rem 0;
  color: #e6e6e6;
}
#price-contact ul.features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #e6e6e6;
  font-weight: 400;
}
#price-contact .note {
  font-size: 1.5rem;
  color: #e6e6e6;
  margin: 0.6rem 0 1rem;
  line-height: 1.7;
}
#price-contact,
#price-contact .card-body,
#price-contact .note,
#price-contact .cta,
#price-contact .price,
#price-contact ul.features li {
  font-kerning: normal;
  font-feature-settings: "kern" 1, "palt" 1;
  letter-spacing: 0.18rem;
}
#price-contact .badge {
  display: none;
}
#price-contact .options h4 {
  margin: 1.2rem 0 0.4rem;
  font-size: 1rem;
}
#price-contact .cta {
  background: transparent;
  color: #e6e6e6;
  border: none;
  padding: 0;
  border-radius: 0;
  margin: 12px 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
}
#price-contact .cta strong {
  color: #e6e6e6;
}

/* Contact Form 7 styling in Price & Contact */
#price-contact .wpcf7 form {
  margin-top: 12px;
  margin-bottom: 48px; /* フォーム下の余白を拡張 */
}
#price-contact .wpcf7 label {
  color: #e6e6e6;
  display: block;
  margin: 0.5rem 0 0.25rem;
}
#price-contact .wpcf7 input[type="text"],
#price-contact .wpcf7 input[type="email"],
#price-contact .wpcf7 input[type="url"],
#price-contact .wpcf7 input[type="tel"],
#price-contact .wpcf7 input[type="number"],
#price-contact .wpcf7 input[type="date"],
#price-contact .wpcf7 textarea,
#price-contact .wpcf7 select {
  width: 100%;
  box-sizing: border-box;
  background: transparent; /* 要件: 透明 */
  color: #e6e6e6; /* ダーク背景上の可読性 */
  border: 1px solid #e6e6e6; /* 要件: 枠色 */
  border-radius: 0; /* 角丸禁止 */
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#price-contact .wpcf7 textarea {
  min-height: 120px;
  resize: vertical;
}
#price-contact .wpcf7 input::placeholder,
#price-contact .wpcf7 textarea::placeholder {
  color: #bdbdbd;
}
#price-contact .wpcf7 input:focus,
#price-contact .wpcf7 textarea:focus,
#price-contact .wpcf7 select:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(230, 230, 230, 0.15);
}

/* Submit button tonality */
#price-contact .wpcf7 input[type="submit"] {
  appearance: none;
  background: transparent; /* 要件: 透明 */
  color: #e6e6e6;
  border: 1px solid #e6e6e6;
  border-radius: 0; /* 角丸禁止 */
  padding: 12px 18px;
  font-weight: 400;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: none;
  transition: border-color 0.2s ease, transform 0.05s ease;
}
#price-contact .wpcf7 input[type="submit"]:hover { border-color: #ffffff; }
#price-contact .wpcf7 input[type="submit"]:active {
  transform: translateY(1px);
}
#price-contact .wpcf7 input[type="submit"][disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
#price-contact .wpcf7 .wpcf7-spinner {
  margin-left: 0.5rem;
}

/* Validation messages */
#price-contact .wpcf7-not-valid-tip {
  color: #ff6b6b;
  font-size: 0.9em;
  margin-top: 0.25rem;
}
#price-contact .wpcf7 form .wpcf7-response-output {
  border-color: #e6e6e6;
}

/* ------------------------------
   記事タイトルとメタの調整（200%拡大＋はみ出し対策）
   - clampでビューポートに応じて可変
   - 長文タイトルは折り返してはみ出し防止
   - 日付はタイトル直下に近接配置
--------------------------------- */
.entry-header .entry-title,
.page-header .page-title {
  /* 記事タイトルを標準より120%（2.4em）に拡大 */
  font-size: 2.4em;
  line-height: 1.12;
  margin: 0 0 0.2em;
  overflow-wrap: anywhere; /* はみ出し防止（長い英単語やURL対策） */
  word-break: break-word;
}

.entry-header .entry-meta,
.page-header .entry-meta {
  margin-top: 0.2em; /* タイトルとの距離を近づける */
}

/* モバイルではやや控えめに（はみ出し・改行回数の抑制） */
@media (max-width: 480px) {
  .entry-header .entry-title,
  .page-header .page-title {
    font-size: revert; /* モバイルも拡大を解除 */
  }
}

/* 画像と同様の面積基準で揃える動画埋め込み用ラッパー */
.scaled-embed {
  display: block;
  position: relative;
  overflow: hidden;
}
.scaled-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 記事本文のカーニングを拡げ、メトリクスカーニングを有効化 */
.entry-content p,
.entry-content li,
.entry-content dd,
.entry-content blockquote,
.entry-content figcaption {
  font-kerning: normal; /* metrics kerning */
  font-feature-settings: "kern" 1, "palt" 1;
  letter-spacing: 0.18rem; /* さらに広めに拡張 */
}

/* 記事下部のタグとフッターの距離を少し確保 */
.post-tags {
  margin-bottom: 3rem;
}

/* ---- Video thumbnail embed ---- */
/* （一時停止）動画サムネイル埋め込みのスタイルは撤去 */
/* サイトタイトルの余白調整（ボタンと高さ合わせのため） */
.site-branding h1,
.site-branding h1 a {
  margin: 0;
  /* 現状(約3.2rem)の約65% ≒ 2.08rem → 親基準1.3em */
  font-size: 1.5em !important;
  font-weight: 400; /* 通常太さ */
  font-family: cochin-lt-pro, sans-serif;
  font-kerning: normal;
  font-feature-settings: "kern" 1;
  letter-spacing: 0.02em;
}

/* ===== 修正パッチ ===== */

/* 1) html の visibility 問題 */
html {
  font-size: 62.5%;
  visibility: visible; /* hidden を削除・上書き */
}

/* 2) 以前の拡大フォールバックは撤去（100%に統一） */

/* 3) メニューオープン時のX色を明示 */
.menu-open .menu-toggle {
  color: #676767;
}

/* 4) z-index調整で常に前面 */
.site-header {
  z-index: 1400;
}
.menu-close {
  z-index: 1410;
}
.main-navigation {
  z-index: 1300;
}

/* 5) ヘッダー文字色を強制 */
.menu-open .site-header,
.menu-open .site-header a,
.menu-open .site-header h1 {
  color: #676767 !important;
}

/* Cookie consent */
.cookie-consent {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1450;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 18px;
  background: rgba(42, 42, 42, 0.94);
  color: #e6e6e6;
  border: 1px solid rgba(230, 230, 230, 0.22);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease;
}
.cookie-consent.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cookie-consent.is-hiding {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
.cookie-consent__copy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
}
.cookie-consent__copy p {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.7;
  letter-spacing: 0.06rem;
}
.cookie-consent__copy a {
  color: #ffffff;
  font-size: 1.2rem;
  text-decoration: underline;
  text-underline-offset: 0.24em;
}
.cookie-consent__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.cookie-consent__button {
  appearance: none;
  border: 1px solid #e6e6e6;
  background: #e6e6e6;
  color: #2a2a2a;
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  white-space: nowrap;
  padding: 10px 14px;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 60ms ease;
}
.cookie-consent__button:hover,
.cookie-consent__button:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
}
.cookie-consent__button:active {
  transform: translateY(1px);
}
.cookie-consent__button--secondary {
  background: transparent;
  color: #e6e6e6;
}
.cookie-consent__button--secondary:hover,
.cookie-consent__button--secondary:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Single post image lightbox */
.kg-lightbox-trigger {
  cursor: zoom-in;
}
body.kg-lightbox-open {
  overflow: hidden;
}
.kg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  justify-items: center;
  background: rgba(12, 12, 12, 0.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
  touch-action: pan-y pinch-zoom;
}
.kg-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 260ms ease, visibility 0s linear 0s;
}
.kg-lightbox__figure {
  grid-column: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.kg-lightbox__image {
  display: block;
  max-width: min(86vw, 1320px);
  max-height: 82dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.985);
  transition: opacity 220ms ease, transform 260ms ease;
  will-change: opacity, transform;
  user-select: none;
  -webkit-user-drag: none;
}
.kg-lightbox__image.is-from-left {
  transform: translate3d(-28px, 0, 0) scale(0.985);
}
.kg-lightbox__image.is-from-right {
  transform: translate3d(28px, 0, 0) scale(0.985);
}
.kg-lightbox__image.is-exit-left {
  opacity: 0;
  transform: translate3d(-28px, 0, 0) scale(0.985);
}
.kg-lightbox__image.is-exit-right {
  opacity: 0;
  transform: translate3d(28px, 0, 0) scale(0.985);
}
.kg-lightbox__image.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
.kg-lightbox__image.is-dragging,
.kg-lightbox__image.is-pinching {
  transition: none;
}
.kg-lightbox__image.is-positioning {
  transition: none;
}
.kg-lightbox__image.is-zoomed {
  cursor: zoom-out;
}
.kg-lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 0.08em;
}
.kg-lightbox__close,
.kg-lightbox__nav {
  appearance: none;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.kg-lightbox__close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
}
.kg-lightbox__close::before,
.kg-lightbox__close::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 1px;
  background: currentColor;
}
.kg-lightbox__close::before {
  transform: rotate(45deg);
}
.kg-lightbox__close::after {
  transform: rotate(-45deg);
}
.kg-lightbox__nav {
  width: 72px;
  height: 100%;
  opacity: 0.82;
  transition: opacity 160ms ease, transform 160ms ease;
}
.kg-lightbox__nav:hover,
.kg-lightbox__nav:focus-visible,
.kg-lightbox__close:hover,
.kg-lightbox__close:focus-visible {
  opacity: 1;
}
.kg-lightbox__nav:active {
  transform: translateY(1px);
}
.kg-lightbox__nav--prev {
  grid-column: 1;
}
.kg-lightbox__nav--next {
  grid-column: 3;
}
.kg-lightbox__nav::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
}
.kg-lightbox__nav--prev::before {
  border-right: 22px solid currentColor;
}
.kg-lightbox__nav--next::before {
  border-left: 22px solid currentColor;
}

/* ===== /修正パッチ ===== */

/* モバイル時のナビ上端（デスクトップの50%ルールに合わせる） */
@media (max-width: 768px) {
  .main-navigation {
    padding-top: 56px;
  } /* 112px→56px */
  .cookie-consent {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }
  .cookie-consent__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .cookie-consent__button {
    width: 100%;
  }
  .kg-lightbox {
    grid-template-columns: 1fr;
  }
  .kg-lightbox__figure {
    grid-column: 1;
    padding: 0 12px;
    box-sizing: border-box;
  }
  .kg-lightbox__image {
    max-width: 92%;
    max-height: 78dvh;
  }
  .kg-lightbox__nav {
    display: none;
  }
  .kg-lightbox__close {
    width: 48px;
    height: 48px;
  }
}
