/* ==========================================================
 *  kh-goods-hub.css
 *  /goods/ グッズ一覧ハブ強化 (.khgh-*)
 *  配置: cocoon-child/css/kh-goods-hub.css
 *  読み込み: functions/11_goods-hub.php が /goods/ でのみ enqueue
 *  [kh_goods_hub_top] / [kh_goods_hub_guide] が出力するHTML用
 *  ＋ /goods/ 上の既存ジャンル別グリッド (.khgrp) の見やすさ調整
 * ========================================================== */
 .khgh {
    --khgh-navy: #0c1838;
    --khgh-ink: #1f3373;
    --khgh-gold: #f7d774;
    --khgh-gold-deep: #d4af37;
    --khgh-line: #e6e8ee;
    --khgh-bg: #fafbfd;
    --khgh-muted: #6a6a6a;
    color: #2a2a2a;
    line-height: 1.8;
  }
  
  /* (1) PR表記 */
  .khgh-pr {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--khgh-muted);
    background: var(--khgh-bg);
    border: 1px solid var(--khgh-line);
    border-radius: 8px;
  }
  .khgh-pr-tag {
    flex: 0 0 auto;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #fff;
    background: #888;
    border-radius: 4px;
  }
  
  /* (2) 導入文 */
  .khgh-lead {
    margin: 0 0 20px;
    padding: 18px 20px;
    background: linear-gradient(180deg, #0c1838 0%, #142455 100%);
    border: 1px solid rgba(255, 209, 102, 0.35);
    border-radius: 12px;
    color: #f3f5ff;
    position: relative;
  }
  .khgh-lead::before {
    content: "";
    position: absolute;
    inset: -1px -1px auto -1px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ffd166, transparent);
    border-radius: 12px 12px 0 0;
  }
  .khgh-lead p {
    margin: 0 0 8px;
    font-size: 14.5px;
    line-height: 1.9;
  }
  .khgh-lead p:last-child {
    margin: 0;
    font-size: 13px;
    color: rgba(243, 245, 255, 0.78);
  }
  .khgh-lead strong {
    color: #ffd166;
  }
  
  /* (3) 数字 */
  .khgh-stats {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .khgh-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    background: #fff;
    border: 1px solid var(--khgh-line);
    border-radius: 10px;
  }
  .khgh-stat-num {
    font-size: 24px;
    font-weight: 800;
    color: var(--khgh-ink);
    line-height: 1.2;
  }
  .khgh-stat-num--date {
    font-size: 18px;
    padding-top: 4px;
  }
  .khgh-stat-label {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--khgh-muted);
    letter-spacing: 0.04em;
  }
  
  /* (4) ブロック・見出し（Cocoonの見出し装飾を打ち消して統一） */
  .khgh-block {
    margin: 0 0 32px;
  }
  .khgh .khgh-h2 {
    position: relative;
    margin: 0 0 14px;
    padding: 0 0 0 14px;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--khgh-ink);
    background: none;
    border: none;
  }
  .khgh .khgh-h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 4px;
    background: linear-gradient(180deg, var(--khgh-gold), var(--khgh-gold-deep));
    border-radius: 2px;
  }
  .khgh .khgh-h2::after {
    display: none;
  }
  .khgh .khgh-h2--genre {
    margin-top: 8px;
  }
  .khgh .khgh-h3 {
    margin: 0 0 6px;
    padding: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--khgh-ink);
    background: none;
    border: none;
  }
  .khgh .khgh-h3::before,
  .khgh .khgh-h3::after {
    display: none;
  }
  .khgh-note {
    margin: -6px 0 12px;
    font-size: 12px;
    color: var(--khgh-muted);
  }
  
  /* (5) キャラ別チップ */
  .khgh-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .khgh-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--khgh-ink) !important;
    text-decoration: none !important;
    background: #fff;
    border: 1px solid #d8def0;
    border-radius: 999px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  }
  .khgh-chip:hover {
    background: #fff8e6;
    border-color: var(--khgh-gold);
    transform: translateY(-1px);
  }
  .khgh-chip-num {
    font-size: 11px;
    font-weight: 800;
    padding: 0 7px;
    color: #fff;
    background: var(--khgh-ink);
    border-radius: 999px;
  }
  
  /* (6) 商品カード（状態・発売日・価格つき） */
  .khgh-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  .khgh-card {
    margin: 0;
    min-width: 0;
  }
  .khgh-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--khgh-line);
    border-radius: 12px;
    overflow: hidden;
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  }
  .khgh-card-link:hover {
    transform: translateY(-3px);
    border-color: var(--khgh-gold);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
  }
  .khgh-card-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: #f3f4f8;
  }
  .khgh-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
  }
  .khgh-card-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 11px;
    color: #aaa;
  }
  .khgh-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: #888;
    border-radius: 999px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  }
  .khgh-badge.is-preorder { background: #1f3373; }
  .khgh-badge.is-onsale   { background: #2e8c4a; }
  .khgh-badge.is-lottery  { background: #b46a1e; }
  .khgh-badge.is-closed   { background: #666; }
  .khgh-badge.is-soldout  { background: #b03030; }
  .khgh-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    padding: 10px 10px 12px;
  }
  .khgh-card-genre {
    align-self: flex-start;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--khgh-ink);
    background: #eef1f8;
    border-radius: 999px;
  }
  .khgh-card-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--khgh-ink);
  }
  .khgh-card-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px dashed var(--khgh-line);
    font-size: 11px;
  }
  .khgh-card-date {
    color: var(--khgh-muted);
  }
  .khgh-card-price {
    font-weight: 800;
    color: #c04040;
  }
  .khgh-block--hot {
    padding: 16px;
    background: #fff8e6;
    border: 1px solid var(--khgh-gold);
    border-radius: 12px;
  }
  
  /* (7) 選び方ガイド */
  .khgh-guide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .khgh-tip {
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    background: var(--khgh-bg);
    border: 1px solid var(--khgh-line);
    border-left: 4px solid var(--khgh-gold);
    border-radius: 10px;
  }
  .khgh-tip p {
    margin: 0 0 10px;
    font-size: 13.5px;
    line-height: 1.85;
  }
  .khgh-tip strong {
    color: var(--khgh-ink);
  }
  .khgh-more {
    margin-top: auto;
    align-self: flex-end;
    font-size: 13px;
    font-weight: 700;
    color: var(--khgh-ink) !important;
    text-decoration: none !important;
  }
  .khgh-more:hover {
    color: #c04040 !important;
  }
  
  /* (8) チェックリスト */
  .khgh-check {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: khgh;
  }
  .khgh-check li {
    position: relative;
    margin: 0 0 10px;
    padding: 12px 14px 12px 48px;
    font-size: 14px;
    line-height: 1.8;
    background: #fff;
    border: 1px solid var(--khgh-line);
    border-radius: 10px;
    counter-increment: khgh;
  }
  .khgh-check li::before {
    content: counter(khgh);
    position: absolute;
    left: 12px;
    top: 12px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--khgh-navy);
    background: linear-gradient(180deg, #ffd166, #f0a500);
    border-radius: 50%;
  }
  .khgh-check strong {
    color: var(--khgh-ink);
  }
  
  /* (9) FAQ */
  .khgh-faq-item {
    margin: 0 0 8px;
    background: #fff;
    border: 1px solid var(--khgh-line);
    border-radius: 10px;
    overflow: hidden;
  }
  .khgh-faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--khgh-ink);
    cursor: pointer;
    list-style: none;
    background: var(--khgh-bg);
  }
  .khgh-faq-q::-webkit-details-marker {
    display: none;
  }
  .khgh-faq-q::before {
    content: "Q";
    flex: 0 0 auto;
    font-weight: 800;
    color: var(--khgh-gold-deep);
  }
  .khgh-faq-q::after {
    content: "▾";
    margin-left: auto;
    font-size: 12px;
    color: var(--khgh-gold-deep);
    transition: transform 0.15s ease;
  }
  .khgh-faq-item[open] > .khgh-faq-q::after {
    transform: rotate(180deg);
  }
  .khgh-faq-a {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--khgh-line);
  }
  .khgh-faq-a p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.85;
  }
  
  /* (10) 運営者 */
  .khgh-editor {
    margin: 0 0 24px;
    padding: 14px 18px;
    font-size: 13px;
    background: var(--khgh-bg);
    border: 1px dashed #d8def0;
    border-radius: 8px;
    color: #555;
  }
  .khgh-editor-title {
    margin: 0 0 4px;
    font-weight: 800;
    color: var(--khgh-ink);
  }
  .khgh-editor p {
    margin: 0;
    line-height: 1.8;
  }
  
  /* (11) 関連導線 */
  .khgh-related {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 0 0 12px;
  }
  .khgh-related-link {
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    color: #fdf6dc !important;
    text-decoration: none !important;
    background: linear-gradient(135deg, #0a1430, #1b2a4e);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .khgh-related-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(7, 17, 42, 0.25);
  }
  .khgh-related-eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.26em;
    color: #e8c252;
  }
  .khgh-related-label {
    font-size: 15px;
    font-weight: 800;
  }
  
  /* (12) /goods/ 上の既存ジャンル別グリッドを見やすく
     ※ body に post-type-archive-goods が付く場合のみ適用 */
  body.post-type-archive-goods .khgrp {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  body.post-type-archive-goods .khgrp-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.post-type-archive-goods .khgrp-name {
    font-size: 0.85em;
  }
  body.post-type-archive-goods .khgrp-thumb {
    object-fit: contain;
    background: #fff;
  }
  body.post-type-archive-goods .khgrp-more {
    padding: 6px 14px;
    font-size: 0.85em;
    background: #fff;
    border: 1px solid #d8def0;
    border-radius: 999px;
  }
  body.post-type-archive-goods .khgrp-more:hover {
    background: #fff8e6;
    border-color: #f7d774;
  }
  
  /* (13) レスポンシブ */
  @media (max-width: 768px) {
    .khgh-cards {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .khgh-guide {
      grid-template-columns: 1fr;
    }
  }
  @media (max-width: 600px) {
    .khgh-stats {
      grid-template-columns: repeat(2, 1fr);
    }
    .khgh .khgh-h2 {
      font-size: 17px;
    }
    .khgh-cards {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    /* 横スクロール列（発売日順・既存ジャンル別） */
    .khgh-cards--scroll,
    body.post-type-archive-goods .khgrp-grid {
      display: flex;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      gap: 10px;
      padding: 2px 2px 10px;
    }
    .khgh-cards--scroll > .khgh-card,
    body.post-type-archive-goods .khgrp-grid > .khgrp-card {
      flex: 0 0 44%;
      scroll-snap-align: start;
    }
    .khgh-block--hot {
      padding: 12px;
    }
    .khgh-related {
      grid-template-columns: 1fr;
    }
    .khgh-check li {
      font-size: 13.5px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .khgh-chip,
    .khgh-card-link,
    .khgh-related-link,
    .khgh-faq-q::after {
      transition: none;
    }
  }