/**
 * ARC-Editing 共通スタイル（全ブロック）
 */

/*
 * 本文段落タイポ — SP/PC 共通
 * 1.05rem / line-height 2.205rem — テーマ $font_size_body / $line_height_body と同期
 */
:root {
  --arc-editing-type-body: 1.05rem;
  --arc-editing-type-body-lh: 2.205rem;
  --arc-editing-type-body-tracking: normal;
}

/* No Wrap */
.text-nowrap {
  white-space: nowrap;
}

/* テキストエリア改行（全ブロック共通） */
.arc-editing-multiline {
  white-space: pre-line;
  line-height: 1.75;
  margin-top: 0;
  margin-bottom: 0;
}

/* 段落が複数あるときは 1 行分（1em）あける（カード本文は下の .arc-editing-prose ルールを優先） */
.arc-editing-multiline + .arc-editing-multiline,
p.arc-editing-multiline + p.arc-editing-multiline {
  margin-top: 1em;
}

/*
 * 見出し＋本文スタック — 横並びストーリー・見出しブロック共用
 * flex gap はテーマで無効化されやすいため margin-top で統一
 */
.arc-editing-copy-stack {
  --arc-editing-copy-gap: clamp(0.85rem, 2vw, 1.35rem);
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.arc-split-story .arc-editing-copy-stack {
  justify-content: center;
}

.arc-editing-copy-stack > :not(:first-child) {
  margin-top: var(--arc-editing-copy-gap);
}

.arc-split-story__heading + .arc-split-story__body {
  margin-top: calc(var(--arc-editing-copy-gap, clamp(0.85rem, 2vw, 1.35rem)) + var(--arc-editing-paragraph-gap, 1em));
}

/*
 * 本文段落 — 全ブロック共通（テーマ $font_size_body / $line_height_body と同期）
 * flex gap はテーマで無効化されやすいため margin-top で段落間隔を統一
 */
:is(
  .arc-section-guide__body,
  .arc-service-intro__body,
  .arc-card-carousel__body,
  .arc-stack-cards__card-body,
  .arc-stack-cards__lead,
  .arc-faq-accordion__lead,
  .arc-h1-section__lead-wrap,
  .arc-split-story__body,
  .arc-heading :is(.arc-heading__text, .arc-split-story__text),
  .arc-faq-accordion__answer,
  .arc-label-note-box__panel-body
) {
  --arc-editing-paragraph-gap: 1em;
  font-size: var(--arc-editing-type-body);
  line-height: var(--arc-editing-type-body-lh);
  letter-spacing: var(--arc-editing-type-body-tracking);
}

:is(
  .arc-section-guide__body,
  .arc-service-intro__body,
  .arc-card-carousel__body,
  .arc-stack-cards__card-body,
  .arc-stack-cards__lead,
  .arc-faq-accordion__lead,
  .arc-h1-section__lead-wrap,
  .arc-split-story__body,
  .arc-heading :is(.arc-heading__text, .arc-split-story__text),
  .arc-faq-accordion__answer,
  .arc-label-note-box__panel-body
) > p {
  margin-top: 0;
  margin-bottom: 0;
  white-space: normal;
  font-size: var(--arc-editing-type-body);
  line-height: var(--arc-editing-type-body-lh);
  letter-spacing: var(--arc-editing-type-body-tracking);
  font-weight: inherit;
}

:is(
  .arc-section-guide__body,
  .arc-service-intro__body,
  .arc-card-carousel__body,
  .arc-stack-cards__card-body,
  .arc-stack-cards__lead,
  .arc-faq-accordion__lead,
  .arc-h1-section__lead-wrap,
  .arc-split-story__body,
  .arc-heading :is(.arc-heading__text, .arc-split-story__text),
  .arc-faq-accordion__answer,
  .arc-label-note-box__panel-body
) > p:not(:first-child),
:is(
  .arc-section-guide__body,
  .arc-service-intro__body,
  .arc-card-carousel__body,
  .arc-stack-cards__card-body,
  .arc-stack-cards__lead,
  .arc-faq-accordion__lead,
  .arc-h1-section__lead-wrap,
  .arc-split-story__body,
  .arc-heading :is(.arc-heading__text, .arc-split-story__text),
  .arc-faq-accordion__answer,
  .arc-label-note-box__panel-body
) p + p {
  margin-top: var(--arc-editing-paragraph-gap);
}

:is(
  .arc-section-guide__body,
  .arc-service-intro__body,
  .arc-card-carousel__body,
  .arc-stack-cards__card-body,
  .arc-stack-cards__lead,
  .arc-faq-accordion__lead,
  .arc-h1-section__lead-wrap,
  .arc-split-story__body,
  .arc-heading :is(.arc-heading__text, .arc-split-story__text),
  .arc-faq-accordion__answer,
  .arc-label-note-box__panel-body
) p br {
  display: block;
  margin-bottom: 0;
  content: '';
}

:is(
  .arc-section-guide__body,
  .arc-service-intro__body,
  .arc-card-carousel__body,
  .arc-stack-cards__card-body,
  .arc-stack-cards__lead,
  .arc-faq-accordion__lead,
  .arc-h1-section__lead-wrap,
  .arc-split-story__body,
  .arc-heading :is(.arc-heading__text, .arc-split-story__text),
  .arc-faq-accordion__answer,
  .arc-label-note-box__panel-body
) br + br {
  display: block;
  margin-top: var(--arc-editing-paragraph-gap);
  content: '';
}

/* PPF メーカー別価格表（ショートコード出力） */
.ppf-pricetable {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}

.ppf-pricetable__table {
  width: 100%;
  min-width: 36rem;
}

.ppf-pricetable__label--mobile {
  display: none;
}

@media (max-width: 767.98px) {
  .ppf-pricetable__label--desktop {
    display: none;
  }

  .ppf-pricetable__label--mobile {
    display: inline;
  }

  .ppf-pricetable__table thead th:not(:first-child) {
    white-space: normal;
    line-height: 1.35;
    text-align: center;
  }
}

/* アコーディオン内 PPF 価格表 — 白背景・ストライプ維持・スクロールヒント */
.arc-faq-accordion__answer .ppf-pricetable {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 70vh;
  background: #fff;
  border-radius: 0.375rem;
}

.arc-faq-accordion__answer .ppf-pricetable .ppf-pricetable__table {
  background-color: #fff;
  color: #242424 !important;
  border-collapse: collapse;
}

.arc-faq-accordion__answer .ppf-pricetable.text-white,
.arc-faq-accordion__answer .ppf-pricetable.text-white :is(th, td) {
  color: #242424 !important;
}

.arc-faq-accordion__answer .ppf-pricetable.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.05);
}

