/*
Theme Name: TOKYO カルチャーデビュー
Theme URI: https://tokyo-culture-debut.rekibun.or.jp
Description: TOKYO カルチャーデビュー ポータルサイトのテーマ
Version: 0.1.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.1
Text Domain: tokyo-culture-debut
*/

/*
 * デザイントークン (--color-* / --space-* 等) は assets/css/tokens.css にある。
 *
 * 波の変数だけはここに残す。 カスタムプロパティの中の相対 URL は「宣言した
 * スタイルシート」ではなく「その変数を使うスタイルシート」を基準に解決される
 * ため、tokens.css へ移すと --wave-image のパスがずれる。 波は style.css 内で
 * しか使わないので、宣言も使用側と同じファイルに置いておく。
 */
:root {
  --wave-h-mobile: 20px;
  --wave-h-desktop: 80px;
  --wave-h: var(--wave-h-mobile);
  --wave-image: url('assets/images/wave-divider.svg');
}

@media (min-width: 769px) {
  :root {
    --wave-h: var(--wave-h-desktop);
  }
}

/*
 * Wave divider system (see docs/wave-divider.md for the full algorithm).
 *
 * Pattern per has-wave-top section:
 *   1. margin-top: -wave-h  → 前セクションへ食い込み
 *   2. linear-gradient bg    → 上 wave-h は透明、以下は --section-bg
 *   3. ::before(mask + bg)   → 波形を --section-bg で描画
 *   4. padding-top: wave-h   → コンテンツを波領域より下に押し出す
 *
 * Bottom overlap (次セクションの波が食い込む領域):
 *   後続セクションが .has-wave-top を持つ場合、自身の
 *   padding-bottom に calc(var(--wave-h) + inner) を足し、
 *   コンテンツが overlap 領域に入らないようにする。
 *
 * Custom properties (最寄りの祖先で上書き):
 *   --section-bg      セクションの塗り色 (body で default)
 *   --wave-flip-x     1 / -1 で波の左右向き (交互指定)
 *   --wave-h          波の高さ (デフォルトは :root、必要ならセクションで上書き)
 *   --wave-image      マスクに使う SVG (:root で単一マスターに固定)
 */
.has-wave-top {
  position: relative;
  margin-top: calc(-1 * var(--wave-h));
  background-color: transparent;
  background-image: linear-gradient(
    to bottom,
    transparent 0,
    transparent var(--wave-h),
    var(--section-bg, transparent) var(--wave-h),
    var(--section-bg, transparent) 100%
  );
  isolation: isolate;
}

main#main.has-wave-top {
  --wave-flip-x: 1;
  padding-top: var(--wave-h);
}

.has-wave-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--wave-h);
  background-color: var(--section-bg, transparent);
  -webkit-mask-image: var(--wave-image);
  -webkit-mask-repeat: repeat-x;
  -webkit-mask-position: 0 bottom;
  -webkit-mask-size: 100vw 100%;
  mask-image: var(--wave-image);
  mask-repeat: repeat-x;
  mask-position: 0 bottom;
  mask-size: 100vw 100%;
  transform: scaleX(var(--wave-flip-x, 1));
  pointer-events: none;
  z-index: 0;
  /*
   * `--wave-flip-x` はデザイン上セクションごとに +1 / -1 が交互に指定される
   * ため、これをそのまま odd / even 判定として流用する。
   *   flip=+1 (odd)  → duration = --wave-anim-dur-odd,  delay = 0
   *   flip=-1 (even) → duration = --wave-anim-dur-even, delay = --wave-anim-delay-even
   * `(1 - flip) / 2` で odd=0 / even=1 に落として補間する。
   */
  animation-name: tcd-wave-drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: calc(
    var(--wave-anim-dur-odd, 20s)
    + ((1 - var(--wave-flip-x, 1)) / 2) * (var(--wave-anim-dur-even, 32s) - var(--wave-anim-dur-odd, 20s))
  );
  animation-delay: calc(((1 - var(--wave-flip-x, 1)) / 2) * var(--wave-anim-delay-even, -5s));
}

/*
 * ループアニメーション。 mask-position を 1 タイル (= 100vw) 進めれば
 * repeat-x で敷き詰められた次のタイルへシームレスに繋がる。
 * --wave-flip-x=-1 のセクションは transform で左右反転しているため、
 * mask-position の進行方向を反転させ視覚上の流れを右向きに揃える。
 */
@keyframes tcd-wave-drift {
  from {
    -webkit-mask-position: 0 bottom;
    mask-position: 0 bottom;
  }
  to {
    -webkit-mask-position: calc(var(--wave-flip-x, 1) * 100vw) bottom;
    mask-position: calc(var(--wave-flip-x, 1) * 100vw) bottom;
  }
}


/*
 * Composite typography utilities (Figma "Body/..." styles).
 * Use as a single class on text elements; weight/size/line-height inherit from tokens.
 */
.type-body-middle {
  font-family: var(--font-family-jp);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-body-middle);
  line-height: var(--line-height-relaxed);
}

.type-body-middle-bold {
  font-family: var(--font-family-jp);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-body-middle);
  line-height: var(--line-height-relaxed);
}

.type-body-small {
  font-family: var(--font-family-jp);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-body-small);
  line-height: var(--line-height-default);
}

.type-body-x-small {
  font-family: var(--font-family-jp);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-body-x-small);
  line-height: var(--line-height-default);
}

.type-body-large-bold {
  font-family: var(--font-family-jp);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-body-large);
  line-height: var(--line-height-relaxed);
}

/*
 * Common utility components.
 * セクション・アーカイブ間で重複していたパターンを集約。
 */

/* セクション見出し直前の小さなラベル（例: "● EVENT", "● FEATURE"）。
 * 詳細ページの eyebrow は `<a class="eyebrow" href="/events/">` のような形で
 * 各 CPT のアーカイブへのリンクを兼ねる。 hover / focus-visible で
 * 内部の `.en` テキストにアンダーラインを出してリンクであることを示す。 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  color: var(--color-brand-primary-green);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-body-small);
}

a.eyebrow:hover .en,
a.eyebrow:focus-visible .en {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* セクション末尾の「すべての…」アウトライン CTA ボタン。 */
.more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-full);
  border: var(--border-width-strong) solid var(--color-brand-primary-green);
  color: var(--color-brand-primary-green);
  font-weight: var(--font-weight-bold);
}

/*
 * Filled pill-shape CTA button. 配色は配置するセクション側で上書き。
 * 例: .home-special .cta { background: var(--color-brand-primary-green); color: var(--color-text-inverted); }
 */
.cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-bold);
}

/*
 * リンクボタンの矢印。ボタン直下の flex アイテムにすると、ラベルが 2 行に
 * 折り返したとき矢印だけが縦中央の右端に取り残される。そこでラベルを唯一の
 * flex アイテムにし、矢印はその内側の ::after としてテキストと同じインライン
 * 整形コンテキストに流す。
 *
 * 日本語はほぼ任意の位置で改行できるため、ラベルが折り返すと矢印だけが次行に
 * 落ちることがある。 以前これを ::after を inline にして content に U+2060
 * WORD JOINER を持たせる方式で塞いだが、iOS Safari が inline ボックスへの mask を
 * 適用せず、background-color の矩形がそのまま出た (実機で確認)。 矢印だけが
 * 稀に行落ちするほうが、常時黒い箱が出るよりましなので inline-block に戻した。
 * 行落ちを塞ぐなら WebKit で検証できる手段を用意してから再挑戦すること。
 *
 * 末尾 1 文字を nowrap の span で包む旧方式は使えない。 GTranslate はラベル
 * 全体を 1 文として訳したうえで訳語を元のノードへ順に割り付けるので、末尾に
 * あったはずの span が訳文の先頭を受け取り、矢印が文中に現れる
 * (docs/gtranslate-worklog.md の「9. 翻訳対象テキストを span で分割しない」)。
 *
 * 行き先で字形を出し分ける。サイト内リンクは →、外部リンク (.is-external) は ↗。
 * .is-external は PHP 側の tcd_external_class() が付与する (inc/links.php)。
 * mask の URL はこの CSS ファイルからの相対パスで解決される。カスタム
 * プロパティに url() を入れると解決基準がブラウザ間で揺れるので使わない。
 */
.cta .label::after,
.pill .label::after,
.more .label::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: var(--space-3);
  vertical-align: -0.15em;
  background-color: currentColor;
  mask: url('assets/images/icon-arrow-right.svg') no-repeat center / contain;
  -webkit-mask: url('assets/images/icon-arrow-right.svg') no-repeat center / contain;
}

.cta.is-external .label::after,
.pill.is-external .label::after,
.more.is-external .label::after {
  mask-image: url('assets/images/icon-arrow-up-right.svg');
  -webkit-mask-image: url('assets/images/icon-arrow-up-right.svg');
}

/*
 * 記事本文・固定ページの共通レイアウト。
 *   .entry-wrap = 読みやすい横幅 (Figma max-width/narrow)
 *   .entry-header = アイキャッチや見出しの縦並びヘッダ
 *   .entry > * = Gutenberg 本文ブロック間の縦リズム
 */
.entry-wrap {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.entry-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.entry > * { margin-bottom: var(--space-6); }
.entry > h2 {
  margin-top: var(--space-12);
  font-family: var(--font-family-jp-title);
  font-size: var(--font-size-body-large);
  font-weight: var(--font-weight-bold);
}
.entry img,
.entry figure { border-radius: var(--radius-default); }
.entry .wp-block-gallery {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/*
 * core/separator は WP のデフォルトが 2px の濃い線で本文中では目立ちすぎるので、
 * gray-300 の細い罫線に統一する。 上下 margin は entry-body の block-family
 * ルール側で付与するので、ここは見た目のみ。 wide / dots バリエーションも同じ扱い。
 */
.wp-block-separator {
  height: 0;
  border: none;
  border-top: 1px solid var(--color-neutral-gray-300);
  background: none;
}

/*
 * .entry-body 内ブロック間の縦方向スペーシング (owl / adjacent-sibling パターン)。
 *
 * 「X の直後に Y が来たら margin-top を M px」を隣接ペアごとに直接宣言する。
 * 以前は flex gap + 族別 margin + 補正 の三層で最終値を計算していたが、複雑さの
 * 割に例外リストが膨らむため、margin-top のみで距離を作る形に集約した。 flex は
 * 使わず flow layout に戻し、margin が普通に効く前提で書く。
 *
 * `:where()` で specificity を 0 に落とし、後に書いたルールが必ず勝つ「順序
 * cascade」にする ("後ろの方が特定" ではなく "後ろの方が後勝ち")。 これで
 * `:not(...)` の例外リストなしで hug / 密着ケースを最終行で上書きできる。
 *
 * 分類:
 *   HEADINGS = .wp-block-heading, .wp-block-lazyblock-qa-heading
 *   MEDIA    = .wp-block-separator, .wp-block-image, .wp-block-embed,
 *              [class*="wp-block-lazyblock-"]  (callout 等の完結型 lazyblock)
 *              ただし MEDIA として拾う際は :not(.wp-block-lazyblock-qa-heading)
 *              で qa-heading を除外する。 qa-heading は本質的に見出しなので
 *              MEDIA の「上下 2x」性質を持たせず、通常 heading と同じ「上のみ 2x」
 *              にしたい (rule 3 の first slot、rule 4 の second slot から除外)。
 *
 * 隣接ペアの結果 (--entry-body-gap = 32px 基準):
 *   * + *             1x (32px)   ベース段落間
 *   * + HEADING       2x (64px)   見出しの上に息 (qa-heading は HEADING に入る)
 *   * + MEDIA         2x (64px)   媒体ブロックの上に息
 *   MEDIA + *         2x (64px)   媒体ブロックの下にも息 (qa-heading 除く)
 *   HEADING + MEDIA   1x (32px)   見出し直後の媒体は意味的に一体で密着
 *                                 (second が qa-heading の場合は除外 → 2x)
 *   * + callout       0           前ブロックに hug (最終上書き)
 *
 * margin はブロック外側 (核ブロックは h タグや hr そのもの、lazyblock は
 * `.wp-block-lazyblock-{slug}` ラッパー) に付く。 各ブロックの style.css は
 * 内部レイアウトだけを扱う。 グローバル要素リセット (h1-h6, p, ul, ol, dl,
 * figure, hr → margin: 0) が前提で、そこに owl ルールが加算される。
 */

.entry-body {
  --entry-body-gap: var(--space-8);
}

.entry-body > :first-child {
  margin-top: 0;
}

.entry-body > :where(* + *) {
  margin-top: var(--entry-body-gap);
}

.entry-body > :where(* + :is(
  .wp-block-heading,
  .wp-block-lazyblock-qa-heading,
  .wp-block-separator,
  .wp-block-image,
  .wp-block-embed,
  [class*="wp-block-lazyblock-"]
)) {
  margin-top: calc(var(--entry-body-gap) * 2);
}

.entry-body > :where(:is(
  .wp-block-separator,
  .wp-block-image,
  .wp-block-embed,
  [class*="wp-block-lazyblock-"]
):not(.wp-block-lazyblock-qa-heading) + *) {
  margin-top: calc(var(--entry-body-gap) * 2);
}

.entry-body > :where(
  :is(.wp-block-heading, .wp-block-lazyblock-qa-heading)
  + :is(
    .wp-block-separator,
    .wp-block-image,
    .wp-block-embed,
    [class*="wp-block-lazyblock-"]
  ):not(.wp-block-lazyblock-qa-heading)
) {
  margin-top: var(--entry-body-gap);
}

.entry-body > :where(* + .wp-block-lazyblock-callout) {
  margin-top: 0;
}

/* core/image と core/embed のキャプション。 Figma 783:6483 (figure) 参照。 */
.entry-body :is(.wp-block-image, .wp-block-embed) :is(figcaption, .wp-element-caption) {
  margin: var(--space-4) 0 0;
  font-size: var(--font-size-body-small);
  line-height: 1.5;
  color: var(--color-text-light);
}

/* core/embed: YouTube 等の oEmbed iframe は width/height 属性が固定値 (500x281)
 * で入るため、そのままだとカラム幅に対して小さく寄る。 wrapper 側で 16:9 の
 * aspect-ratio コンテナ化し、iframe をリキッドに広げる。 Twitter/Instagram など
 * 16:9 でない埋め込みは将来 wp-embed-aspect-* クラス別の上書きで対応する想定。 */
.entry-body .wp-block-embed .wp-block-embed__wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-default);
}

.entry-body .wp-block-embed .wp-block-embed__wrapper iframe,
.entry-body .wp-block-embed .wp-block-embed__wrapper > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* core/list: Figma 833:10819 準拠で bullet 記号は使わず、各行の下に 1px dotted
 * のグレー区切りを引くだけのシンプルな縦積みにする。 セクション固有
 * (feature-single 等) の ul padding-left override とは重ならないよう
 * `.wp-block-list` クラスに限定してターゲットする。 */
