/*
Theme Name: Genique Child
Template: dp-genique
Version: 1.1
*/
/* ============================================================
   ENTLA クーポン記事 UIコンポーネント v1.1
   最終更新：2026-07-07
   v1.0からの変更点：
   ・テーマCSS・wpautop干渉への防御ルールを追加（text-align強制、
   　flex子要素のmin-width、p/brマージン正規化、ol/liリセット）
   ・ショートコード版（entla-coupon-shortcodes.php）に対応
   導入：既存のv1.0を全文置き換え。functions.phpのバージョン番号を
   　　　'1.1' に上げてキャッシュを更新すること
   ============================================================ */

:root{
  --cpn-main: #ff6600;
  --cpn-main-dark: #cc5200;
  --cpn-main-pale: #fff4ec;
  --cpn-red: #e0263c;
  --cpn-green: #1e8a3c;
  --cpn-green-pale: #eef8f0;
  --cpn-ink: #333333;
  --cpn-sub: #767676;
  --cpn-line: #eadfd5;
  --cpn-bg-soft: #faf8f5;
  --cpn-radius: 12px;
}

/* ============================================================
   0. 防御ルール（テーマ・自動整形の干渉を遮断）
   ============================================================ */
.cpn-verified, .cpn-card, .cpn-steps, .cpn-total, .cpn-waza,
.cpn-closed, .cpn-faq, .cpn-toc{
  text-align: left;
}
/* 自動整形で注入されるp/brの余白を正規化 */
.cpn-verified p, .cpn-card p, .cpn-total p,
.cpn-waza p, .cpn-closed p, .cpn-faq p{
  margin: 0 0 0.6em;
}
.cpn-verified p:last-child, .cpn-card p:last-child, .cpn-total p:last-child,
.cpn-waza p:last-child, .cpn-closed p:last-child, .cpn-faq p:last-child{
  margin-bottom: 0;
}

/* ============================================================
   1. 検証日バッジ
   ============================================================ */
