/*
Theme Name: 探検隊の衣装部屋
Theme URI: https://osusume-terevi.com/
Author: 探検隊の衣装部屋
Description: ドラマ・映画の着用アイテムを「探す・見つける・手に入れる」ための物販アフィリエイト特化オリジナルテーマ。冒険・宝探しのビジュアルコンセプトと、モバイルファースト／Core Web Vitals 最優先の軽量設計。
Version: 0.2.7
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: expedition-wardrobe
Tags: blog, affiliate, custom-menu, featured-images, translation-ready, accessibility-ready
*/

/* =========================================================
   目次
   00. Design Tokens   01. Reset / Base      02. Typography
   03. Layout          04. Header / Nav      05. Breadcrumbs
   06. Cards           07. Entry             08. 物販コンポーネント
   09. Pagination      10. Footer            11. Utilities / A11y
   12. Hero / 記事下   13. Top / Archive     14. ショートコード追加分
   ========================================================= */

/* =========================================================
   00. Design Tokens
   ========================================================= */
:root {
  /* Brand : 暖かいオレンジ + イエロー、アクセントにブルー */
  --ew-orange: #f07c1f;
  --ew-orange-100: #fff1e2;
  --ew-orange-200: #ffd9b5;
  /* CTA は白文字で AA(4.8:1) を満たす濃度に落とした橙 */
  --ew-orange-700: #c2410c;
  --ew-orange-800: #9a3412;
  --ew-yellow: #ffc233;
  --ew-yellow-100: #fff6da;
  --ew-blue: #1f6feb;
  --ew-blue-700: #0b4fb8;
  --ew-blue-100: #e8f1ff;

  /* Ink & Surface */
  --ew-ink: #1e2430;
  --ew-ink-70: #4d5665;
  --ew-ink-50: #6b7482;
  --ew-bg: #fffdf8;
  --ew-surface: #ffffff;
  --ew-line: #e9e4da;
  --ew-line-strong: #d8d1c4;

  /* Semantic */
  --ew-cta: var(--ew-orange-700);
  --ew-cta-hover: var(--ew-orange-800);
  --ew-link: var(--ew-blue);
  --ew-focus: #0b4fb8;

  /* Space (4px base) */
  --ew-s1: .25rem; --ew-s2: .5rem;  --ew-s3: .75rem; --ew-s4: 1rem;
  --ew-s5: 1.5rem; --ew-s6: 2rem;   --ew-s7: 3rem;   --ew-s8: 4rem;

  /* Radius / Shadow */
  --ew-r-sm: 6px; --ew-r: 12px; --ew-r-lg: 20px; --ew-r-pill: 999px;
  --ew-shadow: 0 1px 2px rgba(30,36,48,.06), 0 8px 24px rgba(30,36,48,.07);
  --ew-shadow-hover: 0 2px 4px rgba(30,36,48,.08), 0 14px 32px rgba(30,36,48,.13);

  /* Layout */
  --ew-wrap: 1120px;
  --ew-wrap-narrow: 736px;
  --ew-gutter: var(--ew-s4);

  /* Type : Webフォント不使用（CWV優先・端末標準の和文を使う） */
  --ew-font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
             "Noto Sans JP", "Yu Gothic Medium", "Yu Gothic", "Segoe UI", Meiryo, sans-serif;
  --ew-tap: 44px;
  /* 話数ジャンプの着地位置。JS が追従ヘッダーの実高さで上書きする */
  --ew-anchor-offset: 68px;
}

/* =========================================================
   01. Reset / Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ew-bg);
  color: var(--ew-ink);
  font-family: var(--ew-font);
  font-size: 1rem;
  line-height: 1.9;
  font-feature-settings: "palt" 1;
  overflow-wrap: anywhere;
  line-break: strict;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
img { background: var(--ew-orange-100); }
a { color: var(--ew-link); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--ew-blue-700); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ew-focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--ew-yellow); color: var(--ew-ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   02. Typography
   ========================================================= */
h1, h2, h3, h4 { line-height: 1.45; font-weight: 700; letter-spacing: .01em; margin: 0 0 var(--ew-s3); }
h1 { font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.125rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.6rem); }
h3 { font-size: clamp(1.12rem, 1.02rem + .5vw, 1.3rem); }
p  { margin: 0 0 var(--ew-s5); }
small, .ew-small { font-size: .8125rem; color: var(--ew-ink-70); line-height: 1.7; }

.ew-section-title { display: flex; align-items: center; gap: var(--ew-s3); margin: 0 0 var(--ew-s5); }
.ew-section-title .ew-icon { color: var(--ew-orange); flex: none; }
.ew-section-title__sub { display: block; font-size: .75rem; font-weight: 600; color: var(--ew-ink-50); letter-spacing: .08em; }

/* =========================================================
   03. Layout
   ========================================================= */
.ew-container { width: 100%; max-width: var(--ew-wrap); margin-inline: auto; padding-inline: var(--ew-gutter); }
.ew-container--narrow { max-width: var(--ew-wrap-narrow); }
.ew-main { display: block; padding-block: var(--ew-s5) var(--ew-s7); min-height: 50vh; }
/* スキップリンクの着地点。プログラム的なフォーカスなので枠は出さない（Tab で次に進めば通常のフォーカス表示に戻る） */
.ew-main:focus, .ew-main:focus-visible { outline: none; }
.ew-section { margin-block: var(--ew-s7); }
@media (min-width: 768px) { :root { --ew-gutter: var(--ew-s5); } }
/* ナビが2行に折り返す幅でも隠れないよう、JS 無効時は広めに取る */
@media (min-width: 900px) { :root { --ew-anchor-offset: 150px; } }

