/* 生成器が出力する preview.generated.html 用の共通ベース。
   色は --theme-base / --theme-primary / --theme-accent で切り替える。
   （パレットは build_game.py が :root へ注入する） */

:root {
  color-scheme: light;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  color: #263640;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(78, 155, 187, 0.16), transparent 34%),
    linear-gradient(180deg, #eaf3f7 0%, #f6f9fa 42%, #edf3f6 100%);
}

a {
  color: inherit;
}

.preview-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 8px 20px;
  color: #dceaf0;
  background: rgba(11, 28, 38, 0.94);
  backdrop-filter: blur(12px);
  font-size: 12px;
}

.preview-bar strong {
  color: #fff;
}

.preview-bar span:last-child {
  color: #8fb6c6;
}

.entry-content {
  overflow-x: clip;
}

.hero {
  position: relative;
  min-height: 430px;
  padding: 76px 24px;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 24%, rgba(93, 222, 229, 0.25), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(205, 114, 68, 0.2), transparent 30%),
    linear-gradient(135deg, var(--theme-base) 0%, var(--theme-primary) 54%, var(--theme-base) 100%);
}

.hero-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  transform: scale(1.03);
}

.hero--has-photo .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(8, 22, 29, 0.42) 0%,
    rgba(5, 18, 25, 0.58) 45%,
    rgba(5, 18, 25, 0.82) 100%
  );
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 22, 29, 0.08), rgba(5, 18, 25, 0.68));
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.hero-kicker {
  margin: 0 0 12px;
  color: var(--theme-accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 4.6vw, 2.8rem);
  font-weight: 800;
  line-height: 1.22;
}

.hero-description {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.85;
  opacity: 0.94;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 22px;
}

.hero-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.layout {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.layout-side {
  position: sticky;
  /* sticky時にプレビューバー（約42px）の下へ潜り込まないよう、バー高＋余白を確保 */
  top: 60px;
  min-width: 0;
}

.side-card {
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.side-card + .side-card {
  margin-top: 16px;
}

.side-card h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #152535;
}

.side-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #333;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.side-list a:hover {
  background: var(--theme-primary-soft);
  transform: translateX(2px);
}

.side-cat-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-cat-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #333;
  font-size: 14px;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
  overflow-wrap: anywhere;
}

.side-cat-list a:hover {
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
}

.layout-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}

/* グリッド子の min-width:auto による横はみ出しを防ぐ */
.layout-main > * {
  min-width: 0;
  max-width: 100%;
}

.lead {
  display: grid;
  gap: 10px;
}

.lead-paragraph {
  margin: 0;
  color: #3f5665;
  line-height: 1.85;
}

.quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.quick-nav-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid var(--theme-primary-line);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.quick-nav-card:hover {
  transform: translateY(-2px);
  border-color: var(--theme-primary);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.quick-nav-image {
  width: 74px;
  height: 58px;
  flex: none;
  object-fit: cover;
  border-radius: 10px;
}

.quick-nav-card--anchor {
  background: linear-gradient(135deg, var(--theme-primary-soft), #fff 70%);
}

.quick-nav-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.quick-nav-copy > span {
  color: var(--theme-primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quick-nav-copy > strong {
  color: #152535;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.45;
}

.quick-nav-arrow {
  margin-left: auto;
  flex: none;
  color: var(--theme-primary);
  font-size: 1.2rem;
  font-weight: 800;
}

/* 循環フロー図（採掘→加工→納品 など） */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: 4px 0 14px;
}

.flow-step {
  position: relative;
  flex: 1 1 160px;
  min-width: 150px;
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 16px 14px 14px;
  background: linear-gradient(160deg, var(--theme-primary-soft), #fff 72%);
  border: 2px solid var(--theme-primary-line);
  border-radius: 14px;
}

.flow-num {
  position: absolute;
  top: -11px;
  left: 12px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--theme-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.flow-step > strong {
  color: var(--theme-base);
  font-size: 1.05rem;
  font-weight: 800;
}

.flow-step > span:not(.flow-num) {
  color: #526873;
  font-size: 0.85rem;
  line-height: 1.6;
}

.flow-arrow {
  align-self: center;
  flex: none;
  color: var(--theme-primary);
  font-size: 1.4rem;
  font-weight: 800;
}

.flow-loop {
  align-self: center;
  flex: none;
  padding: 6px 12px;
  border: 1px dashed var(--theme-primary);
  border-radius: 999px;
  color: var(--theme-primary);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .flow {
    flex-direction: column;
    align-items: stretch;
  }

  .flow-arrow {
    transform: rotate(90deg);
    text-align: center;
  }

  .flow-loop {
    align-self: center;
  }
}

.map-card {
  overflow: hidden;
  background: var(--theme-base);
  border: 1px solid rgba(24, 87, 111, 0.18);
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(13, 42, 56, 0.16);
}

.map-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  color: #eef7fa;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-base));
}

.map-card-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.map-card-status {
  color: var(--theme-accent);
  font-size: 0.76rem;
  white-space: nowrap;
}

.map-frame {
  display: block;
  width: 100%;
  height: 720px;
  min-height: 520px;
  border: 0;
  background: var(--theme-base);
}

.card {
  padding: 24px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07);
}

.card--soft {
  background: linear-gradient(180deg, var(--theme-primary-soft), #fff 62%);
}

.card h2 {
  margin: 0 0 14px;
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  font-weight: 800;
  color: var(--theme-base);
}

.card p {
  margin: 0 0 14px;
  color: #526873;
  line-height: 1.85;
}

.card p:last-child {
  margin-bottom: 0;
}

.legend-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-width: 0;
  padding: 13px;
  background: #f7fafb;
  border: 1px solid #e6eef1;
  border-radius: 12px;
}

.legend-icon {
  font-size: 1.15rem;
  line-height: 1.5;
  text-align: center;
}

.legend-copy strong {
  display: block;
  margin-bottom: 3px;
  color: #183747;
}

.legend-copy span {
  color: #5b6f79;
  font-size: 0.88rem;
  line-height: 1.65;
}

.article-figure {
  margin: 16px 0 0;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.article-figure figcaption {
  margin-top: 8px;
  color: #5b6f79;
  font-size: 0.86rem;
  line-height: 1.6;
}

.data-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e4eef2;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: #183747;
  background: var(--theme-primary-soft);
  font-weight: 800;
  white-space: nowrap;
}

/* 短い値（数値・％・★など）の列のみ折り返し禁止。生成側で判定してクラス付与 */
.data-table td.cell-tight {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.card h3 {
  margin: 22px 0 10px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--theme-base);
}

.card h4 {
  margin: 16px 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #5b6f79;
}

/* カード内の工程ブロック（### ごと） */
.card {
  counter-reset: guide-step;
}

.guide-step {
  counter-increment: guide-step;
  margin: 16px 0 0;
  padding: 0 0 16px;
  background: #fff;
  border: 1px solid var(--theme-primary-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(24, 55, 71, 0.04);
}

.guide-step > h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px 16px;
  background: linear-gradient(105deg, var(--theme-primary-soft) 0%, #fff 72%);
  border-bottom: 2px solid var(--theme-primary-line);
  font-size: clamp(1.12rem, 2.2vw, 1.32rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--theme-base);
  line-height: 1.3;
}

.guide-step > h3::before {
  content: counter(guide-step);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--theme-primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(24, 55, 71, 0.18);
}

.guide-step > h4,
.guide-step > p,
.guide-step > .guide-list,
.guide-step > .data-table-wrap,
.guide-step > .article-figure {
  margin-left: 16px;
  margin-right: 16px;
}

.guide-step > h4 {
  margin-top: 14px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e4eef2;
  font-size: 0.86rem;
  font-weight: 700;
  color: #5b6f79;
}

.guide-step > h4:first-of-type {
  margin-top: 0;
}

.guide-step > p:last-child,
.guide-step > .guide-list:last-child {
  margin-bottom: 0;
}

.guide-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  position: relative;
  padding: 13px 14px 13px 42px;
  color: #3f555f;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(37, 115, 143, 0.12);
  border-radius: 11px;
  line-height: 1.72;
}

.guide-list li::before {
  content: "✓";
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #fff;
  background: var(--theme-primary);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.related-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  color: #29424d;
  background: #fff;
  border: 1px solid #e1ebef;
  border-radius: 13px;
  text-decoration: none;
  box-shadow: 0 7px 22px rgba(18, 58, 73, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(18, 58, 73, 0.12);
}

.related-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(135deg, var(--theme-base), var(--theme-primary));
}

.related-card-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 15px 16px 17px;
}

.related-card-copy span {
  margin-bottom: 8px;
  color: var(--theme-primary);
  font-size: 0.76rem;
  font-weight: 900;
}

.related-card-copy strong {
  line-height: 1.55;
}

.manual-ad {
  display: grid;
  min-height: 118px;
  place-items: center;
  padding: 18px;
  color: #6f7d83;
  background:
    repeating-linear-gradient(
      -45deg,
      var(--theme-primary-soft),
      var(--theme-primary-soft) 8px,
      rgba(255, 255, 255, 0.74) 8px,
      rgba(255, 255, 255, 0.74) 16px
    );
  border: 1px dashed var(--theme-primary-line);
  border-radius: 14px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.manual-ad strong {
  display: block;
  margin-bottom: 4px;
  color: #4a616c;
  font-size: 0.84rem;
}

/* サイドバー下部の縦長広告（300x600想定） */
.manual-ad--side {
  min-height: 600px;
  margin-top: 16px;
}

.preview-footer {
  padding: 24px;
  color: #71858e;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1023px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .layout-side {
    position: relative;
    top: auto;
  }

  /* 1カラム時はサイドが本文の上に来るため、縦長広告は出さない */
  .manual-ad--side {
    display: none;
  }
}

@media (max-width: 767px) {
  .preview-bar span:last-child {
    display: none;
  }

  .hero {
    padding: 48px 18px;
  }

  .layout {
    padding: 18px 14px 60px;
    gap: 18px;
  }

  .map-frame {
    height: 620px;
    min-height: 480px;
  }

  .legend-list,
  .related-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* === WP / Cocoon parity layer (source: article-ide design/preview-base.css) === */

body.has-custom-layout {
  --theme-base: #101820;
  --theme-primary: #236B8E;
  --theme-accent: #D9F2FF;
  --theme-primary-soft: #236B8E1f;
  --theme-primary-line: #236B8E55;
  --layout-max-width: 1180px;
  background:
    radial-gradient(circle at 10% 0%, rgba(78, 155, 187, 0.16), transparent 34%),
    linear-gradient(180deg, #eaf3f7 0%, #f6f9fa 42%, #edf3f6 100%) !important;
}

body.has-custom-layout.has-hero-page-bg {
  background:
    radial-gradient(circle at 10% 0%, rgba(78, 155, 187, 0.16), transparent 34%),
    linear-gradient(180deg, #eaf3f7 0%, #f6f9fa 42%, #edf3f6 100%) !important;
}

/* Cocoon 幅・余白を記事面から外す */
body.has-custom-layout #content-in.content-in.wrap,
body.has-custom-layout .content-in.wrap,
body.has-custom-layout #content,
body.has-custom-layout .content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  overflow: visible !important;
}

body.has-custom-layout.no-sidebar .content .main,
body.has-custom-layout #main.main,
body.has-custom-layout #main {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-sizing: border-box;
  overflow: visible !important;
  background: transparent !important;
}

body.has-custom-layout article.post,
body.has-custom-layout .entry-content {
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
}

/* プレビューにないサイトChromeを隠す（記事面の完全一致用） */
body.has-custom-layout.has-hero-first #header,
body.has-custom-layout.has-hero-first .header,
body.has-custom-layout.has-hero-first #header-container,
body.has-custom-layout.has-hero-first .header-container,
body.has-custom-layout.has-hero-first #navi,
body.has-custom-layout.has-hero-first .navi,
body.has-custom-layout .breadcrumb,
body.has-custom-layout .breadcrumbs,
body.has-custom-layout .toc,
body.has-custom-layout .article .toc,
body.has-custom-layout .article-header,
body.has-custom-layout .entry-header,
body.has-custom-layout .post-meta,
body.has-custom-layout .eye-catch,
body.has-custom-layout .wp-block-post-featured-image,
body.has-custom-layout .sns-share-top,
body.has-custom-layout .share-button,
body.has-custom-layout .under-entry-content > .sns-share,
body.has-custom-layout .related-entry-heading,
body.has-custom-layout .related-entry-cards,
body.has-custom-layout .pager-post-navi,
body.has-custom-layout .comment-area,
body.has-custom-layout #comment-area {
  display: none !important;
}

/* HERO: preview の淡写真 + kicker */
body.has-custom-layout .hero.hero--has-photo .hero-bg {
  background:
    radial-gradient(circle at 20% 24%, rgba(93, 222, 229, 0.25), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(205, 114, 68, 0.2), transparent 30%),
    linear-gradient(135deg, var(--theme-base) 0%, var(--theme-primary) 54%, var(--theme-base) 100%) !important;
}

body.has-custom-layout .hero-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  transform: scale(1.03);
  pointer-events: none;
}

body.has-custom-layout .hero.hero--has-photo .hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(8, 22, 29, 0.42) 0%,
    rgba(5, 18, 25, 0.58) 45%,
    rgba(5, 18, 25, 0.82) 100%
  ) !important;
}

