/* ==========================================================================
   25_variant-extensions-v1.1.css
   04_canonical.css は無変更。読み込み順は 04 → 本ファイル。
   Golden Master / CANONICAL SPEC v1.1 には一切触れない。

   ★ 属性配置ルール（v1.1で統一・固定。以後変更禁止）★
   「data-*属性は、その属性が変化させるコンポーネントの"ルート要素"自身に置く」
   例外は無い。ancestor(.ed-article)に置いて子孫セレクタで拾う旧方式は廃止。

   | data属性         | 置く場所（ルート要素）        |
   |------------------|-------------------------------|
   | data-h1          | .ed-article（h1トークンはCSS変数として複数コンポーネントに波及するグローバル値のため唯一の例外） |
   | data-hero        | .ed-hero                      |
   | data-section-head| .ed-section__head              |
   | data-card        | .ed-cards                      |
   | data-data        | .ed-grid / .ed-table / .ed-key-number（コンポーネント種別ごとの実ルート） |
   | data-quote       | .ed-quote                      |
   | data-summary     | .ed-summary                    |
   | data-toc         | .ed-toc                        |
   | data-cta         | .ed-cta                        |

   ★ nth-child依存ゼロ方針 ★
   表示件数の制御はCSSで行わない（:nth-child(n+4)等は使用禁止）。
   件数はDesign Blueprint段階でHTMLに出力する要素数そのものを絞ることで制御する
   （例：H02はBlueprintが hero_spec_max_items:3 に従い上位3項目のみをHTML化する）。
   唯一の例外は .ed-table tr:nth-of-type(even) のゼブラ模様（04_canonical.css既存、
   広告等が混入し得ないtable内部限定のため安全）。

   ★ C04/D03統合 ★
   旧C04(comparison_rows/カード実装)はD03(comparison_rows/データ表示実装)の
   重複実装だったため v1.1で **C04を廃止・D03に統合** する。card_variant列挙から
   C04を削除し、比較行表示は常にdata_variant=D03（実体は.ed-table）を用いる。
   ========================================================================== */


/* ============================================================
   TYPOGRAPHY（.ed-article根に付与。04のVARIABLE運用範囲内）
   ============================================================ */
.ed-article[data-h1="TY02"] { --ed-h1-min: 36px; --ed-h1-fluid: 5vw; --ed-h1-max: 64px; }
.ed-article[data-h1="TY03"] { --ed-h1-min: 28px; --ed-h1-fluid: 4vw; --ed-h1-max: 44px; }


/* ============================================================
   HERO（ルート: .ed-hero）
   ============================================================ */