.entry-body :is(ul, ol).wp-block-list {
  padding-inline-start: 0;
  list-style: none;
}

.entry-body :is(ul, ol).wp-block-list > li {
  padding-block: var(--space-2);
  border-top: 1px dotted var(--color-neutral-gray-300);
}

/* entry-body 内の a はすべて緑テキスト、デフォルト下線なし、hover /
 * focus-visible で下線を出す。 段落・リスト・見出しの中身どれでも一貫。 */
.entry-body a {
  color: var(--color-brand-primary-green);
  text-decoration: none;
}

.entry-body a:hover,
.entry-body a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* 見出しは entry-body 全体で継承される段落用 line-height 2 のままだと縦に
 * 間延びして読みづらくなるため、h1-h6 に line-height 1.5 を明示。 各セクション
 * (feature-single / single-event 等) の個別上書きは同じ値なので、こちらに寄せて
 * いけば重複を段階的に取り除ける。 */
.entry-body :is(h1, h2, h3, h4, h5, h6) {
  line-height: 1.5;
}

/* h2 は toc アンカージャンプ時に viewport top に張り付かないよう、上に
 * 基準の 2x ぶんの scroll offset を持たせる。 */
.entry-body h2.wp-block-heading {
  scroll-margin-top: calc(var(--entry-body-gap) * 8);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/*
 * Sticky footer: body を flex-column にして main を伸ばし、コンテンツ量が少ない
 * ページでもフッターがビューポート下端に張り付くようにする。
 * (賛同企業ページなど本文が短いページで、body 背景の余白が footer の下に
 * 見えてしまう問題への対処)
 */
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-background-default);
  color: var(--color-text-default);
  font-family: var(--font-family-jp);
  font-size: var(--font-size-body-middle);
  line-height: 2;
  --section-bg: var(--color-background-default);
}

main#main {
  flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, hr {
  margin: 0;
}

/*
 * Heading text-wrap policy. 詳細と判断根拠は docs/design/implement-design.md
 * の「日本語見出しの折り返し」を参照。
 *
 * `word-break: auto-phrase` は全見出しに当てる。
 *
 * `text-wrap: pretty` は**中央寄せの見出しだけ**に当てる (下の :is() リスト)。
 * 日本語で行頭揃えの見出しに当てると、最終行を短くしないための行送り調整が
 * 逆に効いて右端が不揃いに見える。 中央寄せなら左右対称に詰まるので気になら
 * ない。
 *
 * `text-wrap: balance` は使わない。 日本語では語中で割れる (実測:
 * 「文化体験の輪をひろげ / る仲間を募集しています」)。
 *
 * 注意: これらは Chromium 限定のヒントで、Safari / Firefox では greedy に
 * 折れる。 見出しの行数は Figma を正とし、まずカラム幅で収めること。
 * 折り返しヒントを行数の保証手段にしない。
 *
 * `palt` は Zen Maru Gothic (Google Fonts) では効かない (実測で字幅が変わら
 * ない)。 --font-family-jp 側のための保険として残しているだけなので、詰めが
 * 効く前提で幅を設計しないこと。
 *
 * The `:lang(en)` branch is intentionally deferred until the translation
 * layer is ready.
 */
h1, h2, h3, h4, h5, h6 {
  &:lang(ja) {
    font-feature-settings: 'palt';
    word-break: auto-phrase;
  }
}

/*
 * text-wrap: pretty を効かせる中央寄せの見出し。 ここは text-align: center を
 * 宣言しているセレクタと対で維持すること。 中央寄せのセクションを増やしたら
 * このリストにも足す。 足し忘れても既定 (wrap) に落ちるだけで崩れはしない。
 *
 * balance は使わない。 日本語では語中で割れる。 auto-phrase と組み合わせると
 * モバイル幅で「野外スケッチ / 会（ダミー10）」のような等幅短行になる。
 */
:is(
  .home-cover .lede,
  .home-community .card-supporters,
  .event-archive-head,
  .home-events .heading,
  .home-features .heading,
  .home-news .heading,
  .home-special .heading,
  .home-about .heading,
  .archive-feature .heading,
  .archive-feature-series .heading,
  .archive-news .heading,
  .search-results .heading,
  .not-found .heading,
  .page-content .heading
) :is(h1, h2, h3, h4, h5, h6):lang(ja),
/* 関連セクションの見出しは .heading を見出し要素自身が持つ (news/related.php,
   event/related.php) か、素の h2 で置かれている (feature/related.php)。
   セクションごと拾うとカード側の .title まで当たるので直接指定する。 */
:is(h1, h2, h3, h4, h5, h6).heading:lang(ja),
.feature-related > .wrap > h2:lang(ja) {
  text-wrap: pretty;
}

.heading :is(h1, h2, h3, h4, h5, h6) {
  width: 100%;
}

/*
 * Centered `.heading` blocks live inside flex-columns with `align-items:
 * center`, which sizes children to their intrinsic (unbroken) content width.
 * The heading block and the inner h* both need `width: 100%` (see the rule
 * above) so `text-wrap: pretty` + `word-break: auto-phrase` can actually
 * take effect and wrap the heading text to the parent width.
 */
.heading {
  width: 100%;
  max-width: 100%;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/*
 * iOS Safari のダブルタップズーム抑止。 対話要素を素直な "click" として
 * 扱わせる。 pinch-zoom (アクセシビリティ) は保持されるので単指ジェスチャの
 * ズームだけを止める形になる。
 */
a,
button,
label,
summary,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--color-brand-primary-blue);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus-visible {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  width: auto;
  height: auto;
  padding: var(--space-2) var(--space-3);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--color-background-dark);
  color: var(--color-text-inverted);
  border-radius: var(--radius-small);
  z-index: 1000;
}

/*
 * `--wrap-content` = Figma の wrapper フレーム幅 (= 実際に中身が使える幅)。
 *
 * `box-sizing: border-box` が全体に効いているので `max-width` に Figma の幅を
 * そのまま書くと gutter (padding) が内側に食い込み、コンテンツ幅が gutter*2
 * だけ痩せる。 セクション側が Figma の値を素直に書けるよう、gutter の加算は
 * ここで一度だけ行う。 セクションで幅を変えるときは `max-width` ではなく
 * `--wrap-content` を上書きする。
 *
 * 既定値は従来の実効値 (--max-width-wide 1440 から gutter 40*2 を引いた 1360)
 * をそのまま維持しているので、上書きしないセクションの見た目は変わらない。
 */
.wrap {
  --wrap-gutter: var(--space-4);
  --wrap-content: calc(var(--max-width-wide) - var(--space-10) * 2);
  width: 100%;
  max-width: calc(var(--wrap-content) + var(--wrap-gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--wrap-gutter);

  @media (min-width: 769px) {
    --wrap-gutter: var(--space-10);
  }
}

/*
 * .article-layout — /events/[slug]/, /features/[slug]/ など、記事本文 + サイド
 * の 2 カラム記事シェル。 モバイル〜狭デスクトップは 1 列縦積み、1024px 以上で
 * デフォルト 3fr : 1fr の 2 カラム。 gap もモバイル 40 / デスクトップ 64。
 * ブレイクポイントは "サイドカラムに情報を詰め込んでも本文側が読める最小幅"
 * として 1024px を採用 (card block の横並び閾値と同じ)。
 *
 * サイドカラムを固定幅にする / gap を変える等の派生 (feature: 1fr+320px, gap 56/128)
 * は section スコープで CSS カスタムプロパティを上書きする:
 *   section.single-feature {
 *     --article-layout-columns: minmax(0, 1fr) 320px;
 *     --article-layout-gap-desktop: var(--space-32);
 *     --article-layout-gap-mobile: var(--space-14);
 *   }
 * `.wrap` と結合して 1 段の div (`.wrap.article-layout`) で使うのが標準。
 */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--article-layout-gap-mobile, var(--space-10));
  align-items: start;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: var(--article-layout-columns, minmax(0, 3fr) minmax(0, 1fr));
    gap: var(--article-layout-gap-desktop, var(--space-16));
  }
}

/*
 * サイトロゴの言語切り替え (Figma 388:402 / 388:403)。 ヘッダー・フッターの
 * `.logo` は日英 2 種類の SVG を同時に持ち (template-parts/global/site-logo.php)、
 * 表示するほうだけをここで選ぶ。
 *
 * 判定は <html lang> の一本。 GTranslate 無料版はクライアント JS 翻訳で URL が
 * 変わらないため PHP 側では表示言語が確定せず、Google の翻訳ライブラリが翻訳を
 * 当てるときに <html lang> を対象言語へ書き換えるのが唯一の手がかりになる
 * (実測: lang="en" + class="translated-ltr")。 Business プランの /en/ 方式へ
 * 戻したときも <html lang="en"> になるので、このセレクタのまま通る。
 *
 * span は `display: contents` で箱を消し、SVG が `.logo` の flex item のままに
 * なるようにしている。
 *
 * サイズはヘッダー / ドロワー / フッターの各スコープが `--logo-width` を上書き
 * して決める。 英語ロゴだけはこの幅ではなく、日本語ロゴと同じ「高さ」に揃える。
 * 英語は 2 行とも欧文キャップで日本語 2 行より背が低く (Figma は両方とも幅
 * 400 で描かれている)、幅を合わせるとロゴが一回り小さく見えるため。
 */
.logo {
  --logo-width: 140px;

  & svg {
    width: var(--logo-width);
    height: auto;
  }

  /*
   * 日本語 viewBox 200x46 / 英語 viewBox 400x74 から、同じ高さになる英語の幅は
   * 日本語の幅 x (46/200) x (400/74) = 約 1.243 倍。
   */
  & > .logo-en svg {
    width: calc(var(--logo-width) * 46 / 200 * 400 / 74);
  }

  & > .logo-ja {
    display: contents;
  }

  & > .logo-en {
    display: none;
  }

  &:lang(en) {
    & > .logo-ja {
      display: none;
    }

    & > .logo-en {
      display: contents;
    }
  }
}