body.has-custom-layout .hero-kicker {
  margin: 0 0 12px;
  color: var(--theme-accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.has-custom-layout .layout {
  --layout-max-width: 1180px;
  max-width: 1180px;
  gap: 32px;
  padding: 36px 24px 72px;
  margin: 0 auto;
}

body.has-custom-layout .layout-side {
  top: 20px;
  margin-top: 0 !important;
}

body.has-custom-layout .layout-main {
  display: grid;
  gap: 24px;
}

/* Cocoon の h2 装飾が map-card ヘッダを崩さないようにする */
body.has-custom-layout .map-card-header,
body.has-custom-layout .map-card-header h2,
body.has-custom-layout .map-card-title {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #eef7fa !important;
}

body.has-custom-layout .map-card-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px !important;
  color: #eef7fa !important;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-base)) !important;
}

body.has-custom-layout .map-card-title {
  font-size: 0.96rem !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
}

body.has-custom-layout .map-card-header h2::before,
body.has-custom-layout .map-card-title::before {
  display: none !important;
  content: none !important;
}

body.has-custom-layout .map-card-status {
  color: var(--theme-accent) !important;
  font-size: 0.76rem;
  white-space: nowrap;
}

/* 地図シアターモード：サイドバーを一時的に畳み、既存の最大幅を地図へ渡す */
body.has-custom-layout .map-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

body.has-custom-layout .map-theater-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin: 0 !important;
  padding: 7px 12px !important;
  color: #eef7fa !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  cursor: pointer;
}