/* =========================================================
   04. Header / Navigation / Search
   ========================================================= */
.ew-header { position: sticky; top: 0; z-index: 50; background: var(--ew-surface); border-bottom: 1px solid var(--ew-line); }
.ew-header.is-scrolled { box-shadow: 0 2px 12px rgba(30,36,48,.08); }
.ew-header__bar { display: flex; align-items: center; gap: var(--ew-s3); min-height: 56px; }

.ew-brand { display: flex; align-items: center; margin-right: auto; min-width: 0; }
.ew-brand__link { display: inline-flex; align-items: center; gap: var(--ew-s2); text-decoration: none; color: var(--ew-ink); }
.ew-brand__link:hover { color: var(--ew-ink); }
.ew-brand .custom-logo-link { display: inline-flex; }
.ew-brand .custom-logo { max-height: 44px; width: auto; }
.ew-brand__mark {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: var(--ew-r-pill);
  background: linear-gradient(140deg, var(--ew-yellow), var(--ew-orange)); color: #fff;
}
.ew-brand__name { font-weight: 700; font-size: 1.0625rem; letter-spacing: .02em; line-height: 1.3; }
.ew-brand__tagline { display: none; font-size: .6875rem; color: var(--ew-ink-50); font-weight: 600; }
@media (min-width: 768px) { .ew-brand__tagline { display: block; } }

.ew-iconbtn {
  display: grid; place-items: center; width: var(--ew-tap); height: var(--ew-tap);
  border: 1px solid var(--ew-line); border-radius: var(--ew-r-sm);
  background: var(--ew-surface); color: var(--ew-ink-70); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.ew-iconbtn:hover { background: var(--ew-orange-100); color: var(--ew-orange-700); border-color: var(--ew-orange-200); }
.ew-iconbtn[aria-expanded="true"] { background: var(--ew-orange-700); border-color: var(--ew-orange-700); color: #fff; }
.ew-iconbtn .ew-icon--close { display: none; }
.ew-iconbtn[aria-expanded="true"] .ew-icon--close { display: block; }
.ew-iconbtn[aria-expanded="true"] .ew-icon--open { display: none; }

.ew-nav { display: none; border-top: 1px solid var(--ew-line); }
.ew-nav.is-open { display: block; }
.ew-nav__list { list-style: none; margin: 0; padding: var(--ew-s2) 0 var(--ew-s4); }
.ew-nav__list a {
  display: flex; align-items: center; gap: var(--ew-s3);
  min-height: var(--ew-tap); padding: var(--ew-s2) var(--ew-gutter);
  color: var(--ew-ink); text-decoration: none; font-weight: 600; font-size: .9375rem;
}
.ew-nav__list a:hover, .ew-nav__list .current-menu-item > a { background: var(--ew-orange-100); color: var(--ew-orange-800); }
.ew-nav__list .ew-icon { color: var(--ew-orange); flex: none; }
.ew-nav__list .sub-menu { list-style: none; margin: 0; padding: 0 0 0 var(--ew-s5); }

@media (min-width: 900px) {
  .ew-nav { display: block !important; border-top: 0; }
  .ew-nav__list {
    display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ew-s1);
    padding: 0 var(--ew-gutter) var(--ew-s2); max-width: var(--ew-wrap); margin-inline: auto;
  }
  .ew-nav__list > li > a { min-height: 38px; padding: var(--ew-s1) var(--ew-s3); border-radius: var(--ew-r-pill); font-size: .875rem; gap: var(--ew-s2); }
  .ew-nav__toggle { display: none; }
}

.ew-search { border-top: 1px solid var(--ew-line); background: var(--ew-yellow-100); }
.ew-search__form { display: flex; gap: var(--ew-s2); align-items: center; max-width: var(--ew-wrap); margin-inline: auto; padding: var(--ew-s3) var(--ew-gutter); }
.ew-search__field {
  flex: 1; min-width: 0; height: var(--ew-tap); padding: 0 var(--ew-s3);
  font-size: 1rem; /* 16px : iOS の自動ズーム防止 */
  border: 1px solid var(--ew-line-strong); border-radius: var(--ew-r-sm);
  background: var(--ew-surface); color: var(--ew-ink);
}
.ew-search__submit {
  display: inline-flex; align-items: center; gap: var(--ew-s2); height: var(--ew-tap); padding-inline: var(--ew-s4);
  border: 0; border-radius: var(--ew-r-sm); cursor: pointer; background: var(--ew-blue); color: #fff; font-weight: 700;
}
.ew-search__submit:hover { background: var(--ew-blue-700); }

/* =========================================================
   05. Breadcrumbs
   ========================================================= */
.ew-breadcrumbs { padding-block: var(--ew-s3); font-size: .8125rem; color: var(--ew-ink-70); }
.ew-breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--ew-s1); margin: 0; padding: 0; }
.ew-breadcrumbs li { display: flex; align-items: center; gap: var(--ew-s1); }
.ew-breadcrumbs li + li::before { content: "\203A"; color: var(--ew-line-strong); margin-right: var(--ew-s1); }
.ew-breadcrumbs a { color: var(--ew-ink-70); text-decoration: none; }
.ew-breadcrumbs a:hover { color: var(--ew-orange-800); text-decoration: underline; }
.ew-breadcrumbs [aria-current="page"] { color: var(--ew-ink); font-weight: 600; }

/* =========================================================
   06. Cards（記事カード・カテゴリーマップ）
   ========================================================= */
.ew-page-head { margin-bottom: var(--ew-s6); }
.ew-page-head__title { margin-bottom: var(--ew-s2); }
.ew-page-head__desc { color: var(--ew-ink-70); font-size: .9375rem; margin: 0; }

