/* =========================================================
   Affiliate Blocks - Decorated Heading Block
========================================================= */

.ab-decorated-heading,
.ab-decorated-heading * {
  box-sizing: border-box;
}

.ab-decorated-heading {
  width: 100%;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ab-heading-text, #111827);
}

/* ===============================
   余白
================================ */

.ab-decorated-heading.is-spacing-small {
  margin-top: 18px;
  margin-bottom: 14px;
}

.ab-decorated-heading.is-spacing-normal {
  margin-top: 30px;
  margin-bottom: 20px;
}

.ab-decorated-heading.is-spacing-large {
  margin-top: 44px;
  margin-bottom: 28px;
}

/* ===============================
   基本構造
================================ */

.ab-decorated-heading-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.ab-decorated-heading.is-align-left .ab-decorated-heading-inner {
  justify-content: flex-start;
  text-align: left;
}

.ab-decorated-heading.is-align-center .ab-decorated-heading-inner {
  justify-content: center;
  text-align: center;
}

.ab-decorated-heading-text {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  color: var(--ab-heading-text, #111827) !important;
  font-weight: 900 !important;
  line-height: 1.45 !important;
  letter-spacing: 0.01em;
  box-shadow: none !important;
  text-decoration: none !important;
}

.ab-decorated-heading-text::before,
.ab-decorated-heading-text::after {
  content: none !important;
  display: none !important;
}

/* ===============================
   見出しレベル別
================================ */

.ab-decorated-heading.is-level-h2 .ab-decorated-heading-text {
  font-size: 28px !important;
}

.ab-decorated-heading.is-level-h3 .ab-decorated-heading-text {
  font-size: 23px !important;
}

.ab-decorated-heading.is-level-h4 .ab-decorated-heading-text {
  font-size: 19px !important;
}

/* ===============================
   アイコン共通
================================ */

.ab-decorated-heading-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--ab-heading-accent, #2563eb);
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.22);
  position: relative;
  z-index: 1;
}

.ab-decorated-heading.is-level-h3 .ab-decorated-heading-icon {
  width: 30px;
  height: 30px;
  font-size: 16px;
}

.ab-decorated-heading.is-level-h4 .ab-decorated-heading-icon {
  width: 26px;
  height: 26px;
  font-size: 14px;
}

/* =========================================================
   デザイン1：左ライン
========================================================= */

.ab-decorated-heading.is-style-left-line .ab-decorated-heading-inner {
  padding: 14px 18px;
  background: #fff;
  border-left: 7px solid var(--ab-heading-accent, #2563eb);
  border-radius: 0 14px 14px 0;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.08);
}

.ab-decorated-heading.is-style-left-line.is-level-h3 .ab-decorated-heading-inner {
  padding: 12px 16px;
  border-left-width: 6px;
}

.ab-decorated-heading.is-style-left-line.is-level-h4 .ab-decorated-heading-inner {
  padding: 10px 14px;
  border-left-width: 5px;
}

/* =========================================================
   デザイン2：マーカー
========================================================= */

.ab-decorated-heading.is-style-marker .ab-decorated-heading-inner {
  padding: 4px 2px 6px;
  background: transparent;
  box-shadow: none;
}