.arc-faq-accordion__answer .ppf-pricetable.table-striped tbody tr:nth-of-type(even) {
  background-color: #fff;
}

.arc-faq-accordion__answer .ppf-pricetable .thead-light th {
  background-color: #fff;
  color: #495057;
  border-color: #dee2e6;
}

.arc-faq-accordion__answer .ppf-pricetable :is(th, td) {
  border-color: #dee2e6;
}

.ppf-pricetable__scroll-hints {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.45;
  transition: opacity 0.6s ease;
}

.ppf-pricetable__scroll-hints.is-ppf-scroll-hint-fresh {
  opacity: 1;
}

.ppf-pricetable__scroll-hint {
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ppf-pricetable__scroll-hint-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(44, 46, 54, 0.32);
}

.ppf-pricetable__scroll-hint-icon {
  display: block;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}

.ppf-pricetable__scroll-hint.is-visible {
  opacity: 1;
}

.ppf-pricetable__scroll-hint--left {
  left: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
}

.ppf-pricetable__scroll-hint--right {
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
}

.ppf-pricetable__scroll-hint--up {
  top: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
}

.ppf-pricetable__scroll-hint--down {
  bottom: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
}

@media (prefers-reduced-motion: reduce) {
  .ppf-pricetable__scroll-hints,
  .ppf-pricetable__scroll-hint {
    transition: none;
  }
}