.ew-grid { display: grid; gap: var(--ew-s5); grid-template-columns: 1fr; }
@media (min-width: 600px) { .ew-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .ew-grid { grid-template-columns: repeat(3, 1fr); } }

.ew-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--ew-surface); border: 1px solid var(--ew-line);
  border-radius: var(--ew-r); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ew-card:hover { transform: translateY(-3px); box-shadow: var(--ew-shadow-hover); border-color: var(--ew-orange-200); }
.ew-card__thumb { position: relative; aspect-ratio: 16 / 9; background: var(--ew-orange-100); }
.ew-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ew-card__thumb--empty { display: grid; place-items: center; color: var(--ew-orange-200); }
.ew-card__thumb--empty .ew-icon { width: 44px; height: 44px; }
.ew-card__body { display: flex; flex-direction: column; gap: var(--ew-s2); padding: var(--ew-s4); flex: 1; }
.ew-card__title { font-size: 1rem; line-height: 1.6; margin: 0; }
.ew-card__title a { color: var(--ew-ink); text-decoration: none; }
/* カード全面をタップ領域にする */
.ew-card__title a::after { content: ""; position: absolute; inset: 0; }
.ew-card:hover .ew-card__title a { color: var(--ew-orange-800); }
.ew-card__meta { margin-top: auto; display: flex; align-items: center; gap: var(--ew-s2); font-size: .75rem; color: var(--ew-ink-50); }
.ew-card__excerpt { font-size: .8125rem; color: var(--ew-ink-70); line-height: 1.8; margin: 0; }

.ew-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: var(--ew-r-pill); font-size: .6875rem; font-weight: 700; letter-spacing: .02em;
  background: var(--ew-orange-100); color: var(--ew-orange-800); text-decoration: none;
}
.ew-badge--blue { background: var(--ew-blue-100); color: var(--ew-blue-700); }
.ew-badge--onthumb { position: absolute; left: var(--ew-s3); bottom: var(--ew-s3); z-index: 1; background: rgba(255,255,255,.94); color: var(--ew-orange-800); box-shadow: var(--ew-shadow); }

/* カテゴリーマップ（8つの大きな箱） */
.ew-map { display: grid; gap: var(--ew-s3); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .ew-map { grid-template-columns: repeat(4, 1fr); gap: var(--ew-s4); } }
.ew-map__item {
  display: flex; flex-direction: column; min-height: 104px; overflow: hidden;
  background: var(--ew-surface); border: 1px solid var(--ew-line); border-radius: var(--ew-r);
  color: var(--ew-ink); text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ew-map__item:hover { transform: translateY(-3px); box-shadow: var(--ew-shadow-hover); border-color: var(--ew-orange-200); color: var(--ew-ink); }
/* カテゴリーのイラストバナー（assets/img/{slug}-card.jpg） */
.ew-map__thumb { display: block; aspect-ratio: 640 / 369; background: var(--ew-orange-100); overflow: hidden; }
.ew-map__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.ew-map__item:hover .ew-map__thumb img { transform: scale(1.05); }
.ew-map__body { display: flex; flex-direction: column; gap: var(--ew-s1); padding: var(--ew-s3) var(--ew-s4) var(--ew-s4); }
.ew-map__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--ew-r-sm); background: var(--ew-orange-100); color: var(--ew-orange-700); }
.ew-map__name { display: flex; align-items: center; gap: var(--ew-s2); font-weight: 700; font-size: .875rem; line-height: 1.5; }
.ew-map__name .ew-icon { flex: none; color: var(--ew-orange-700); }
.ew-map__desc { font-size: .75rem; color: var(--ew-ink-50); line-height: 1.6; }

/* =========================================================
   07. Entry（本文の基本スタイル）
   ========================================================= */