/* H02: poster_left — spec横並び最大3個。件数制御はBlueprint側の責務（nth-child不使用） */
.ed-hero[data-hero="H02"] .ed-hero__grid { grid-template-columns: 1fr; }
.ed-hero[data-hero="H02"] .ed-hero__spec { flex-direction: row; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.ed-hero[data-hero="H02"] .ed-hero__spec-item { flex: 1 1 180px; min-width: 0; border-left: 3px solid var(--ed-t1); }

/* H03: centered_masthead */
.ed-hero[data-hero="H03"] .ed-hero__grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.ed-hero[data-hero="H03"] .ed-hero__kicker { justify-content: center; }
.ed-hero[data-hero="H03"] .ed-hero__lead { margin-left: auto; margin-right: auto; }
.ed-hero[data-hero="H03"] .ed-hero__tags { justify-content: center; }
.ed-hero[data-hero="H03"] .ed-hero__spec { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 640px; margin: 24px auto 0; }
.ed-hero[data-hero="H03"] .ed-hero__spec-item { flex: 0 1 160px; min-width: 0; }

/* H04: data_first */
.ed-hero[data-hero="H04"] .ed-hero__grid { grid-template-columns: minmax(0,0.85fr) minmax(0,1.15fr); }
.ed-hero[data-hero="H04"] .ed-hero__spec-item { padding: 16px 20px; }
.ed-hero[data-hero="H04"] .ed-hero__spec-value { font-size: 14px; }

/* H05: compact_editorial */
.ed-hero[data-hero="H05"] { padding: 36px 60px 32px; }
.ed-hero[data-hero="H05"] .ed-hero__spec { display: none; }
.ed-hero[data-hero="H05"] .ed-hero__grid { grid-template-columns: 1fr; }

/* H06: text_dominant */
.ed-hero[data-hero="H06"] .ed-hero__grid { grid-template-columns: 1fr; }
.ed-hero[data-hero="H06"] .ed-hero__spec { display: none; }
.ed-hero[data-hero="H06"] .ed-hero__lead { max-width: 640px; font-size: 16px; }

/* --- HERO responsive（04のmax-width:720pxの後に読み込まれるため、
       720px以下では常にPC用ルールを明示的に無効化してBaseline挙動へ収束させる） --- */
@media (max-width: 720px) {
  .ed-hero[data-hero="H02"] .ed-hero__spec,
  .ed-hero[data-hero="H03"] .ed-hero__spec { flex-direction: column; gap: 3px; max-width: none; }
  .ed-hero[data-hero="H02"] .ed-hero__spec-item,
  .ed-hero[data-hero="H03"] .ed-hero__spec-item { display: none; } /* 04のBaseline同様、モバイルではspec全体を間引く */
  .ed-hero[data-hero="H04"] .ed-hero__grid { grid-template-columns: 1fr; }
  .ed-hero[data-hero="H04"] .ed-hero__spec { display: none; }
  .ed-hero[data-hero="H05"] { padding: 40px 24px 28px; }
}


/* ============================================================
   SECTION HEAD（ルート: .ed-section__head）
   ============================================================ */

/* S02: number_rule */
.ed-section__head[data-section-head="S02"] .ed-pill {
  background: transparent; color: var(--ed-t1);
  font-family: var(--ed-heading-font); font-weight: 900;
  font-size: 32px; padding: 0; letter-spacing: 0;
}

/* S03: kicker_rule — REGISTERED VARIANT DOM: .ed-section__kicker-label（22_variant-dom-schema.json登録済み） */
.ed-section__head[data-section-head="S03"] .ed-pill { display: none; }
.ed-section__head[data-section-head="S03"] .ed-section__kicker-label {
  font-family: var(--ed-mono-font); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ed-muted); white-space: nowrap;
}
@media (max-width: 720px) {
  .ed-section__head[data-section-head="S02"] .ed-pill { font-size: 24px; }
}


/* ============================================================
   CARD（ルート: .ed-cards）※C04は廃止。C01/C02/C03/C05のみ。
   ============================================================ */