.site-header {
  position: relative;
  /* overflow は visible。 background-image は element box を越えないので clip
   * 不要。 hidden にすると .site-lang の .gt_options ドロップダウン (top: 100%
   * で header 外に落ちる) が clip されて選択肢が隠れてしまう。 */
  background-color: var(--color-background-ultra-light);
  background-image: url('assets/images/header-leaves-mobile.svg');
  background-repeat: no-repeat;
  background-position: right -10% center;
  background-size: 60% auto;
  height: 120px;

  @media (min-width: 769px) {
    background-image: url('assets/images/header-leaves.svg');
    background-position: right -20% center;
    background-size: 80% auto;
    height: 200px;
  }

  & .logo {
    position: absolute;
    top: var(--space-6);
    left: var(--space-6);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    --logo-width: 140px;
  }

  /*
   * 言語切替 (.site-lang) 用の absolute ラッパー。 右端は viewport 直付けの
   * .drawer-trigger (56px) + gap 16px 分だけ内側に寄せて重ならないようにする。
   * absolute なのでスクロール中はヘッダーと一緒に流れて視界から外れる。
   */
  & .header-actions {
    position: absolute;
    top: 16px;
    right: calc(16px + 56px + var(--space-4));
    z-index: 10;
    display: inline-flex;
    align-items: center;
  }

  /* Free-plugin GTranslate widget → 56px round icon button per Figma menu-lang (813:6488).
   * Reshape the plugin's default float widget: .gt-selected becomes the pill (its inner
   * .gt-current-lang is painted as the language icon via mask-image so it inherits color),
   * and .gt_options anchors below as a small dropdown menu that appears on click. Rules
   * are !important-heavy because the plugin appends its own <style class="gtranslate_css">
   * to <head> at DOM-ready, so cascade order otherwise loses to the plugin defaults. */
  & .site-lang {
    display: inline-flex;
    align-items: center;
  }

  & .site-lang > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-background-ultra-light);
    color: var(--color-neutral-black);
    text-decoration: none;
    transition: background-color 0.15s ease;

    @media (hover: hover) {
      &:hover {
        background: var(--color-background-light);
      }
    }
  }

  & .gt_float_switcher {
    position: relative !important;
    display: inline-flex !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: var(--color-neutral-black) !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: 1 !important;
    overflow: visible !important;
    opacity: 1 !important;

    & .gt-selected {
      width: 56px;
      height: 56px;
      padding: 0 !important;
      border-radius: var(--radius-full);
      background: var(--color-background-ultra-light);
      cursor: pointer;
      overflow: hidden;
      transition: background-color 0.15s ease;

      @media (hover: hover) {
        &:hover {
          background: var(--color-background-light);
        }
      }
    }

    & .gt-current-lang {
      width: 100%;
      height: 100%;
      padding: 0 !important;
      display: flex;
      align-items: center;
      justify-content: center;
      color: inherit !important;
      font-weight: inherit !important;
      background-color: currentColor;
      -webkit-mask-image: url('assets/images/icon-language.svg');
      mask-image: url('assets/images/icon-language.svg');
      -webkit-mask-repeat: no-repeat;
      mask-repeat: no-repeat;
      -webkit-mask-position: center;
      mask-position: center;
      -webkit-mask-size: 32px 32px;
      mask-size: 32px 32px;

      & > * {
        visibility: hidden;
      }
    }

    /*
     * 開いている間はアイコンを × に差し替える (Figma menu-lang 開状態 839:6535 /
     * icon-xmark 879:6723)。 mask を入れ替えるだけなので DOM も PHP も触らない。
     *
     * 開閉の手がかりはプラグインの float.js が付けるクラス 2 種のうち
     * .gt_float_switcher-arrow.gt_arrow_rotate を使う。 もう一方の
     * .gt_options.gt-open は「開くときだけ 200ms 遅れて付き、閉じるときは即座に
     * 外れる」という非対称があり、開くたびにアイコンの切り替えが目に見えて遅れる。
     * gt_arrow_rotate は click ハンドラ内で同期的に付け外しされる。
     */
    &:has(.gt_arrow_rotate) .gt-current-lang {
      -webkit-mask-image: url('assets/images/icon-xmark.svg');
      mask-image: url('assets/images/icon-xmark.svg');
    }

    /*
     * ドロップダウン本体 = Figma switcher (879:6711)。 白 320px のパネルに
     * 言語 2 件を横並びで置き、その下に機械翻訳の注意書きを敷く。
     * 注意書きの中身は PHP が .site-lang 直下に出し、assets/js/lang-note.js が
     * ここへ移してくる (プラグインが options を JS で組むため PHP からは
     * 直接入れられない)。
     *
     * 子は [a, a, .site-lang-note] の 3 つ。 flex-wrap + 注意書きの width: 100%
     * で「言語行 / 注意書き」の 2 行に割る。
     */
    & .gt_options {
      position: absolute !important;
      top: calc(100% + var(--space-2)) !important;
      /* パネル右端をドロワーボタンの右端に揃える (Figma もその位置)。
       * .header-actions は右から calc(gutter + 56px + 16px) の位置にいるので、
       * ボタン 1 個 + gap ぶん右へ戻すと SP / PC どちらでも画面内に収まる。
       * 揃えないと 375px 幅で 320px のパネルが左に 48px はみ出す。 */
      right: calc(-1 * (56px + var(--space-4))) !important;
      left: auto !important;
      width: min(320px, calc(100vw - var(--space-8)));
      /* switcher_horizontal_position: inline のとき float.js が
       * (wrapper 幅 - switcher 幅 - 1) をインラインの max-width に書き込む。
       * どちらも 56px なので -1px という無効値になり実害は出ていないが、
       * 幅を自前で決める以上ここで無効化しておく。 */
      max-width: none !important;
      max-height: none !important;
      margin: 0 !important;
      padding: var(--space-4) !important;
      background: var(--color-background-ultra-light) !important;
      border-radius: var(--radius-default) !important;
      box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
      transform: none !important;
      text-align: center;
      z-index: 20;
      /* flex + order で言語リンクを [日本語 → English] の順に固定 (プラグインの
       * 出力順に依存しない)。 */
      display: flex !important;
      flex-wrap: wrap;
      justify-content: center;
      gap: var(--space-4) 0;

      /*
       * 閉じている間の当たり判定を消す。 上の display: flex !important は
       * プラグインがインラインで書く display: none に勝ってしまうため、
       * 何もしないとパネルは常にレイアウトされ、opacity: 0 のまま
       * pointer-events を拾う (実測: ボタン下に 119x140px の透明な
       * クリック領域ができ、言語リンクが押せてしまう)。
       */
      visibility: hidden;
      pointer-events: none;
      /*
       * 開閉はグローバルメニュー (.site-drawer) に合わせてトランジション無し。
       * プラグインは .gt_options に transition: all .8s を当て、opacity を
       * .gt-open で 0 -> 1 にするが、.gt-open は開く 200ms 後にしか付かない。
       * transition だけ切ると今度は 200ms の無反応時間が見えるので、opacity も
       * 同期フック (gt_arrow_rotate) 側へ移して即時に切り替える。
       */
      transition: none !important;
      opacity: 0 !important;
    }

    &:has(.gt_arrow_rotate) .gt_options {
      visibility: visible;
      pointer-events: auto;
      opacity: 1 !important;
    }

    & .gt_options a {
      display: flex !important;
      align-items: center;
      justify-content: center;
      /* Figma: hitarea が左右 16px、label が上下 8px */
      padding: var(--space-2) var(--space-4) !important;
      color: var(--color-neutral-black) !important;
      text-decoration: none;
      font-family: var(--font-family-jp);
      font-size: var(--font-size-text-16);
      font-weight: var(--font-weight-regular);
      line-height: 1;

      @media (hover: hover) {
        &:hover {
          background: var(--color-background-light) !important;
        }
      }

      /* Figma 順に固定 (プラグインの incl_langs 並び順に依存しない) */
      &[data-gt-lang="ja"] { order: 1; }
      &[data-gt-lang="en"] { order: 2; }

      /*
       * 表示中の言語に緑の下線、もう一方を brand green の「リンク色」にする。
       * 日本語を既定にして、英語表示のときだけ :lang(en) で入れ替える。
       *
       * html[lang="ja"] と html[lang="en"] の 2 本立てにはできない。 Google の
       * 翻訳ライブラリは英語へ切り替えるとき <html lang="en"> にするが、日本語へ
       * 戻すときは "ja" ではなく "auto" を書き込む。 どちらのセレクタにも当たらず、
       * 2 回目以降の切り替えで両方のリンクが素のままになる (実測)。
       * ロゴ (.logo) と注意書き (.site-lang-note) の :lang(en) 切り替えも同じ理由で
       * 日本語を既定にしてある。
       */
      &[data-gt-lang="ja"] {
        text-decoration: underline;
        text-decoration-color: var(--color-brand-primary-green);
        text-underline-offset: 6px;
      }

      &[data-gt-lang="en"] {
        color: var(--color-text-brand-primary-green) !important;
      }

      html:lang(en) & {
        &[data-gt-lang="ja"] {
          text-decoration: none;
          color: var(--color-text-brand-primary-green) !important;
        }

        &[data-gt-lang="en"] {
          color: var(--color-neutral-black) !important;
          text-decoration: underline;
          text-decoration-color: var(--color-brand-primary-green);
          text-underline-offset: 6px;
        }
      }
    }

    /*
     * 機械翻訳の注意書き (Figma 839:6511)。 width: 100% で必ず言語行の次に
     * 折り返させ、パネル下段に敷く。 order は言語リンクの 1 / 2 より後ろ。
     */
    & .site-lang-note {
      order: 3;
      width: 100%;
      font-family: var(--font-family-jp);
      font-size: var(--font-size-text-12);
      line-height: 1.75;
      text-align: left;
      color: var(--color-text-default);

      & p {
        margin: 0;
      }

      & > .lang-note-en {
        display: none;
      }

      &:lang(en) {
        & > .lang-note-ja {
          display: none;
        }

        & > .lang-note-en {
          display: block;
        }
      }
    }

    & .gt_options img {
      display: none !important;
    }
  }

  /*
   * ドロワートリガーは記事本文中でも常時アクセスできる必要があるので
   * viewport 直下に fixed で貼り付ける。 HTML 上は .header-actions の子だが
   * position: fixed で flex 流れから抜けるため親の inline-flex には影響しない。
   * 隣の .site-lang とは 56px + 16px gap 分の間隔を .header-actions 側の right
   * オフセットで作っている。
   */
  & .drawer-trigger {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 11;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
    transition: background-color 0.15s ease;

    & svg {
      width: 24px;
      height: auto;
    }

    @media (hover: hover) {
      &:hover {
        background: var(--color-fill-brand-primary);
      }
    }
  }

  @media (min-width: 769px) {
    & .logo {
      top: 44px;
      left: 44px;
      --logo-width: 200px;
    }

    & .header-actions {
      top: 40px;
      right: calc(40px + 56px + var(--space-4));
    }

    & .drawer-trigger {
      top: 40px;
      right: 40px;
    }
  }
}

/* Front-page: ヘッダーをカバー上にフロート、波形デコレーション非表示 */
body.home .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
}

main {
  display: block;
}

.site-drawer {
  position: fixed;
  /* モバイル: 4 辺すべて 0 で全画面。 Safari (iOS を含む) は <dialog> に
     `max-width: calc(100vw - 2em)` を UA CSS で強制するため、明示的に
     `max-width: none` で打ち消さないと右側に隙間が残る。 デスクトップは
     下の @media (min-width: 769px) で右上に浮く 390px カードに切り替わる。 */
  inset: 0;
  width: auto;
  max-width: none;
  height: auto;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--color-fill-light);
  color: var(--color-text-default);
  overflow: hidden;
  flex-direction: column;

  &[open] {
    display: flex;
  }

  &::backdrop {
    background: rgba(54, 54, 54, 0.5);
  }

  & .head {
    display: contents;
  }

  & .head .logo {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    --logo-width: 140px;
  }

  & .close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
    transition: background-color 0.15s ease;

    @media (hover: hover) {
      &:hover {
        background: var(--color-fill-brand-primary);
      }
    }

    &:focus-visible {
      background: var(--color-fill-brand-primary);
    }
  }

  & .inner {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
    padding: var(--space-6);
    overflow-y: auto;

    & > * {
      flex-shrink: 0;
    }
  }

  @media (min-width: 769px) {
    inset: 20px 20px auto auto;
    width: 390px;
    max-width: calc(100vw - 40px);
    height: auto;
    max-height: calc(100dvh - 40px);
    border-radius: var(--radius-default);

    & .close {
      top: 20px;
      right: 20px;
    }

    & .inner {
      padding-top: var(--space-8);
    }
  }

  & .search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    height: 56px;
    padding-left: var(--space-6);
    padding-right: var(--space-2);
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    background: var(--color-background-ultra-light);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-full);

    & input {
      flex: 1;
      min-width: 0;
      border: none;
      background: transparent;
      font: inherit;
      font-size: var(--font-size-body-middle);
      color: inherit;

      &:focus-visible {
        outline: none;
      }

      &::placeholder {
        color: #9c9c9c;
      }
    }

    & button {
      width: 44px;
      height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius-full);
      background: var(--color-fill-dark);
      color: var(--color-text-inverted);
      flex-shrink: 0;
      transition: background-color 0.15s ease;

      @media (hover: hover) {
        &:hover {
          background: var(--color-fill-brand-primary);
        }
      }

      &:focus-visible {
        background: var(--color-fill-brand-primary);
      }
    }
  }

  & .tags {
    padding: var(--space-6);
    background: var(--color-background-default);
    border-radius: var(--radius-default);

    & .tags-title {
      margin-bottom: var(--space-2);
      font-size: var(--font-size-body-middle);
      font-weight: var(--font-weight-bold);
      line-height: 2;
    }

    & .tags-list {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-2);

      & a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 var(--space-3);
        border-radius: var(--radius-full);
        background: var(--color-background-ultra-light);
        font-size: var(--font-size-body-small);
        transition: background-color 0.15s ease;

        @media (hover: hover) {
          &:hover {
            background: var(--color-background-default);
          }
        }

        &:focus-visible {
          background: var(--color-background-default);
        }
      }
    }
  }

  & .nav {
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-default);
    overflow: hidden;

    & .nav-list {
      & li {
        border-bottom: 1px solid var(--color-border-default);

        &:last-child {
          border-bottom: none;
        }

        & a {
          display: flex;
          align-items: center;
          min-height: 56px;
          padding: var(--space-4) 20px;
          font-weight: var(--font-weight-bold);
          font-size: var(--font-size-body-middle);
          background: var(--color-background-ultra-light);
          transition: background-color 0.15s ease, color 0.15s ease;

          &::after {
            content: "→";
            margin-left: auto;
            font-weight: var(--font-weight-regular);
          }

          @media (hover: hover) {
            &:hover {
              background: var(--color-fill-brand-primary);
              color: var(--color-text-inverted);
            }
          }

          &:focus-visible {
            background: var(--color-fill-brand-primary);
            color: var(--color-text-inverted);
          }

          &[aria-current="page"] {
            background: var(--color-fill-brand-primary);
            color: var(--color-text-inverted);
          }
        }
      }
    }
  }

  & .instagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    background: var(--color-brand-primary-green);
    color: var(--color-text-inverted);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
  }
}

body[data-drawer-open="true"],
body[data-modal-open] {
  overflow: hidden;
}

.site-footer {
  position: relative;
  padding: var(--space-12) 0;
  padding-top: calc(var(--wave-h, 0px) + var(--space-12));
  --section-bg: var(--color-background-dark);
  color: var(--color-text-inverted);
  --wave-flip-x: -1;

  & .wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
  }

  /*
   * SP はサイトロゴの下に主催ロゴを 32px 空けて縦積み、PC は同じ行の左右端へ
   * 振り分ける (Figma 786:7979 / 786:8019)。 高さの違うロゴ同士なので PC でも
   * 中央揃えではなく上揃え。
   */
  & .brand-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);

    @media (min-width: 769px) {
      flex-direction: row;
      justify-content: space-between;
      align-items: flex-start;
      gap: var(--space-4);
    }
  }

  & .logo {
    display: inline-flex;
    align-items: center;
    --logo-width: 140px;

    @media (min-width: 769px) {
      --logo-width: 200px;
    }
  }

  /*
   * 主催 2 者のロゴ。 東京都 78x20 とアーツカウンシル東京 186x28 を 16px 空けて
   * 並べる (Figma 856:6925 / 856:6920)。 行幅は 280px あり、320px 級の幅では
   * .wrap の左右 16px とスクロールバーを引いた残りに収まらないため、wrap で
   * 縦積みへ逃がしておく。
   */
  & .organizer-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);

    & a {
      display: inline-flex;
      align-items: center;
      color: var(--color-text-inverted);
    }

    & .logo-tokyo svg {
      width: 78px;
      height: 20px;
    }

    & .logo-act svg {
      width: 186px;
      height: 28px;
    }
  }

  & .divider {
    border: 0;
    border-top: 1px solid var(--color-border-little-thin);
    width: 100%;
    margin: 0;
  }

  & .footer-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--space-8);

    & .main-list {
      display: contents;

      & li { margin: 0; }
      & a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        font-weight: var(--font-weight-bold);
        font-size: var(--font-size-body-small);
      }
      & a:hover { text-decoration: underline; }
    }

    & .instagram {
      display: inline-block;
      color: inherit;
    }
  }

  & .footer-utility {
    & .utility-list {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-3) var(--space-6);
      margin: 0;
      padding: 0;
      list-style: none;

      & li { margin: 0; }
      & a {
        display: inline-flex;
        align-items: center;
        gap: var(--space-1);
        font-size: var(--font-size-body-x-small);
        color: var(--color-text-inverted);
        opacity: 0.75;
      }
      & a:hover { opacity: 1; text-decoration: underline; }
      & a[target="_blank"]::after {
        content: "";
        display: inline-block;
        width: 12px;
        height: 12px;
        background-color: currentColor;
        mask-image: url('assets/images/icon-arrow-up-right.svg');
        mask-size: contain;
        mask-repeat: no-repeat;
        mask-position: center;
        -webkit-mask-image: url('assets/images/icon-arrow-up-right.svg');
        -webkit-mask-size: contain;
        -webkit-mask-repeat: no-repeat;
        -webkit-mask-position: center;
        flex-shrink: 0;
      }
    }
  }

  /*
   * 主催クレジットと著作権表記 (Figma 872:6858)。 幅によらず 8px 空けて縦積み。
   * 以前は PC で 32px 空けた横並びだったが、デザイン更新で常時 2 行になった。
   */
  & .legal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--font-size-text-10);
    line-height: 1.5;

    & p { margin: 0; }
  }

}

/*
 * .event-card — /events/ グリッド用の縦積みパネル (Figma panel 715:9192)。
 * サムネイル画像 (aspect 3:2, radius-default) → 開催ステータス + 募集ステータス
 * の chip ラベル 2 種 → 太字 2 行クランプの title → 開催期間の順で並ぶ。
 * カード自体は背景・枠線を持たず、リストの各アイテムがそのまま並ぶ。
 * ステータス chip は open (=左) が塗り、recruitment (=右) が outline のペア構成。
 */