.ew-entry { max-width: var(--ew-wrap-narrow); margin-inline: auto; }
.ew-entry > * + * { margin-top: var(--ew-s4); }
.ew-entry h2 {
  margin-top: var(--ew-s7); padding: var(--ew-s2) 0 var(--ew-s2) var(--ew-s3);
  border-left: 6px solid var(--ew-orange);
  background: linear-gradient(90deg, var(--ew-yellow-100), transparent 70%);
  border-radius: 0 var(--ew-r-sm) var(--ew-r-sm) 0;
}
.ew-entry h3 { margin-top: var(--ew-s6); padding-bottom: var(--ew-s2); border-bottom: 2px dotted var(--ew-line-strong); }
.ew-entry ul, .ew-entry ol { padding-left: 1.4em; }
.ew-entry li { margin-bottom: var(--ew-s2); }
.ew-entry img { border-radius: var(--ew-r); }
.ew-entry blockquote { margin: 0; padding: var(--ew-s4); border-left: 4px solid var(--ew-line-strong); background: #fff; color: var(--ew-ink-70); border-radius: 0 var(--ew-r-sm) var(--ew-r-sm) 0; }
.ew-entry table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.ew-entry :is(th, td) { padding: var(--ew-s3); border: 1px solid var(--ew-line); text-align: left; }
.ew-entry th { background: var(--ew-yellow-100); }
/* 表とコードは単独で横スクロール（body は横に流さない） */
.ew-entry :is(table, pre) { display: block; max-width: 100%; overflow-x: auto; }

/* =========================================================
   08. 物販コンポーネント
   ショートコード／ブロックパターン化を前提にした BEM クラス。
   想定マークアップ:
     .ew-item
       .ew-item__head      見出し＋バッジ
       .ew-item__visual    公式アイテムの画像
       .ew-item__spec      ブランド・価格などの定義リスト
       .ew-cta             購入ボタン＋マイクロコピー
       .ew-dupe            プチプラ代替品リスト
   ========================================================= */
.ew-item { border: 2px solid var(--ew-orange-200); border-radius: var(--ew-r-lg); background: var(--ew-surface); overflow: hidden; box-shadow: var(--ew-shadow); }
.ew-item__head {
  display: flex; align-items: center; gap: var(--ew-s2); padding: var(--ew-s3) var(--ew-s4);
  background: linear-gradient(135deg, var(--ew-yellow-100), var(--ew-orange-100));
  border-bottom: 1px solid var(--ew-orange-200);
}
.ew-item__head .ew-icon { color: var(--ew-orange-700); flex: none; }
.ew-item__label { font-weight: 700; font-size: .9375rem; }
.ew-item__body { padding: var(--ew-s4); }
.ew-item__visual { width: 100%; aspect-ratio: 1 / 1; max-width: 320px; margin: 0 auto var(--ew-s4); border-radius: var(--ew-r); overflow: hidden; background: var(--ew-orange-100); }
.ew-item__visual img { width: 100%; height: 100%; object-fit: contain; }
.ew-item__spec { display: grid; grid-template-columns: auto 1fr; gap: var(--ew-s2) var(--ew-s4); margin: 0 0 var(--ew-s4); font-size: .875rem; }
.ew-item__spec dt { color: var(--ew-ink-50); font-weight: 600; }
.ew-item__spec dd { margin: 0; font-weight: 600; }
@media (min-width: 600px) {
  .ew-item__body--split { display: grid; grid-template-columns: 280px 1fr; gap: var(--ew-s5); align-items: start; }
  .ew-item__body--split .ew-item__visual { margin-bottom: 0; }
}

/* CTA : 目立つ購入ボタン＋マイクロコピー */
.ew-cta { display: flex; flex-direction: column; gap: var(--ew-s2); align-items: center; text-align: center; }
.ew-cta__microcopy { font-size: .8125rem; font-weight: 700; color: var(--ew-orange-800); margin: 0; }
.ew-cta__microcopy::before { content: "\FF3C "; }
.ew-cta__microcopy::after { content: " \FF0F"; }
.ew-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ew-s2);
  width: 100%; max-width: 420px; min-height: 56px; padding: var(--ew-s3) var(--ew-s5);
  border: 0; border-radius: var(--ew-r-pill); cursor: pointer;
  background: var(--ew-cta); color: #fff;   /* 白文字で 4.8:1 = AA 準拠 */
  font-size: 1.0625rem; font-weight: 700; text-decoration: none; line-height: 1.4;
  box-shadow: 0 4px 0 rgba(0,0,0,.18), var(--ew-shadow);
  transition: transform .12s ease, background .15s ease, box-shadow .12s ease;
}
.ew-btn:hover { background: var(--ew-cta-hover); color: #fff; }
.ew-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.ew-btn--sub { background: var(--ew-blue); }
.ew-btn--sub:hover { background: var(--ew-blue-700); }
.ew-btn--ghost { background: transparent; color: var(--ew-blue-700); border: 2px solid var(--ew-blue); box-shadow: none; }
.ew-btn--ghost:hover { background: var(--ew-blue-100); color: var(--ew-blue-700); }
.ew-cta__note { font-size: .6875rem; color: var(--ew-ink-50); margin: 0; }

/* プチプラ代替品（似てるアイテム） */
.ew-dupe { margin-top: var(--ew-s5); padding-top: var(--ew-s4); border-top: 2px dashed var(--ew-line-strong); }
.ew-dupe__title { display: flex; align-items: center; gap: var(--ew-s2); font-size: .9375rem; font-weight: 700; margin-bottom: var(--ew-s3); color: var(--ew-blue-700); }
.ew-dupe__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ew-s3); }
.ew-dupe__item { display: grid; grid-template-columns: 72px 1fr; gap: var(--ew-s3); align-items: center; padding: var(--ew-s3); border: 1px solid var(--ew-line); border-radius: var(--ew-r); background: var(--ew-bg); }
.ew-dupe__thumb { aspect-ratio: 1 / 1; border-radius: var(--ew-r-sm); overflow: hidden; background: var(--ew-surface); }
.ew-dupe__thumb img { width: 100%; height: 100%; object-fit: contain; }
.ew-dupe__name { font-size: .875rem; font-weight: 700; line-height: 1.5; }
.ew-dupe__price { font-size: .8125rem; color: var(--ew-orange-800); font-weight: 700; }

/* PR 表記（ステマ規制対応） */
.ew-pr {
  display: flex; gap: var(--ew-s2); align-items: flex-start;
  padding: var(--ew-s3) var(--ew-s4); margin-bottom: var(--ew-s5);
  background: var(--ew-yellow-100); border: 1px solid var(--ew-line); border-radius: var(--ew-r-sm);
  font-size: .75rem; color: var(--ew-ink-70); line-height: 1.7;
}
.ew-pr .ew-icon { flex: none; color: var(--ew-orange-700); }
.ew-pr strong { color: var(--ew-ink); }

/* =========================================================
   09. Pagination
   ========================================================= */