/* PPF フィルム比較表 — ZAP 列を強調（wp-block-table に arc-ppf-compare-table を追加） */
.arc-ppf-compare-table {
  --arc-compare-zap-bg: rgba(252, 146, 0, 0.09);
  --arc-compare-zap-bg-strong: rgba(252, 146, 0, 0.16);
  --arc-compare-zap-border: var(--arc-brand-orange, #fc9200);
  --arc-compare-label-bg: var(--arc-brand-cream, #fbf9ef);
  --arc-compare-border: #e2e6ea;
  --arc-compare-ink: var(--arc-brand-ink, #2c2e36);
  --arc-compare-muted: #5c6570;
  --arc-compare-radius: 0.625rem;

  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--arc-compare-radius);
  box-shadow: 0 2px 14px rgba(44, 46, 54, 0.08);
}

.arc-ppf-compare-table table {
  width: 100%;
  min-width: 36rem;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  background: #fff;
  color: var(--arc-compare-ink) !important;
  font-size: clamp(0.875rem, 2.2vw, 0.9375rem);
  line-height: 1.55;
}

.arc-ppf-compare-table :is(th, td) {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--arc-compare-border);
  vertical-align: middle;
}

.arc-ppf-compare-table thead th {
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  background: var(--arc-compare-ink);
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.12);
}

.arc-ppf-compare-table thead th:first-child {
  text-align: left;
  border-radius: var(--arc-compare-radius) 0 0 0;
}

.arc-ppf-compare-table thead th:last-child {
  border-radius: 0 var(--arc-compare-radius) 0 0;
}

