:root {
  --bg: #fff;
  --fg: #08131a;
  --fg-muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --purchase-bg: #f8f7f5;
  --content-width: 620px;
  --sans: "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Arial, "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* 地獄プラン基準の共通見出し画像 */
.header-img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.article {
  width: min(var(--content-width), calc(100% - 80px));
  margin: 0 auto;
  padding: 40px 0 80px;
  line-height: 1.5;
}
.article-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 72px;
  margin-bottom: 18px;
}
.article-meta {
  color: var(--fg-muted);
  font-size: 14px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.article p {
  font-size: 18px;
  line-height: 2;
  margin-top: 36px;
  margin-bottom: 36px;
}
.article h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 36px;
  margin-top: 54px;
  margin-bottom: -18px;
}
.article h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 40px;
  margin-bottom: 12px;
}
.article strong { font-weight: 700; }
.article ul {
  font-size: 16px;
  line-height: 1.5;
  margin-top: 36px;
  margin-bottom: 36px;
  padding-left: 1.5em;
}
.article li { margin-bottom: 4px; }
.article a {
  color: var(--accent);
  text-decoration: underline;
}
.article a:hover { color: var(--accent-hover); }

.article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px 0;
  border-radius: 4px;
}
.article-image { margin: 32px 0; }
.article-image img { margin: auto; border: 1px solid var(--border); }
.article-image figcaption {
  margin-top: 12px;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 24px 0 36px;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

.toc {
  background: #f5f8fa;
  border: 0;
  border-radius: 0;
  padding: 16px;
  margin: 36px 0 0;
}
.toc-title {
  position: relative;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  color: rgba(8, 19, 26, 0.66);
  padding-left: 16px;
  margin: 0;
}
.toc-title::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 7px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid rgba(8, 19, 26, 0.66);
}
.toc ul { list-style: none; padding-left: 0; margin: 0; }
.toc li {
  font-size: 14px;
  line-height: 21px;
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px solid rgba(8, 19, 26, 0.14);
}
.toc li:first-child { padding: 20px 0 8px; }
.toc li:last-child { border-bottom: 0; }
.toc a { display: block; color: rgba(8, 19, 26, 0.66); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.toc-more { margin-top: 8px; }
.toc-more button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid rgba(8, 19, 26, 0.14);
  border-radius: 8px;
  color: var(--fg);
  font: 600 12px/12px var(--sans);
  cursor: pointer;
}

/* 原典noteから残る目次は、各ページの静的な目次に置き換える。 */
.article .o-tableOfContents { display: none; }

.note-embed, .audio-wrap, .external-embed-wrap, .twitter-wrap {
  width: 100%;
  margin: 24px 0;
  overflow: hidden;
}
.note-embed iframe { display: block; width: 100%; height: 210px; border: 0; }
.audio-wrap iframe { display: block; width: 100%; min-height: 152px; border: 0; }
.external-embed-wrap iframe { display: block; width: 100%; min-height: 360px; border: 0; }
.twitter-wrap iframe { display: block; width: 100%; min-height: 520px; border: 0; }