.ew-pagination { margin-top: var(--ew-s7); }
.ew-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ew-s2); }
.ew-pagination .page-numbers {
  display: grid; place-items: center; min-width: var(--ew-tap); height: var(--ew-tap); padding-inline: var(--ew-s3);
  border: 1px solid var(--ew-line); border-radius: var(--ew-r-sm);
  background: var(--ew-surface); color: var(--ew-ink); text-decoration: none; font-weight: 600;
}
.ew-pagination .page-numbers:hover { background: var(--ew-orange-100); border-color: var(--ew-orange-200); }
.ew-pagination .page-numbers.current { background: var(--ew-orange-700); border-color: var(--ew-orange-700); color: #fff; }
.ew-pagination .page-numbers.dots { border-color: transparent; background: transparent; }
.ew-pagination .screen-reader-text { position: absolute !important; }

/* =========================================================
   10. Footer
   ========================================================= */
.ew-footer { margin-top: var(--ew-s8); background: #221c16; color: #e8e2d8; }
.ew-footer a { color: #ffd9b5; }
.ew-footer a:hover { color: #fff; }
.ew-footer__map { padding-block: var(--ew-s6); border-bottom: 1px solid rgba(255,255,255,.12); }
.ew-footer__title { display: flex; align-items: center; gap: var(--ew-s2); font-size: .875rem; letter-spacing: .08em; color: var(--ew-yellow); margin-bottom: var(--ew-s4); }
.ew-footer__links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--ew-s2) var(--ew-s4); }
@media (min-width: 768px) { .ew-footer__links { grid-template-columns: repeat(4, 1fr); } }
.ew-footer__links a { display: flex; align-items: center; gap: var(--ew-s2); min-height: 40px; font-size: .8125rem; text-decoration: none; }
.ew-footer__links a:hover { text-decoration: underline; }
.ew-footer__links .ew-icon { flex: none; opacity: .8; }

/* フッターウィジェット（外観 → ウィジェット →「フッターウィジェット」） */
.ew-footer__widgets { padding-block: var(--ew-s6); border-bottom: 1px solid rgba(255,255,255,.12); }
.ew-footer__widgets .ew-container { display: grid; gap: var(--ew-s5); }
@media (min-width: 768px) {
  .ew-footer__widgets .ew-container { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--ew-s6); }
}
.ew-widget { min-width: 0; }
.ew-widget__title { margin: 0 0 var(--ew-s3); font-size: .875rem; letter-spacing: .06em; color: var(--ew-yellow); }
.ew-widget :is(ul, ol) { list-style: none; margin: 0; padding: 0; }
.ew-widget li + li { border-top: 1px solid rgba(255,255,255,.08); }
.ew-widget li a { display: inline-flex; align-items: center; min-height: 40px; font-size: .8125rem; text-decoration: none; }
.ew-widget li a:hover { text-decoration: underline; }
.ew-widget p { margin: 0 0 var(--ew-s3); font-size: .8125rem; color: #b9b1a5; }
.ew-widget :is(input, select) {
  width: 100%; max-width: 100%; min-height: var(--ew-tap); padding: 0 var(--ew-s3);
  font-size: 1rem; /* 16px : iOS の自動ズーム防止 */
  border: 1px solid rgba(255,255,255,.22); border-radius: var(--ew-r-sm);
  background: rgba(255,255,255,.06); color: #f2ece2;
}
.ew-widget ::placeholder { color: #9a9186; }
.ew-widget :is(button, .search-submit) {
  min-height: var(--ew-tap); margin-top: var(--ew-s2); padding-inline: var(--ew-s4);
  border: 0; border-radius: var(--ew-r-sm); cursor: pointer;
  background: var(--ew-orange-700); color: #fff; font-weight: 700;
}
.ew-footer__meta { padding-block: var(--ew-s5); display: grid; gap: var(--ew-s3); }
.ew-footer__nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--ew-s2) var(--ew-s5); }
.ew-footer__nav a { font-size: .8125rem; min-height: 32px; display: inline-flex; align-items: center; }
.ew-footer__disclosure { font-size: .75rem; color: #b9b1a5; line-height: 1.8; margin: 0; }
.ew-footer__copy { font-size: .75rem; color: #b9b1a5; margin: 0; }

.ew-totop {
  position: fixed; right: var(--ew-s4); bottom: var(--ew-s4); z-index: 40;
  width: var(--ew-tap); height: var(--ew-tap); display: grid; place-items: center;
  border: 0; border-radius: var(--ew-r-pill); cursor: pointer;
  background: var(--ew-orange-700); color: #fff; box-shadow: var(--ew-shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.ew-totop.is-visible { opacity: 1; visibility: visible; transform: none; }

/* =========================================================
   11. Utilities / A11y
   ========================================================= */
.ew-icon { width: 1.25em; height: 1.25em; }
.ew-icon--lg { width: 1.75em; height: 1.75em; }
.ew-stack > * + * { margin-top: var(--ew-s4); }
.ew-center { text-align: center; }
.ew-notice { padding: var(--ew-s5); background: var(--ew-surface); border: 1px dashed var(--ew-line-strong); border-radius: var(--ew-r); }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.ew-skip-link:focus {
  position: fixed !important; top: 8px; left: 8px; z-index: 999;
  width: auto; height: auto; clip: auto; clip-path: none; margin: 0;
  padding: var(--ew-s3) var(--ew-s4); background: var(--ew-surface); color: var(--ew-ink);
  border-radius: var(--ew-r-sm); box-shadow: var(--ew-shadow-hover); font-weight: 700;
}
body.ew-nav-open { overflow: hidden; }

/* WordPress 標準クラス */
.alignleft { float: left; margin: 0 var(--ew-s4) var(--ew-s3) 0; }
.alignright { float: right; margin: 0 0 var(--ew-s3) var(--ew-s4); }
.aligncenter { margin-inline: auto; }
.alignwide, .alignfull { max-width: 100%; }
.wp-caption-text, figcaption { font-size: .75rem; color: var(--ew-ink-50); text-align: center; margin-top: var(--ew-s2); }
.sticky .ew-card { border-color: var(--ew-orange); }

/* =========================================================
   12. ヒーロー / 記事下導線（single.php）
   ========================================================= */
/* .ew-main の上パディングを打ち消し、アイキャッチを画面幅いっぱいに見せる */
.ew-hero { margin-top: calc(var(--ew-s5) * -1); }
.ew-hero--flat { margin-top: 0; }
.ew-hero__media { width: 100%; aspect-ratio: 16 / 9; max-height: 520px; overflow: hidden; background: var(--ew-orange-100); }
.ew-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.ew-hero__card {
  position: relative; z-index: 1; margin-top: calc(var(--ew-s5) * -1);
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--ew-s3);
  padding: var(--ew-s4); background: var(--ew-surface);
  border: 1px solid var(--ew-line); border-radius: var(--ew-r-lg); box-shadow: var(--ew-shadow);
}
.ew-hero--flat .ew-hero__card { margin-top: 0; padding-inline: 0; background: none; border: 0; box-shadow: none; }
.ew-hero__title { margin: 0; }
@media (min-width: 768px) {
  .ew-hero__card { margin-top: calc(var(--ew-s6) * -1); padding: var(--ew-s5); }
}

.ew-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ew-s2) var(--ew-s4); font-size: .8125rem; color: var(--ew-ink-50); }
.ew-entry-meta__item { display: inline-flex; align-items: center; gap: var(--ew-s2); }
.ew-entry-meta__label { padding: 2px 8px; border-radius: var(--ew-r-pill); background: var(--ew-yellow-100); color: var(--ew-ink-70); font-size: .6875rem; font-weight: 700; }

.ew-linkpages { display: flex; flex-wrap: wrap; gap: var(--ew-s2); margin-top: var(--ew-s5); font-size: .875rem; }
.ew-tags { display: flex; flex-wrap: wrap; gap: var(--ew-s2); margin-top: var(--ew-s6); }

/* カテゴリー（クラスター）へ送る導線 */
.ew-cluster-cta {
  margin-top: var(--ew-s6); padding: var(--ew-s5); text-align: center;
  background: linear-gradient(135deg, var(--ew-yellow-100), var(--ew-orange-100));
  border-radius: var(--ew-r-lg);
}
.ew-cluster-cta__lead { display: flex; align-items: center; justify-content: center; gap: var(--ew-s2); margin: 0 0 var(--ew-s4); font-weight: 700; font-size: .9375rem; }
.ew-cluster-cta__lead .ew-icon { flex: none; color: var(--ew-orange-700); }
.ew-cluster-cta .ew-btn { margin-inline: auto; background: var(--ew-surface); }

/* 前後の記事 */
.ew-postnav { display: grid; gap: var(--ew-s3); margin-top: var(--ew-s6); }
.ew-postnav__item {
  display: flex; flex-direction: column; gap: var(--ew-s2); padding: var(--ew-s4);
  background: var(--ew-surface); border: 1px solid var(--ew-line); border-radius: var(--ew-r);
  color: var(--ew-ink); text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}
.ew-postnav__item:hover { transform: translateY(-2px); border-color: var(--ew-orange-200); color: var(--ew-ink); }
.ew-postnav__label { font-size: .75rem; font-weight: 700; color: var(--ew-orange-700); }
.ew-postnav__title { font-size: .875rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 600px) {
  .ew-postnav { grid-template-columns: 1fr 1fr; }
  .ew-postnav__item--next { text-align: right; }
  .ew-postnav__item--next:only-child { grid-column: 2; }
}

/* =========================================================
   13. トップ / アーカイブ / 固定ページ
   ========================================================= */
.ew-front-hero {
  margin-top: calc(var(--ew-s5) * -1); padding-block: var(--ew-s7); text-align: center;
  background: linear-gradient(160deg, var(--ew-yellow-100) 0%, var(--ew-orange-100) 55%, var(--ew-bg) 100%);
  border-bottom: 1px solid var(--ew-line);
}
.ew-front-hero__sub {
  display: inline-flex; align-items: center; gap: var(--ew-s2); margin: 0 0 var(--ew-s3);
  font-size: .75rem; font-weight: 700; letter-spacing: .12em; color: var(--ew-orange-800);
}
.ew-front-hero__title { font-size: clamp(1.5rem, 1.05rem + 2.2vw, 2.5rem); margin: 0 0 var(--ew-s4); }
.ew-front-hero__lead { max-width: 42em; margin: 0 auto var(--ew-s5); color: var(--ew-ink-70); font-size: .9375rem; text-align: left; }
.ew-front-hero__search { max-width: 560px; padding-inline: 0; }
.ew-front-hero__inner { display: grid; gap: var(--ew-s5); align-items: center; }
.ew-front-hero__visual { border-radius: var(--ew-r-lg); overflow: hidden; box-shadow: var(--ew-shadow-hover); }
.ew-front-hero__visual img { display: block; width: 100%; height: auto; }
@media (min-width: 900px) {
  .ew-front-hero { text-align: left; }
  .ew-front-hero__inner { grid-template-columns: 1.05fr 1fr; gap: var(--ew-s7); }
  .ew-front-hero__lead { margin-inline: 0; text-align: left; }
  .ew-front-hero__search { margin-inline: 0; }
}
@media (min-width: 768px) { .ew-front-hero__lead { text-align: center; } }

/* まとめ記事（ピラーページ）への導線 */
.ew-section--pillar {
  padding: var(--ew-s5); background: var(--ew-yellow-100);
  border: 1px dashed var(--ew-orange-200); border-radius: var(--ew-r-lg);
}
.ew-section--pillar .ew-card { border-color: var(--ew-orange-200); }

/* アーカイブ見出し */
/* カテゴリーの扉絵（assets/img/{slug}.jpg） */
.ew-archive-banner { margin-bottom: var(--ew-s5); border-radius: var(--ew-r-lg); overflow: hidden; box-shadow: var(--ew-shadow); }
.ew-archive-banner img {
  display: block; width: 100%; height: auto;
  /* 記事一覧を押し下げないよう、広い画面では帯として上部を見せる */
  max-height: 380px; object-fit: cover; object-position: center top;
}

.ew-archive-head { display: flex; align-items: flex-start; gap: var(--ew-s4); }
.ew-archive-head__icon {
  display: grid; place-items: center; flex: none; width: 56px; height: 56px;
  border-radius: var(--ew-r); background: var(--ew-orange-100); color: var(--ew-orange-700);
}
.ew-archive-head__body { min-width: 0; }
.ew-page-head__count { margin: var(--ew-s2) 0 0; font-size: .75rem; color: var(--ew-ink-50); }

/* 固定ページ */
.ew-page__thumb { margin: 0 0 var(--ew-s5); border-radius: var(--ew-r); overflow: hidden; }

/* =========================================================
   14. 物販ショートコードの追加パーツ
   ========================================================= */
.ew-item__detail { min-width: 0; }
.ew-item__name { margin: 0 0 var(--ew-s3); font-size: 1.0625rem; font-weight: 700; line-height: 1.5; }
.ew-item__extra { padding-top: 0; }
.ew-item__desc { font-size: .9375rem; }
.ew-item__desc > :last-child { margin-bottom: 0; }
.ew-dupe__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ew-dupe__note { margin: 0; }
.ew-dupe__btn {
  width: auto; min-height: 40px; margin-top: var(--ew-s2); align-self: flex-start;
  padding: var(--ew-s2) var(--ew-s4); font-size: .8125rem; box-shadow: none;
}
.ew-dupe__btn:active { transform: none; box-shadow: none; }

/* =========================================================
   記事テンプレート v3 コンポーネント
   番組情報 / 話数ジャンプ / 話数見出し / 公式Xポスト facade
   ========================================================= */

/* --- 番組情報ブロック --- */
.ew-program {
  margin: var(--ew-s5) 0;
  padding: var(--ew-s4) var(--ew-s5);
  background: var(--ew-orange-100);
  border: 1px solid var(--ew-orange-200);
  border-radius: var(--ew-r);
}
.ew-program__title {
  display: flex; align-items: center; gap: var(--ew-s2);
  margin: 0 0 var(--ew-s3);
  font-size: .9375rem; font-weight: 700; color: var(--ew-orange-800);
}
.ew-program__title .ew-icon { flex: none; }
.ew-program__spec {
  display: grid; grid-template-columns: 6.5em 1fr;
  gap: var(--ew-s1) var(--ew-s4); margin: 0; font-size: .9375rem;
}
.ew-program__spec dt { color: var(--ew-ink-70); font-weight: 500; }
.ew-program__spec dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.ew-program__spec dd a { display: inline-flex; align-items: center; gap: 4px; }
.ew-program__cast-label {
  margin: var(--ew-s4) 0 var(--ew-s2);
  font-size: .8125rem; font-weight: 700; color: var(--ew-ink-70);
}
.ew-program__cast { display: flex; flex-wrap: wrap; gap: var(--ew-s2); margin: 0; padding: 0; list-style: none; }
.ew-program__cast li {
  padding: 3px var(--ew-s3); font-size: .8125rem;
  background: var(--ew-surface); border: 1px solid var(--ew-orange-200);
  border-radius: var(--ew-r-pill);
}

/* --- 話数ジャンプ --- */
.ew-epnav {
  margin: var(--ew-s5) 0;
  padding: var(--ew-s4) var(--ew-s5);
  background: var(--ew-surface);
  border: 1px solid var(--ew-line);
  border-radius: var(--ew-r);
}
.ew-epnav__label {
  display: flex; align-items: center; gap: var(--ew-s2);
  margin: 0 0 var(--ew-s3); font-size: .8125rem; font-weight: 700; color: var(--ew-ink-70);
}
.ew-epnav__list { display: flex; flex-wrap: wrap; gap: var(--ew-s2); margin: 0; padding: 0; list-style: none; }
.ew-epnav__list a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--ew-tap); min-width: var(--ew-tap);
  padding: 0 var(--ew-s4);
  font-size: .875rem; font-weight: 700; text-decoration: none;
  color: var(--ew-orange-800); background: var(--ew-orange-100);
  border: 1px solid var(--ew-orange-200); border-radius: var(--ew-r-sm);
}
.ew-epnav__list a:hover { background: var(--ew-orange-200); }