.event-card {
  & .card-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    color: inherit;
    text-decoration: none;
  }

  & .thumb {
    position: relative;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-default);
    overflow: hidden;
    background: var(--color-background-default);

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
  }

  & .body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  & .labels {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: wrap;
  }

  /* 親 .body が align-items: flex-start のため width: 100% で幅を親に固定。 */
  & .title {
    width: 100%;
    margin: 0;
    font-family: var(--font-family-jp);
    font-size: var(--font-size-body-large);
    font-weight: var(--font-weight-bold);
    line-height: 1.5;
    color: var(--color-text-default);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  & .date {
    margin: 0;
    color: var(--color-text-default);
    font-size: var(--font-size-body-small);
    line-height: 1.5;
  }

  @media (hover: hover) {
    & .card-link:hover .title {
      color: var(--color-brand-primary-green);
    }
  }
}

/*
 * Event status chip — /events/ archive カード、home-events の featured/list カード、
 * および /events/[slug]/ single-event ページ heading のラベルで共通して使う
 * 開催・募集ステータスラベル。
 * 左側 (`.chip-open.{status}`) は塗り、右側 (`.chip-recruitment.{status}`) は
 * outline のペア構成。 塗り色:
 *   ongoing / upcoming / year-round = background-ultra-light (白) + default text
 *   ended                            = fill-dark             + inverted text
 * recruitment (accepting / closed) は共通で outline + default text。
 */
:is(.event-card, .event-card-featured, .event-card-list, section.single-event .heading) .chip {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: 99px;
  font-family: var(--font-family-jp);
  font-size: var(--font-size-text-12);
  font-weight: var(--font-weight-regular);
  line-height: 1.75;
  white-space: nowrap;
}

:is(.event-card, .event-card-featured, .event-card-list, section.single-event .heading) .chip-open.ongoing,
:is(.event-card, .event-card-featured, .event-card-list, section.single-event .heading) .chip-open.upcoming,
:is(.event-card, .event-card-featured, .event-card-list, section.single-event .heading) .chip-open.year-round {
  background: var(--color-background-ultra-light);
  color: var(--color-text-default);
}

:is(.event-card, .event-card-featured, .event-card-list, section.single-event .heading) .chip-open.ended {
  background: var(--color-fill-dark);
  color: var(--color-text-inverted);
}

:is(.event-card, .event-card-featured, .event-card-list, section.single-event .heading) .chip-recruitment {
  background: transparent;
  border-color: var(--color-border-default);
  color: var(--color-text-default);
}

/*
 * .single-event — /events/[slug]/ イベント詳細 (Figma 715:16640 / 715:16809)。
 * feature single と同じ流れで、EVENT eyebrow + Zen Maru H1 + chip + 日付 の
 * heading → the_content の entry-body → sensitivity ブロック の順で並ぶ。
 * body の背景は default gray のまま、related はその下の has-wave-top light
 * バンドで切り出す (event-related 側で担当)。 body_class 衝突を避けるため
 * `section.single-event` にスコープする。
 */
section.single-event {
  padding-top: var(--space-16);
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-16));

  /* 2 カラムの grid は共通 `.article-layout` (line ~706) で管理。 event は
   * デフォルト値 (3fr : 1fr / gap 40→64) をそのまま使う。 サイドの sticky は
   * event 固有の要件なので下部 @media 内で単独に定義する。 */

  & .entry {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    min-width: 0;
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  /*
   * eyebrow-row = EVENT eyebrow (● + ラベル) と 開催・募集ステータス chip を
   * 同じ行に並べる (Figma workspace 205:9605 / 194:6124)。 chip は eyebrow の
   * 右に inline で連続し、狭幅では折り返し。
   */
  & .heading .eyebrow-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-brand-primary-green);
  }

  & .heading .title {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-text-32);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    color: var(--color-text-default);
  }

  & .heading .labels {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: wrap;
  }

  & .heading .date {
    margin: 0;
    color: var(--color-text-default);
    font-size: var(--font-size-body-small);
    line-height: 1.5;
  }

  /*
   * .entry-body は Gutenberg 出力を受ける汎用シェル。 基本のタイポグラフィ
   * (font-size body-middle / line-height 2 / color default) は body から継承、
   * 縦リズムはトップレベルの owl ルール、見出し line-height はトップレベルの
   * `.entry-body :is(h1..h6) { line-height: 1.5 }` で共通化しているので、
   * ここでは特集独自の見出しサイズだけを与える。
   */
  & .entry-body h2 {
    font-size: var(--font-size-body-large);
    font-weight: var(--font-weight-bold);
  }

  & .entry-body h3 {
    font-size: var(--font-size-body-large);
    font-weight: var(--font-weight-bold);
  }

  & .entry-body img,
  & .entry-body figure img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-default);
  }

  @media (min-width: 769px) {
    & .heading .title { font-size: var(--font-size-heading-level-2); }
  }

  /* sticky は 2 カラム時のみ意味を持つ。 layout の breakpoint (`.article-layout`,
   * 1024px) と揃えないと 1 列縦積み帯でサイドが全幅のまま上部に張り付く。 */
  @media (min-width: 1024px) {
    & .event-sensitivity {
      position: sticky;
      top: var(--space-8);
    }
  }
}

/*
 * 感性ゲージの伸び幅。 幅と文字色の切替点を 1 つの変数で動かすため、補間可能な
 * 型として登録する。 未対応ブラウザでは補間されず中間で最終値に飛ぶだけで、
 * 最終的な見た目は変わらない。
 */
@property --fill-progress {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

@keyframes tcd-gauge-grow {
  from { --fill-progress: 0%; }
  to   { --fill-progress: var(--fill, 0%); }
}

/* 動きを減らす設定では即時表示にする (JS 側は animation が無ければ何もしない)。 */
@media (prefers-reduced-motion: reduce) {
  .event-sensitivity .weights .row {
    animation: none;
  }
}

/*
 * .event-sensitivity — /events/[slug]/ 右サイドのタームウェイトパネル
 * (Figma 715:17606 の右カラム)。 見出しなしの白ボディカード。 ボディには:
 *   - top ターム (weight 最大) の ACF illustration
 *   - # 付きの top ターム名 pill (グリーン fill)
 *   - top タームの WP 説明文 (WP タームの `description`)
 *   - このイベントに紐づく全タームの weight を percent 換算した水平バー一覧
 * デスクトップは 2 カラム grid の右列で `position: sticky` に貼り付く。
 * モバイルは記事本文の下に単列で並ぶ。
 */
.event-sensitivity {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-default);
  background: var(--color-background-ultra-light);
  overflow: hidden;

  & .panel-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-6);
  }

  & .illustration {
    margin: 0;

    & img {
      max-width: 180px;
      height: auto;
      display: block;
    }
  }

  /*
   * top-term = weight 最大のタームを大きめの outline pill で表示 (Figma 715:17658)。
   * <a> でタクソノミー archive にリンクさせ、hover で塗り反転。
   */
  & .top-term {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: var(--space-2) var(--space-6);
    border: 1px solid var(--color-border-default);
    border-radius: 99px;
    background: transparent;
    color: var(--color-text-default);
    font-family: var(--font-family-jp);
    font-size: var(--font-size-body-middle);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  @media (hover: hover) {
    & .top-term[href]:hover {
      background: var(--color-fill-dark);
      color: var(--color-text-inverted);
    }
  }

  & .description {
    margin: 0;
    font-size: var(--font-size-body-small);
    line-height: 1.7;
    color: var(--color-text-default);
  }

  /*
   * weights = 感性ごとの一覧 (Figma 715:17662)。 各行は角丸の pill 型リンクで、
   * 名前を左、パーセントを右に配置。 top (weight 最大) の行は緑塗り + 白文字、
   * それ以外は light gray 塗り + default 文字。 <a> なので該当タクソノミーへ遷移。
   */
  & .weights {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  & .weights li { margin: 0; }

  /*
   * 各 row は「ベース (background)」+「fill (proportional width)」+「content (text overlay)」
   * の 3 レイヤ構成。 fill は inline style の width で percent 分だけ左から塗る。
   * is-current は fill が brand-primary-green、それ以外は background-default gray。
   * content は position: relative で fill の上に重ねてテキストを表示。
   */
  & .weights .row {
    /*
     * 実際に描画に使う値。 既定は inline style の最終値そのままで、
     * アニメーションが走るときだけ 0% から補間される。
     */
    --fill-progress: var(--fill, 0%);

    /*
     * バーは 0 から最終幅まで伸ばし、上の行から順に遅らせる (--row-index は
     * テンプレートが行番号を入れる)。 backwards で遅延中も 0% を描くので、
     * 待っている行が満タンで一瞬見えることはない。
     *
     * 既定では読み込み時に再生される。 assets/js/sensitivity-gauge.js が
     * あるときだけ、パネルが画面に入るまで一時停止して頭出しする。
     */
    animation: tcd-gauge-grow 700ms cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
    animation-delay: calc(var(--row-index, 0) * 120ms);

    position: relative;
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-default);
    background: var(--color-background-light);
    color: var(--color-text-default);
    font-family: var(--font-family-jp);
    font-size: var(--font-size-body-small);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-decoration: none;
    overflow: hidden;
    transition: color 0.15s ease;
  }

  & .weights .row .fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--fill-progress, 0%);
    border-radius: inherit;
    background: var(--color-background-default);
    transition: background-color 0.15s ease;
  }

  /*
   * is-current は percent 分だけ緑塗り。 文字は左 var(--fill-progress) までを白、
   * それ以降を default 色に切り替えるため、.content を background-clip: text
   * にして水平方向の 2 色グラデーション (white → default) を text glyph に流す。
   * `--fill-progress` は .fill 幅と共通の変数で、緑バー端と文字色の切替点が一致する。
   * バーが伸びる間もこの 1 変数が両方を動かすので、塗りより先に白文字だけが
   * 現れて背景に沈む、という状態にならない。
   */
  & .weights .row.is-current .fill {
    background: var(--color-brand-primary-green);
  }

  & .weights .row.is-current .content {
    color: transparent;
    background-image: linear-gradient(
      to right,
      var(--color-text-inverted) 0,
      var(--color-text-inverted) var(--fill-progress, 0%),
      var(--color-text-default) var(--fill-progress, 0%),
      var(--color-text-default) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
  }

  & .weights .row .content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    z-index: 1;
  }

  & .weights .name {
    flex: 1;
    min-width: 0;
  }

  & .weights .percent {
    font-family: var(--font-family-en);
    flex-shrink: 0;
  }

  @media (hover: hover) {
    & .weights a.row:hover .name {
      text-decoration: underline;
      text-underline-offset: 3px;
    }
  }
}

/*
 * .event-related — /events/[slug]/ 下部の「おすすめのイベント」波セクション
 * (Figma 715:16669)。 feature-related と同じく main (default) → light gray
 * の波トランジションで独立バンドを作り、内側に h2 + 4 パネルグリッド +
 * 「すべてのイベント」pill を並べる。 マーキーはグローバル marquee-section
 * が続くので、この section 内では扱わない。
 */
.event-related.has-wave-top {
  --section-bg: var(--color-background-light);
  --wave-flip-x: 1;
  padding-top: calc(var(--wave-h, 0px) + var(--space-14));
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-4));
  display: flex;
  flex-direction: column;

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-10);
    margin-bottom: var(--space-14);
  }

  & .heading {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-text-24);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

  & .list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  & .list li { margin: 0; }

  & .more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-background-ultra-light);
    color: var(--color-text-default);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  @media (hover: hover) {
    & .more:hover {
      background: transparent;
      border-color: var(--color-brand-primary-green);
      color: var(--color-brand-primary-green);
    }
  }

  @media (min-width: 769px) {
    & .list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    & .heading { font-size: var(--font-size-heading-level-3); }
  }
}

/*
 * .pagination — アーカイブ共通のページ切替 (Figma 704:9312 / 535:25096 / 704:9718)。
 * カレント ± 2 の最大 5 件を白いピル型コンテナに並べ、前後ページがあれば
 * 左右に丸ボタンで矢印を出す。hover / current で dark 反転。
 * template-parts/archive/pagination.php が生成する DOM:
 *   <nav.pagination>
 *     <span.edge.edge-prev>
 *       <a.prev.page-numbers><span.icon>svg</span><span.sr-only/></a>
 *     </span>
 *     <ol.pages>
 *       <li><a.page-numbers>1</a></li>
 *       <li><span.page-numbers.current>2</span></li>
 *       …
 *     </ol>
 *     <span.edge.edge-next>…</span>
 *   </nav>
 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);

  & .edge .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-full);
    background: var(--color-background-ultra-light);
    color: var(--color-text-default);
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  & .edge .icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
  }

  & .edge .icon svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  & .pages {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin: 0;
    padding: var(--space-1);
    border-radius: var(--radius-full);
    background: var(--color-background-ultra-light);
    list-style: none;
  }

  & .pages li { margin: 0; }

  & .pages .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-text-default);
    font-family: var(--font-family-jp);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  & .pages .current {
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
  }

  & .pages .dots {
    background: transparent;
    min-width: 24px;
    padding: 0;
  }

  @media (hover: hover) {
    & .edge a.page-numbers:hover {
      background: var(--color-fill-brand-primary);
      color: var(--color-text-inverted);
    }

    & .pages a.page-numbers:hover {
      background: var(--color-fill-brand-primary);
      color: var(--color-text-inverted);
    }
  }
}

.event-archive {
  padding-top: var(--space-8);
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-16));

  & .list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin: 0 0 var(--space-12);

    & li {
      margin: 0;
    }
  }

  & .empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-16) var(--space-4);
    text-align: center;

    & .message {
      font-size: var(--font-size-body-middle);
    }

    & .reset {
      display: inline-flex;
      align-items: center;
      min-height: 44px;
      padding: 0 var(--space-6);
      border-radius: var(--radius-full);
      background: var(--color-fill-dark);
      color: var(--color-text-inverted);
      font-weight: var(--font-weight-bold);
    }
  }

  @media (min-width: 769px) {
    & .list {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--space-8);
    }
  }
}

/*
 * .event-archive-head — /events/ トップの見出しブロック (Figma 715:18272)。
 * 中央寄せの eyebrow (EVENT 緑ドット) + Zen Maru H1、続いて `.filters-group`
 * (「条件からさがす」+ 「今週末のイベント」+ 「募集中のイベント」の 3 pill)。
 * 適用中のフィルタは `.active-filters` として下段に chip 一覧で表示。
 * .home-events の filters-group と同じ意匠を持たせるため、同型の pill・
 * filters-group スタイルをこのスコープ内でも定義している。
 */
