/* banner-cta-th19.css — ベースライン(自動読込・module-base.css前提)。編集せず上書きで調整。 */
@charset "UTF-8";

/* ══════════════════════════════════════════════════════════════════════════
   版面・余白・ヘアラインを1組の変数に集約する

   受領時は 見出しラッパ width:1200px 固定 / 内側ラッパ max-width:1200px /
   箱の padding が 20px・4%・50px の3段 と、3つがバラバラの値で書かれていた。その結果:
     ・1220px 以下で見出しだけ左へ 20px ずれる
     ・480/481px で箱の余白が 20px → 50px と 2.5 倍に跳ぶ
     ・ラベル左のヘアライン(固定 50px)が箱の overflow:hidden に切られる
       (実測: 375/480px で 30px = 60% / 768〜1023px で 19.3px / 1024px で 9px が消える。
        1280px 以上でだけ全長が出ていた)
   版面・外側の余白・箱の余白を変数にして連動させ、この3つを同時に解く。
   --th19-edge / --th19-pad の clamp は common.css の
   .container｛padding:0 clamp(1.25rem,4vw,3rem)｝ と同じ数値。独自の余白を発明せず
   サイトの版面リズムにそろえる(1280px 以上で 48px ≒ 受領時の 50px)。
   ══════════════════════════════════════════════════════════════════════════ */
.th19_module {
  --th19-measure: 1200px;                   /* 受領時の版面。1920px でも孤島にならないので広げない */
  --th19-edge: clamp(1.25rem, 4vw, 3rem);   /* 版面の外側の余白 */
  --th19-pad:  clamp(1.25rem, 4vw, 3rem);   /* 箱の内側の余白 ＝ ヘアラインの長さ */
  --th19-band: var(--color-surface);        /* 帯の地(受領時のまま。意匠の中心にしない) */
  /* box2 の地を沈めるベール。濃度 92% は「背景写真が真っ黒」の最悪ケースから逆算した値
     (淡色ベージュの --color-heading-ink #6b5a3e が最悪で、90% では 4.62 と余裕が無い。
      92% で 5.45)。地色そのものではなく明度を 8% 沈めた色を使うのは、地色のままだと
     【明るい写真が来た案件で box2 が box1 と同じ白になり、README が言う塗り分けが消える】ため。
     8% 混ぜておけば、真っ白な写真が来ても box1 との段差が 6% 残る。 */
  --th19-ground: color-mix(in srgb, var(--color-text) 8%, var(--color-bg));
  --th19-veil: 92%;
}

/* 見出しラッパと箱のラッパを「同じ版面」に置く。
   → どの画面幅でも 版面の縁 ＝ 箱の縁 ＝ ヘアラインの左端 ＝ 見出しの左端 が
     1本の垂直線でそろう(この部品の signature)。 */
.th19_module .th19_module_h2_wrap,
.th19_module .th19_module_inner_wrap {
  width: 100%;
  max-width: min(var(--th19-measure), 100% - var(--th19-edge) * 2);
  margin-inline: auto;
}

/* ── セクション見出し(部品が自分で持つ) ───────────────────────────── */
.th19_module .th19_module_h2_wrap {
  padding: 0 0 var(--space-md);
}
.th19_module .th19_module_h2_wrap :is(h2:where(:not([data-sm-h])),:where([data-sm-h="h2"])) {
  margin: 0;
  text-align: left;
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  font-weight: bold;
  /* 受領時は 2.6rem = 41.6px。土台の .lgx｛font-size:62.5%｝ は .lgx がルート要素ではないため
     rem の基準が 16px のままで、旧テーマが 26px のつもりで書いた値が 1.6 倍に出ていた。 */
  color: var(--color-heading-ink);
}
.th19_module .th19_module_h2_wrap :is(h2:where(:not([data-sm-h])),:where([data-sm-h="h2"])):after,
.th19_module .th19_module_h2_wrap :is(h2:where(:not([data-sm-h])),:where([data-sm-h="h2"])):before {
  content: none;
}
.th19_module .th19_module_h2_wrap :is(h2:where(:not([data-sm-h])),:where([data-sm-h="h2"])) span {
  display: inline-block;
  position: relative;
  padding-left: 3em;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: normal;
  color: var(--color-text-muted);
}
.th19_module .th19_module_h2_wrap :is(h2:where(:not([data-sm-h])),:where([data-sm-h="h2"])) span:before {
  content: "";
  position: absolute;
  left: 1.5em;
  width: 1px;
  height: 100%;
  background: var(--color-heading-ink);
  /* 受領時は var(--color-primary) 生。淡色ベージュのプリセットで白地に 1.66:1 まで落ちていた。
     受領時にはさらに color:var(--color-on-primary) も書かれていたが、content:"" の
     疑似要素に文字色を書いても何も起きない死に指定なので外した。 */
}