.ab-decorated-heading.is-style-marker .ab-decorated-heading-text {
  display: inline;
  padding: 0 4px 2px !important;
  background: linear-gradient(
    transparent 58%,
    color-mix(in srgb, var(--ab-heading-accent, #2563eb) 28%, #ffffff) 58%
  ) !important;
}

.ab-decorated-heading.is-style-marker .ab-decorated-heading-icon {
  border-radius: 10px;
  width: 32px;
  height: 32px;
}

/* color-mix 非対応ブラウザ用 */
@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
  .ab-decorated-heading.is-style-marker .ab-decorated-heading-text {
    background: linear-gradient(transparent 58%, var(--ab-heading-bg, #eff6ff) 58%) !important;
  }
}

/* =========================================================
   デザイン3：ラベル付き
========================================================= */

.ab-decorated-heading.is-style-label .ab-decorated-heading-inner,
.ab-decorated-heading.is-style-check .ab-decorated-heading-inner {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  padding: 10px 18px 10px 12px;
  background: var(--ab-heading-bg, #eff6ff);
  border: 2px solid var(--ab-heading-accent, #2563eb);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.ab-decorated-heading.is-style-label .ab-decorated-heading-icon,
.ab-decorated-heading.is-style-check .ab-decorated-heading-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  box-shadow: none;
}

.ab-decorated-heading.is-style-label.is-align-center,
.ab-decorated-heading.is-style-check.is-align-center {
  text-align: center;
}

.ab-decorated-heading.is-style-label.is-align-center .ab-decorated-heading-inner,
.ab-decorated-heading.is-style-check.is-align-center .ab-decorated-heading-inner {
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
   デザイン4：リボン
========================================================= */

.ab-decorated-heading.is-style-ribbon .ab-decorated-heading-inner {
  display: inline-flex;
  width: auto;
  max-width: calc(100% - 20px);
  padding: 13px 24px 13px 18px;
  background: var(--ab-heading-accent, #2563eb);
  color: #fff;
  border-radius: 10px 0 0 10px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.ab-decorated-heading.is-style-ribbon .ab-decorated-heading-inner::after {
  content: "";
  position: absolute;
  top: 0;
  right: -18px;
  width: 0;
  height: 0;
  border-top: 26px solid transparent;
  border-bottom: 26px solid transparent;
  border-left: 18px solid var(--ab-heading-accent, #2563eb);
}

.ab-decorated-heading.is-style-ribbon .ab-decorated-heading-text {
  color: #fff !important;
}

.ab-decorated-heading.is-style-ribbon .ab-decorated-heading-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: none;
}

.ab-decorated-heading.is-style-ribbon.is-align-center .ab-decorated-heading-inner {
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
   デザイン5：ステップ番号
========================================================= */

.ab-decorated-heading.is-style-step .ab-decorated-heading-inner,
.ab-decorated-heading.is-style-number .ab-decorated-heading-inner {
  gap: 14px;
  padding: 14px 18px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.ab-decorated-heading-number {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 44px;
  padding: 0 12px;
  background: var(--ab-heading-accent, #2563eb);
  color: #fff;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.22);
}

.ab-decorated-heading.is-style-step .ab-decorated-heading-number,
.ab-decorated-heading.is-style-number .ab-decorated-heading-number {
  position: relative;
}

.ab-decorated-heading.is-style-step .ab-decorated-heading-number::after,
.ab-decorated-heading.is-style-number .ab-decorated-heading-number::after {
  content: "";
  position: absolute;
  right: -7px;
  width: 12px;
  height: 12px;
  background: var(--ab-heading-accent, #2563eb);
  transform: rotate(45deg);
  border-radius: 2px;
}

.ab-decorated-heading.is-level-h3 .ab-decorated-heading-number {
  min-width: 50px;
  height: 38px;
  font-size: 16px;
}

.ab-decorated-heading.is-level-h4 .ab-decorated-heading-number {
  min-width: 42px;
  height: 32px;
  border-radius: 10px;
  font-size: 14px;
}

/* =========================================================
   デザイン6：括弧
========================================================= */

.ab-decorated-heading.is-style-bracket .ab-decorated-heading-inner {
  justify-content: center;
  gap: 14px;
  padding: 8px 16px;
  background: transparent;
}

.ab-decorated-heading.is-style-bracket .ab-decorated-heading-inner::before,
.ab-decorated-heading.is-style-bracket .ab-decorated-heading-inner::after {
  content: "";
  display: block;
  width: 18px;
  height: 46px;
  border-color: var(--ab-heading-accent, #2563eb);
  flex: 0 0 auto;
}

.ab-decorated-heading.is-style-bracket .ab-decorated-heading-inner::before {
  border-left: 5px solid var(--ab-heading-accent, #2563eb);
  border-top: 5px solid var(--ab-heading-accent, #2563eb);
  border-bottom: 5px solid var(--ab-heading-accent, #2563eb);
  border-radius: 10px 0 0 10px;
}

.ab-decorated-heading.is-style-bracket .ab-decorated-heading-inner::after {
  border-right: 5px solid var(--ab-heading-accent, #2563eb);
  border-top: 5px solid var(--ab-heading-accent, #2563eb);
  border-bottom: 5px solid var(--ab-heading-accent, #2563eb);
  border-radius: 0 10px 10px 0;
}

.ab-decorated-heading.is-style-bracket .ab-decorated-heading-icon {
  display: none;
}

/* =========================================================
   デザイン7：上下ライン
========================================================= */

.ab-decorated-heading.is-style-double-line .ab-decorated-heading-inner {
  padding: 14px 4px;
  border-top: 3px solid var(--ab-heading-accent, #2563eb);
  border-bottom: 3px solid var(--ab-heading-accent, #2563eb);
  background: transparent;
}

.ab-decorated-heading.is-style-double-line .ab-decorated-heading-icon {
  border-radius: 8px;
}

/* =========================================================
   デザイン8：ドット下線
========================================================= */

.ab-decorated-heading.is-style-dot-line .ab-decorated-heading-inner {
  padding: 0 0 12px;
  border-bottom: 4px dotted var(--ab-heading-accent, #2563eb);
  background: transparent;
}

.ab-decorated-heading.is-style-dot-line .ab-decorated-heading-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

/* =========================================================
   デザイン9：カード
   旧 band 互換
========================================================= */

.ab-decorated-heading.is-style-card .ab-decorated-heading-inner,
.ab-decorated-heading.is-style-band .ab-decorated-heading-inner {
  padding: 16px 20px;
  background: var(--ab-heading-bg, #eff6ff);
  border: 2px solid var(--ab-heading-accent, #2563eb);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
  overflow: hidden;
}

.ab-decorated-heading.is-style-card .ab-decorated-heading-inner::before,
.ab-decorated-heading.is-style-band .ab-decorated-heading-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 55%);
  pointer-events: none;
}

.ab-decorated-heading.is-style-card .ab-decorated-heading-icon,
.ab-decorated-heading.is-style-card .ab-decorated-heading-text,
.ab-decorated-heading.is-style-band .ab-decorated-heading-icon,
.ab-decorated-heading.is-style-band .ab-decorated-heading-text {
  position: relative;
  z-index: 1;
}

/* =========================================================
   デザイン10：吹き出し風
========================================================= */

.ab-decorated-heading.is-style-speech .ab-decorated-heading-inner {
  padding: 15px 20px;
  background: var(--ab-heading-bg, #eff6ff);
  border: 2px solid var(--ab-heading-accent, #2563eb);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.ab-decorated-heading.is-style-speech .ab-decorated-heading-inner::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -10px;
  width: 18px;
  height: 18px;
  background: var(--ab-heading-bg, #eff6ff);
  border-right: 2px solid var(--ab-heading-accent, #2563eb);
  border-bottom: 2px solid var(--ab-heading-accent, #2563eb);
  transform: rotate(45deg);
}

.ab-decorated-heading.is-style-speech.is-align-center .ab-decorated-heading-inner::after {
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
}

/* =========================================================
   旧 underline 互換
========================================================= */

.ab-decorated-heading.is-style-underline .ab-decorated-heading-inner {
  padding: 0 0 12px;
  border-bottom: 4px solid #e5e7eb;
}

.ab-decorated-heading.is-style-underline .ab-decorated-heading-inner::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 34%;
  min-width: 120px;
  height: 4px;
  background: var(--ab-heading-accent, #2563eb);
  border-radius: 999px;
}

.ab-decorated-heading.is-style-underline.is-align-center .ab-decorated-heading-inner::after {
  left: 50%;
  transform: translateX(-50%);
}

/* ===============================
   アイコンなし
================================ */

.ab-decorated-heading.no-icon .ab-decorated-heading-inner {
  gap: 0;
}

.ab-decorated-heading.is-style-step.no-icon .ab-decorated-heading-inner,
.ab-decorated-heading.is-style-number.no-icon .ab-decorated-heading-inner {
  gap: 14px;
}

/* ===============================
   編集画面用
================================ */

.ab-decorated-heading-admin-note {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.ab-decorated-heading.is-align-center .ab-decorated-heading-admin-note {
  text-align: center;
}

/* ===============================
   スマホ対応
================================ */

@media (max-width: 768px) {
  .ab-decorated-heading.is-spacing-small {
    margin-top: 16px;
    margin-bottom: 12px;
  }

  .ab-decorated-heading.is-spacing-normal {
    margin-top: 24px;
    margin-bottom: 16px;
  }

  .ab-decorated-heading.is-spacing-large {
    margin-top: 34px;
    margin-bottom: 22px;
  }

  .ab-decorated-heading.is-level-h2 .ab-decorated-heading-text {
    font-size: 23px !important;
  }

  .ab-decorated-heading.is-level-h3 .ab-decorated-heading-text {
    font-size: 20px !important;
  }

  .ab-decorated-heading.is-level-h4 .ab-decorated-heading-text {
    font-size: 17px !important;
  }

  .ab-decorated-heading-inner {
    gap: 10px;
  }

  .ab-decorated-heading.is-style-left-line .ab-decorated-heading-inner,
  .ab-decorated-heading.is-style-card .ab-decorated-heading-inner,
  .ab-decorated-heading.is-style-band .ab-decorated-heading-inner,
  .ab-decorated-heading.is-style-speech .ab-decorated-heading-inner,
  .ab-decorated-heading.is-style-label .ab-decorated-heading-inner,
  .ab-decorated-heading.is-style-check .ab-decorated-heading-inner,
  .ab-decorated-heading.is-style-step .ab-decorated-heading-inner,
  .ab-decorated-heading.is-style-number .ab-decorated-heading-inner {
    padding: 12px 14px;
  }

  .ab-decorated-heading.is-style-ribbon .ab-decorated-heading-inner {
    padding: 11px 18px 11px 14px;
  }

  .ab-decorated-heading.is-style-ribbon .ab-decorated-heading-inner::after {
    border-top-width: 23px;
    border-bottom-width: 23px;
  }

  .ab-decorated-heading-icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .ab-decorated-heading.is-level-h3 .ab-decorated-heading-icon,
  .ab-decorated-heading.is-level-h4 .ab-decorated-heading-icon {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .ab-decorated-heading-number {
    min-width: 46px;
    height: 36px;
    font-size: 15px;
  }

  .ab-decorated-heading.is-level-h4 .ab-decorated-heading-number {
    min-width: 38px;
    height: 30px;
    font-size: 13px;
  }

  .ab-decorated-heading.is-style-bracket .ab-decorated-heading-inner::before,
  .ab-decorated-heading.is-style-bracket .ab-decorated-heading-inner::after {
    width: 14px;
    height: 38px;
    border-width: 4px;
  }
}

@media (max-width: 480px) {
  .ab-decorated-heading.is-level-h2 .ab-decorated-heading-text {
    font-size: 21px !important;
  }

  .ab-decorated-heading.is-level-h3 .ab-decorated-heading-text {
    font-size: 18px !important;
  }

  .ab-decorated-heading.is-level-h4 .ab-decorated-heading-text {
    font-size: 16px !important;
  }

  .ab-decorated-heading.is-align-center .ab-decorated-heading-inner {
    text-align: center;
  }

  .ab-decorated-heading.is-style-label .ab-decorated-heading-inner,
  .ab-decorated-heading.is-style-check .ab-decorated-heading-inner {
    border-radius: 16px;
  }

  .ab-decorated-heading.is-style-speech .ab-decorated-heading-inner::after {
    bottom: -8px;
    width: 15px;
    height: 15px;
  }

  .ab-decorated-heading.is-style-ribbon .ab-decorated-heading-inner {
    max-width: calc(100% - 16px);
  }
}