.event-archive-head {
  padding-top: var(--space-12);
  padding-bottom: var(--space-8);

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-8);
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-brand-primary-green);
  }

  & h1 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-text-32);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

  /*
   * .phase-tabs — 「開催中・開催前 / 開催終了」のセグメンテッドタブ。
   * カレントタブは下線 (ブランドグリーン) で強調、非カレントは muted 色。
   * リンクなので Tab / エンターで直接ページ遷移する (`?phase=live|ended`)。
   */
  & .phase-tabs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
  }

  & .phase-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted, #a5a5a2);
    font-family: var(--font-family-jp);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
  }

  & .phase-tab.is-current {
    color: var(--color-text-default);
    border-bottom-color: var(--color-brand-primary-green);
  }

  @media (hover: hover) {
    & .phase-tab:not(.is-current):hover {
      color: var(--color-text-default);
    }
  }

  & .filters-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    width: 100%;
    max-width: 1280px;
    padding: var(--space-6);
    border-radius: var(--radius-default);
    background: var(--color-fill-base);
  }

  & .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-fill-light);
    color: var(--color-text-default);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  & .pill .icon {
    display: inline-flex;
    align-items: center;
    width: 16px;
    height: 16px;
  }

  & .pill .icon svg { width: 100%; height: 100%; display: block; }

  & .pill-fill {
    background: var(--color-fill-brand-primary);
    border-color: var(--color-fill-brand-primary);
    color: var(--color-text-inverted);
  }

  & .pill-fill .icon { width: 20px; height: 20px; }

  @media (hover: hover) {
    & .pill:not(.pill-fill):hover {
      background: transparent;
      border-color: var(--color-brand-primary-green);
      color: var(--color-brand-primary-green);
    }

    & .pill-fill:hover {
      background: var(--color-text-default);
      border-color: var(--color-text-default);
    }
  }

  & .active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-4);

    & ul {
      display: contents;
    }

    & li {
      margin: 0;
    }

    & .chip {
      display: inline-flex;
      align-items: center;
      gap: var(--space-2);
      min-height: 36px;
      padding: 0 var(--space-3);
      border-radius: var(--radius-full);
      background: var(--color-background-ultra-light);
      font-size: var(--font-size-body-small);
    }

    & .x {
      font-size: var(--font-size-body-middle);
      line-height: 1;
    }

    & .reset-all {
      font-size: var(--font-size-body-small);
      text-decoration: underline;
      text-underline-offset: 4px;
    }
  }

  @media (min-width: 769px) {
    & h1 { font-size: var(--font-size-heading-level-2); }

    & .filters-group {
      flex-direction: row;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
    }

    & .filters-group > .pill {
      flex: 1 1 0;
      min-width: 200px;
    }
  }
}

/*
 * .filter-modal = 条件からさがす モーダル (Figma 538:20221 / 538:19120 準拠)
 * デスクトップは 左サイドドロワー (max-w 420px)、モバイルはフルスクリーン。
 * セクションごとに下線でセパレート、チップは outline (default) / dark fill (checked)。
 */
.filter-modal {
  position: fixed;
  inset: 20px 0;
  width: calc(100% - 40px);
  max-width: 640px;
  height: auto;
  max-height: calc(100dvh - 40px);
  margin: 0 auto;
  padding: 0;
  border: none;
  border-radius: var(--radius-default);
  background: var(--color-fill-light);
  color: var(--color-text-default);
  overflow: hidden;

  &::backdrop {
    background: rgba(54, 54, 54, 0.5);
  }

  & form {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
  }

  /* --- Header --- */
  & .head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-fill-base-dark);
    background: var(--color-fill-light);

    & h2 {
      margin: 0;
      font-family: var(--font-family-jp-title);
      font-size: var(--font-size-body-middle);
      font-weight: var(--font-weight-bold);
      line-height: 1.5;
    }
  }

  & .close {
    position: absolute;
    top: 50%;
    right: var(--space-4);
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
    transition: background-color 0.15s ease;
  }

  @media (hover: hover) {
    & .close:hover {
      background: var(--color-fill-brand-primary);
    }
  }

  /* --- Section groups --- */
  & .group {
    margin: var(--space-6) 0 0;
    padding: var(--space-6);
    border: none;
    border-bottom: 1px solid var(--color-fill-base-dark);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);

    & legend {
      padding: 0;
      margin-bottom: 0;
      font-weight: var(--font-weight-bold);
      font-size: var(--font-size-body-middle);
      line-height: 1;
    }
  }

  & .group:not(.group-date) {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
  }

  & .group:not(.group-date) legend {
    width: 100%;
  }

  /* --- Date section --- */
  & .presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);

    & button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 32px;
      padding: 0 var(--space-3);
      border: 1px solid var(--color-fill-dark);
      border-radius: var(--radius-full);
      background: var(--color-fill-light);
      color: var(--color-text-default);
      font-size: var(--font-size-body-small);
      font-weight: var(--font-weight-bold);
      white-space: nowrap;
      cursor: pointer;
      transition: background-color 0.15s ease, color 0.15s ease;
    }

    & button:focus-visible,
    & button.is-active {
      background: var(--color-fill-dark);
      color: var(--color-text-inverted);
    }

    @media (hover: hover) {
      & button:hover {
        background: var(--color-fill-dark);
        color: var(--color-text-inverted);
      }
    }
  }

  & .group-date input[type="text"] {
    width: 100%;
    min-height: 44px;
    padding: 0 var(--space-3);
    border: 1px solid var(--color-fill-base-dark);
    border-radius: var(--radius-small);
    background: var(--color-fill-light);
    font: inherit;
    font-size: var(--font-size-body-small);
  }

  & .clear-date {
    align-self: center;
    padding: 0;
    background: transparent;
    color: var(--color-text-default);
    font-size: var(--font-size-body-small);
    text-decoration: underline;
    cursor: pointer;
  }

  /* --- Chips (checkbox pills) --- */
  & .chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;

    & input[type="checkbox"] {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    & > span {
      display: inline-flex;
      align-items: center;
      min-height: 32px;
      padding: 0 var(--space-3);
      border: 1px solid var(--color-fill-dark);
      border-radius: var(--radius-full);
      background: var(--color-fill-light);
      color: var(--color-text-default);
      font-size: var(--font-size-body-small);
      line-height: 1.3;
      white-space: nowrap;
      transition: background-color 0.15s ease, color 0.15s ease;
    }

    & input[type="checkbox"]:checked + span {
      background: var(--color-fill-dark);
      color: var(--color-text-inverted);
    }

    &:focus-within > span {
      outline: 2px solid var(--color-brand-primary-blue);
      outline-offset: 2px;
    }

    @media (hover: hover) {
      &:hover > span {
        background: var(--color-fill-dark);
        color: var(--color-text-inverted);
      }
    }
  }

  /* --- Sensitivity chips (# prefix keeps its brand color) --- */
  & .group-sensitivity .chip > span > span[aria-hidden="true"] {
    margin-right: 2px;
  }

  & .group-sensitivity .chip:nth-child(8n+1) > span > span[aria-hidden="true"] { color: #f8c3e0; }
  & .group-sensitivity .chip:nth-child(8n+2) > span > span[aria-hidden="true"] { color: #008714; }
  & .group-sensitivity .chip:nth-child(8n+3) > span > span[aria-hidden="true"] { color: #f48a49; }
  & .group-sensitivity .chip:nth-child(8n+4) > span > span[aria-hidden="true"] { color: #00a0f0; }
  & .group-sensitivity .chip:nth-child(8n+5) > span > span[aria-hidden="true"] { color: #ffd200; }
  & .group-sensitivity .chip:nth-child(8n+6) > span > span[aria-hidden="true"] { color: #ef6657; }
  & .group-sensitivity .chip:nth-child(8n+7) > span > span[aria-hidden="true"] { color: #59dad1; }
  & .group-sensitivity .chip:nth-child(8n) > span > span[aria-hidden="true"] { color: #af62aa; }

  /* --- Footer buttons (sticky bottom) --- */
  & .buttons {
    display: flex;
    gap: var(--space-3);
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-fill-base-dark);
    background: var(--color-fill-light);
    margin-top: auto;

    & button {
      flex: 1;
      min-height: 56px;
      padding: 0 var(--space-6);
      border: 1px solid transparent;
      border-radius: var(--radius-full);
      font-family: inherit;
      font-weight: var(--font-weight-bold);
      font-size: var(--font-size-body-middle);
      line-height: 1.3;
      cursor: pointer;
      transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }

    & .cancel {
      background: var(--color-fill-light);
      color: var(--color-text-default);
      border-color: transparent;
    }

    & .submit {
      background: var(--color-fill-brand-primary);
      color: var(--color-text-inverted);
    }

    @media (hover: hover) {
      & .cancel:hover {
        background: transparent;
        border-color: var(--color-brand-primary-green);
        color: var(--color-brand-primary-green);
      }

      & .submit:hover {
        background: var(--color-text-default);
      }
    }
  }

  @media (max-width: 768px) {
    inset: 12px;
    width: calc(100% - 24px);
    max-width: none;
    max-height: calc(100dvh - 24px);

    & form { max-height: calc(100dvh - 24px); }
  }
}

/* Flatpickr overrides */
.flatpickr-calendar {
  font-family: var(--font-family-jp);
}

.flatpickr-day.today {
  border-color: var(--color-brand-primary-green);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected.endRange,
.flatpickr-day.startRange.endRange {
  background: var(--color-brand-primary-green);
  border-color: var(--color-brand-primary-green);
}

.flatpickr-day.inRange {
  background: rgba(0, 135, 20, 0.15);
  border-color: rgba(0, 135, 20, 0.15);
  box-shadow: none;
}

.home-cover {
  position: relative;
  overflow: hidden;
  background: #f2f2f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  & .canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  & .lede {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: var(--space-8);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    align-items: center;
  }

  /*
   * カバー下端に載せるマーキー (波コンテナなし、素のティッカー)
   * bottom 値は Figma 準拠: mobile 56px / desktop 96px
   * これで後続セクションの波 (wave-h 20/80px) より上に位置し重ならない
   */
  & > .marquee {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    z-index: 2;
    pointer-events: auto;

    /*
     * blob アニメーションの上に載るので白抜き。 `#` の 8 色巡回と文字サイズは
     * .marquee の既定 (SP 20px / PC 24px) のまま。
     */
    color: var(--color-text-inverted);

    /*
     * blob が飛び込んでくるまでカバーは紙地のままで、白抜きの文字が背景に溶ける。
     * そのため既定は伏せておき、cover-animation.js が blob の着地を検知して
     * .is-entered を付けたところでフェードインさせる。
     *
     * 伏せる側を JS ではなくここ (レンダーブロックする CSS) に置いているのは、
     * p5 が CDN 越しで到着が遅れるため。 JS で伏せると最初のペイントから p5 到着
     * までの間だけ文字が出てしまい、リロード時に一瞬見える。
     *
     * スクリプト無効時は cover.php の <noscript> がこの指定を打ち消す。
     *
     * visibility も併せて畳んでいるのは、伏せている数秒の間にタブ移動やタップで
     * 見えないタグリンクへ到達できてしまうため。 visibility は即時に切り替わるので
     * opacity のフェードはそのまま効く。
     */
    opacity: 0;
    visibility: hidden;

    &.is-entered {
      opacity: 1;
      visibility: visible;
      transition: opacity 0.6s ease;
    }
  }

  @media (min-width: 769px) {
    & > .marquee {
      bottom: 80px;
    }
  }

  & .lede h1 {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: var(--font-family-jp-title);
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
  }

  & .lede h1 .row {
    display: contents;
  }

  & .lede h1 .line {
    display: block;
    padding: 0 var(--space-4) var(--space-0-5);
    background: var(--color-fill-light);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-default);
    color: var(--color-text-default);
    font-size: var(--font-size-text-40);
    white-space: nowrap;
  }

  & .lede h1 .line + .line,
  & .lede h1 .row + .row > .line {
    margin-top: -1px;
  }

  @media (min-width: 769px) {
    & .lede h1 .row {
      display: block;
      padding: 0 var(--space-4) var(--space-0-5);
      background: var(--color-fill-light);
      border: 1px solid var(--color-border-default);
      border-radius: var(--radius-default);
      font-size: var(--font-size-text-64);
      white-space: nowrap;
    }

    & .lede h1 .line {
      display: inline;
      padding: 0;
      background: transparent;
      border: none;
      border-radius: 0;
      font-size: inherit;
    }

    & .lede h1 .row + .row {
      margin-top: -1px;
    }
  }

  & .lede .cta {
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
    transition: background-color 0.15s ease;
  }

  & .lede .cta:hover {
    background: var(--color-brand-primary-green);
  }

}

/*
 * .marquee = 純粋な感性タグティッカー (アニメーションとタグ配色のみ)。
 * 波形ディバイダーや背景色は呼び出し側 (.marquee-section 等) で管理する。
 */
.marquee {
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
  padding: var(--space-4) 0;
  color: var(--color-text-default);
  font-size: var(--font-size-text-20);

  & .track {
    position: relative;
    z-index: 2;
  }

  & .track {
    display: flex;
    gap: var(--space-6);
    width: max-content;
    animation: tcd-marquee 120s linear infinite;
  }

  & ul {
    display: flex;
    gap: var(--space-6);
    margin: 0;
    padding: 0;
    list-style: none;
    flex-shrink: 0;
  }

  & li { margin: 0; }

  & li a {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: inherit;
    white-space: nowrap;
    line-height: 1.5;
  }

  & li a > span[aria-hidden="true"] {
    color: var(--color-text-light);
  }

  & ul li:nth-child(8n+1) a > span[aria-hidden="true"] { color: #f8c3e0; }
  & ul li:nth-child(8n+2) a > span[aria-hidden="true"] { color: #008714; }
  & ul li:nth-child(8n+3) a > span[aria-hidden="true"] { color: #f48a49; }
  & ul li:nth-child(8n+4) a > span[aria-hidden="true"] { color: #00a0f0; }
  & ul li:nth-child(8n+5) a > span[aria-hidden="true"] { color: #ffd200; }
  & ul li:nth-child(8n+6) a > span[aria-hidden="true"] { color: #ef6657; }
  & ul li:nth-child(8n+7) a > span[aria-hidden="true"] { color: #59dad1; }
  & ul li:nth-child(8n) a > span[aria-hidden="true"] { color: #af62aa; }

  &:hover .track { animation-play-state: paused; }

  @media (min-width: 769px) {
    padding: var(--space-6) 0;
    font-size: var(--font-size-text-24);

    & .track,
    & ul {
      gap: var(--space-8);
    }
  }
}

/*
 * .marquee-section = マーキーを波形ディバイダー付きセクションとして配置する時のラッパー。
 * (footer.php で site-footer の直前に置くなど)。
 */
.marquee-section {
  --section-bg: var(--color-background-ultra-light);
  --wave-flip-x: 1;
  padding: calc(var(--wave-h) + var(--space-6)) 0;
  @media (min-width: 769px) {
    padding: calc(var(--wave-h) + var(--space-12)) 0;
  }
}

@keyframes tcd-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.home-events {
  padding-top: calc(var(--wave-h, 0px) + var(--space-14));
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));
  --section-bg: var(--color-background-default);
  --wave-flip-x: 1;

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-20);
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--eyebrow-dot, var(--color-brand-primary-green));
  }

  & .heading h2 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-heading-level-2);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

  /* Filters group — beige rounded panel wrapping the search + link buttons */
  & .filters-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    width: 100%;
    max-width: 1280px;
    padding: var(--space-6);
    border-radius: var(--radius-default);
    background: var(--color-fill-base);
  }

  & .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-fill-light);
    color: var(--color-text-default);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  & .pill .icon {
    display: inline-flex;
    align-items: center;
    width: 16px;
    height: 16px;
  }

  & .pill .icon svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  & .pill-fill {
    background: var(--color-fill-brand-primary);
    border-color: var(--color-fill-brand-primary);
    color: var(--color-text-inverted);
  }

  & .pill-fill .icon { width: 20px; height: 20px; }

  @media (hover: hover) {
    & .pill:not(.pill-fill):hover {
      background: transparent;
      border-color: var(--color-brand-primary-green);
      color: var(--color-brand-primary-green);
    }

    & .pill-fill:hover {
      background: var(--color-text-default);
      border-color: var(--color-text-default);
    }
  }

  /* Layout — asymmetric 2-column on desktop, single column on mobile */
  & .layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    width: 100%;
    max-width: 1280px;
  }

  & .list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--color-fill-dark);
    border-radius: var(--radius-default);
    overflow: hidden;
  }

  & .list li {
    margin: 0;
    border-bottom: 1px solid var(--color-fill-dark);
  }

  & .list li:last-child { border-bottom: none; }

  /* "すべてのイベント" — link-button default variant per Figma component 715:9203 */
  & .more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    max-width: 400px;
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-fill-light);
    color: var(--color-text-default);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  @media (hover: hover) {
    & .more:hover {
      background: transparent;
      border-color: var(--color-brand-primary-green);
      color: var(--color-brand-primary-green);
    }
  }

  @media (min-width: 769px) {
    padding-top: calc(var(--wave-h, 0px) + var(--space-14));
    padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));

    & .filters-group {
      flex-direction: row;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
    }

    & .filters-group > .pill {
      flex: 1 1 0;
      min-width: 200px;
    }

    & .layout {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: var(--space-16);
      align-items: start;
    }

    & .featured {
      position: sticky;
      top: var(--space-6);
    }
  }
}