/* ── 帯 ─────────────────────────────────────────────────────────────── */
.th19_module .th19_module_wrap {
  background: var(--th19-band);
  padding-block: clamp(1.5rem, 4vw, 3.75rem);   /* 1280px 以上で 60px = 受領時と同値 */
  padding-inline: 0;
}

/* ── 2枚の箱 ────────────────────────────────────────────────────────── */
.th19_module .th19_module_inner_wrap .th19_module_box1,
.th19_module .th19_module_inner_wrap .th19_module_box2 {
  position: relative;
  width: 50%;
  float: left;
  padding: var(--th19-pad);
  overflow: hidden;
}

/* box1 = 無地。受領時は生 #fff で、配色4種すべてで 1px も変わらなかった(テーマ非追従)。 */
.th19_module .th19_module_inner_wrap .th19_module_box1 {
  background: var(--color-bg);
}

/* box2 = 画像スロットが地。
   README は「テクスチャ」と書いているが、同じ README のファイル表は images/ を
   「本番は自動生成写真に置換」と明記しており、同梱サンプルも既に人物写真である。
   受領時はラベルがその写真の上に生で乗っていて、実画素コントラストが
   配色4種 × 幅4種 = 16パターンすべてで AA 未達だった(平均 1.48〜7.30 / 最悪画素 1.00)。
   ＝ 2択導線の片方が全案件で読めない状態。
   地色(--color-bg)のベールで「奥の壁」に沈める。黒スクリムにしないのは、黒がテーマの
   明暗に追従しないため(地色基準なら淡色でも濃色でも『一段引っ込んだ地』の意味が保たれる)。
   あわせて repeat → cover にした(受領時は repeat で継ぎ目が出ていた)。 */
