/* ============================================================
   マッチ学園「チョークボード×採点」デザイン (案A+C / 2026-08-21)
   黒板グリーン #2E5E4E / 深緑 #234A3C / 赤ペン #D9483B
   鉛筆インク #2A2A26 / ノート紙 #F6F1E6 / 採点朱(明朝) はCの遺伝子
   ============================================================ */

/* --- 見出し書体: Zen Kaku Gothic New --- */
h1, h2, h3, h4,
.site_title,
.heading,
.keyvisual__text_area {
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
.site_title__link {
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* --- キービジュアル = 黒板（チョークの枠線と文字） --- */
.keyvisual {
  position: relative;
}
.keyvisual::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px dashed rgba(249, 246, 236, 0.35);
  border-radius: 10px;
  pointer-events: none;
}
.keyvisual__text_area {
  color: #f9f6ec;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.05em;
}

/* --- 記事本文 h2: 赤ペンの短いアンダーバー ＋ 薄い罫線 --- */
.main_content h2.wp-block-heading {
  color: #234a3c;
  font-weight: 900;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(35, 74, 60, 0.18);
  background: linear-gradient(#d9483b, #d9483b) left bottom / 56px 3px no-repeat;
}

/* --- 記事本文 h3: 赤ペンの縦マーカー --- */
.main_content h3.wp-block-heading {
  color: #234a3c;
  padding: 2px 0 2px 12px;
  border-left: 4px solid #d9483b;
  border-radius: 2px;
}

/* --- 引用 = 答案用紙の罫線（案Cの遺伝子） --- */
.main_content blockquote {
  background: repeating-linear-gradient(transparent 0 25px, rgba(38, 53, 94, 0.08) 25px 26px), #fffdf6;
  border: 1px solid #e6ddc8;
  border-left: 4px solid #c13b2a;
  border-radius: 8px;
  padding: 14px 16px;
}

/* --- 黒板ミニパネル見出し（サイドバー/フッター上/ハンバーガー共通） ---
   従来4箇所に同一宣言がコピペされfont-sizeだけ不揃いだった(0.95〜1em)。1本化。 */
.sub_content .widget h3.wp-block-heading,
.sub_content .heading__title,
.l-side_main .widget h3.wp-block-heading,
.c-footer_top .widget h2,
.panel__contents .widget h3.wp-block-heading {
  background: #2e5e4e;
  color: #f9f6ec;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.04em;
  outline: 1.5px dashed rgba(249, 246, 236, 0.45);
  outline-offset: -5px;
}
.l-side_main .widget h3.wp-block-heading { margin-bottom: 6px; }
.c-footer_top .widget h2 { margin: 0 0 10px; }
.panel__contents .widget h3.wp-block-heading { margin: 18px 0 8px; }

/* --- 採点スタンプ / 点数（案Cの遺伝子・記事内で使える汎用クラス） --- */
.mg-stamp {
  display: inline-block;
  border: 2px solid #c13b2a;
  color: #c13b2a;
  border-radius: 6px;
  padding: 1px 9px;
  font-weight: 800;
  font-size: 0.8em;
  letter-spacing: 0.1em;
  transform: rotate(-3deg);
  background: rgba(255, 255, 255, 0.6);
}
.mg-score {
  font-family: "Shippori Mincho", serif;
  color: #c13b2a;
  font-weight: 800;
  font-size: 1.35em;
  letter-spacing: 0.02em;
}

/* --- 冒頭の統合表記: 沈めつつ読める濃さに（実測2.26:1→4.5:1以上・審査指摘） --- */
p.taffi-notice {
  color: #7d776a;
  font-size: 12px;
}

/* --- 商品カードはノート紙の上で白く浮かせる --- */
.taffi-card {
  box-shadow: 0 1px 2px rgba(42, 42, 38, 0.05), 0 10px 24px -12px rgba(42, 42, 38, 0.16);
}

/* --- サイドバー（.l-side_main 配下）: 整列リスト（見出しは上の共通ルール） --- */
.l-side_main .widget ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.88em;
}
.l-side_main .widget li {
  padding: 9px 2px;
  border-bottom: 1px dashed rgba(35, 74, 60, 0.25);
  line-height: 1.55;
}
.l-side_main .widget li:last-child { border-bottom: 0; }
.l-side_main .widget a { text-decoration: none; }
.l-side_main .wp-block-latest-posts__post-date {
  display: block;
  font-size: 0.82em;
  color: #8b8574;
  margin-top: 2px;
}
.l-side_main .wpp-excerpt { display: none; }
.l-side_main .widget { margin-bottom: 22px; }

/* キービジュアルのURL表示は非表示（タイトル＋キャッチフレーズで十分） */
.keyvisual__text_area__inner small { display: none; }

/* ============================================================
   本文タイポグラフィ（読む体験の作り込み）
   ============================================================ */

/* 段落: ゆったりした行間とリズム */
.main_content p {
  line-height: 1.95;
  margin: 1.5em 0;
  letter-spacing: 0.015em;
}
.main_content p.taffi-notice { margin: 0 0 12px; }

/* 本文リンク = 赤ペンの下線 */
.main_content p a,
.main_content li a {
  color: #b23e30;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(217, 72, 59, 0.45);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.main_content p a:hover,
.main_content li a:hover { text-decoration-color: #d9483b; }

/* 強調: 太字 ＋ 蛍光マーカー（==〜==記法） */
.main_content strong { font-weight: 800; }
.main_content mark.mg-marker,
.main_content mark {
  background: linear-gradient(transparent 52%, rgba(247, 227, 107, 0.85) 52%);
  padding: 0 2px;
  color: inherit;
}

/* 箇条書き = 赤ペンのチェックリスト */
.main_content ul.wp-block-list {
  list-style: none;
  margin: 1.6em 0;
  padding: 14px 18px;
  background: #fffdf6;
  border: 1px solid #e6ddc8;
  border-radius: 10px;
}
.main_content ul.wp-block-list > li {
  position: relative;
  padding-left: 1.7em;
  margin: 0.55em 0;
  line-height: 1.8;
}
.main_content ul.wp-block-list > li::before {
  content: "✓";
  position: absolute;
  left: 0.2em;
  color: #d9483b;
  font-weight: 800;
}
.main_content ol { margin: 1.6em 0; }
.main_content ol > li { margin: 0.5em 0; line-height: 1.8; }
.main_content ol > li::marker { color: #234a3c; font-weight: 800; }

/* 区切り線 = チョークの破線 */
.main_content hr {
  border: 0;
  border-top: 2px dashed rgba(35, 74, 60, 0.35);
  margin: 2.4em auto;
  max-width: 240px;
}

/* テーブル = 黒板ヘッダー×ノート紙
   thはテーマの.wp-block-table系が背景を白で上書きし「クリーム文字×白地」で
   読めなくなっていた（運営者情報の会社概要表・実測）→特異度を上げて確定 */
.main_content table { border-collapse: collapse; margin: 1.6em 0; }
.main_content th,
.main_content table th,
.main_content figure.wp-block-table:not(.table) table th {
  /* テーマの .main_content .wp-block-table:not(.table) table :is(td,th) (0,3,2)が
     白背景を当て、しかも子テーマより後に読まれる。figure型を足して(0,3,3)で上回る */
  background: #2e5e4e;
  color: #f9f6ec;
  border: 1px solid #24493c;
  padding: 0.6em 0.9em;
  font-weight: 700;
}
.main_content td {
  border: 1px solid #dcd3bf;
  padding: 0.6em 0.9em;
  background: #fff;
}
.main_content tr:nth-child(even) td { background: #fbf8ef; }

/* 見出し前後の呼吸 */
.main_content h2.wp-block-heading { margin: 2.6em 0 1em; }
.main_content h3.wp-block-heading { margin: 2em 0 0.8em; }

/* 動画・カードの余白 */
.main_content .wp-block-embed { margin: 2em 0; }
.main_content .taffi-card { margin: 1.8em 0 2.4em; }

/* --- フッター上ウィジェット: リスト（見出しは共通ルール） --- */
.c-footer_top .widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9em;
}
.c-footer_top .widget li {
  padding: 8px 2px;
  border-bottom: 1px dashed rgba(35, 74, 60, 0.22);
  line-height: 1.6;
}
.c-footer_top .widget li:last-child { border-bottom: 0; }
.c-footer_top .widget li .children { margin-left: 1em; border-top: 1px dashed rgba(35, 74, 60, 0.22); margin-top: 8px; }
.c-footer_top .widget a { text-decoration: none; }

/* --- 関連記事: 1件もない場合はセクションごと非表示 --- */
.related:not(:has(article)) { display: none; }

/* --- スマホのヒーロー最適化（旧3ブロックを統合・24px/23pxの死に指定を削除） ---
   タイトル26pxはテーマ生成CSS(4rem/nowrap)より後勝ちさせるため!important必須 */
@media (max-width: 767px) {
  .keyvisual__scroll_area { display: none; } /* サブタイトルと衝突 */
  .global_navi { display: none; }            /* ヒーロー上に浮くPCナビ（ハンバーガーで代替） */
  .l-keyvisual_top .heading-is-custom,
  .l-keyvisual_common .heading-is-custom {
    font-size: 26px !important;
    line-height: 1.55 !important;
    white-space: normal !important;
    text-align: center;
    letter-spacing: 0.03em;
  }
  .l-keyvisual_top .phrase-is-custom,
  .l-keyvisual_common .phrase-is-custom {
    font-size: 13px !important;
    white-space: normal !important;
    text-align: center;
  }
  .keyvisual__text_area,
  .keyvisual__text_area__inner {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .keyvisual__text_area__inner { padding: 0 14px; }
}

/* --- 文字サイズの底上げ（テーマ既定: 本文13.5〜15pxは小さすぎるため） --- */
body {
  font-size: clamp(1.5rem, 1.6vw, 1.6rem); /* 15〜16px */
}
.main_content p,
.main_content li {
  font-size: 1.6rem; /* 記事本文は16px固定 */
}
.main_content h2.wp-block-heading {
  font-size: clamp(2.1rem, 2.5vw, 2.5rem); /* 21〜25px */
}
.main_content h3.wp-block-heading {
  font-size: clamp(1.8rem, 2.1vw, 2.1rem); /* 18〜21px */
}


/* --- ヘッダー位置の全ページ統一 ---
   トップのみ .i-header が position:absolute でコンテンツに重なる設計だったため、
   下層と同じ通常フローに戻す。ティッカー+検索帯は廃止（検索はヘッダーのSEARCHへ） */
.type-home .i-header { position: relative; }
.l-info_search { display: none; }

/* --- ヒーロー上端をヘッダーに密着（全ページ） --- */
.l-keyvisual { margin-top: 0 !important; padding-top: 0 !important; }

/* --- ハンバーガーパネル内リスト（見出しは共通ルール） --- */
.panel__contents .widget ul { list-style: none; margin: 0; padding: 0; font-size: 0.92em; }
.panel__contents .widget li { padding: 9px 2px; border-bottom: 1px dashed rgba(35, 74, 60, 0.25); }
.panel__contents .widget li:last-child { border-bottom: 0; }
.panel__contents .widget a { text-decoration: none; }

/* --- お気に入りページ: トップ同様の全幅ヒーロー（文字はバナー内蔵のため非表示） --- */
.page-id-64 .keyvisual {
  min-height: clamp(300px, 36vw, 700px); /* 記事Heroと同じ計算式（文字入り画像のため切らない） */
}
/* バナーに文字が入っているので上下左右とも中央に置く。
   left寄せだと狭い画面で右側（Favoritesの語尾）が切れていた。
   ショートハンドと background-position の二重指定になっていたのを1つにまとめる。 */
.page-id-64 .keyvisual__bg {
  background: url(/wp-content/uploads/2026/08/fav-hero.jpg) center center / cover no-repeat !important;
}
.page-id-64 .keyvisual__contents { display: none; }
/* お気に入りヒーロー: 黒板色・方眼などのオーバーレイを除去してバナーをそのまま見せる */
.page-id-64 .keyvisual,
.page-id-64 .l-keyvisual {
  background: none !important;
}
.page-id-64 .keyvisual__bg::before,
.page-id-64 .keyvisual__bg::after,
.page-id-64 .keyvisual__overlay {
  display: none !important;
}

/* --- 記事一覧ページ(page 253): 全幅ヒーロー（お気に入りと同方式・matchlist.png） --- */
/* 文字はバナーに焼き込み済みのため、テーマ側のタイトル・オーバーレイは出さない。
   ロゴ・文字が画像の上寄り(y82〜621/916)にあるため縦位置は 25%。
   center だと幅1440でロゴ上端が67px切れる（幅390〜1920で収まることを計算確認済み）。 */
.page-id-253 .keyvisual {
  min-height: clamp(300px, 36vw, 700px);
}
.page-id-253 .keyvisual__bg {
  background: url(/wp-content/uploads/2026/08/matchlist-hero.jpg) center 25% / cover no-repeat !important;
}
.page-id-253 .keyvisual__contents { display: none; }
.page-id-253 .keyvisual,
.page-id-253 .l-keyvisual {
  background: none !important;
}
.page-id-253 .keyvisual__bg::before,
.page-id-253 .keyvisual__bg::after,
.page-id-253 .keyvisual__overlay {
  display: none !important;
}

/* --- 記事ページ: 全幅ヒーロー（3種バナーを記事IDでローテーション・お気に入りと同サイズ） --- */
/* バナーに文字が入っているため重ねず、記事タイトルは画像の下に出す */
.type-single .keyvisual {
  min-height: 0;
  overflow: visible;
}
.type-single .keyvisual__bg {
  position: relative; /* 絶対配置をやめて高さを持たせ、タイトルを下に流す */
  /* バナーに文字が焼き込まれているため、高さを幅に追随させて切れを防ぐ。
     画像比は約0.53(高さ/幅)。36vwなら上下の切り取り量が常に一定に収まる。 */
  height: clamp(300px, 36vw, 700px);
}
.type-single.mg-hero-1 .keyvisual__bg { background: url(/wp-content/uploads/2026/08/article-hero-1.jpg) left 40% / cover no-repeat !important; }
.type-single.mg-hero-2 .keyvisual__bg { background: url(/wp-content/uploads/2026/08/article-hero-2.jpg) left 40% / cover no-repeat !important; }
.type-single.mg-hero-3 .keyvisual__bg { background: url(/wp-content/uploads/2026/08/article-hero-3.jpg) left 28% / cover no-repeat !important; }
/* KVコンテンツ（タイトル・日付）は画像の下、ノート紙の上に配置する */
.type-single .keyvisual__contents {
  display: block;
  padding: 22px 0 0;
}
/* ヒーロー〜パンくずの間の余白を締める（テーマのKVテキスト枠 min-height:340px が余白の正体） */
.type-single .l-keyvisual { padding-bottom: 6px; }
.type-single .c-keyvisual {
  min-height: 0;
  height: auto;
  align-items: flex-start;
}
.type-single .keyvisual__text_area,
.type-single .keyvisual__text_area__inner { width: 100%; }
/* text_areaのflex gapで日付の下に20pxの空きが出るためブロック化 */
.type-single .keyvisual__text_area { display: block; }
.type-single .keyvisual__contents { gap: 0; }
.type-single .keyvisual h1.heading {
  color: #234A3C;
  font-size: clamp(21px, 3.2vw, 30px);
  font-weight: 900;
  line-height: 1.55;
  letter-spacing: 0.01em;
  text-align: left;
  text-shadow: none;
}
/* タイトルを先、日付を後に並べ替える（テーマは日付が先） */
.type-single .keyvisual__text_area__inner {
  display: flex;
  flex-direction: column;
}
.type-single .keyvisual h1.heading { order: 1; margin: 0 0 8px; }
.type-single .keyvisual__time {
  order: 2;
  display: flex;
  gap: 16px;
  margin: 0;
  color: #5d6a62; /* 3.98:1→4.5:1以上（審査指摘） */
  font-size: 12px;
  letter-spacing: 0.02em;
}
.type-single .keyvisual__time span { color: inherit; }
/* アイコンだけだと公開/更新が区別できないため文字を添える */
.type-single .keyvisual__time_posted::before { content: "公開 "; font-family: inherit; opacity: 0.85; }
.type-single .keyvisual__time_update::before { content: "更新 "; font-family: inherit; opacity: 0.85; }
/* 記事上部の余白を締める（テーマの本文エリアpadding-top: PC60px/SP40pxが過大） */
.type-single .l-contents { padding-top: 22px; }
.type-single .main_content .sns_list { margin-top: 0; margin-bottom: 4px; }
@media (max-width: 767px) {
  .type-single .main_content .sns_list .sns_list__item { margin-top: 2px; margin-bottom: 2px; }
}
@media (max-width: 767px) {
  .type-single .l-contents { padding-top: 12px; }
}

/* パンくずはJSでヒーロー画像の直下へ移動する。移動先での余白を整える */
.type-single .keyvisual .l-breadcrumb {
  padding: 12px 0 0;
  border-bottom: 1px solid rgba(35, 74, 60, 0.10);
}
.type-single .keyvisual .l-breadcrumb .container { padding-bottom: 10px; }
@media (max-width: 767px) {
  .type-single .keyvisual__contents { padding: 18px 0 2px; }
}
.type-single .keyvisual,
.type-single .l-keyvisual {
  background: none !important;
}
.type-single .keyvisual__bg::before,
.type-single .keyvisual__bg::after,
.type-single .keyvisual__overlay {
  display: none !important;
}
/* 記事ヒーローはバナーそのまま（黒板のチョーク枠線を除去） */
.type-single .keyvisual::after { display: none; }

/* --- お問い合わせフォーム（Contact Form 7）: 黒板×ノート紙のデザインに合わせる --- */
.wpcf7 {
  background: #fff;
  border: 1px solid rgba(35, 74, 60, 0.18);
  border-radius: 12px;
  padding: 26px 26px 22px;
  box-shadow: 0 2px 10px rgba(35, 74, 60, 0.06);
}
.wpcf7 label {
  display: block;
  font-weight: 700;
  font-size: 0.95em;
  color: #234A3C;
  margin-bottom: 18px;
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  border: 1.5px solid rgba(35, 74, 60, 0.28);
  border-radius: 8px;
  background: #FCFAF4;
  font-size: 16px; /* iOSの自動ズーム防止 */
  color: #2A2A26;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wpcf7 textarea { min-height: 190px; line-height: 1.8; resize: vertical; }
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 textarea:focus {
  outline: none;
  border-color: #2E5E4E;
  box-shadow: 0 0 0 3px rgba(46, 94, 78, 0.12);
}
/* クイズ（スパム対策）は1行にまとめる */
.wpcf7 .wpcf7-quiz-label { font-weight: 400; }
.wpcf7 span.wpcf7-form-control-wrap { display: inline-block; width: 100%; }
.wpcf7 label:has(.wpcf7-quiz) { font-weight: 400; font-size: 0.9em; color: #4a5a52; }
.wpcf7 input.wpcf7-quiz { max-width: 220px; }
/* 同意チェック */
.wpcf7 .wpcf7-acceptance { display: block; margin: 4px 0 18px; }
.wpcf7 .wpcf7-acceptance .wpcf7-list-item { margin: 0; }
.wpcf7 .wpcf7-acceptance label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 0.92em; margin: 0; }
.wpcf7 .wpcf7-acceptance input[type="checkbox"] { width: 17px; height: 17px; accent-color: #2E5E4E; }
/* 送信ボタン */
.wpcf7 input[type="submit"] {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 6px auto 0;
  padding: 14px 20px;
  background: #2E5E4E;
  color: #F6F1E6;
  border: 0;
  border-radius: 999px;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-weight: 700;
  font-size: 1.02em;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 3px 0 #234A3C;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.wpcf7 input[type="submit"]:hover { background: #234A3C; }
.wpcf7 input[type="submit"]:active { transform: translateY(2px); box-shadow: 0 1px 0 #234A3C; }
.wpcf7 input[type="submit"]:focus-visible { outline: 3px solid #D9483B; outline-offset: 3px; }
/* 検証メッセージ */
.wpcf7 .wpcf7-not-valid-tip { color: #D9483B; font-size: 0.86em; font-weight: 700; margin-top: 4px; }
.wpcf7 .wpcf7-response-output {
  border-radius: 8px;
  border-width: 1.5px;
  padding: 12px 16px;
  margin: 18px 0 0;
  font-size: 0.94em;
}
.wpcf7 form.sent .wpcf7-response-output { border-color: #2E5E4E; background: rgba(46, 94, 78, 0.06); }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output { border-color: #D9483B; background: rgba(217, 72, 59, 0.05); }
@media (max-width: 767px) {
  .wpcf7 { padding: 18px 16px 16px; }
  .wpcf7 input[type="submit"] { max-width: 100%; }
}

/* --- 規約系リンク行: ページ最下部（JSで移動） --- */
.ap-legal--page-bottom {
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}
.ap-legal--page-bottom a {
  opacity: 0.75;
  transition: opacity 0.15s ease;
}
.ap-legal--page-bottom a:hover { opacity: 1; }

/* --- トップHero: 画像にロゴ・コピーを焼き込んだ版に差し替え（2026-08-22） --- */
/* 画像側に文字があるため、重ねて表示しているテキストは視覚的に隠す。
   （DOMからは消さない＝見出しの意味とスクリーンリーダー向け読み上げは残す） */
.type-home .keyvisual__text_area {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* 記事Heroと同じ考え方: 高さを幅に比例させ、どの画面幅でも文字が切れないようにする */
.type-home .keyvisual {
  min-height: clamp(300px, 36vw, 700px);
}
.type-home .keyvisual__bg {
  background-position: center top !important; /* 画像の上端をヘッダー直下に合わせる */
}

/* 仕上げ済みバナーのため、黒板デザインのチョーク枠とオーバーレイを外す */
.type-home .keyvisual::after { display: none; }
.type-home .keyvisual__overlay,
.type-home .keyvisual__bg::before,
.type-home .keyvisual__bg::after { display: none !important; }
.type-home .keyvisual__img { object-fit: cover; object-position: center top; }

/* --- HOME: 背景の空気感（モックアップ準拠） ---
   平坦なクリーム1色ではなく、上から下へわずかに沈むグラデーションに、
   右上と左下へぼかしたユーカリの枝（透過webp）を低不透明度で置く。
   ::before/::after は position:fixed + z-index:-1 のため、グラデーションは
   html 側に持たせる（bodyに背景があると -1 の装飾が隠れるため）。 */
html:has(body.type-home) {
  /* fixed必須: htmlのグラデーションは画面1枚分の高さで描かれるため、
     ページが長いとビューポートごとにリピートして横一線の縫い目が出る */
  background: linear-gradient(180deg, #fbf9f3 0%, #f7f3e8 45%, #f2eee1 100%) fixed no-repeat;
}
body.type-home {
  background: transparent;
}
body.type-home::before,
body.type-home::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: min(46vw, 640px);
  aspect-ratio: 1 / 1;
  background: url(/wp-content/uploads/2026/08/deco-leaf.webp) center / contain no-repeat;
  pointer-events: none;
}
body.type-home::before {
  top: -4vw;
  right: -6vw;
  transform: scaleX(-1) rotate(8deg);  /* 素材は左寄りの枝なので右上用に反転 */
  opacity: .5;
}
body.type-home::after {
  bottom: -8vw;
  left: -7vw;
  transform: rotate(-6deg);
  opacity: .34;
}
@media (max-width: 768px) {
  body.type-home::before { width: 62vw; opacity: .4; }
  body.type-home::after { display: none; } /* 狭い画面では下の装飾は省く */
}

/* --- サイト全体: コンテナ幅を広げてゆったり使う（全幅デザイン化） --- */
@media (min-width: 1240px) {
  .container {
    max-width: 1320px;
  }
}

/* --- HOME: カテゴリナビはHero直後の全幅枠(header_bottom)に置く --- */
/* テーマはこの枠を3カラム(c-columns-is-3)で組もうとするので1列に戻し、
   背景はページのグラデーションに溶かす（白いパネルは敷かない） */
.l-header_bottom:has(.mg-catnav) {
  background: transparent;
  padding: 34px 0 8px;
}
.c-header_bottom:has(.mg-catnav) {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
}
.c-header_bottom .widget:has(.mg-catnav) {
  width: 100%;
  max-width: 100%;
  background: transparent;
  padding: 0;
}
/* 広い枠に移ったぶんカードを伸びやかに */
.c-header_bottom .mg-catnav__grid {
  gap: 16px;
}
.c-header_bottom .mg-catnav__top {
  padding: 22px 12px 16px;
}

/* --- フッター整理 ---
   法的リンク(.ap-legal)はJSでコピーライト直上へ移動させているため、
   元の枠(l-footer_middle)は空の黒帯として残る→枠ごと畳む。
   ナビ帯とコピーライトの間延びも詰める。 */
.l-footer_middle { display: none; }
.l-footer_navi { padding: 26px 0 22px; }
.l-footer_navi .global_navi__list { margin: 0; }

/* --- カテゴリページ: 専用Heroバナー（お気に入り・記事一覧と同方式） ---
   タイトル・説明はバナーに焼き込み済みのためテーマ側の見出しは出さない。
   文字が画像の上寄りのため縦位置は38%基準（画像は全て1672x941の統一組版）。
   5カテゴリすべて適用済み。 */
body.type-category .keyvisual {
  min-height: clamp(300px, 36vw, 700px);
}
/* 画像はカテゴリごとにCSS変数で1行定義。新カテゴリは変数を1行足すだけ。
   （旧実装は5カテゴリ×10プロパティの列挙が約50行×2箇所あった） */
body.category-desk   { --mg-cat-hero: url(/wp-content/uploads/2026/08/hero-cat-desk.jpg); }
body.category-kaden  { --mg-cat-hero: url(/wp-content/uploads/2026/08/hero-cat-kaden.jpg); }
body.category-gadget { --mg-cat-hero: url(/wp-content/uploads/2026/08/hero-cat-gadget.jpg); }
body.category-audio  { --mg-cat-hero: url(/wp-content/uploads/2026/08/hero-cat-audio.jpg); }
body.category-car    { --mg-cat-hero: url(/wp-content/uploads/2026/08/hero-cat-car.jpg?v=2); }
body.type-category .keyvisual__bg {
  background: var(--mg-cat-hero) center 38% / cover no-repeat !important;
}
body.type-category .keyvisual__contents { display: none; }
body.type-category .keyvisual,
body.type-category .l-keyvisual { background: none !important; }
body.type-category .keyvisual__bg::before,
body.type-category .keyvisual__bg::after,
body.type-category .keyvisual__overlay { display: none !important; }

/* ============================================================
   フッター再設計: クリーム/黒の交互帯を廃し、深緑一枚岩に
   「ブランド → ナビ → 法的リンク → 表記・コピーライト」を積む。
   基調 #1E3A30（本文の緑よりひと段深い=ページの終止符）
   金 #C9A44B はロゴ下の短罫1本だけ（カテゴリカードの金罫と同じDNA）
   ============================================================ */

/* --- 1. ブランドブロック（footer_top枠） --- */
.l-footer_top {
  background: #1e3a30 !important;
  padding: 52px 0 6px;
}
.c-footer_top { display: block !important; max-width: none; }
.l-footer_top .widget {
  width: 100%;
  max-width: 100%;
  background: transparent;
  padding: 0;
  margin: 0;
}
.mg-foot { text-align: center; }
.mg-foot-logo {
  width: min(140px, 40vw);
  height: auto;
  display: inline-block;
  opacity: .95;
}
.mg-foot-rule {
  display: block;
  width: 36px;
  height: 2px;
  margin: 16px auto 13px;
  background: #c9a44b;
}
.mg-foot-tagline {
  margin: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  color: #c8d6cc;
  font-size: .88em;
  letter-spacing: .1em;
}

/* --- 2. ナビ（中央寄せ・静かに） --- */
.l-footer_navi {
  background: #1e3a30 !important;
  padding: 26px 0 30px !important;
}
.global_navi-is-footer .global_navi__list {
  justify-content: center;
  width: fit-content;      /* リスト自体が左に張り付くため中央へ */
  margin-left: auto;
  margin-right: auto;
}
.global_navi-is-footer .global_navi__link { color: #e6e9e2; }

/* --- 3. 法的リンク（ページ最下部・hairlineで区切る） --- */
.ap-legal--page-bottom {
  background: #1e3a30;
  margin: 0;
  /* ページ末尾の余白はこの行が持つ（Amazon表記側は詰める） */
  padding: 14px 16px 34px;
  text-align: center;
  border-top: 1px solid rgba(249, 246, 236, .14);
}
.ap-legal--page-bottom a {
  display: inline-block;
  padding: 8px 6px; /* タップ領域確保（実測10px高だった） */
  color: #b9c9bd;
  text-decoration: none;
  font-size: .82em;
}
.ap-legal--page-bottom a:hover { color: #f4f1e6; }

/* --- 4. コピーライト＋Amazon表記（黒バー廃止・同じ面に沈める） --- */
.l-copyright {
  background: #1e3a30 !important;
  padding: 2px 0 0;
}
.l-copyright .copyright {
  color: #9db3a6;
  font-size: .74em;
  font-weight: 400;
  padding: 4px 0 6px;
}
.l-copyright .copyright a { color: #c8d6cc; }
p.taffi-amazon-disclosure {
  background: #1e3a30;
  margin: 0;
  /* 直後に法的リンク行が来るため下余白は持たせない */
  padding: 2px 16px 14px;
  text-align: center;
  color: #a8bdb2; /* 深緑地で4.5:1以上。remはroot=10pxで7pxに潰れていた */
  font-size: 11px;
  width: 100%;      /* body直下の孤立要素で1100pxに制限され右が欠けていた */
  max-width: none;
}

/* --- 5. ページネーション: フッターとの呼吸を確保し、ピルを絞る --- */
.type-home .pagination { margin-bottom: 72px; }
.pagination .pagination__next_link,
.pagination a[rel="next"] { max-width: 340px; margin-left: auto; margin-right: auto; }

/* --- 6. 右下の重なり: TOPボタンとお気に入りFABを縦に積む --- */
.taffi-fav--link { bottom: 92px !important; }

/* --- 記事ページ: 所属カテゴリのHeroに合わせる（mg-cathero-{slug}） ---
   カテゴリ一覧と同じバナー・同じ縦位置38%。記事タイトルは従来どおり画像の下。
   バナーが無いカテゴリの記事は従来の .mg-hero-N ローテーションが効く。 */
.type-single.mg-cathero-desk .keyvisual__bg   { background: url(/wp-content/uploads/2026/08/hero-cat-desk.jpg) center 38% / cover no-repeat !important; }
.type-single.mg-cathero-kaden .keyvisual__bg  { background: url(/wp-content/uploads/2026/08/hero-cat-kaden.jpg) center 38% / cover no-repeat !important; }
.type-single.mg-cathero-gadget .keyvisual__bg { background: url(/wp-content/uploads/2026/08/hero-cat-gadget.jpg) center 38% / cover no-repeat !important; }
.type-single.mg-cathero-audio .keyvisual__bg  { background: url(/wp-content/uploads/2026/08/hero-cat-audio.jpg) center 38% / cover no-repeat !important; }
.type-single.mg-cathero-car .keyvisual__bg    { background: url(/wp-content/uploads/2026/08/hero-cat-car.jpg?v=2) center 38% / cover no-repeat !important; }



/* ============================================================
   デザイン審査対応（2026-08-26 パックA/B/C1-C2）
   ============================================================ */

/* --- A7: ランキングページ(304)の全幅ヒーロー（お気に入り64と同方式） --- */
.page-id-304 .keyvisual {
  min-height: clamp(300px, 36vw, 700px);
}
.page-id-304 .keyvisual__bg {
  background: url(/wp-content/uploads/2026/08/ranking-hero.jpg) center center / cover no-repeat !important;
}
.page-id-304 .keyvisual__contents { display: none; }
.page-id-304 .keyvisual,
.page-id-304 .l-keyvisual { background: none !important; }
.page-id-304 .keyvisual__bg::before,
.page-id-304 .keyvisual__bg::after,
.page-id-304 .keyvisual__overlay { display: none !important; }

/* --- B1: キーボードフォーカスの可視化（テーマの button{outline:none} を上書き） ---
   赤ペン色のリングで統一。マウス操作では出ない(:focus-visible)。 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #D9483B !important;
  outline-offset: 2px;
  border-radius: 2px;
}
/* スキップリンク（Tab最初の1回で本文へ） */
.mg-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  padding: 10px 16px;
  background: #234A3C;
  color: #F6F1E6;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}
.mg-skip-link:focus {
  left: 0;
}

/* --- B2: PCサイドバー: 最後のウィジェットを追従させ、長い記事の右カラム空白を埋める --- */
@media (min-width: 960px) {
  .l-side_main > :last-child {
    /* テーマの動的CSS(style-custom.php)が子テーマより後に読まれ position を
       上書きするため !important が必要（実測で確認） */
    position: sticky !important;
    top: 96px;
  }
}

/* --- C1: YouTubeサムネの「額装」 ---
   原色サムネがパレットを壊すため、全一覧で減彩＋ブランド枠に収める。
   商品写真(mg-pcard__img等)は白背景の物撮りなので対象外。 */
.eyecatch img,
.mg-ranking__thumb,
.mg-popular__thumb,
.mg-index__thumb img,
.taffi-fav-card__thumb img {
  filter: saturate(0.82);
  border: 1px solid rgba(35, 74, 60, 0.22);
  border-radius: 8px;
}

/* --- C2: 赤の配給制 ---
   赤(#D9483B)は NEW/CTA/お気に入り/価格 に限定し、一覧・本文のテキストリンクは
   深緑＋金の下線へ。「先生の赤ペン=ここが大事」の意味を取り戻す。 */
.l-contents a:not(.taffi-btn):not(.taffi-rtable__link):not(.mg-pcard__mall):not(.taffi-fav):not(.taffi-fav--link):not(.mg-item):not(.pagination__link):not(.wp-element-button) {
  color: #234A3C;
  text-decoration-color: rgba(201, 164, 75, 0.8); /* 金罫#c9a44bを機能させる */
}
.l-contents a:not(.taffi-btn):not(.taffi-rtable__link):not(.mg-pcard__mall):not(.taffi-fav):not(.taffi-fav--link):not(.mg-item):hover {
  color: #1c3b30;
  text-decoration-color: #c9a44b;
}


/* --- テーマの transition: all 0.3s を安全なプロパティに限定 ---
   all指定はlayout/paintを巻き込む。compositor系+色に絞り200ms以内へ。 */
.outline__link,
.sns_list__link,
.global_navi__link,
.eyecatch img,
.pagination a {
  transition-property: transform, opacity, color, background-color, border-color, box-shadow, filter;
  transition-duration: 0.2s;
}

/* --- モーション低減設定の尊重（テーマ側に対応が無いため包括で） --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   C3: シグネチャ「赤ペン採点スタンプ」(2026-08-26・AD提案)
   手書き風の二重丸＝先生が教材を採点した印。サイトの記憶点として
   記事の要点ボックスとランキング1位で同じ意匠を反復する。
   SVGは二重の歪んだ円ストローク（データURI・外部リクエストなし）。
   ============================================================ */
.mg-seal,
.main_content .mg-lead::after,
.mg-pcard__rank--1 {
  --mg-seal-svg: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23d9483b' stroke-linecap='round'%3E%3Cpath d='M50 5.5 C73 4 93.5 23 95 47.5 C96.5 73 76.5 93.5 51 95 C26.5 96.5 6 77 5 51.5 C4 26.5 26 7 50 5.5 Z' stroke-width='3.2' opacity='.92' stroke-dasharray='230 5 40 4'/%3E%3Cpath d='M50 12.5 C69.5 11 87 27.5 88.5 47.5 C90 69 73 87 51.5 88.5 C30 90 13 73.5 11.5 52 C10 31 29 14 50 12.5 Z' stroke-width='1.8' opacity='.7' stroke-dasharray='150 6 60 5'/%3E%3C/g%3E%3C/svg%3E");
}

/* 汎用ユーティリティ（記事本文でも <span class="mg-seal">85点</span> のように使える） */
.mg-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--mg-seal-svg) center / contain no-repeat;
  color: #d9483b;
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-align: center;
  transform: rotate(8deg);
}

/* 記事の「3行でわかる要点」に採点印を捺す（全記事に自動で載る） */
.main_content .mg-lead { position: relative; }
/* スタンプと最終項目の文字が重ならないよう逃げ幅を確保 */
.main_content .mg-lead li:last-child { padding-right: 78px; }
.main_content .mg-lead::after {
  content: "採点済";
  position: absolute;
  /* 右上はヘッダーバー(濃緑+POINTラベル)と重なるため右下の白地へ。
     枠線をまたいで捺したように少しはみ出させる */
  bottom: -16px;
  right: 14px;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mg-seal-svg) center / contain no-repeat;
  color: #d9483b;
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  transform: rotate(9deg);
  opacity: 0.88;
  pointer-events: none;
}
@media (max-width: 767px) {
  .main_content .mg-lead::after {
    width: 58px;
    height: 58px;
    font-size: 12px;
    bottom: -12px;
    right: 8px;
  }
}

/* ランキングの1位: 金ピルをやめ、赤ペンの丸で囲む（2位/3位はメダル色のまま＝
   「先生が選んだ1位」だけが赤ペンという配給ルール） */
.mg-pcard .mg-pcard__rank--1 {
  top: -8px;
  left: 4px;
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mg-seal-svg) center / contain no-repeat;
  border-radius: 0;
  color: #d9483b;
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-size: 13px;
  transform: rotate(-8deg);
}


/* ============================================================
   マッチ先生の吹き出し（サイト案内キャラクター・[sensei]ショートコード）
   ============================================================ */
.mg-sensei {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 1.8em 0;
}
.mg-sensei__icon {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid #2e5e4e;
  background: #fff;
  object-fit: cover;
}
.mg-sensei__bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #fffdf6;
  border: 1px solid #e6ddc8;
  border-radius: 12px;
  padding: 12px 16px 13px;
}
/* 吹き出しの尻尾（アイコン側） */
.mg-sensei__bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 28px;
  width: 14px;
  height: 14px;
  background: #fffdf6;
  border-left: 1px solid #e6ddc8;
  border-bottom: 1px solid #e6ddc8;
  transform: rotate(45deg);
}
.mg-sensei__name {
  display: block;
  font-weight: 800;
  color: #234a3c;
  font-size: 0.82em;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  /* 名前の下に赤ペンの短い下線（h2と同じDNA） */
  background: linear-gradient(#d9483b, #d9483b) left bottom / 44px 2px no-repeat;
  padding-bottom: 4px;
}
/* 見出しは名前を含む一文（例: マッチ先生のひとこと）。emでの分割表記は廃止 */
.mg-sensei__bubble p {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.85;
}
@media (max-width: 767px) {
  .mg-sensei { gap: 10px; }
  .mg-sensei__icon { width: 56px; height: 56px; }
  .mg-sensei__bubble::before { top: 20px; }
}

/* ============================================================
   かっぱキッチン 仮ブランド上書き（2026-08-27 セットアップ時）
   マッチ学園から複製した際、ロゴ・文字焼き込みHeroバナー類は
   ブランド名入りのため持ち込んでいない（上のurl()参照は全て
   存在しないファイル＝透明のまま）。本ブランド素材が完成したら
   このブロックごと差し替える。
   ============================================================ */

/* トップHero: 画像なし運用に戻すため、隠していたHTMLテキストを再表示 */
.type-home .keyvisual__text_area {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0 20px;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}

/* Hero背景はチョークボードのグラデーションで統一（トップ・固定ページ・記事カテゴリ） */
.type-home .keyvisual__bg,
.page-id-64 .keyvisual__bg,
.page-id-253 .keyvisual__bg,
.page-id-304 .keyvisual__bg,
.type-category .keyvisual__bg,
.type-single .keyvisual__bg {
  background: linear-gradient(160deg, #2E5E4E 0%, #1F4235 100%) !important;
}

/* グラデーションのみのHeroに700pxは大きすぎるため控えめに */
.type-home .keyvisual {
  min-height: clamp(220px, 24vw, 380px);
}

/* 背景装飾のユーカリ素材（deco-leaf.webp）は未配置のため無効化 */
body.type-home::before,
body.type-home::after { display: none; }