/*
 * .event-card-featured = Panel component (large featured card)
 * 画像 + ラベル + タイトル + 日付を縦に並べる。カード bg なし、画像のみ radius
 */
.event-card-featured {
  & .card-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    color: inherit;
    text-decoration: none;
  }

  & .figure {
    aspect-ratio: 608 / 405;
    border-radius: var(--radius-default);
    overflow: hidden;
    background: var(--color-background-default);

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
  }

  & .body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  & .labels {
    display: flex;
    gap: var(--space-1);
    flex-wrap: wrap;
  }

  & .title {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-heading-level-3, 32px);
    font-weight: var(--font-weight-bold);
    line-height: 1.5;
    color: var(--color-text-default);
    transition: color 0.15s ease;
  }

  & .date {
    margin: 0;
    font-size: var(--font-size-body-small);
    line-height: 1.5;
    color: var(--color-text-default);
  }

  @media (hover: hover) {
    & .card-link:hover .title {
      color: var(--color-brand-primary-green);
    }
  }

  @media (max-width: 768px) {
    & .title { font-size: var(--font-size-body-large); }
  }
}

/*
 * .event-card-list = 横並びリストカード (Figma panel-horizontal component)
 * 親 .list コンテナが border と radius を持つのでカード側は透明。
 * サムネ 160px (aspect 3:2) + 情報右、ホバー時にタイトル緑
 */
.event-card-list {
  & .card-link {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--space-6);
    padding: var(--space-6);
    color: inherit;
    text-decoration: none;
    align-items: start;
  }

  & .thumb {
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-small);
    overflow: hidden;
    background: var(--color-background-default);

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
  }

  & .body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
  }

  & .labels {
    display: flex;
    gap: var(--space-1);
    flex-wrap: wrap;
  }

  & .title {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-body-middle);
    font-weight: var(--font-weight-bold);
    line-height: 1.5;
    color: var(--color-text-default);
    transition: color 0.15s ease;
  }

  & .date {
    margin: 0;
    font-size: var(--font-size-body-small);
    line-height: 1.5;
    color: var(--color-text-default);
  }

  @media (hover: hover) {
    & .card-link:hover .title {
      color: var(--color-brand-primary-green);
    }
  }

  @media (max-width: 768px) {
    & .card-link {
      grid-template-columns: 100px 1fr;
      gap: var(--space-4);
      padding: var(--space-4);
    }
  }
}

/*
 * .feature-card = Figma feature-slide (605x400 image + gradient overlay + tag + title)
 */
.feature-card {
  position: relative;
  border-radius: var(--radius-default);
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--color-background-default);

  & .card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
  }

  & .thumb {
    position: relative;
    width: 100%;
    height: 100%;

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
  }

  & .overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-6);
    /*
     * オーバーレイはタイトルとシリーズチップを読ませるためのもので、写真全体を
     * 暗くするためのものではない。 テキストは下から約 34% を占めるので、そこを
     * 覆いきったうえで 62% までに完全に抜く。 単純な 2 点グラデーションだと
     * 境目が帯に見えるため、5 段でイージング風に落としている。
     */
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.65) 0%,
      rgba(0, 0, 0, 0.6) 20%,
      rgba(0, 0, 0, 0.4) 35%,
      rgba(0, 0, 0, 0.15) 50%,
      rgba(0, 0, 0, 0) 62%
    );
    color: var(--color-text-inverted);
  }

  & .series {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-3);
    border: 1px solid var(--color-fill-light);
    border-radius: 99px;
    background: transparent;
    color: var(--color-text-inverted);
    font-size: var(--font-size-text-12);
    line-height: 1.75;
  }

  /* 親 .overlay が align-items: flex-start のため width: 100% で幅を親に固定。 */
  & .title {
    width: 100%;
    margin: 0;
    font-size: var(--font-size-body-large);
    line-height: 1.5;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-inverted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
}

/*
 * Mobile 1:1 aspect override applies only inside the home features carousel,
 * where each slot is a viewport-wide square. Other usages (feature archive,
 * related cards on single-feature) keep the default 3:2 ratio.
 */
@media (max-width: 768px) {
  .feature-carousel .feature-card {
    aspect-ratio: 1 / 1;

    & .overlay {
      gap: var(--space-4);
      padding: var(--space-4);
    }

    & .title { font-size: 20px; }
  }
}

.home-features {
  padding-top: calc(var(--wave-h, 0px) + var(--space-14));
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));
  --section-bg: var(--color-background-light);
  --wave-flip-x: -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16);

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--eyebrow-dot, var(--color-brand-primary-green));
  }

  & .heading h2 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-heading-level-2);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

  /* "すべての特集" — link-button default variant */
  & .more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    max-width: 400px;
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-fill-light);
    color: var(--color-text-default);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  @media (hover: hover) {
    & .more:hover {
      background: transparent;
      border-color: var(--color-brand-primary-green);
      color: var(--color-brand-primary-green);
    }
  }
}

/*
 * .feature-carousel = center-focused carousel (Figma 705:10734).
 * Track uses transform-translate driven by JS. Center card is highlighted;
 * neighbors peek from left/right, clipped by .home-features .wrap width.
 * EDITORS PICK badge is fixed on the center card position (not per-slide).
 * Small autoplay-toggle inverts colors on hover per annotation.
 */
.feature-carousel {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);

  & .viewport {
    position: relative;
    width: 100%;
    /* Clip horizontally but let EDITORS PICK badge and card shadows overflow vertically */
    overflow-x: clip;
    overflow-y: visible;
  }

  & .track {
    display: flex;
    align-items: stretch;
    gap: var(--space-6);
    list-style: none;
    margin: 0;
    padding: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }

  & .track.no-transition {
    transition: none !important;
  }

  & .slide {
    flex: 0 0 min(600px, calc(100vw - var(--space-8)));
    margin: 0;
  }

  & .slide-prev,
  & .slide-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
    cursor: pointer;
    transition: background-color 0.15s ease;
  }

  & .slide-prev { left: calc(50% - 312px); }
  & .slide-next { left: calc(50% + 312px); transform: translate(-100%, -50%); }

  @media (hover: hover) {
    & .slide-prev:hover,
    & .slide-next:hover { background: var(--color-fill-brand-primary); }
  }

  & .slide-prev .icon,
  & .slide-next .icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
  }

  & .editors-pick {
    position: absolute;
    top: -16px;
    left: calc(50% - 300px - 16px);
    z-index: 3;
    width: 88px;
    height: 88px;
    pointer-events: none;

    & .shape {
      position: absolute;
      inset: 0;
      display: block;
      animation: tcd-editors-pick-rotate 12s linear infinite;
    }

    & .shape svg { width: 100%; height: 100%; display: block; }

    & .label {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: var(--font-family-en);
      font-weight: var(--font-weight-bold);
      font-size: var(--font-size-text-14);
      line-height: 1.2;
      color: var(--color-text-default);
      text-align: center;
    }
  }

  & .controller {
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }

  & .dots {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;

    & li { margin: 0; }

    & button {
      display: block;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      border: 1px solid var(--color-fill-dark);
      background: transparent;
      cursor: pointer;
      padding: 0;
      transition: background-color 0.15s ease;
    }

    & button.is-current,
    & button[aria-selected="true"] {
      background: var(--color-fill-dark);
    }
  }

  & .autoplay-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease;

    & .icon-pause { display: inline-flex; }
    & .icon-play { display: none; }
  }

  &.is-paused .autoplay-toggle {
    & .icon-pause { display: none; }
    & .icon-play { display: inline-flex; }
  }

  @media (hover: hover) {
    & .autoplay-toggle:hover {
      background: var(--color-fill-light);
      color: var(--color-text-default);
    }
  }

  @media (max-width: 768px) {
    gap: var(--space-4);

    & .slide-prev,
    & .slide-next { display: none; }

    & .autoplay-toggle { display: none; }

    /*
     * 左右のスライドを部分的に見せてスワイプ可能性をアフォードする。
     * viewport の両側に約 48px の余白を残し、うち 12px は隣スライドとの gap、
     * 残り 36px 前後が隣スライドの覗き幅になる。
     */
    & .track {
      gap: var(--space-3);
    }

    & .slide {
      flex: 0 0 calc(100vw - var(--space-24));
    }

    /* EDITORS PICK badge anchored at top-left of the centered card.
     * The centered card starts at `50% - cardWidth/2`. Badge overhangs -8px
     * outside per Figma mobile spec (vs -16px on desktop). */
    & .editors-pick {
      top: -8px;
      left: calc(50% - (100vw - var(--space-24)) / 2 - 8px);
    }
  }
}

@keyframes tcd-editors-pick-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.site-special-popup {
  position: fixed;
  /* クッキー告知 (.site-cookie-notice) と同じ 24px の余白で下辺を揃える。 */
  right: var(--space-6);
  bottom: var(--space-6);
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-background-light);
  border-radius: var(--radius-default);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 360px;

  /* display: flex がブラウザ既定の [hidden] { display: none } を打ち消すので、
     hidden 属性のときに明示的に隠す。 */
  &[hidden] { display: none; }

  & .link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: inherit;
    text-decoration: none;
  }

  & .thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-small);
    flex-shrink: 0;
  }

  & .body {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }

  & .title {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-small);
    line-height: 1.3;
  }

  & .cta-arrow {
    display: inline-block;
    color: var(--color-brand-primary-green);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-x-small);
  }

  /*
   * 矢印はテキスト直後に流す (.cta/.pill/.more と同じ inline + WORD JOINER
   * 方式)。バナーの文字が --font-size-body-x-small と小さいので、他の 16px では
   * なく 12px 角にする。
   */
  & .cta-arrow::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: var(--space-1);
    vertical-align: -0.1em;
    background-color: currentColor;
    mask: url('assets/images/icon-arrow-right.svg') no-repeat center / contain;
    -webkit-mask: url('assets/images/icon-arrow-right.svg') no-repeat center / contain;
  }

  & .link.is-external .cta-arrow::after {
    mask-image: url('assets/images/icon-arrow-up-right.svg');
    -webkit-mask-image: url('assets/images/icon-arrow-up-right.svg');
  }

  & .close {
    position: absolute;
    top: calc(-1 * var(--space-2));
    right: calc(-1 * var(--space-2));
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--color-background-light);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/*
 * クッキー利用の告知 (Figma cookie-policy 879:6765)。 左下固定の非モーダル。
 * 背景を覆わないのは Figma と、文言の出典であるアーツカウンシル東京の実装に
 * 合わせたもの。 初期状態は hidden で、未同意と判定した
 * assets/js/cookie-notice.js だけが外す。
 */
.site-cookie-notice {
  position: fixed;
  /* SP は画面下部の中央寄せ。 PC は Figma どおり左下 (下の min-width: 769px)。
     SP で左下に寄せると、右にある特設バナーとの間に半端な隙間が空く。 */
  left: 50%;
  transform: translateX(-50%);
  bottom: var(--space-6);
  /* 特設バナー (.site-special-popup, z-index: 1000) の上に重ねる。 */
  z-index: 1001;
  display: flex;
  flex-direction: column;
  /* 本文は幅いっぱい、ボタンは中央 (Figma の items-center)。 */
  align-items: center;
  gap: var(--space-4);
  /* 上限 400px (Figma)。 画面が狭いときは左右 24px ずつ空ける。 */
  width: min(400px, calc(100vw - var(--space-6) * 2));
  padding: var(--space-4);
  border-radius: var(--radius-default);
  background: var(--color-background-dark);
  color: var(--color-text-inverted);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);

  @media (min-width: 769px) {
    left: var(--space-6);
    transform: none;
    /* 左下に据えるので、ボタンも中央ではなく左端に揃える。 SP は中央寄せの
       パネルなので align-items: center のまま。 */
    align-items: flex-start;
  }

  /* display: flex がブラウザ既定の [hidden] { display: none } を打ち消すので、
     hidden 属性のときに明示的に隠す (.site-special-popup と同じ事情)。 */
  &[hidden] {
    display: none;
  }

  & .text {
    width: 100%;
    font-size: var(--font-size-text-14);
    line-height: 1.75;
  }

  /*
   * Figma の button (880:6767) は角丸 8px の白枠。 .cta は --radius-full の
   * 塗りつぶしピルで形が違うため流用しない。
   */
  & .agree {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-border-inverted);
    border-radius: var(--radius-small);
    color: var(--color-text-inverted);
    font-family: var(--font-family-jp);
    font-size: var(--font-size-text-14);
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;

    @media (hover: hover) {
      &:hover {
        background: var(--color-background-ultra-light);
        color: var(--color-text-default);
      }
    }
  }
}

