/*
 * 静的サイト用の補完: 本番 WordPress の wp-block-library-inline-css にある画像の基本規則。
 * WordPress 本体の CSS を外した後も、本文の wp-image-* は width/height 属性の比率で縮小する。
 * height 属性の固定高が残る縦伸びと、cover-sizes.js による過大な画像選択を防ぐ。
 * 以下のテーマ由来の本文スタイルは維持し、テーマ側の写しにはこの補完を加えない。
 */
html :where(img[class*="wp-image-"]) { height: auto; max-width: 100%; }

/*
 * 旧形式の本文では、長いURLやスラッシュでつながる英単語が狭い画面からはみ出す。
 * 収まらない語だけを折り返し、通常の改行位置と min-content の幅を維持する。
 * 新形式の .tn-column-body とテーマ由来の規則は変更しない。
 */
.column-content :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, blockquote) {
  overflow-wrap: break-word;
}

/**
 * 自動生成コラム専用スタイル
 *
 * 既存記事への影響を避けるため、生成本文の直下ラッパー
 * `.single-column .entry-content > .tn-column-body` の内側だけを対象にする。
 */

.single-column .entry-title {
  line-break: strict;
  overflow-wrap: normal;
  word-break: normal;
  word-break: auto-phrase;
  text-wrap: balance;
}

.single-column .entry-content > .tn-column-body {
  --tn-column-ink: #333;
  --tn-column-muted: #626b7b;
  --tn-column-border: #dce1e8;
  --tn-column-surface: #f7f7f7;
  --tn-column-navy: #202a46;
  --tn-column-pink: #fc4d68;
  --tn-column-blue: #167eae;
  color: var(--tn-column-ink);
  font-size: 0.9375rem;
  line-height: 2;
  line-break: strict;
  overflow-wrap: normal;
  word-break: normal;
  word-break: auto-phrase;
  text-wrap: pretty;
}

.single-column .entry-content > .tn-column-body > :first-child {
  margin-top: 0;
}

.single-column .entry-content > .tn-column-body > :last-child {
  margin-bottom: 0;
}

.single-column .entry-content > .tn-column-body .tn-column-nowrap {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
}

.single-column .entry-content > .tn-column-body p {
  margin: 0 0 1.65em;
}

.single-column .entry-content > .tn-column-body h2,
.single-column .entry-content > .tn-column-body h3 {
  color: var(--tn-column-navy);
  line-height: 1.55;
  line-break: strict;
  overflow-wrap: normal;
  word-break: normal;
  word-break: auto-phrase;
  text-wrap: balance;
}

.single-column .entry-content > .tn-column-body h2 {
  margin: 2.6em 0 0.9em;
  padding: 0 0 0.55em;
  border: 0;
  border-bottom: 2px solid #333;
  font-size: clamp(1.25rem, 1.15rem + 0.35vw, 1.5rem);
  font-weight: 700;
}

.single-column .entry-content > .tn-column-body h2::before {
  content: none;
}

.single-column .entry-content > .tn-column-body h3 {
  margin: 2.2em 0 0.8em;
  padding: 0;
  border: 0;
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  font-weight: 700;
}

.single-column .entry-content > .tn-column-body strong {
  color: var(--tn-column-navy);
  font-weight: 700;
}