/* --- 話数見出し --- */
h2.ew-ep {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--ew-s2) var(--ew-s3);
  /* 追従ヘッダーに隠れない位置で止める。実際の高さは JS が --ew-anchor-offset に入れる */
  scroll-margin-top: var(--ew-anchor-offset);
}
.ew-ep__n {
  flex: none; padding: 2px var(--ew-s3);
  font-size: .8125rem; font-weight: 700; letter-spacing: .04em;
  color: #fff; background: var(--ew-cta); border-radius: var(--ew-r-sm);
}
.ew-ep__t { min-width: 0; }
.ew-ep__d { font-size: .8125rem; font-weight: 500; color: var(--ew-ink-50); }

/* --- 公式Xポスト facade --- */
.ew-xpost { margin: var(--ew-s5) 0; }
.ew-xpost__btn {
  display: flex; flex-direction: column; gap: var(--ew-s1);
  width: 100%; min-height: var(--ew-tap);
  padding: var(--ew-s4) var(--ew-s5);
  font: inherit; text-align: left; cursor: pointer;
  background: var(--ew-surface); color: inherit;
  border: 1px solid var(--ew-line-strong); border-radius: var(--ew-r);
}
.ew-xpost__btn:hover { border-color: var(--ew-cta); }
.ew-xpost__acct { font-size: .9375rem; font-weight: 700; }
.ew-xpost__note { font-size: .8125rem; color: var(--ew-ink-50); }
.ew-xpost__cue {
  display: inline-flex; align-items: center; gap: 4px; margin-top: var(--ew-s1);
  font-size: .8125rem; font-weight: 700; color: var(--ew-cta);
}
.ew-xpost .twitter-tweet { margin: 0 auto; }

