/* JLINE Gutenberg LP デザインシステム v1：共通レイアウト */

/* LP全体のスコープ。色は固定せず、親の設定を継承する。 */
.jline-lp {
  --jline-container-width: 1120px;
  --jline-prose-width: 800px;
  --jline-space-mobile: 20px;
  --jline-space-desktop: 32px;

  box-sizing: border-box;
  color: inherit;
}

/* レイアウト用コンテナ。最大幅には左右の内側余白を含む。 */
.jline-lp .jline-container {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--jline-container-width);
  margin-inline: auto;
  padding-inline: var(--jline-space-mobile);
}

/* 文章用コンテナ。左右の安全な余白は親側で確保する。 */
.jline-lp .jline-prose {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--jline-prose-width);
  margin-inline: auto;
}

/* 768px以上では、レイアウト用コンテナの左右余白を広げる。 */
@media (min-width: 768px) {
  .jline-lp .jline-container {
    padding-inline: var(--jline-space-desktop);
  }
}

/* 通常セクションとカバー章タイトルで共有する上下余白。 */
.jline-lp {
  --jline-section-space-mobile: 48px;
  --jline-section-space-desktop: 80px;
}

/* 通常セクション。幅と左右余白は内側のコンテナで管理する。 */
.jline-lp .jline-section {
  box-sizing: border-box;
  padding-block: var(--jline-section-space-mobile);
}

/* カバー章タイトル。画像・色・高さ・内部構造はブロック側に委ねる。 */
.jline-lp .jline-section-cover {
  box-sizing: border-box;
  padding-block: var(--jline-section-space-mobile);
}

/* 768px以上では、両セクションの上下余白を広げる。 */
@media (min-width: 768px) {
  .jline-lp .jline-section,
  .jline-lp .jline-section-cover {
    padding-block: var(--jline-section-space-desktop);
  }
}

/* カード用の共通設定。背景色と境界線は後から一括変更できる。 */
.jline-lp {
  --jline-card-gap: 24px;
  --jline-card-padding-mobile: 24px;
  --jline-card-padding-desktop: 32px;
  --jline-card-radius: 16px;
  --jline-card-bg: #fafafa;
  --jline-card-border: #e5e5e5;
}

/* 標準カラムの列数・折り返しを維持し、間隔だけを調整する。 */
.jline-lp .jline-card-grid {
  gap: var(--jline-card-gap);
}

/* カードの高さは内容に任せ、影や内容を切り取る指定は加えない。 */
.jline-lp .jline-card {
  box-sizing: border-box;
  padding: var(--jline-card-padding-mobile);
  border: 1px solid var(--jline-card-border);
  border-radius: var(--jline-card-radius);
  background-color: var(--jline-card-bg);
}

/* 768px以上では、カード内余白を広げる。 */
@media (min-width: 768px) {
  .jline-lp .jline-card {
    padding: var(--jline-card-padding-desktop);
  }
}


/* v1共通文字・パーツ設定。色はブランド決定までの中立的な初期値。 */
.jline-lp {
  --jline-font-h1: 34px;
  --jline-font-h2: 28px;
  --jline-font-h3: 21px;
  --jline-font-body: 16px;
  --jline-font-note: 14px;
  --jline-line-body: 1.8;
  --jline-line-heading: 1.4;
  --jline-flow-space: 24px;
  --jline-image-radius: 12px;
  --jline-hero-space: 56px;
  --jline-cta-space: 48px;
  --jline-cta-bg: #f5f5f5;
  --jline-button-bg: #333333;
  --jline-button-text: #ffffff;
  --jline-button-radius: 8px;
  --jline-button-min-height: 48px;
  --jline-button-padding-inline: 28px;
  font-size: var(--jline-font-body);
  line-height: var(--jline-line-body);
  overflow-wrap: anywhere;
}

/* 詳細度を抑え、ブロックで指定された文字サイズや配置を尊重する。 */
.jline-lp :where(h1, h2, h3) {
  line-height: var(--jline-line-heading);
}
.jline-lp :where(h1) { font-size: var(--jline-font-h1); }
.jline-lp :where(h2) { font-size: var(--jline-font-h2); }
.jline-lp :where(h3) { font-size: var(--jline-font-h3); }
.jline-lp :where(p, ul, ol) {
  font-size: var(--jline-font-body);
  line-height: var(--jline-line-body);
}
.jline-lp :where(small, figcaption) {
  font-size: var(--jline-font-note);
}
.jline-lp .jline-prose > :where(p, ul, ol) + :where(p, ul, ol, h2, h3) {
  margin-block-start: var(--jline-flow-space);
}