.external-reference {
  display: flex;
  align-items: stretch;
  min-height: 112px;
  margin: 24px 0 36px;
  border: 1px solid rgba(8, 19, 26, 0.14);
  border-radius: 8px;
  overflow: hidden;
  transition: background 0.2s;
}
.external-reference:hover { background: #f9fafb; }
.external-reference a {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 16px 20px;
  color: var(--fg);
  text-decoration: none;
}
.external-reference strong {
  display: block;
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 6px;
}
.external-reference span {
  display: block;
  color: rgba(8, 19, 26, 0.66);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.external-reference small { display: block; color: var(--fg); font-size: 12px; }

/* 地獄プラン基準の外部リンクカード */
.article a.ext-card,
.article a.ext-card:hover {
  text-decoration: none;
}
.ext-card {
  display: flex;
  align-items: stretch;
  height: 152px;
  border: 1px solid rgba(8, 19, 26, 0.14);
  border-radius: 8px;
  overflow: hidden;
  margin: 24px 0 36px;
  color: var(--fg);
  transition: background 0.2s;
}
.ext-card--text {
  height: auto;
  min-height: 112px;
}
.ext-card:hover {
  background: #f9fafb;
  color: var(--fg);
}
.ext-card-body {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}
.ext-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ext-card-desc {
  font-size: 12px;
  color: rgba(8, 19, 26, 0.66);
  line-height: 1.5;
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ext-card-desc:empty { display: none; }
.ext-card-url {
  font-size: 12px;
  color: var(--fg);
  flex-shrink: 0;
}
.article .ext-card-img {
  width: 220px;
  min-width: 220px;
  height: 150px;
  max-width: none;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

/* 連載記事の既存ナビゲーション */
.series-nav {
  margin-top: 60px;
  color: var(--fg-muted);
  font-size: 14px;
  text-align: center;
}
.series-nav a { color: var(--accent); }
.series-nav a:hover { color: var(--accent-hover); }

.attachment a {
  display: block;
  padding: 16px;
  border: 1px solid var(--border);
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

/* note.com移行記事。本文Markdownの構造をそのまま読みやすく表示する。 */
.article:has(.notecom-body) .article-title {
  margin-top: 0;
  margin-bottom: 40px;
}
.notecom-body h2 {
  margin-top: 56px;
  margin-bottom: 20px;
}
.notecom-body h3 {
  margin-top: 40px;
  margin-bottom: 16px;
}
.notecom-body p { margin: 24px 0; }
.notecom-body ul,
.notecom-body ol {
  margin: 24px 0;
  padding-left: 1.6em;
  font-size: 18px;
  line-height: 1.9;
}
.notecom-body li {
  margin: 8px 0;
  padding-left: 0.2em;
}
.notecom-body blockquote {
  margin: 28px 0;
  padding: 2px 0 2px 20px;
  border-left: 4px solid var(--border);
  color: var(--fg-muted);
}
.notecom-body .video-wrap,
.notecom-body .audio-wrap,
.notecom-body .twitter-wrap { margin: 28px 0; }
.notecom-body .twitter-wrap {
  min-height: 0;
  overflow: visible;
}
.notecom-body .twitter-wrap iframe {
  min-height: 0;
  max-width: 100% !important;
}
.notecom-body .link-card-list {
  display: grid;
  gap: 16px;
  margin: 28px 0 32px;
}
.notecom-body .link-card-list .link-card { margin: 0; }
.notecom-body .link-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 112px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
}
.notecom-body .link-card-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 18px 20px;
}
.notecom-body .link-card-image {
  display: block;
  width: 220px;
  min-width: 220px;
  height: 150px;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}
.notecom-body .link-card:hover {
  background: #f9fafb;
  color: var(--fg);
}
.notecom-body .link-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.5;
}
.notecom-body .link-card em {
  display: block;
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.6;
  font-style: normal;
}
.notecom-body .link-card:not(:has(> .link-card-body > .link-card-cta)) .link-card-body > em:first-of-type {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.notecom-body .link-card-cta {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}
.notecom-body .attachment-disabled {
  display: block;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg-muted);
}
.asset-note, .draft-note {
  background: #f5f8fa;
  color: var(--fg-muted);
  font-size: 14px !important;
  padding: 16px;
}

@media (max-width: 640px) {
  .article { width: calc(100% - 40px); }
  .article-title { font-size: 24px; }
  .article h2 { font-size: 22px; }
  .article p, .article ul { font-size: 16px; }
  .external-reference a { padding: 12px 14px; }
  .external-reference strong { font-size: 14px; }
  .external-reference span { display: none; }
  .ext-card { height: 120px; }
  .ext-card--text { height: auto; min-height: 96px; }
  .ext-card-body { padding: 12px 14px; }
  .article .ext-card-img { width: 110px; min-width: 110px; height: 120px; }
  .ext-card-title { font-size: 14px; }
  .ext-card-desc { display: none; }
  .notecom-body ul,
  .notecom-body ol { font-size: 16px; }
  .notecom-body .link-card-image { width: 110px; min-width: 110px; height: 120px; }
  .notecom-body .link-card-body { padding: 12px 14px; }
  .notecom-body .link-card:not(:has(> .link-card-body > .link-card-cta)) .link-card-body > em:first-of-type { -webkit-line-clamp: 1; }
}