.single-column .entry-content > .tn-column-body a {
  color: var(--tn-column-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.single-column .entry-content > .tn-column-body a:hover {
  color: var(--tn-column-pink);
}

.single-column .entry-content > .tn-column-body ul,
.single-column .entry-content > .tn-column-body ol {
  margin: 0 0 1.8em;
  padding-inline-start: 1.5em;
}

.single-column .entry-content > .tn-column-body li {
  margin-bottom: 0.55em;
  padding-inline-start: 0.25em;
}

.single-column .entry-content > .tn-column-body li::marker {
  color: var(--tn-column-pink);
  font-weight: 700;
}

.single-column .entry-content > .tn-column-body blockquote {
  margin: 2em 0;
  padding: 1.35em 1.5em;
  border-left: 4px solid var(--tn-column-blue);
  background: var(--tn-column-surface);
  color: #3f4858;
}

.single-column .entry-content > .tn-column-body blockquote > :last-child {
  margin-bottom: 0;
}

/*
 * 既存コラムの「この記事の結論」「このセクションの要点」を、
 * インラインstyleなしで再現する編集カード。
 */
.single-column .entry-content > .tn-column-body .tn-column-summary {
  margin: 1.2em 0 2em;
  padding: 1.25rem;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f4f8fb;
  color: var(--tn-column-ink);
}

.single-column .entry-content > .tn-column-body .tn-column-summary--point {
  padding: 1.125rem 1.375rem;
  border: 0;
  border-left: 5px solid #222;
  border-radius: 0;
  background: #f7f7f7;
}

.single-column .entry-content > .tn-column-body .tn-column-summary__label {
  margin: 0 0 0.65em;
  color: #0d426c;
  font-size: 0.95em;
  font-weight: 700;
}

.single-column .entry-content > .tn-column-body .tn-column-summary--point .tn-column-summary__label {
  color: #333;
}

.single-column .entry-content > .tn-column-body .tn-column-summary > :last-child {
  margin-bottom: 0;
}

/* 既存コラム終盤の「the Nからの一言」カード。 */
.single-column .entry-content > .tn-column-body .tn-column-message {
  position: relative;
  margin: 3.4em 0 3em;
  padding: 2.5rem 1.5rem 1.5rem;
  border: 2px solid #8fc1e3;
  border-radius: 12px;
  background: #eaf4fc;
  color: var(--tn-column-ink);
}

.single-column .entry-content > .tn-column-body .tn-column-message__label {
  position: absolute;
  top: -1.15rem;
  left: 1.35rem;
  margin: 0;
  padding: 0.35rem 0.9rem;
  border-radius: 4px;
  background: #0b83b5;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

.single-column .entry-content > .tn-column-body .tn-column-message > :last-child {
  margin-bottom: 0;
}

.single-column .entry-content > .tn-column-body code {
  padding: 0.12em 0.34em;
  border-radius: 4px;
  background: #eef1f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.single-column .entry-content > .tn-column-body pre {
  max-width: 100%;
  margin: 2em 0;
  padding: 1.25em 1.4em;
  overflow-x: auto;
  border-radius: 10px;
  background: #171d2d;
  color: #f3f5fa;
  font-size: 0.875rem;
  line-height: 1.75;
  overscroll-behavior-inline: contain;
}

.single-column .entry-content > .tn-column-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre;
  word-break: normal;
}

.single-column .entry-content > .tn-column-body figure {
  margin: 2.25em 0;
}

.single-column .entry-content > .tn-column-body img {
  display: block;
  max-width: 100%;
  height: auto;
}

.single-column .entry-content > .tn-column-body figure img,
.single-column .entry-content > .tn-column-body figure svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.single-column .entry-content > .tn-column-body figcaption {
  margin-top: 0.65em;
  color: var(--tn-column-muted);
  font-size: 0.8125rem;
  line-height: 1.7;
  text-align: center;
}

/*
 * 表は必ず `.tn-column-table` で包む。
 * キーボード利用者が横スクロール領域へ移動できるよう、生成HTML側で
 * tabindex="0" と、内容を示す aria-label を付与する。
 */
.single-column .entry-content > .tn-column-body .tn-column-table {
  max-width: 100%;
  margin: 2em 0;
  overflow-x: auto;
  border: 1px solid var(--tn-column-border);
  border-radius: 10px;
  background: #fff;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.single-column .entry-content > .tn-column-body .tn-column-table table {
  width: 100%;
  min-width: 38rem;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.7;
}

.single-column .entry-content > .tn-column-body .tn-column-table th,
.single-column .entry-content > .tn-column-body .tn-column-table td {
  padding: 0.85em 1em;
  border-right: 1px solid var(--tn-column-border);
  border-bottom: 1px solid var(--tn-column-border);
  text-align: left;
  vertical-align: top;
}

.single-column .entry-content > .tn-column-body .tn-column-table th {
  background: #eef1f7;
  color: var(--tn-column-navy);
  font-weight: 700;
}

.single-column .entry-content > .tn-column-body .tn-column-table tr > :last-child {
  border-right: 0;
}

.single-column .entry-content > .tn-column-body .tn-column-table tbody tr:last-child > * {
  border-bottom: 0;
}

.single-column .entry-content > .tn-column-body .tn-column-notice {
  margin: 2em 0;
  padding: 1.25em 1.4em;
  border: 1px solid #cfd7e6;
  border-radius: 10px;
  background: #f1f5fc;
}

.single-column .entry-content > .tn-column-body .tn-column-notice--warning {
  border-color: #efcfaa;
  background: #fff7ed;
}

.single-column .entry-content > .tn-column-body .tn-column-notice > :last-child {
  margin-bottom: 0;
}

/* 既存コラムのQ/A配色と点線区切りを共通化する。 */
.single-column .entry-content > .tn-column-body .tn-column-faq {
  margin-top: 3em;
}

.single-column .entry-content > .tn-column-body .tn-column-faq__title {
  margin-top: 0;
}

.single-column .entry-content > .tn-column-body .tn-column-faq__item {
  padding: 0.3em 0 1.4em;
  border-bottom: 1px dashed #ddd;
  margin-bottom: 1.5em;
}

.single-column .entry-content > .tn-column-body .tn-column-faq__question {
  margin: 0 0 0.85em;
  color: #333;
  font-size: 1.05rem;
  line-height: 1.7;
}

.single-column .entry-content > .tn-column-body .tn-column-faq__answer {
  margin: 0;
  padding-left: 1rem;
  border-left: 3px solid #e5edf3;
}

.single-column .entry-content > .tn-column-body .tn-column-faq__mark {
  display: inline-block;
  margin-right: 0.6em;
  color: var(--tn-column-pink);
  font-weight: 800;
}

.single-column .entry-content > .tn-column-body .tn-column-faq__answer .tn-column-faq__mark {
  color: var(--tn-column-blue);
}

.single-column .entry-content > .tn-column-body .tn-column-cta {
  margin: 3.2em 0 2.25em;
  padding: clamp(1.5rem, 5vw, 2.8rem) clamp(1.25rem, 4vw, 2rem);
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  color: var(--tn-column-ink);
  text-align: center;
}

.single-column .entry-content > .tn-column-body .tn-column-cta::before {
  content: none;
}

.single-column .entry-content > .tn-column-body .tn-column-cta__eyebrow {
  margin: 0 0 0.75em;
  color: var(--tn-column-blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.single-column .entry-content > .tn-column-body .tn-column-cta__title {
  margin: 0 0 0.65em;
  padding: 0;
  border: 0;
  color: #333;
  font-size: clamp(1.2rem, 1.05rem + 0.55vw, 1.55rem);
  line-height: 1.6;
}

.single-column .entry-content > .tn-column-body .tn-column-cta__title::before,
.single-column .entry-content > .tn-column-body .tn-column-sources__title::before {
  content: none;
}

.single-column .entry-content > .tn-column-body .tn-column-cta__text {
  max-width: 36rem;
  margin: 0 auto 1.45em;
  color: #555;
}

.single-column .entry-content > .tn-column-body .tn-column-cta__button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.8em 1.4em;
  border: 0;
  border-radius: 999px;
  background: var(--tn-column-pink);
  box-shadow: 0 8px 20px rgba(252, 77, 104, 0.22);
  color: #fff;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.single-column .entry-content > .tn-column-body .tn-column-cta__button:hover {
  background: #d93655;
  color: #fff;
  transform: translateY(-2px);
}

.single-column .entry-content > .tn-column-body .tn-column-cta__label {
  display: block;
  text-wrap: balance;
}

.single-column .entry-content > .tn-column-body .tn-column-cta__note {
  margin: 1.25em 0 0;
  color: var(--tn-column-muted);
  font-size: 0.8125rem;
}

.single-column .entry-content > .tn-column-body .tn-column-sources {
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px solid var(--tn-column-border);
  color: var(--tn-column-muted);
  font-size: 0.875rem;
  line-height: 1.75;
}

.single-column .entry-content > .tn-column-body .tn-column-sources__title {
  margin: 0 0 0.75em;
  padding: 0;
  border: 0;
  color: var(--tn-column-navy);
  font-size: 1rem;
  font-weight: 700;
}

.single-column .entry-content > .tn-column-body .tn-column-sources ol {
  margin-bottom: 0;
}

.single-column .entry-content > .tn-column-body .tn-column-sources a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.single-column .entry-content > .tn-column-body :where(a, button, [tabindex]):focus-visible {
  outline: 3px solid #fc4d68;
  outline-offset: 4px;
}

@media (max-width: 767px) {
  .single-column .entry-content > .tn-column-body {
    font-size: 0.875rem;
    line-height: 2;
  }

  .single-column .entry-content > .tn-column-body h2 {
    margin-top: 2.35em;
    padding: 0 0 0.5em;
  }

  .single-column .entry-content > .tn-column-body h3 {
    margin-top: 2em;
  }

  .single-column .entry-content > .tn-column-body blockquote,
  .single-column .entry-content > .tn-column-body .tn-column-notice {
    padding: 1.1em;
  }

  .single-column .entry-content > .tn-column-body .tn-column-summary,
  .single-column .entry-content > .tn-column-body .tn-column-summary--point {
    padding: 1rem;
  }

  .single-column .entry-content > .tn-column-body .tn-column-message {
    padding: 2.25rem 1rem 1.2rem;
  }

  .single-column .entry-content > .tn-column-body .tn-column-message__label {
    left: 1rem;
  }

  .single-column .entry-content > .tn-column-body .tn-column-table {
    margin-inline: -0.25rem;
  }

  .single-column .entry-content > .tn-column-body .tn-column-cta {
    border-radius: 12px;
  }

  .single-column .entry-content > .tn-column-body .tn-column-cta__button {
    width: 100%;
    padding-inline: 1em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .single-column .entry-content > .tn-column-body *,
  .single-column .entry-content > .tn-column-body *::before,
  .single-column .entry-content > .tn-column-body *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