.th19_module .th19_module_inner_wrap .th19_module_box2 {
  background-image:
    linear-gradient(color-mix(in srgb, var(--th19-ground) var(--th19-veil), transparent) 0 100%),
    url(images/th19-bg-1.webp);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* ── 写真枠 ─────────────────────────────────────────────────────────
   受領時は max-width:100% だけで比率固定が無く、同梱2枚の自然比 1.833 / 1.429 の差が
   そのまま段差になっていた(2枚の箱の下端が 49.8〜77.3px ずれる。配色・フォント・文字量を
   振っても 1px も動かない = 構造欠陥)。README 自身が「2枚を同じ比率でそろえること」と
   書いている。本番は自動生成写真なので比率がそろう保証はゼロ。
   16:9 は banner-cta で未使用の比(既出は 8:4 / 3:2 / 4:3 / 1:1 / 4:5 / 全幅 / 45:55)。
   max-height は箱の中身幅の上限(504px → 高さ 283.5px)より上に置いてあり、実効比率は
   全幅で 16:9 のまま(R-5 の「広い側で実効比率が伸びる」落とし穴を踏まない値)。 */
/* ★lint の ⚠R8-wh（img に width/height 属性が無い）を許容する理由:
   本作業は「CSS のみ」の指示のため index.html を1バイトも変更していない。
   レイアウトシフトは figure の aspect-ratio が器の高さを先に確定させるので実害は出ない
   （属性の追加は先方への指摘 plan §9-2 に回した）。 */
.th19_module .th19_module_inner_wrap figure {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  max-height: min(46vh, 340px);
  overflow: hidden;
}
/* 写真のリンクを復活させる。
   受領時の <a href="@@LINK@@"> は中身が空・display:inline・position:static のため
   矩形が 0×0 で、実測した 384 パターンすべてで一度もクリックできなかった。
   README が「差し替えるもの」に挙げている主リンクが機能していない状態。
   ★このリンクは中身が空なので、CSS だけではアクセシブルな名前を与えられない
     (CSS の content で日本語を足すと規約 §6「表示テキストは HTML 側に置く」に反する)。
     aria-label の付与は先方への指摘に回した(plan §9-1)。 */
.th19_module .th19_module_inner_wrap figure > a {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.th19_module .th19_module_inner_wrap figure img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none;      /* common.css の img｛max-height:800px｝ を器基準に戻す */
  object-fit: cover;
}

/* ── ラベル(英字 + 日本語) ─────────────────────────────────────────── */
.th19_module .th19_module_inner_wrap .th19_module_link {
  position: relative;
  display: inline-block;
  margin-top: var(--space-sm);
  padding: 0 2em 0 1em;
  font-size: var(--fs-mod-title);
  /* 受領時は 2rem = 32px。セクション見出し(41.6px)とほぼ同格で主従が付いていなかった。 */
}
.th19_module .th19_module_inner_wrap .th19_module_link a {
  font-family: var(--font-heading);
  color: var(--color-heading-ink);
  text-decoration: none;
  opacity: 1;
  transition: none;
  /* 受領時は font-family の指定が無く、土台の .lgx｛font-family:Arial,…｝(0,1,0) が
     common.css の body｛font-family:var(--font-body)｝(0,0,1) に勝って、
     フォントプリセット4種すべてで Arial 固定だった(h2 だけは common.css の
     h1,h2,h3,h4｛font-family:var(--font-heading)｝ が直接当たるので追従していて、
     見出しだけ書体が変わりラベルが変わらないという食い違いが起きていた)。 */
}
.th19_module .th19_module_inner_wrap .th19_module_link a span {
  display: inline-block;
  margin-left: 1em;
  font-family: var(--font-body);
  font-size: var(--fs-body);
}

/* アクセント: 面の縁から引き出される1本のヘアライン(引出線)。
   長さを箱の余白そのものにしたので、どの画面幅でも左端が箱の縁にぴったり止まり、
   overflow:hidden に切られない(受領時は 375px で 60% が消えていた)。 */
.th19_module .th19_module_inner_wrap .th19_module_link:before {
  content: "";
  position: absolute;
  /* ★1行目の中央に合わせる（50% にすると、ラベルが2行になった箱だけ罫が行間に落ちて
     隣の箱と高さがそろわなくなる。実測: 1280px の長いコピーで 19px の食い違い）。
     0.7em は現在の line-height 1.4 のときの 0.5lh と同値で、lh 非対応環境の保険。 */
  top: 0.7em;
  top: 0.5lh;
  left: calc(var(--th19-pad) * -1);
  width: var(--th19-pad);
  height: 1px;
  background: var(--color-heading-ink);
  transition: width 0.3s ease;
}
/* 行末の矢印。
   受領時は right:5%(= ラベル自身の幅の割合)で、ラベルが長いほど内側へ入り、
   ホバーの移動量も文字数で変わっていた。em の固定値にして幅・文字数から切り離す。
   回転は transform ではなく独立プロパティ rotate/translate で書く。
   common.css:103 の @media(prefers-reduced-motion)｛.fade-in｛transform:none !important｝｝ が
   将来この部品に当たっても、矢印の形が消えないようにするための保険
   (このモジュールのマークアップに .fade-in は現時点で1つも無い)。 */
.th19_module .th19_module_inner_wrap .th19_module_link:after {
  content: "";
  display: block;
  position: absolute;
  top: 0.7em;
  top: 0.5lh;        /* 罫と同じ「1行目の中央」に置く */
  right: 0.75em;
  width: 6px;
  height: 6px;
  border-top: 1px solid var(--color-heading-ink);
  border-right: 1px solid var(--color-heading-ink);
  translate: 0 -50%;
  rotate: 45deg;
  transition: right 0.2s ease;
}

/* ── ホバー / フォーカス ────────────────────────────────────────────
   合図は「幾何」だけで取り、面と文字の色を1つも変えない。
   → ホバー時のコントラストが rest と必ず同値になる。
   受領時は .th19_module_link:hover a｛opacity:.5｝ でラベルが
   10.98〜15.91 → 2.55〜3.40 に落ちていた(配色4種すべて AA 未達)。
   _shared/common.css の a:hover｛opacity:.8｝ も同じ経路なので、まとめて打ち消す。 */
.th19_module .th19_module_inner_wrap .th19_module_link:hover a,
.th19_module .th19_module_inner_wrap .th19_module_link a:hover,
.th19_module .th19_module_inner_wrap figure > a:hover {
  opacity: 1;
}
/* ラベルへのホバー / 写真リンクへのホバー / キーボードフォーカス の3経路で同じ合図を出す */
.th19_module .th19_module_inner_wrap .th19_module_link:hover:before,
.th19_module .th19_module_inner_wrap :is(.th19_module_box1, .th19_module_box2):is(:focus-within, :has(figure > a:hover)) .th19_module_link:before {
  width: calc(var(--th19-pad) + 0.7em);   /* 引出線がラベルの1文字目の直前まで届く */
}
.th19_module .th19_module_inner_wrap .th19_module_link:hover:after,
.th19_module .th19_module_inner_wrap :is(.th19_module_box1, .th19_module_box2):is(:focus-within, :has(figure > a:hover)) .th19_module_link:after {
  right: 0.4em;
}

/* ── PC: float をやめて flex にし、2枚の下端をそろえる ─────────────
   受領時は float 段組みで、写真の比率差とラベルの行数差がそのまま下端の段差になっていた。
   ★BP は 1列側 max-width:768px / 2列側 min-width:769px で、土台の
     @media(min-width:768px) と 1px も重ねない(規約 R-6 / triage R13)。 */
@media (min-width: 769px) {
  .th19_module .th19_module_inner_wrap {
    display: flex;
    align-items: stretch;
  }
  .th19_module .th19_module_inner_wrap:after {
    display: none;   /* clearfix が3つ目の flex アイテムになるので止める */
  }
  .th19_module .th19_module_inner_wrap .th19_module_box1,
  .th19_module .th19_module_inner_wrap .th19_module_box2 {
    float: none;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
}

/* ── SP/タブレット: 1列 ──────────────────────────────────────────────
   受領時の width:calc(1200px/2) = 600px 固定 + margin:0 auto は外した。
   1列のとき箱が版面より狭くなって中央へ寄るため、644〜768px の帯で
   見出しの左端と箱の縁が 22〜53px ずれていた(実測)。版面を変数にした今は
   --th19-measure が「広がりすぎない」役目を兼ねている(768px で箱幅 706px が上限)。 */
@media (max-width: 768px) {
  .th19_module .th19_module_inner_wrap .th19_module_box1,
  .th19_module .th19_module_inner_wrap .th19_module_box2 {
    float: none;
    width: 100%;
    margin-inline: 0;
  }
}

/* ── 動きを減らす設定 ──────────────────────────────────────────────
   _shared/common.css の reduce ブロックが transition-duration を潰しているが、
   モジュール側にも明示しておく(規約 R-9 / lint R9-motion)。
   ★レイアウトに transform を1つも使っていないので、reduce で構図は 1px も動かない。 */
@media (prefers-reduced-motion: reduce) {
  .th19_module .th19_module_inner_wrap .th19_module_link:before,
  .th19_module .th19_module_inner_wrap .th19_module_link:after {
    transition: none;
  }
}