/*
 * .home-news = Figma "Frame 178" (705:10888) — a rounded darker card that sits
 * inside the features wave. Section background matches features (light) so the
 * card visually floats within the shared wave surface.
 */
.home-news {
  padding: 0 0 calc(var(--wave-h, 0px) + var(--space-14));
  --section-bg: var(--color-background-light);
  background: var(--color-background-light);

  /* Figma 705:10888 は 1440 フレーム内で x=200 / w=1040 (= --max-width-default)。 */
  & > .wrap {
    --wrap-content: var(--max-width-default);
  }

  & .card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-10);
    max-width: 1040px;
    margin: 0 auto;
    padding: var(--space-16) var(--space-6);
    border-radius: var(--radius-large);
    background: var(--color-background-default);

    @media (min-width: 769px) {
      gap: var(--space-16);
      padding: var(--space-20);
    }
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--eyebrow-dot, var(--color-brand-primary-green));
  }

  & .heading h2 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-heading-level-2);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

  & .list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
    border-top: 1px solid var(--color-fill-dark);
  }

  & .list li {
    margin: 0;
    border-bottom: 1px solid var(--color-fill-dark);
  }

  & .item {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-6) 0;
    color: var(--color-text-default);
    text-decoration: none;
    transition: color 0.15s ease;

    @media (min-width: 769px) {
      gap: var(--space-10);
    }
  }

  & .summary {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    line-height: 1.5;
  }

  & .title {
    margin: 0;
    font-family: var(--font-family-jp);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  & .date {
    margin: 0;
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-body-small);
  }

  & .figure {
    flex-shrink: 0;
    width: 96px;
    aspect-ratio: 160 / 107;
    border-radius: var(--radius-small);
    overflow: hidden;
    background: var(--color-background-light);

    @media (min-width: 769px) {
      width: 160px;
    }

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
  }

  @media (hover: hover) {
    & .item:hover .title {
      color: var(--color-brand-primary-green);
    }
  }

  & .more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    max-width: 400px;
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-fill-light);
    color: var(--color-text-default);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  @media (hover: hover) {
    & .more:hover {
      background: transparent;
      border-color: var(--color-brand-primary-green);
      color: var(--color-brand-primary-green);
    }
  }
}

/*
 * .home-special = Figma 705:8206 特設バナー
 * Yellow bg full-bleed, 2 column layout (text left, hero image right).
 * Content stacks vertically on mobile.
 */
.home-special {
  --section-bg: var(--color-brand-primary-yellow);
  --wave-flip-x: -1;
  padding-top: calc(var(--wave-h, 0px) + var(--space-14));
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-10);
  }

  & .body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-10);
    width: 100%;
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--eyebrow-dot, var(--color-brand-primary-green));
  }

  & .heading .title {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-heading-level-2);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
    color: var(--color-text-default);
  }

  & .cta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
    width: 100%;
  }

  & .description {
    margin: 0;
    text-align: center;
    font-size: var(--font-size-body-middle);
    line-height: 2;
    color: var(--color-text-default);
  }

  & .cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    max-width: 400px;
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  @media (hover: hover) {
    & .cta:hover {
      background: transparent;
      border-color: var(--color-fill-dark);
      color: var(--color-fill-dark);
    }
  }

  & .figure {
    aspect-ratio: 608 / 405;
    width: 100%;
    border-radius: var(--radius-large);
    overflow: hidden;
    background: #a0a0a0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  & .figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  & .figure-placeholder {
    margin: 0;
    padding: var(--space-4);
    text-align: center;
    font-family: var(--font-family-jp);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-large);
    line-height: 2;
    color: var(--color-text-default);
  }

  @media (min-width: 769px) {
    & > .wrap {
      /* Figma 705:10968 — wrapper 1280 = 608 + gap 64 + 608 */
      --wrap-content: 1280px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      align-items: center;
      gap: var(--space-16);
    }

    & .body { gap: var(--space-10); }
  }
}

/*
 * .home-about = Figma 705:8211 TOKYOカルチャーデビューとは
 * Green bg, 2 column layout (logo card left, text right). On mobile, body
 * comes first and the logo card is placed below.
 */
.home-about {
  --section-bg: var(--color-brand-primary-green);
  --wave-flip-x: 1;
  --eyebrow-dot: var(--color-brand-primary-yellow);
  color: var(--color-text-inverted);
  padding-top: calc(var(--wave-h, 0px) + var(--space-14));
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-10);
  }

  & .figure {
    aspect-ratio: 608 / 405;
    border-radius: var(--radius-large);
    background: var(--color-fill-light);
    /* Logo SVG text paths use currentColor — reset from the section's white
     * so the "TOKYOカルチャーデビュー" wordmark stays legible on the white card. */
    color: var(--color-text-default);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    order: 2;
  }

  & .figure svg {
    width: 100%;
    max-width: 400px;
    height: auto;
  }

  & .body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-10);
    order: 1;
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
    color: inherit;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--eyebrow-dot);
  }

  & .heading h2 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-heading-level-2);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
    color: inherit;
  }

  & .cta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
    width: 100%;
  }

  & .description {
    margin: 0;
    text-align: center;
    font-size: var(--font-size-body-middle);
    line-height: 2;
    color: inherit;
  }

  & .cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    max-width: 400px;
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  @media (hover: hover) {
    & .cta:hover {
      background: transparent;
      border-color: var(--color-fill-light);
      color: var(--color-fill-light);
    }
  }

  @media (min-width: 769px) {
    & > .wrap {
      /* Figma 705:11068 — wrapper 1280 = figure 608 + gap 64 + text 608。
       * 見出し「TOKYOカルチャーデビューとは」は 575px なので 608 なら 1 行に収まる。 */
      --wrap-content: 1280px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      align-items: center;
      gap: var(--space-16);
    }

    & .figure { order: 0; }
    & .body { order: 0; align-items: stretch; }

    & .heading,
    & .cta-group { align-items: center; }
  }
}

/*
 * .home-community = Figma 705:8216 (Instagram + supporters recruit).
 * Blue section, two outlined rounded cards side-by-side on desktop,
 * stacked on mobile. Each card has a dark pill CTA.
 */
.home-community {
  --section-bg: var(--color-brand-primary-blue);
  --wave-flip-x: -1;
  color: var(--color-text-default);
  padding-top: calc(var(--wave-h, 0px) + var(--space-14));
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));

  /* Figma 705:11115 — wrapper 1280 = 608 + gap 64 + 608。SP の gutter だけ 24px。 */
  & > .wrap {
    --wrap-content: 1280px;
    --wrap-gutter: var(--space-6);
    display: flex;
    flex-direction: column;
    align-items: center;

    @media (min-width: 769px) {
      --wrap-gutter: var(--space-10);
    }
  }

  /*
   * 2 カラム化は 960px から。Instagram ロックアップ ("INSTAGRAM" は分割できない
   * 1 単語) がカードの min-content 幅を 379.66px に固定するため、769px では
   * 379.66 * 2 + gap 64 + wrap padding 80 = 903.32px に届かず、1fr =
   * minmax(auto, 1fr) の auto 下限でトラックが縮めずセクションが横にはみ出す。
   * 903.32px はスクロールバー込みで約 918px 相当なので、フォントのフォールバック
   * で字幅が変わっても耐えられるよう 960px に余裕を取っている。
   */
  & .cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    width: 100%;

    @media (min-width: 960px) {
      grid-template-columns: 1fr 1fr;
      gap: var(--space-16);
    }
  }

  & .card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    padding: var(--space-12) var(--space-6);
    border: 1px solid var(--color-fill-dark);
    border-radius: var(--radius-large);
    background: transparent;
    color: inherit;
    text-decoration: none;

    @media (min-width: 769px) {
      /* 左右は Figma の 64px (--space-16) ではなく 48px。 64px だと supporters の
         説明文が 16px 足りずに「す。」だけ行落ちする。 48px で 18px の余裕が出る。
         instagram カードと横並びなので padding は両方揃える。 */
      padding: var(--space-20) var(--space-12);
      gap: var(--space-8);
    }
  }

  /* -------- Instagram card -------- */
  & .card-instagram {
    text-align: center;
  }

  & .card-instagram .head {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);

    @media (min-width: 769px) {
      gap: var(--space-4);
    }
  }

  & .card-instagram .head .icon {
    display: inline-flex;
    width: 28px;
    height: 28px;

    @media (min-width: 769px) {
      width: 40px;
      height: 40px;
    }
  }

  & .card-instagram .head .icon svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  & .card-instagram .head .label {
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-text-24);
    line-height: 1.3;
    color: var(--color-text-default);

    @media (min-width: 769px) {
      font-size: var(--font-size-text-32);
    }
  }

  /* -------- Supporters card -------- */
  & .card-supporters {
    text-align: center;
  }

  & .card-supporters .title {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-text-32);
    line-height: 1.3;
    color: var(--color-text-default);
  }

  & .card-supporters .body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
    width: 100%;
  }

  & .card-supporters .description {
    margin: 0;
    font-size: var(--font-size-body-middle);
    line-height: 2;
    color: var(--color-text-default);
  }

  & .card-supporters .link {
    color: var(--color-text-default);
    text-decoration: underline;
    font-size: var(--font-size-body-middle);
    line-height: 2;
  }

  /* -------- Shared dark pill CTA -------- */
  /* SP はカード幅いっぱい、PC は内容にあわせて縮む (Figma 705:10112 / 705:11121)。 */
  & .cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    max-width: 400px;
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-fill-dark);
    color: var(--color-text-inverted);
    font-family: var(--font-family-jp);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;

    @media (min-width: 769px) {
      width: auto;
    }
  }

  @media (hover: hover) {
    & .cta:hover {
      background: transparent;
      border-color: var(--color-fill-dark);
      color: var(--color-fill-dark);
    }

    & .card-supporters .link:hover {
      text-decoration-thickness: 2px;
    }
  }
}

/* =============================================
   archive-feature.php
   ============================================= */

/*
 * .archive-feature — /features/ 一覧 (Figma 715:16013 / 715:14777)。
 * 上部は 見出し → カルーセル (feature-carousel) → シリーズピル → グリッド → ページネーション。
 * has-wave-top はテーマ全体で main に付与されるので、ここでは背景色と余白だけ持つ。
 */
.archive-feature {
  --section-bg: var(--color-background-light);
  padding-top: var(--space-14);
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-16);

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-16);
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-brand-primary-green);
  }

  & .heading h1 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-heading-level-2);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

}

/*
 * .feature-series-pills — 特集シリーズ選択バー (Figma 715:16428)。
 * ベース色の角丸パネルに、outline スタイルの pill を横並びで配置する。
 * モバイルは横スクロール、デスクトップは折り返し中央寄せ。
 */
.feature-series-pills {
  width: 100%;

  & ul {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: var(--space-6);
    border-radius: var(--radius-default);
    background: var(--color-background-light);
    list-style: none;
  }

  & li { margin: 0; }

  & .pill {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-3);
    border: 1px solid var(--color-border-default);
    border-radius: 99px;
    background: transparent;
    color: var(--color-text-default);
    font-size: var(--font-size-text-16);
    font-weight: var(--font-weight-regular);
    line-height: 1.75;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  @media (hover: hover) {
    & .pill:hover {
      background: var(--color-fill-dark);
      color: var(--color-text-inverted);
    }
  }

  @media (max-width: 768px) {
    & ul {
      flex-direction: column;
      align-items: center;
      padding: var(--space-4);
      gap: var(--space-2);
    }

    & .pill {
      font-size: var(--font-size-text-14);
    }
  }
}

/*
 * .feature-grid + .feature-panel — シリーズパネル・カード列 (Figma 715:16432)。
 * カルーセル用の .feature-card はテキストを画像にオーバーレイするが、
 * こちらは画像を上、シリーズ pill と title を下に積むボックス型カード。
 */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;

  & > li { margin: 0; }

  @media (min-width: 769px) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature-panel {
  & .card-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    color: inherit;
    text-decoration: none;
  }

  & .thumb {
    position: relative;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-default);
    overflow: hidden;
    background: var(--color-background-default);

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
  }

  & .body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  & .series {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-2);
    border: 1px solid var(--color-border-default);
    border-radius: 99px;
    background: transparent;
    color: var(--color-text-default);
    font-size: var(--font-size-text-12);
    line-height: 1.75;
  }

  /*
   * width: 100% は必須。 親 .body が `align-items: flex-start` のため title は
   * 何もしないと min-content 幅を取ってしまい、長いタイトルが grid セル幅を
   * 突き破る。 明示的に幅 100% を敷いてカラム内に閉じ込める。
   */
  & .title {
    width: 100%;
    margin: 0;
    font-family: var(--font-family-jp);
    font-size: var(--font-size-body-large);
    font-weight: var(--font-weight-bold);
    line-height: 1.5;
    color: var(--color-text-default);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  @media (hover: hover) {
    & .card-link:hover .title {
      color: var(--color-brand-primary-green);
    }
  }
}

/*
 * .single-feature — /features/[slug]/ 特集記事詳細 (Figma 715:12543 / 715:12700、
 * バリアント 715:13705 / 715:13876)。
 * WordPress の body_class() が feature シングル投稿で <body> に `single-feature`
 * を付与するため、`.single-feature` 単体だと body にもマッチしてしまい、
 * body の flex + padding + gap が site-header / main / marquee / footer の
 * 間に予期しない余白を生む。 `section.single-feature` にスコープすることで
 * テンプレート内の <section> だけに CSS を効かせる。
 * 見出し領域は eyebrow (FEATURE + 緑ドット) + Zen Maru H1 + 日付。
 * ヒーロー画像はテンプレートには置かず、本文フィールド (the_content) 内で
 * 編集者が必要に応じて挿入する。 記事末尾にはシリーズタグのピル (.tags)、
 * 記事カラムの隣に ACF 管理のクレジット欄 (.credit) が付く。 記事下部には
 * `template-parts/feature/related.php` の 4 パネル (`feature-panel`) を配置。
 */