@media (max-width: 600px) {
  .ew-program { padding: var(--ew-s4); }
  .ew-program__spec { grid-template-columns: 5.5em 1fr; font-size: .875rem; }
}

/* =========================================================
   15. 今期放送中ドラマの列（v0.2.0）
   スマホ：横スクロール（次のカードが少し見えて「続きがある」と分かる幅）
   PC：4列。5作品以上は横スクロール
   ========================================================= */
.ew-onair { padding-block: var(--ew-s5) var(--ew-s4); background: var(--ew-surface); border-bottom: 1px solid var(--ew-line); }
.ew-onair__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ew-s3); margin-bottom: var(--ew-s3); }
.ew-onair__title { display: flex; align-items: center; gap: var(--ew-s2); margin: 0; font-size: 1.125rem; }
.ew-onair__title .ew-icon { color: var(--ew-orange); }
.ew-onair__all { display: inline-flex; align-items: center; gap: var(--ew-s1); min-height: var(--ew-tap); font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ew-onair__list {
  display: grid; grid-auto-flow: column; grid-auto-columns: 68%;
  gap: var(--ew-s3); margin: 0 auto; padding: var(--ew-s1) var(--ew-gutter) var(--ew-s3);
  max-width: var(--ew-wrap); list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--ew-gutter); scrollbar-width: thin;
}
.ew-onair__item { scroll-snap-align: start; min-width: 0; }
.ew-onair__card {
  display: flex; flex-direction: column; height: 100%;
  background: var(--ew-surface); border: 1px solid var(--ew-line); border-radius: var(--ew-r);
  overflow: hidden; color: var(--ew-ink); text-decoration: none; box-shadow: var(--ew-shadow);
  transition: box-shadow .2s, transform .2s;
}
.ew-onair__card:hover { color: var(--ew-ink); box-shadow: var(--ew-shadow-hover); transform: translateY(-2px); }
.ew-onair__thumb { display: block; aspect-ratio: 7 / 4; background: var(--ew-orange-100); }
.ew-onair__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ew-onair__drama { display: block; padding: var(--ew-s3) var(--ew-s3) 0; font-size: 1rem; font-weight: 700; line-height: 1.4; }
.ew-onair__post {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding: var(--ew-s1) var(--ew-s3) var(--ew-s3); font-size: .8125rem; line-height: 1.6; color: var(--ew-ink-70);
}
@media (min-width: 600px) { .ew-onair__list { grid-auto-columns: 40%; } }
@media (min-width: 900px) {
  .ew-onair { padding-block: var(--ew-s6) var(--ew-s5); }
  .ew-onair__title { font-size: 1.25rem; }
  .ew-onair__list { grid-auto-columns: calc((100% - var(--ew-gutter) * 2 - var(--ew-s3) * 3) / 4); }
}
/* 列があるときのスマホ：飾りの絵を外し、余白を詰めて、列を最初の画面に入れる */
@media (max-width: 899px) {
  .ew-front-hero--has-onair { padding-block: var(--ew-s5) var(--ew-s4); }
  .ew-front-hero--has-onair .ew-front-hero__visual { display: none; }
  .ew-front-hero--has-onair .ew-front-hero__lead { margin-bottom: var(--ew-s4); font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) { .ew-onair__card { transition: none; } .ew-onair__card:hover { transform: none; } }

/* =========================================================
   16. 画像なしの商品カード（v0.2.1）
   空の画像枠を出さず、文字だけのコンパクトなカードにする。
   ========================================================= */
.ew-item__body--noimg { padding: var(--ew-s4) var(--ew-s5); }
.ew-item__body--noimg .ew-item__spec { margin-bottom: var(--ew-s2); }
.ew-item__body--noimg + .ew-item__extra { padding-top: 0; }
.ew-item__pending {
  display: inline-block; margin: 0; padding: 2px 10px; border-radius: 999px;
  font-size: .75rem; color: var(--ew-ink-50); background: var(--ew-orange-100);
}
.ew-dupe__item--noimg { grid-template-columns: 1fr; }

/* =========================================================
   17. スマホ表示の調整（v0.2.4）
   ========================================================= */
/* 今期放送中カード：説明文を2行で止める（下の余白に3行目が透けないよう、余白は外側に） */
.ew-onair__post {
  padding: 0; margin: var(--ew-s1) var(--ew-s3) var(--ew-s3);
  max-height: calc(1.6em * 2);
}
@media (max-width: 599px) {
  /* 商品画像：画面の半分を占めないよう小さく */
  .ew-item__visual { max-width: 200px; }
  /* 上へ戻るボタン：小さく・半透明にして本文やボタンに重なっても読めるように */
  .ew-totop { width: 40px; height: 40px; right: 10px; bottom: 10px; }
  .ew-totop.is-visible { opacity: .7; }
  .ew-totop.is-visible:hover, .ew-totop.is-visible:focus-visible { opacity: 1; }
}