.cpn-verified{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--cpn-green-pale);
  border: 1px solid #cfe8d6;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 1.4em;
  font-size: 13px;
  line-height: 1.7;
  color: var(--cpn-ink);
}
.cpn-verified::before{
  content: "✓";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cpn-green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.cpn-verified > span{
  flex: 1 1 0;
  min-width: 0;
}
.cpn-verified .cpn-date{
  font-weight: 700;
  color: var(--cpn-green);
}

/* ============================================================
   2. 即答カード
   ============================================================ */
.cpn-card{
  position: relative;
  border: 1px solid var(--cpn-line);
  border-radius: var(--cpn-radius);
  background: #fff;
  padding: 14px 16px 14px 52px;
  margin: 0 0 10px;
}
.cpn-card.is-1{
  border: 2px solid var(--cpn-main);
  background: #fff9f4;
}
.cpn-rank{
  position: absolute;
  left: 14px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--cpn-main);
  color: var(--cpn-main-dark);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cpn-card.is-1 .cpn-rank{
  background: var(--cpn-main);
  color: #fff;
}
.cpn-src{
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #996a45;
  background: #f6ede4;
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 4px;
}
.cpn-amount{
  font-size: 21px;
  font-weight: 800;
  color: var(--cpn-red);
  line-height: 1.35;
}
.cpn-cond{
  font-size: 12px;
  color: var(--cpn-sub);
  margin-top: 3px;
}

/* ============================================================
   3. ステップフロー
   ============================================================ */
.cpn-steps{
  list-style: none;
  margin: 1em 0 0;
  padding: 0;
  counter-reset: cpnstep;
}
.cpn-steps li{
  position: relative;
  padding: 0 0 20px 44px;
  margin: 0;
  list-style: none;
  counter-increment: cpnstep;
  line-height: 1.7;
}
.cpn-steps li::marker{ content: ""; }
.cpn-steps li::before{
  content: counter(cpnstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cpn-main);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cpn-steps li::after{
  content: "";
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: 4px;
  width: 2px;
  background: var(--cpn-line);
}
.cpn-steps li:last-child{ padding-bottom: 0; }
.cpn-steps li:last-child::after{ display: none; }
.cpn-steps .cpn-note{
  display: block;
  font-size: 12px;
  color: var(--cpn-sub);
}

/* 実質割引の合計表示ボックス */
.cpn-total{
  background: var(--cpn-main-pale);
  border: 1px solid #ffd9bd;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0 0;
  font-size: 14px;
}
.cpn-total .cpn-num{
  color: var(--cpn-red);
  font-size: 17px;
  font-weight: 800;
}

/* ============================================================
   4. お得技ボックス
   ============================================================ */
.cpn-waza{
  border: 2px solid var(--cpn-main);
  border-radius: var(--cpn-radius);
  background: #fff;
  padding: 16px;
  margin: 1em 0;
  position: relative;
}
.cpn-waza .cpn-waza-label{
  display: inline-block;
  background: var(--cpn-main);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 14px;
  margin-bottom: 8px;
  margin-right: 8px;
}

/* ============================================================
   5. 可否チップ
   ============================================================ */
.cpn-ok, .cpn-ng, .cpn-tri{
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.cpn-ok{  background: var(--cpn-green-pale); color: var(--cpn-green); }
.cpn-ng{  background: #fdecec; color: #c0392b; }
.cpn-tri{ background: #fdf3e0; color: #a06a00; }

.cpn-scroll{ overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================
   6. 終了・廃止アコーディオン
   ============================================================ */
.cpn-closed{
  border: 1px solid #e2dad0;
  border-radius: 10px;
  background: var(--cpn-bg-soft);
  margin: 1em 0;
  font-size: 14px;
}
.cpn-closed summary{
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  padding: 12px 40px 12px 16px;
  position: relative;
}
.cpn-closed summary::-webkit-details-marker{ display: none; }
.cpn-closed summary::after{
  content: "＋";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #996a45;
  font-weight: 700;
}
.cpn-closed[open] summary::after{ content: "−"; }
.cpn-closed .cpn-inner{
  padding: 0 16px 14px;
  color: #555;
}

/* ============================================================
   7. FAQ（キャラクター対話）
   ============================================================ */
.cpn-faq{
  margin: 0 0 32px;
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
}
.cpn-q, .cpn-a{
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cpn-q img, .cpn-a img{
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #eee;
  margin: 0;
  float: none;
}
.cpn-q > div, .cpn-a > div{
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
}
.cpn-q-title{
  display: block;
  color: var(--cpn-main);
  font-weight: 700;
  margin-bottom: 4px;
}
.cpn-a{
  background: var(--cpn-bg-soft);
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
}
.cpn-a-title{
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ============================================================
   8. CTAボタン
   ============================================================ */
.cpn-btn{
  display: block;
  text-align: center;
  background: var(--cpn-main);
  color: #fff !important;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 20px;
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow: 0 3px 0 var(--cpn-main-dark);
  margin: 1.2em auto;
  max-width: 420px;
  transition: transform .08s ease;
}
.cpn-btn:active{
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--cpn-main-dark);
}

/* ============================================================
   9. 目次
   ============================================================ */
.cpn-toc{
  border: 1px solid var(--cpn-line);
  border-radius: var(--cpn-radius);
  background: #fff;
  padding: 14px 18px;
  margin: 1em 0 1.5em;
}
.cpn-toc a{
  display: block;
  padding: 7px 0 7px 20px;
  position: relative;
  border-bottom: 1px dashed #f0e6da;
  text-decoration: none;
  font-size: 14px;
}
.cpn-toc a:last-child{ border-bottom: none; }
.cpn-toc a::before{
  content: "▶";
  position: absolute;
  left: 0;
  top: 8px;
  font-size: 10px;
  color: var(--cpn-main);
}
@media (min-width: 600px){
  .cpn-toc{
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce){
  .cpn-btn{ transition: none; }
}

/* ============================================================
   v1.2 FAQ表示修正パッチ
   テーマCSSの干渉を受けないよう、FAQのみflexからgridに変更し
   「アバター50px＋残り全幅」の2列レイアウトを強制固定する
   ============================================================ */
.cpn-faq .cpn-q,
.cpn-faq .cpn-a{
  display: grid !important;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  justify-content: start !important;
  justify-items: start !important;
  text-align: left !important;
}
.cpn-faq .cpn-q > div,
.cpn-faq .cpn-a > div{
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  text-align: left !important;
}
.cpn-faq .cpn-q > div *,
.cpn-faq .cpn-a > div *{
  text-align: left !important;
}
.cpn-faq img{
  margin: 0 !important;
  float: none !important;
  max-width: 50px;
}