section.single-feature {
  /* 2 カラム grid は共通 `.article-layout` (line ~706) で管理。 feature は
   * Figma wrapper 715:14551 に準拠して "本文可変 + サイド 320px 固定" と gap を
   * 大きめに取るため、CSS カスタムプロパティで default を上書き。 */
  --article-layout-columns: minmax(0, 1fr) 320px;
  --article-layout-gap-mobile: var(--space-14);
  --article-layout-gap-desktop: var(--space-32);

  padding-top: var(--space-14);
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));

  & .entry {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    min-width: 0;
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    text-align: left;
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-brand-primary-green);
  }

  & .heading .title {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-text-32);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    color: var(--color-text-default);
  }

  /*
   * Figma 872:6849 の meta 行。 日付とシリーズ名を 24px 空けて横並びにする。
   * シリーズ名が長いと SP で溢れるので折り返しを許可し、折り返した行の間隔は
   * 8px にしている。
   */
  & .heading .meta {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-2) var(--space-6);
  }

  & .heading .date {
    margin: 0;
    color: var(--color-text-default);
    font-size: var(--font-size-body-small);
    line-height: 1.5;
  }

  /*
   * シリーズ名は term アーカイブへのテキストリンク。 色と hover は本文中の
   * リンク (.entry-body a) に揃える。 複数タームが付いた記事もあるので全件
   * 並べる (Figma は 1 件だが、コンテナ側の gap 8px はその想定)。
   */
  & .heading .series {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    color: var(--color-brand-primary-green);
    font-size: var(--font-size-body-small);
    line-height: 1.5;
  }

  & .heading .series a:hover,
  & .heading .series a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  /*
   * .entry-body — Gutenberg 記事本文のシェル。 基本タイポグラフィと縦リズム
   * (line-height 2 / owl による block 間隔 / 見出し line-height 1.5) は
   * body とトップレベルの entry-body ルールに一任し、ここでは feature-single
   * 独自の大きめの見出しサイズと h2 の scroll-offset だけを追加する。
   * 数字付きセクション / 情報テーブルなど Figma の構造化コンポーネントは
   * ここでは扱わず、将来のカスタムブロック側で提供する想定。
   */

  & .entry-body h2 {
    scroll-margin-top: var(--space-16);
    font-size: var(--font-size-body-large);
    font-weight: var(--font-weight-bold);
  }

  & .entry-body h3 {
    font-size: var(--font-size-body-large);
    font-weight: var(--font-weight-bold);
  }

  & .entry-body img,
  & .entry-body figure img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-default);
  }

  /* classic_editor 由来などのマーカー付き ul/ol にだけインデントを入れる。
   * 除外対象:
   *   - core/list の `.wp-block-list` (Figma 833:10819 準拠のフラット表示、line 495-503)
   *   - `.lazyblock-*` コンテナ内部の list (もくじ等、各ブロックが padding を管理)
   * ブロック側の padding: 0 を specificity 0-3-2 で打ち消さないための保険。 */
  & .entry-body :is(ul, ol):not(.wp-block-list, [class*="lazyblock-"] *) {
    padding-left: var(--space-6);
  }

  & .entry-body blockquote {
    padding: var(--space-4) var(--space-6);
    border-left: 4px solid var(--color-brand-primary-green);
    background: var(--color-background-ultra-light);
    font-style: italic;
  }

  & .tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;
  }

  & .tags .tag {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-2);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-full);
    color: var(--color-text-default);
    font-size: var(--font-size-text-14);
    line-height: 1.75;
    text-decoration: none;
  }

  & .credit {
    border-top: 1px solid var(--color-border-default);
    padding: var(--space-6) 0;
    font-size: var(--font-size-body-small);
    line-height: var(--line-height-default);
    color: var(--color-text-default);
  }

  & .credit p { margin: 0; }

  @media (min-width: 769px) {
    padding-top: var(--space-16);
    padding-bottom: calc(var(--wave-h, 0px) + var(--space-16));

    & .heading .title { font-size: var(--font-size-heading-level-2); }

    & .tags .tag {
      padding: 0 var(--space-3);
      font-size: var(--font-size-text-16);
    }
  }
}

/*
 * .feature-related — 特集シングル下部の「その他の特集」波セクション (Figma 715:12568)。
 * has-wave-top で main (default) → light gray へトランジションし、その内側に
 * 中央寄せ h2 + 4 パネルグリッド + すべての特集 pill、続いてマーキーを内包する。
 * global の marquee-section は footer.php 側で feature single 時に抑止済みなので、
 * ここで直接 `template-parts/home/marquee` を include している。
 */
.feature-related.has-wave-top {
  --section-bg: var(--color-background-light);
  --wave-flip-x: 1;
  padding-top: calc(var(--wave-h, 0px) + var(--space-14));
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-4));
  display: flex;
  flex-direction: column;

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-10);
    margin-bottom: var(--space-14);
  }

  & h2 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-text-24);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

  & .list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  & .list li { margin: 0; }

  & .more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-background-ultra-light);
    color: var(--color-text-default);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  @media (hover: hover) {
    & .more:hover {
      background: transparent;
      border-color: var(--color-brand-primary-green);
      color: var(--color-brand-primary-green);
    }
  }

  @media (min-width: 769px) {
    & .list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    & h2 { font-size: var(--font-size-heading-level-3); }
  }
}

/* =============================================
   taxonomy-feature_series.php
   ============================================= */

.archive-feature-series {
  padding-top: var(--space-14);
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-16);
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-brand-primary-green);
  }

  & .heading h1 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-heading-level-2);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

  & .heading .description {
    max-width: 720px;
    margin: var(--space-2) 0 0;
    line-height: 1.7;
    text-align: center;
  }
}

/* =============================================
   archive-news.php
   ============================================= */

/*
 * .archive-news — /news/ お知らせ一覧 (Figma 715:11892 / 715:12055)。
 * 上部: 中央寄せの eyebrow (● NEWS) + Zen Maru H1、続いて縦積みのカード一覧
 * (news-card) と共通ページネーション。 body_class 衝突回避のため
 * `section.archive-news` にスコープ。
 */
section.archive-news {
  padding-top: var(--space-14);
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-12);
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-brand-primary-green);
  }

  & .heading h1 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-text-32);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

  /*
   * カード同士は border-top で細い水平線区切り、最上段にも線を敷いてリストの
   * 上端を明示する。 カード自体には背景色を持たせず、body の default gray が
   * そのまま透ける構造 (Figma 715:12382)。 中央 wrap 幅で読みやすさ確保。
   */
  & .list {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--max-width-narrow);
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-border-default);
  }

  & .list li {
    margin: 0;
    border-bottom: 1px solid var(--color-border-default);
  }

  @media (min-width: 769px) {
    & .heading h1 { font-size: var(--font-size-heading-level-2); }
  }
}

/* =============================================
   search.php
   ============================================= */

/*
 * .search-results — /?s={keyword} 検索結果 (Figma 729:6161 / 729:6318)。
 * 上部にキーワードと「の検索結果」を並べた中央寄せ H1、続いて archive-news と
 * 同じ罫線区切りリスト + 共通ページネーション。 検索結果は post_type 横断で
 * 出るので、行 DOM は `template-parts/news/card` を流用する (見た目は
 * お知らせ一覧と共通)。 body_class 衝突回避のため `section.search-results`
 * にスコープする。
 */
section.search-results {
  padding-top: var(--space-14);
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-12);
  }

  /*
   * 見出しはキーワード + 「の検索結果」の 2 スパン構成だが、archive / single 系
   * ページと視覚的な重みを揃えるため両スパンとも同じサイズ (モバイル 32px /
   * デスクトップ heading-level-2 40px) にする。 Figma ではキーワード側だけ
   * 一段大きく表示していたが、他のアーカイブ H1 と並んだときに突出しないよう
   * こちらを優先している。
   */
  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: var(--max-width-narrow);
  }

  & .heading h1 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    color: var(--color-text-default);
    text-align: center;
    font-size: var(--font-size-text-32);
    word-break: break-word;
  }

  & .heading .keyword,
  & .heading .suffix { display: inline; }

  & .list {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--max-width-narrow);
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-border-default);
  }

  & .list li {
    margin: 0;
    border-bottom: 1px solid var(--color-border-default);
  }

  & .empty {
    margin: 0;
    padding: var(--space-8) 0;
    text-align: center;
    color: var(--color-text-default);
    font-size: var(--font-size-body-middle);
  }

  @media (min-width: 769px) {
    & .heading h1 { font-size: var(--font-size-heading-level-2); }
  }
}

/* =============================================
   404.php
   ============================================= */

/*
 * .not-found — 存在しない URL や削除済みリソースにアクセスされたときの
 * 案内シェル (Figma 729:7058 / 729:7215)。 header の白 cover と footer 前
 * 波の間に中央寄せの H1 と補足テキストのみを配置する。 body_class 衝突
 * 回避のため `section.not-found` にスコープする。
 */
section.not-found {
  padding-top: var(--space-14);
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-14));

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-14);
    max-width: var(--max-width-narrow);
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  & .heading h1 {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-text-32);
    line-height: 1.4;
    color: var(--color-text-default);
    text-align: center;
  }

  & .description {
    margin: 0;
    width: 100%;
    color: var(--color-text-default);
    font-size: var(--font-size-body-middle);
    line-height: 2;
  }

  @media (min-width: 769px) {
    & .heading h1 { font-size: var(--font-size-heading-level-2); }
  }
}

/*
 * .news-card — お知らせの 1 行 (Figma 715:12382 のリスト項目)。
 * 背景色は持たず、リスト側の border-top/bottom (border-light 細線) で
 * 隣り合うカードとセパレートされる。 左に title (2 行クランプ) + 日付、
 * 右にサムネイル (rounded 3:2)。 hover でタイトルがブランドグリーンに変色。
 */
.news-card {
  & .link {
    display: flex;
    align-items: center;
    gap: var(--space-10);
    padding: var(--space-6) 0;
    color: inherit;
    text-decoration: none;
  }

  & .body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  & .title {
    margin: 0;
    font-family: var(--font-family-jp);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.5;
    color: var(--color-text-default);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    transition: color 0.15s ease;
  }

  & .date {
    margin: 0;
    color: var(--color-text-default);
    font-size: var(--font-size-body-small);
    line-height: 1.5;
  }

  & .thumb {
    width: 120px;
    aspect-ratio: 3 / 2;
    flex-shrink: 0;
    border-radius: var(--radius-small);
    overflow: hidden;
    background: var(--color-background-light);

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
  }

  @media (hover: hover) {
    & .link:hover .title { color: var(--color-brand-primary-green); }
  }

  @media (min-width: 769px) {
    & .thumb { width: 160px; }
  }
}

/*
 * .single-news — /news/[slug]/ お知らせ詳細 (Figma 715:10902 / 715:11050)。
 * single-feature / single-event と同じ流れで、eyebrow (● NEWS) + Zen Maru H1 + 日付
 * の heading と the_content 本文の後に、`.news-related` の波セクションが続く。
 * body_class 衝突回避のため `section.single-news` にスコープする。
 * アイキャッチ画像はテンプレートには置かず、本文フィールド内で編集者が任意に
 * 挿入する運用 (feature single と同じ)。
 */
section.single-news {
  padding-top: var(--space-16);
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-16));

  & .entry {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    width: 100%;
    max-width: var(--max-width-narrow);
    margin-inline: auto;
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-brand-primary-green);
  }

  & .heading .title {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-text-32);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    color: var(--color-text-default);
  }

  & .heading .date {
    margin: 0;
    color: var(--color-text-default);
    font-size: var(--font-size-body-small);
    line-height: 1.5;
  }

  & .entry-body {
    width: 100%;
    max-width: var(--max-width-narrow);
    margin-inline: auto;
  }

  & .entry-body img,
  & .entry-body figure img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-default);
  }

  @media (min-width: 769px) {
    & .heading .title { font-size: var(--font-size-heading-level-2); }
  }
}

/*
 * .news-related — /news/[slug]/ 下部の「その他のお知らせ」波セクション
 * (Figma 715:10902 内の下段)。 feature-related / event-related と同じく main
 * (default gray) → light gray の波でバンドを切り出し、内側に中央寄せ h2 +
 * 罫線区切りの news-card 一覧 + 「すべてのお知らせ」pill を並べる。 見出しサイズと
 * バンド下端の余白 (`.wrap` の margin-bottom) は feature-related / event-related と
 * 揃えている。
 */
.news-related.has-wave-top {
  --section-bg: var(--color-background-light);
  --wave-flip-x: 1;
  padding-top: calc(var(--wave-h, 0px) + var(--space-14));
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-4));
  display: flex;
  flex-direction: column;

  & > .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-10);
    margin-bottom: var(--space-14);
  }

  & .heading {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-text-24);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    text-align: center;
  }

  & .list {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--max-width-narrow);
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-border-default);
  }

  & .list li {
    margin: 0;
    border-bottom: 1px solid var(--color-border-default);
  }

  & .more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-height: 56px;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: var(--color-background-ultra-light);
    color: var(--color-text-default);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-body-middle);
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  @media (hover: hover) {
    & .more:hover {
      background: transparent;
      border-color: var(--color-brand-primary-green);
      color: var(--color-brand-primary-green);
    }
  }

  @media (min-width: 769px) {
    & .heading { font-size: var(--font-size-heading-level-3); }
  }
}

/*
 * .page-content — 固定ページ共通シェル (page.php)。
 * heading は archive-feature 等と同型で eyebrow (● + EN ラベル) + Zen Maru H1
 * を中央寄せで積む。 body_class の衝突を避けるため <section> にスコープする。
 */
section.page-content {
  padding: var(--space-16) 0;
  padding-bottom: calc(var(--wave-h, 0px) + var(--space-16));

  & .entry-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
  }

  & .heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    text-align: center;
  }

  & .heading .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-family: var(--font-family-en);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.09em;
    line-height: 1.3;
  }

  & .heading .eyebrow .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-brand-primary-green);
  }

  & .heading .title {
    margin: 0;
    font-family: var(--font-family-jp-title);
    font-size: var(--font-size-text-32);
    font-weight: var(--font-weight-bold);
    line-height: 1.4;
    color: var(--color-text-default);
  }

  @media (min-width: 769px) {
    & .heading .title { font-size: var(--font-size-heading-level-2); }
  }
}

/*
 * iOS Safari は focus 時にフォーム要素の font-size が 16px 未満だと
 * 自動で拡大 (zoom-to-input) する。 これを避けるためモバイル幅で
 * 全テキスト系フォームコントロールに 16px を強制する。 デスクトップの
 * 視覚設計 (例: フィルタモーダル日付入力の 14px) は維持する。
 *
 * checkbox / radio / submit / button / reset / file / range / color は
 * 直接テキスト入力しない (= フォーカス時ズームの対象外) ので除外する。
 */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]):not([type="range"]):not([type="color"]),
  textarea,
  select {
    font-size: 16px;
  }
}