/* 通常の画像のみ対象。カバー背景の画像には適用しない。 */
.jline-lp :where(.wp-block-image img) {
  border-radius: var(--jline-image-radius);
}

/* ヒーローの列数・積み重ね・順序は標準カラム側で設定する。 */
.jline-lp .jline-hero {
  box-sizing: border-box;
  padding-block: var(--jline-hero-space);
}
.jline-lp .jline-hero :where(.wp-block-columns) {
  gap: var(--jline-card-gap);
}

/* カバーの画像・オーバーレイ・文字色・全幅設定はブロック側で管理する。 */
.jline-lp .jline-section-cover :where(h2) {
  line-height: 1.3;
}

/* CTA。個別の背景色・文字揃え設定を優先できる低詳細度の初期値。 */
.jline-lp .jline-cta {
  box-sizing: border-box;
  padding-block: var(--jline-cta-space);
}
.jline-lp :where(.jline-cta) {
  background-color: var(--jline-cta-bg);
  text-align: center;
}
.jline-lp .jline-cta :where(.wp-block-buttons) {
  justify-content: center;
  gap: var(--jline-flow-space);
  margin-block-start: var(--jline-flow-space);
}
.jline-lp .jline-cta :where(.jline-container) > :where(p) {
  max-width: var(--jline-prose-width);
  margin-inline: auto;
}

/* クラスは個々の標準ボタンの外枠に付与。補助クラス単独でも利用可能。 */
.jline-lp :where(.jline-button, .jline-button-secondary) {
  box-sizing: border-box;
  max-width: 100%;
}
.jline-lp :where(.jline-button, .jline-button-secondary) > .wp-block-button__link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--jline-button-min-height);
  max-width: 100%;
  padding: 12px var(--jline-button-padding-inline);
  border: 1px solid var(--jline-button-bg);
  border-radius: var(--jline-button-radius);
  font-size: inherit;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* 色設定を持つ標準ボタンは、その設定を優先する。 */