/* ZAP 列ヘッダー */
.arc-ppf-compare-table thead th:nth-child(2) {
  position: relative;
  background: var(--arc-compare-zap-border);
  color: #fff !important;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}

.arc-ppf-compare-table thead th:nth-child(2)::after {
  content: 'THE WRAP おすすめ';
  display: block;
  margin-top: 0.2rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  opacity: 0.95;
}

/* 行ラベル列 */
.arc-ppf-compare-table tbody td:first-child,
.arc-ppf-compare-table tbody th:first-child {
  font-weight: 600;
  text-align: left;
  background: var(--arc-compare-label-bg);
  color: var(--arc-compare-ink) !important;
  white-space: nowrap;
}

/* 競合他社列 — 控えめ */
.arc-ppf-compare-table tbody :is(td, th):not(:first-child):not(:nth-child(2)) {
  text-align: center;
  color: var(--arc-compare-muted) !important;
  background: #fff;
}

/* ZAP 列 — 背景・枠で強調 */
.arc-ppf-compare-table tbody :is(td, th):nth-child(2) {
  text-align: center;
  font-weight: 600;
  color: var(--arc-compare-ink) !important;
  background: var(--arc-compare-zap-bg);
  border-left: 2px solid var(--arc-compare-zap-border);
  border-right: 2px solid var(--arc-compare-zap-border);
}

.arc-ppf-compare-table thead th:nth-child(2) {
  border-left: 2px solid var(--arc-compare-zap-border);
  border-right: 2px solid var(--arc-compare-zap-border);
}

/* ZAP 列のアピール値（strong） */
.arc-ppf-compare-table tbody :is(td, th):nth-child(2) strong {
  color: var(--arc-compare-zap-border);
  font-weight: 800;
}

/* 優位な行 — arc-ppf-compare-table__win を ZAP セルに付与 */
.arc-ppf-compare-table tbody .arc-ppf-compare-table__win {
  background: var(--arc-compare-zap-bg-strong);
}

/* 自己修復など記号セル */
.arc-ppf-compare-table tbody td:not(:first-child) {
  font-variant-numeric: tabular-nums;
}

/* 交互ストライプ（ZAP 列の色は維持） */
.arc-ppf-compare-table tbody tr:nth-child(even) td:not(:first-child):not(:nth-child(2)) {
  background: #f8f9fa;
}

.arc-ppf-compare-table tbody tr:nth-child(even) td:nth-child(2) {
  background: color-mix(in srgb, var(--arc-compare-zap-bg) 70%, #f8f9fa);
}

.arc-ppf-compare-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 var(--arc-compare-radius);
}

.arc-ppf-compare-table tbody tr:last-child td:last-child {
  border-radius: 0 0 var(--arc-compare-radius) 0;
}

@media (max-width: 767.98px) {
  .arc-ppf-compare-table table {
    min-width: 34rem;
  }

  .arc-ppf-compare-table :is(th, td) {
    padding: 0.7rem 0.65rem;
  }

  .arc-ppf-compare-table thead th:nth-child(2)::after {
    font-size: 0.5625rem;
  }
}

/* PPF 保証対象一覧 — 製品保証と施工保証の違い */
.arc-ppf-warranty-table {
  --arc-warranty-border: #e2e6ea;
  --arc-warranty-ink: var(--arc-brand-ink, #2c2e36);
  --arc-warranty-muted: var(--arc-brand-muted-ink, #3d4654);
  --arc-warranty-label-bg: var(--arc-brand-cream, #fbf9ef);
  --arc-warranty-radius: 0.625rem;
  --arc-warranty-insight-bg: color-mix(in srgb, var(--arc-brand-red, #f9423a) 6%, transparent);
  --arc-warranty-alert: var(--arc-brand-red, #f9423a);
  --arc-warranty-yes: var(--arc-brand-green, #339f00);
  --arc-warranty-partial: var(--arc-brand-orange, #fc9200);
  --arc-warranty-no: color-mix(in srgb, var(--arc-brand-muted-ink, #3d4654) 52%, #ffffff);
  --arc-warranty-na: color-mix(in srgb, var(--arc-brand-muted-ink, #3d4654) 38%, #ffffff);
  --arc-warranty-stripe: var(--arc-brand-cream, #fbf9ef);
  --arc-warranty-surface: var(--arc-brand-surface-card, #ffffff);
  --arc-warranty-symbol-ink: var(--arc-brand-black, #000000);
  --arc-warranty-on-dark: var(--arc-brand-on-dark-pure, #ffffff);

  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--arc-warranty-radius);
  box-shadow: 0 2px 14px rgba(44, 46, 54, 0.08);
}

.arc-ppf-warranty-table table {
  width: 100%;
  min-width: 44rem;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  background: var(--arc-warranty-surface);
  color: var(--arc-warranty-ink) !important;
  font-size: clamp(0.875rem, 2.2vw, 0.9375rem);
  line-height: 1.55;
}

.arc-ppf-warranty-table :is(th, td) {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--arc-warranty-border);
  vertical-align: middle;
}

.arc-ppf-warranty-table thead th {
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  background: var(--arc-warranty-ink);
  color: var(--arc-warranty-on-dark) !important;
  border-color: rgba(255, 255, 255, 0.12);
}

.arc-ppf-warranty-table thead th:first-child {
  text-align: left;
  border-radius: var(--arc-warranty-radius) 0 0 0;
}

.arc-ppf-warranty-table thead th:last-child {
  border-radius: 0 var(--arc-warranty-radius) 0 0;
}

.arc-ppf-warranty-table thead th:nth-child(2)::after,
.arc-ppf-warranty-table thead th:nth-child(3)::after {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  opacity: 0.82;
}

.arc-ppf-warranty-table thead th:nth-child(2)::after {
  content: 'メーカーが定める';
}

.arc-ppf-warranty-table thead th:nth-child(3)::after {
  content: '施工店が担う';
}

/* 3列目ヘッダー — 施工保証 / （アフター保証）の2行表示 */
.arc-ppf-warranty-table thead th:nth-child(3) {
  white-space: normal;
  line-height: 1.35;
  font-size: 0;
}

.arc-ppf-warranty-table thead th:nth-child(3)::before {
  content: '施工保証\A（アフター保証）';
  display: block;
  white-space: pre;
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--arc-warranty-on-dark);
}

.arc-ppf-warranty-table tbody td:first-child,
.arc-ppf-warranty-table tbody th:first-child {
  font-weight: 600;
  text-align: left;
  background: var(--arc-warranty-label-bg);
  color: var(--arc-warranty-ink) !important;
  white-space: normal;
  min-width: 10.5rem;
}

.arc-ppf-warranty-table tbody :is(td, th):nth-child(2),
.arc-ppf-warranty-table tbody :is(td, th):nth-child(3) {
  width: 5.75rem;
  min-width: 5.75rem;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--arc-warranty-muted) !important;
  background: var(--arc-warranty-surface);
}

.arc-ppf-warranty-table tbody td:nth-child(2).arc-ppf-warranty-table__status--yes,
.arc-ppf-warranty-table tbody td:nth-child(3).arc-ppf-warranty-table__status--yes {
  color: var(--arc-warranty-yes) !important;
  font-weight: 700 !important;
}

.arc-ppf-warranty-table tbody td:nth-child(2).arc-ppf-warranty-table__status--partial,
.arc-ppf-warranty-table tbody td:nth-child(3).arc-ppf-warranty-table__status--partial {
  color: var(--arc-warranty-partial) !important;
}

.arc-ppf-warranty-table tbody td:nth-child(2).arc-ppf-warranty-table__status--no,
.arc-ppf-warranty-table tbody td:nth-child(3).arc-ppf-warranty-table__status--no {
  color: var(--arc-warranty-no) !important;
}

.arc-ppf-warranty-table tbody td:nth-child(2).arc-ppf-warranty-table__status--na,
.arc-ppf-warranty-table tbody td:nth-child(3).arc-ppf-warranty-table__status--na {
  color: var(--arc-warranty-na) !important;
  font-weight: 600 !important;
}

.arc-ppf-warranty-table tbody tr:nth-child(even) :is(td, th):nth-child(2),
.arc-ppf-warranty-table tbody tr:nth-child(even) :is(td, th):nth-child(3) {
  background: var(--arc-warranty-stripe);
}

.arc-ppf-warranty-table tbody :is(td, th):nth-child(4) {
  text-align: left;
  font-weight: 400;
  color: var(--arc-warranty-muted) !important;
  background: var(--arc-warranty-surface);
  white-space: normal;
  min-width: 16rem;
  line-height: 1.6;
}

.arc-ppf-warranty-table tbody tr:nth-child(even) td:nth-child(4) {
  background: var(--arc-warranty-stripe);
}

.arc-ppf-warranty-table__insight-row :is(td, th) {
  background: var(--arc-warranty-insight-bg);
}

/* 製品×・施工◯の3行 — 症状列を赤文字 */
.arc-ppf-warranty-table tbody tr.arc-ppf-warranty-table__insight-row > td:first-child {
  color: var(--arc-warranty-alert) !important;
  font-weight: 700 !important;
}

/* 同3行 — 施工保証の◯を太字（色はブランド黒のまま） */
.arc-ppf-warranty-table tbody tr.arc-ppf-warranty-table__insight-row > td:nth-child(3).arc-ppf-warranty-table__status--yes {
  color: var(--arc-warranty-symbol-ink) !important;
  font-weight: 700 !important;
  font-size: 1.35em;
  line-height: 1;
}

.arc-ppf-warranty-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 var(--arc-warranty-radius);
}

.arc-ppf-warranty-table tbody tr:last-child td:last-child {
  border-radius: 0 0 var(--arc-warranty-radius) 0;
}

.arc-ppf-warranty-table__alert {
  color: var(--arc-warranty-alert);
  font-weight: 700;
}

.arc-ppf-warranty-table__key {
  color: var(--arc-warranty-ink);
  font-weight: 700;
}

@media (max-width: 767.98px) {
  .arc-ppf-warranty-table table {
    min-width: 40rem;
  }

  .arc-ppf-warranty-table :is(th, td) {
    padding: 0.7rem 0.65rem;
  }

  .arc-ppf-warranty-table thead th:nth-child(2)::after,
  .arc-ppf-warranty-table thead th:nth-child(3)::after {
    font-size: 0.5625rem;
  }
}