/* C02: two_column_feature */
.ed-cards[data-card="C02"] { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.ed-cards[data-card="C02"] > :not(.ed-card) { grid-column: 1 / -1; } /* AdSense保険 */
@media (max-width: 720px) {
  .ed-cards[data-card="C02"] { grid-template-columns: 1fr; }
}

/* C03: compact_catalog */
.ed-cards[data-card="C03"] .ed-card { padding: 14px 18px; grid-template-columns: 40px minmax(0,1fr); gap: 12px; }
.ed-cards[data-card="C03"] .ed-card__icon { font-size: 22px; }
.ed-cards[data-card="C03"] .ed-card__title { font-size: 15px; }
.ed-cards[data-card="C03"] .ed-card__desc { font-size: 12px; }
@media (max-width: 720px) {
  .ed-cards[data-card="C03"] .ed-card { grid-template-columns: 1fr; }
}

/* C05: large_feature（Blueprint側でmax_items:2を強制。CSS側は表示件数を制御しない） */
.ed-cards[data-card="C05"] .ed-card { grid-template-columns: 64px minmax(0,1fr); padding: 28px 32px; }
.ed-cards[data-card="C05"] .ed-card__icon { font-size: 48px; }
.ed-cards[data-card="C05"] .ed-card__title { font-size: 20px; }
.ed-cards[data-card="C05"] .ed-card__desc { font-size: 14px; }
@media (max-width: 720px) {
  .ed-cards[data-card="C05"] .ed-card { grid-template-columns: 1fr; padding: 20px 22px; }
}


/* ============================================================
   DATA（ルート: コンポーネント種別ごとに .ed-grid / .ed-table / .ed-key-number）
   ============================================================ */

/* D02: stat_strip — auto-fitを明示的に許可された唯一の例外variant */
.ed-grid[data-data="D02"] { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 720px) {
  .ed-grid[data-data="D02"] { grid-template-columns: 1fr; }
}

/* D03: comparison_rows（旧C04を統合。実体はtable、column数2〜3を想定） */
.ed-table[data-data="D03"] th,
.ed-table[data-data="D03"] td { text-align: center; }
.ed-table[data-data="D03"] th:first-child,
.ed-table[data-data="D03"] td:first-child { text-align: left; font-weight: 700; }

/* D04: key_number_block — REGISTERED VARIANT DOM: .ed-key-number（22登録済み） */
.ed-key-number[data-data="D04"] {
  background: var(--ed-card); border: 1px solid var(--ed-border);
  padding: 32px; text-align: center; margin: 24px 0;
}
.ed-key-number[data-data="D04"] .ed-key-number__figure {
  font-family: var(--ed-heading-font); font-weight: 900; font-size: 48px; color: var(--ed-t1); display: block;
}
.ed-key-number[data-data="D04"] .ed-key-number__label { font-size: 14px; color: var(--ed-muted); margin-top: 8px; }
@media (max-width: 720px) {
  .ed-key-number[data-data="D04"] .ed-key-number__figure { font-size: 36px; }
}

/* D05: table_dense */
.ed-table[data-data="D05"] th { white-space: normal; } /* 20字超th対応 */
@media (max-width: 720px) {
  /* 04既存の.ed-table-wrap横スクロールに委譲。追加ルールなしで十分（HARD LOCK継承） */
}


/* ============================================================
   QUOTE/TAKEAWAY（ルート: .ed-quote）
   ============================================================ */

.ed-quote[data-quote="Q02"]::before { content: none; }
.ed-quote[data-quote="Q02"] p { font-size: 20px; }
.ed-quote[data-quote="Q02"] .ed-quote__source { display: none; }

.ed-quote[data-quote="Q03"] { padding: 24px 32px; }
.ed-quote[data-quote="Q03"]::before { content: none; }
.ed-quote[data-quote="Q03"] p { font-size: 16px; font-family: var(--ed-body-font); font-weight: 700; }
@media (max-width: 720px) {
  .ed-quote[data-quote="Q02"] p { font-size: 17px; }
}


/* ============================================================
   SUMMARY（ルート: .ed-summary）
   ============================================================ */

.ed-summary[data-summary="SUM02"] { background: var(--ed-card); border: 2px solid var(--ed-t1); }
.ed-summary[data-summary="SUM02"] .ed-summary__title { color: var(--ed-t1); }
.ed-summary[data-summary="SUM02"] .ed-summary__row { color: var(--ed-text); border-bottom-color: var(--ed-border); }
.ed-summary[data-summary="SUM02"] .ed-summary__motif { opacity: .04; }

.ed-summary[data-summary="SUM03"] .ed-summary__list { counter-reset: ed-summary-counter; }
.ed-summary[data-summary="SUM03"] .ed-summary__row { counter-increment: ed-summary-counter; }
.ed-summary[data-summary="SUM03"] .ed-summary__row::before {
  content: counter(ed-summary-counter);
  background: var(--ed-t1); color: #fff;
  width: 20px; height: 20px; border-radius: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
@media (max-width: 720px) {
  .ed-summary[data-summary="SUM02"],
  .ed-summary[data-summary="SUM03"] { padding: 28px 24px; }
}


/* ============================================================
   TOC（ルート: .ed-toc）
   ============================================================ */

.ed-toc[data-toc="T03"] .ed-toc__list { counter-reset: ed-toc-counter; }
.ed-toc[data-toc="T03"] .ed-toc__list a { counter-increment: ed-toc-counter; }
.ed-toc[data-toc="T03"] .ed-toc__list a::before { content: counter(ed-toc-counter) "."; color: var(--ed-t1); font-weight: 700; }


/* ============================================================
   CTA（ルート: .ed-cta）
   ============================================================ */

.ed-cta[data-cta="CTA02"] { background: none; border: none; padding: 0; text-align: left; margin: 32px 0; }
.ed-cta[data-cta="CTA02"] .ed-cta__title { display: none; }
.ed-cta[data-cta="CTA02"] .ed-cta__desc { display: none; }
.ed-cta[data-cta="CTA02"] .ed-cta__button { background: none; color: var(--ed-t1); padding: 0; font-size: 15px; text-decoration: underline; }


/* ============================================================
   広告混入対策（全variant共通、コンポーネントルートを問わず適用）
   ============================================================ */
.ed-cards[data-card] > :not(.ed-card) { width: 100%; }
.ed-grid[data-data] > :not(.ed-grid__item) { grid-column: 1 / -1; }


/* ============================================================
   未実装（ドキュメントのみ）一覧 — CSSに存在しない理由
   ============================================================ */
/*
  H01 / S01 / C01 / D01 / Q01 / SUM01 / T01 / T02 / CTA01
    → 04_canonical.cssのBaseline実装そのもの。data属性なしがBaseline。

  TY01 → Baseline値と同一のため定義不要（04の既定値がTY01相当）。

  R01-R05（page rhythm） → CSSではなく「どの順序でどのコンポーネントを
    何個配置するか」というBlueprint/コンテンツ構成の問題。09_page-rhythm-rules.md
    の数値ルールをBlueprint生成時に適用する。CSSで強制する対象ではない。

  M01-M04（motif） → 絵文字/記号/数値という「テキストコンテンツ」の差でしかなく、
    .ed-hero__motif / .ed-summary__motif は既存04のCSS（opacity等）をそのまま使う。
    M03(giant_number)のみ、桁数が多い場合にfont-sizeが自動縮小しないため
    以下の1ルールのみ追加する（motif用の唯一のCSS）：
*/
.ed-hero__motif[data-motif="M03"] { font-size: min(28vw, 260px); } /* 絵文字よりも数値は横幅を取るため縮小 */

/* ============================================================
   ARTICLE SIGNATURE — Design Blueprintが選んだ記事固有の主役
   ============================================================ */
.ed-article[data-ed-signature="atlas_board"] .ed-cards { border-top: 5px solid var(--ed-t1); }
.ed-article[data-ed-signature="comparison_board"] .ed-table-wrap { border-top: 5px solid var(--ed-t2); }
.ed-article[data-ed-signature="metric_wall"] .ed-grid { border-top: 5px solid var(--ed-t1); }
.ed-article[data-ed-signature="catalog_card_field"] .ed-cards { border-left: 5px solid var(--ed-t1); }
.ed-article[data-ed-signature="quote_feature"] .ed-quote { border-left-width: 8px; }
.ed-article[data-ed-signature="numbered_step_rail"] .ed-timeline,
.ed-article[data-ed-signature="timeline_strip"] .ed-timeline { border-left: 3px solid var(--ed-t1); padding-left: 28px; }
@media (max-width: 720px) {
  .ed-article[data-ed-signature="numbered_step_rail"] .ed-timeline,
  .ed-article[data-ed-signature="timeline_strip"] .ed-timeline { padding-left: 18px; }
}

/*
  AC01-AC04（accent） → 06_design-experiment-rules.mdでEXPERIMENTAL対象外・
    AC01固定運用と規定済み。AC02-04は将来のGolden Master Evolution検討時のみ
    有効化する設計のため、v1.1でもCSS未実装のまま据え置く（意図的な未実装）。
*/


/* [PATCH追加, D-4対応] FIG01-06 Media Component CSS(実資産化) */
.ed-figure { margin: 24px 0; }
.ed-figure__image { width: 100%; height: auto; display: block; border: 1px solid var(--ed-border); border-radius: 0; }
.ed-figure__caption { font-size: 13px; color: var(--ed-muted); line-height: 1.6; margin-top: 8px; }
.ed-figure__caption .ed-figure__source { font-family: var(--ed-mono-font); font-size: 11px; }
.ed-figure[data-figure="FIG02"] { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; margin-top: 40px; margin-bottom: 40px; }
.ed-figure[data-figure="FIG02"] .ed-figure__image { border: none; }
.ed-figure[data-figure="FIG02"] .ed-figure__caption { max-width: 880px; margin-left: auto; margin-right: auto; padding: 0 40px; }
.ed-figure[data-figure="FIG05"] { position: relative; }
.ed-figure[data-figure="FIG05"]::before { content: "EVIDENCE"; position: absolute; top: 8px; left: 8px; z-index: 1; background: var(--ed-t2); color: #fff; font-family: var(--ed-mono-font); font-size: 9px; letter-spacing: .14em; padding: 3px 8px; border-radius: 0; }
.ed-figure-compare[data-figure="FIG06"] { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; margin: 24px 0; }
@media (max-width: 720px) { .ed-figure-compare[data-figure="FIG06"] { grid-template-columns: 1fr; } }

/* ============================================================
   [files14監査B対応] ED専用Design A/B variant CSS
   AS-ISの.aap/.aapy selectorとは完全に独立した、.ed-*専用のA/B実験契約。
   AS-ISのvariant_b_css(html.aapy-exp-b .aap-article .aapy-hero等)は
   .ed-*記事には一切適用されない(セレクタ自体が存在しないDOMを指すため)。
   実装状態: IMPLEMENTED NOT TESTED(実browserでのcomputed style差分検証は未実施)
   ============================================================ */

/* Arm A(control)は既定のed-canonical.cssをそのまま使う(追加CSSなし) */

/* Arm B: hero_layout variant実験の例。data-ed-experiment-arm="B"はJS側が
   body要素へ付与する(aapy_design_ab_head_assignment相当のED専用実装、
   ed-design-ab.js参照) */
html[data-ed-experiment-arm="B"] .ed-article .ed-section:first-child {
  --ed-hero-padding-top: 24px; /* Arm Aの48pxから変更、computed styleで検証可能な実差分 */
}
html[data-ed-experiment-arm="B"] .ed-article .ed-section:first-child h2 {
  font-size: 1.75rem; /* Arm Aの2rem相当から縮小 */
}

/* ============================================================
   見出し書体の合成太字を止める(実ブラウザ表示で初めて出た欠陥の修正)
   ------------------------------------------------------------
   Dela Gothic One は単一ウェイト(400)の書体である。04_canonical.css は
   見出しに font-weight:900 を宣言しているため、browser は該当ウェイトが
   無いと判断して**合成太字**をかける。合成太字は輪郭を外側へ膨らませるので、
   画数の多い漢字(国・雑・情・報 など)が塗り潰れ、Golden Master と別物になる。
   Golden Master 側は .hero-title に font-weight を書いておらず、素の 400 で
   描かれている(golden-master-tunisia.html 84-89行)。
   宣言(= 極太1書体という LOCKED の意図)は変えずに、合成だけを止めて
   Golden Master と同じ描画へ戻す。04_canonical.css は無変更のまま。
   ============================================================ */
.ed-article .ed-topbar__logo,
.ed-article .ed-hero__title,
.ed-article .ed-section__title,
.ed-article .ed-h3,
.ed-article .ed-card__title,
.ed-article .ed-grid__figure,
.ed-article .ed-quote p,
.ed-article .ed-summary__title,
.ed-article .ed-cta__title,
.ed-article .ed-faq__q,
.ed-article .ed-faq__q::before,
.ed-article .ed-faq__a::before {
  font-synthesis-weight: none;
  font-synthesis: none;
}
