/* /articles/assets/css/article.css */

.site-main {
  padding-bottom: 24px;
}

.article-hero {
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(110, 231, 255, .08), rgba(0, 0, 0, 0));
}

.breadcrumb {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-title {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.25;
  letter-spacing: .2px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
}

.article-body {
  padding: 22px 0;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}

.content {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.content .lead {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.content p {
  line-height: 1.9;
  color: rgba(231, 233, 238, .95);
}

.content h2 {
  margin-top: 26px;
  font-size: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.content h3 {
  margin-top: 18px;
  font-size: 16px;
  color: var(--text);
}

.content ul,
.content ol {
  padding-left: 1.2em;
  line-height: 1.9;
}

.content li {
  margin: 6px 0;
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin: 12px 0;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.tbl th,
.tbl td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.tbl th {
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  font-weight: 650;
}

.tbl td {
  color: rgba(231, 233, 238, .95);
}

.cta-card {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(110, 231, 255, .25);
  background: rgba(110, 231, 255, .07);
}

.cta-card h3 {
  margin: 0 0 8px;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-weight: 650;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
}

.end-link {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.end-link a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-box {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.sidebar-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.sidebar-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
  line-height: 1.8;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .tbl {
    min-width: 560px;
  }
}

/* 追記：TOC & 小テーマ区切り */
.toc-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .03);
}

.toc-title {
  font-weight: 800;
  margin-bottom: 10px;
}

.toc {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.9;
  color: var(--muted);
}

.toc a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.sub-article {
  scroll-margin-top: 92px;
}

.sub-head {
  margin-bottom: 10px;
}

.sub-title {
  margin: 0;
  font-size: 18px;
}

.sub-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.sub-sep {
  margin: 18px 0;
  border: 0;
  border-top: 1px dashed var(--line);
}

.mini-cta {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(110, 231, 255, .20);
  background: rgba(110, 231, 255, .06);
}

.mini-cta__text {
  margin: 0;
  color: rgba(231, 233, 238, .95);
}

/* hub (大テーマページ) */
.hub-hero {
  padding: 30px 0 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(110, 231, 255, .08), rgba(0, 0, 0, 0));
}

.hub-eyebrow {
  color: var(--muted);
  margin: 0 0 8px;
  font-size: 13px;
}

.hub-title {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.25;
}

.hub-desc {
  margin: 10px 0 0;
  color: rgba(231, 233, 238, .95);
  line-height: 1.9;
  max-width: 820px;
}

.hub-actions {
  margin-top: 14px;
}

.hub-list {
  padding: 22px 0;
}

.hub-h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card {
  display: block;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}

.card-title {
  font-weight: 750;
  line-height: 1.5;
}

.card-desc {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.card-meta {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.hero-cta {
  margin-top: 20px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: .2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #4fd1ff, #4fb3ff);
  color: #001018;
  box-shadow: 0 8px 20px rgba(79, 209, 255, .25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(79, 209, 255, .35);
}

.btn-secondary {
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  background: rgba(255, 255, 255, .05);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, .12);
}

/* ===== Hero CTA (2 buttons) ===== */
.hero-cta {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-primary {
  background: rgba(110, 231, 255, .95);
  color: #001018;
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(110, 231, 255, .22);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(110, 231, 255, .30);
}

.btn-secondary {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .22);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, .12);
}

.cta-note {
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

html {
  scroll-behavior: smooth;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb a:hover {
  color: rgba(231, 233, 238, .95);
}

.breadcrumb-sep {
  color: rgba(255, 255, 255, .22);
}

/* ===== Category badge / tabs ===== */
.card-cat {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.article-cat {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-size: 12px;
}

/* ===== Category Mark (pill) ===== */
.card-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);

  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(231, 233, 238, .92);

  margin-bottom: 10px;
}

/* 小さな点（マーク感） */
.card-cat::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(110, 231, 255, .9);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, .15);
}

.article-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);

  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: rgba(231, 233, 238, .92);

  margin: 0 0 10px;
}

.article-cat::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(110, 231, 255, .9);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, .15);
}

.tag-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== 記事内テーブル ===== */
.article-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 24px 0;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}

.article-body thead {
  background: linear-gradient(135deg, #1f2937, #111827);
}

.article-body th,
.article-body td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.article-body th {
  font-weight: 600;
  color: #e5f2ff;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.article-body td {
  color: #d1d5db;
}

.article-body tbody tr:hover {
  background: rgba(59, 130, 246, 0.06);
}

/* 数値列を見やすく */
.article-body td:nth-child(2),
.article-body td:nth-child(3) {
  white-space: nowrap;
  font-feature-settings: "tnum";
  color: #93c5fd;
}

/* 役割列を少し強調 */
.article-body td:last-child {
  color: #e5e7eb;
}

/* モバイル対応 */
@media (max-width: 640px) {
  .article-body table {
    font-size: 13px;
  }
  .article-body th,
  .article-body td {
    padding: 10px 10px;
  }
}
.article-body td:nth-child(3) {
  font-weight: 600;
  color: #22d3ee;
}
.article-body thead th {
  position: sticky;
  top: 0;
}
/* ===== Fix: .tbl（table-wrap内）だけは汎用テーブル装飾を無効化して安定表示 ===== */
.table-wrap .tbl{
  border-collapse: collapse;   /* .article-body table の separate を打ち消す */
  border-spacing: 0;
  background: transparent;     /* 汎用の背景を外す（見た目はtable-wrap側に寄せる） */
  border-radius: 0;
  overflow: visible;
}

/* セルの折り返しを強制して、列崩れを防ぐ */
.table-wrap .tbl th,
.table-wrap .tbl td{
  white-space: normal;         /* 汎用 nth-child nowrap を打ち消す */
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 汎用の「2列目・3列目はnowrap」指定が、この表だと致命傷なので無効化 */
.table-wrap .tbl td:nth-child(2),
.table-wrap .tbl td:nth-child(3){
  white-space: normal;
  font-feature-settings: normal;
}

/* overflowコンテナ内のstickyは相性で崩れることがあるので、この表では無効化 */
.table-wrap .tbl thead th{
  position: static;
}