body.has-custom-layout .map-theater-toggle:hover,
body.has-custom-layout .map-theater-toggle:focus-visible {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.22) !important;
  outline: 2px solid rgba(217, 242, 255, 0.72);
  outline-offset: 2px;
}

body.has-custom-layout .layout.is-map-theater {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "main";
}

body.has-custom-layout .layout.is-map-theater > .layout-side {
  display: none;
}

body.has-custom-layout .layout.is-map-theater .map-card {
  box-shadow: 0 22px 56px rgba(13, 42, 56, 0.22);
}

body.has-custom-layout .map-frame {
  height: 720px;
  min-height: 520px;
}

body.has-custom-layout .layout-main > p,
body.has-custom-layout .layout-main .lead-paragraph {
  margin: 0;
  color: #263640;
  font-size: 1.02rem;
  line-height: 1.85;
}

/* HERO タイトル：preview-base と同一（改行位置を揃える） */
body.has-custom-layout .hero-inner,
body.has-custom-layout .hero-inner.hero--align-center {
  max-width: 820px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.has-custom-layout .hero.wp-block-custom-hero,
body.has-custom-layout .hero {
  padding-left: 24px !important;
  padding-right: 24px !important;
}

body.has-custom-layout .hero-title,
body.has-custom-layout .hero h1.hero-title {
  margin: 0 0 16px !important;
  padding: 0 !important;
  max-width: none !important;
  font-size: clamp(1.8rem, 4.6vw, 2.8rem) !important;
  font-weight: 800 !important;
  line-height: 1.22 !important;
  letter-spacing: normal !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  word-break: normal;
  overflow-wrap: normal;
}

body.has-custom-layout .hero-title::before,
body.has-custom-layout .hero h1.hero-title::before {
  display: none !important;
  content: none !important;
}

/* サイド見出し：Cocoon の h2 ボックス装飾を外し preview の side-card h2 に合わせる */
body.has-custom-layout .side-card h2,
body.has-custom-layout .article .side-card h2,
body.has-custom-layout .side-nav-title,
body.has-custom-layout .side-nav-category-title,
body.has-custom-layout .side-nav h2.side-nav-title,
body.has-custom-layout .side-nav h2.side-nav-category-title,
body.has-custom-layout .side-nav h2.wp-block-heading {
  margin: 0 0 12px !important;
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
  color: #152535 !important;
  letter-spacing: normal !important;
}

body.has-custom-layout .side-card h2::before,
body.has-custom-layout .side-card h2::after,
body.has-custom-layout .side-nav-title::before,
body.has-custom-layout .side-nav-category-title::before,
body.has-custom-layout .side-nav h2::before,
body.has-custom-layout .side-nav h2.wp-block-heading::after,
body.has-custom-layout .side-nav h2.wp-block-heading::before {
  display: none !important;
  content: none !important;
  width: 0 !important;
  height: 0 !important;
  background: none !important;
}

body.has-custom-layout .side-card h2 span,
body.has-custom-layout .side-nav-title span,
body.has-custom-layout .side-nav-category-title span {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* 本文カード見出しも Cocoon .article h2 の灰ボックスを外す */
body.has-custom-layout .article .card h2,
body.has-custom-layout .card h2,
body.has-custom-layout .map-card-title {
  padding: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.has-custom-layout .article .card h2,
body.has-custom-layout .card h2 {
  margin: 0 0 14px !important;
  font-size: clamp(1.05rem, 2vw, 1.32rem) !important;
  font-weight: 800 !important;
  color: var(--theme-base) !important;
  line-height: 1.4 !important;
}

body.has-custom-layout .article .card h2::before,
body.has-custom-layout .card h2::before {
  display: none !important;
  content: none !important;
}

/* side-nav を preview の side-card トーンに合わせる */
body.has-custom-layout .side-nav a.active,
body.has-custom-layout .side-nav-list a.active {
  background: var(--theme-primary-soft);
  color: var(--theme-primary);
}

body.has-custom-layout .side-nav a.active::before,
body.has-custom-layout .side-nav-list a.active::before {
  background: var(--theme-primary);
}

body.has-custom-layout .side-nav a:hover,
body.has-custom-layout .side-nav-list a:hover {
  background: var(--theme-primary-soft);
}

/* 本文内広告（マップ直後 / 関連前）。layout-main の grid 子として間隔が付く */
body.has-custom-layout .layout-main > .article-ad {
  margin: 0;
  min-height: 90px;
  text-align: center;
  overflow: hidden;
}

body.has-custom-layout .article-ad .adsbygoogle,
body.has-custom-layout .side-ad .adsbygoogle {
  display: block;
  max-width: 100%;
}

@media (max-width: 1023px) {
  body.has-custom-layout .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 28px 20px 60px;
  }

  body.has-custom-layout .map-theater-toggle {
    display: none;
  }
}

@media (max-width: 767px) {
  body.has-custom-layout .layout {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 18px 14px 60px;
    gap: 18px;
  }
}