.jline-lp :where(.jline-button) > .wp-block-button__link:not(.has-background) {
  background-color: var(--jline-button-bg);
}
.jline-lp :where(.jline-button) > .wp-block-button__link:not(.has-text-color) {
  color: var(--jline-button-text);
}
.jline-lp :where(.jline-button-secondary) > .wp-block-button__link:not(.has-background) {
  background-color: transparent;
}
.jline-lp :where(.jline-button-secondary) > .wp-block-button__link:not(.has-text-color) {
  color: var(--jline-button-bg);
}
.jline-lp :where(.jline-button, .jline-button-secondary) > .wp-block-button__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.jline-lp :where(.jline-button, .jline-button-secondary) > .wp-block-button__link:focus {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.jline-lp :where(.jline-button, .jline-button-secondary) > .wp-block-button__link:focus-visible {
  outline: 3px double var(--jline-button-bg);
  outline-offset: 4px;
}

/* 狭い画面ではCTAボタンのタップ幅を確保する。 */
@media (max-width: 767px) {
  .jline-lp .jline-cta :where(.jline-button, .jline-button-secondary) {
    width: 100%;
  }
  .jline-lp .jline-cta :where(.jline-button, .jline-button-secondary) > .wp-block-button__link {
    width: 100%;
  }
}

/* 768px以上のデザイントークン。固定高にはせず内容に応じて伸ばす。 */
@media (min-width: 768px) {
  .jline-lp {
    --jline-font-h1: 48px;
    --jline-font-h2: 36px;
    --jline-font-h3: 24px;
    --jline-font-body: 17px;
    --jline-hero-space: 96px;
    --jline-cta-space: 72px;
  }
}

/* PCでは同じ行のカードを伸ばす。768px未満は既存の自然な高さを維持する。 */
@media (min-width: 768px) {
  .jline-lp .jline-card-grid > .wp-block-column {
    display: flex;
    flex-direction: column;
    align-self: stretch;
  }

  .jline-lp .jline-card-grid > .wp-block-column > .jline-card {
    width: 100%;
    flex: 1 1 auto;
  }
}

/* 0.1.2：暫定ブランドカラー。Gutenbergの個別色設定は優先する。 */
.jline-lp {
  --jline-primary: #245578;
  --jline-primary-dark: #17364d;
  --jline-accent: #147d87;
  --jline-text: #243746;
  --jline-muted: #596b78;
  --jline-surface: #f3f6f8;
  --jline-border: #d5dfe6;
  --jline-white: #ffffff;
  --jline-cta-bg: var(--jline-primary-dark);
  --jline-button-bg: var(--jline-primary);
  --jline-button-text: var(--jline-white);
  --jline-button-hover: var(--jline-primary-dark);
  --jline-button-outline: var(--jline-primary);
  --jline-button-secondary-hover: var(--jline-surface);
}

/* ヒーロー。列の順序と折り返しは標準カラムに任せる。 */
/* 初期背景。Gutenberg側の明示的な背景設定を優先する。 */
:where(.jline-lp .jline-hero) {
  background-color: var(--jline-surface);
}
.jline-lp :where(.jline-hero:not(.has-text-color)) {
  color: var(--jline-text);
}
.jline-lp .jline-hero :where(h1) {
  font-size: var(--jline-font-h1);
  line-height: 1.3;
  font-weight: 700;
  margin-block: 0 24px;
}
.jline-lp .jline-hero :where(h1:not(.has-text-color)) {
  color: inherit;
}
.jline-lp .jline-hero :where(p) {
  max-width: 38em;
  margin-block: 0 24px;
}
.jline-lp .jline-hero :where(.wp-block-image img) {
  border-radius: var(--jline-image-radius);
}
.jline-lp .jline-hero :where(.wp-block-buttons) {
  gap: 16px;
  margin-block-start: 32px;
}

/* カバーの画像・焦点位置・オーバーレイ・文字色は標準ブロックで管理。 */
.jline-lp .jline-section-cover {
  padding-inline: 0;
}
.jline-lp .jline-section-cover :where(h2) {
  max-width: 24em;
  font-size: var(--jline-font-h2);
  font-weight: 700;
  margin-block: 0;
}
.jline-lp .jline-section-cover :where(h2:not(.has-text-color)) {
  color: inherit;
}
.jline-lp .jline-section-cover :where(p) {
  max-width: var(--jline-prose-width);
  margin-block: 24px 0;
}

/* CTAは濃いブランド背景。ボタンは背景とのコントラストを確保する。 */
.jline-lp :where(.jline-cta:not(.has-text-color)) {
  color: var(--jline-white);
}
.jline-lp .jline-cta {
  --jline-button-bg: var(--jline-accent);
  --jline-button-hover: var(--jline-primary);
  --jline-button-outline: var(--jline-white);
  --jline-button-secondary-hover: var(--jline-primary);
}
.jline-lp .jline-cta :where(h2) {
  max-width: 24em;
  margin-inline: auto;
  margin-block: 0 24px;
  font-size: var(--jline-font-h2);
  line-height: 1.4;
}
.jline-lp .jline-cta :where(h2:not(.has-text-color)) {
  color: inherit;
}
.jline-lp .jline-cta :where(.jline-container) > :where(p) {
  max-width: 38em;
  margin-block: 0 24px;
}

/* 背景・文字色の個別設定があるボタンは、その色を維持する。 */
.jline-lp :where(.jline-button, .jline-button-secondary) > .wp-block-button__link {
  font-weight: 700;
}
.jline-lp :where(.jline-button-secondary) > .wp-block-button__link {
  border-color: var(--jline-button-outline);
}
.jline-lp :where(.jline-button-secondary) > .wp-block-button__link:not(.has-text-color) {
  color: var(--jline-button-outline);
}
.jline-lp :where(.jline-button) > .wp-block-button__link:not(.has-background):hover {
  background-color: var(--jline-button-hover);
}
.jline-lp :where(.jline-button-secondary) > .wp-block-button__link:not(.has-background):hover {
  background-color: var(--jline-button-secondary-hover);
}
.jline-lp :where(.jline-button, .jline-button-secondary) > .wp-block-button__link:focus,
.jline-lp :where(.jline-button, .jline-button-secondary) > .wp-block-button__link:focus-visible {
  outline: 3px solid var(--jline-button-outline);
  outline-offset: 4px;
}

/* 狭い画面ではヒーローのボタンも幅いっぱいにし、長文を折り返す。 */
@media (max-width: 767px) {
  .jline-lp .jline-hero :where(.jline-button, .jline-button-secondary),
  .jline-lp .jline-hero :where(.jline-button, .jline-button-secondary) > .wp-block-button__link {
    width: 100%;
  }
}
