/* NAMANE blog — article tables (2026-11-10, 대표 「표 디자인을 제대로 다시 snapholo처럼」).
   Theme-only: every existing post keeps its plain <table> (HTML card, no class, no inline style) and is fixed by this file
   plus assets/js/tables.js. Structure follows SnapHolo News article.css (header row, row rules, numeric columns right,
   fit → stack → compact → scroll per width); colours are NAMANE's own neutrals + accent (#111), never SnapHolo emerald.
   Font: Noto Sans only (language glyph family first). Baseline at 390 px: cell text ≥ 14 px, no horizontal overflow,
   text contrast ≥ WCAG AA (body #1a1a1a / header #292929 on #f5f5f5 / labels #575757 on #fff = 17.4 / 13.1 / 7.0 : 1). */
/* The post column (.s-content-layout, margin: 0 auto inside a column flex box) takes fit-content width, i.e. the
   min-content width of a wide table, so a 7-column table stretched the whole article past the phone width
   (390 px viewport → 665 px page on post 2033, the browser then zooms out to ~0.59). Pin the column to the box width
   (main.css max-width 1038 px still caps it) and let its children shrink; the table handles its own width. */
.post-template .s-content-layout { width: 100%; }
.post-template .s-content-layout,
.post-template .s-content-layout > .s-content-main,
.post-template .s-entry,
.post-template .s-entry-content { min-width: 0; }
.post-template .s-entry-content table {
  --nm-t-border: #e6e6e6;
  --nm-t-border-strong: #d6d6d6;
  --nm-t-head-bg: #f5f5f5;
  --nm-t-zebra: #fafafa;
  --nm-t-text: #1a1a1a;
  --nm-t-head-text: #292929;
  --nm-t-muted: #575757;
  --nm-t-accent: var(--ghost-accent-color, #111111);
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.75rem 0;
  overflow-x: auto;
  border: 1px solid var(--nm-t-border);
  border-collapse: collapse;
  border-spacing: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--nm-t-text);
  font-family: "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
html[data-lang="ko"] .post-template .s-entry-content table { font-family: "Noto Sans KR", "Noto Sans", sans-serif; }
html[data-lang="ja"] .post-template .s-entry-content table { font-family: "Noto Sans JP", "Noto Sans", sans-serif; }
html[data-lang="zh"] .post-template .s-entry-content table { font-family: "Noto Sans SC", "Noto Sans", sans-serif; }
.post-template .s-entry-content .nm-tw.nm-ko > table { font-family: "Noto Sans KR", "Noto Sans", sans-serif; }
.post-template .s-entry-content .nm-tw.nm-ja > table { font-family: "Noto Sans JP", "Noto Sans", sans-serif; }
.post-template .s-entry-content .nm-tw.nm-zh > table { font-family: "Noto Sans SC", "Noto Sans", sans-serif; }
.post-template .s-entry-content table :is(th, td) {
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--nm-t-border);
  background: transparent;
  color: inherit;
  font-size: inherit;
  text-align: start;
  vertical-align: top;
  /* never break inside a word in table mode. Blink lets break-word shrink a column below its longest word, which
     overrode keep-all and cut '엘리베이|터 경로' (v1, ko-subway 1280). A word that does not fit now overflows the
     table, and tables.js switches that table to cards (.is-stack), where long tokens may wrap. */
  overflow-wrap: normal;
  word-break: normal;
  line-break: strict;
  letter-spacing: 0;
}
/* Language rules follow the table's own text: tables.js tags each wrapper nm-ko / nm-ja / nm-zh from its characters.
   <html data-lang> is not reliable on posts: the head script takes it from localStorage when the slug has no language
   marker, so a reader who last opened an English post gets data-lang="en" on a Korean post. The html[data-lang]
   selectors below are only the fallback before/without JS. */
/* ko: break between words (spaces) only, strict kinsoku for punctuation */
html[data-lang="ko"] .post-template .s-entry-content table :is(th, td),
.post-template .s-entry-content .nm-tw.nm-ko > table :is(th, td) { word-break: keep-all; line-break: strict; }
/* ja / zh have no spaces: break between characters as usual, but obey strict kinsoku (no line starting with 。、」ー ゃ).
   word-break: auto-phrase (ja bunsetsu) was tried and rejected: phrases widen columns so 1280 px tables overflowed
   into cards. */
html[data-lang="ja"] .post-template .s-entry-content table :is(th, td),
html[data-lang="zh"] .post-template .s-entry-content table :is(th, td),
.post-template .s-entry-content .nm-tw.nm-ja > table :is(th, td),
.post-template .s-entry-content .nm-tw.nm-zh > table :is(th, td) { word-break: normal; line-break: strict; }
.post-template .s-entry-content table thead :is(th, td),
.post-template .s-entry-content table tr.nm-head > :is(th, td) {
  background: var(--nm-t-head-bg);
  border-bottom: 2px solid var(--nm-t-accent);
  color: var(--nm-t-head-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  vertical-align: bottom;
}
.post-template .s-entry-content table tbody tr:nth-child(even) > :is(td, th) { background: var(--nm-t-zebra); }
.post-template .s-entry-content table tbody tr:last-child > :is(td, th) { border-bottom: 0; }
.post-template .s-entry-content table tbody > tr > :first-child { font-weight: 600; color: var(--nm-t-text); }
.post-template .s-entry-content table tbody th { font-size: inherit; vertical-align: top; }
.post-template .s-entry-content table a { color: var(--nm-t-text); text-decoration: underline; text-underline-offset: 2px; }
.post-template .s-entry-content table :is(strong, b) { font-weight: 700; }
.post-template .s-entry-content table caption {
  caption-side: bottom;
  padding: 8px 2px 0;
  color: var(--nm-t-muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: start;
}
/* wrapped by tables.js */
.post-template .s-entry-content .nm-tw {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 1.75rem 0;
  border: 1px solid var(--nm-t-border, #e6e6e6);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.post-template .s-entry-content .nm-tw > table {
  display: table;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  table-layout: auto;
}
.post-template .s-entry-content .nm-tw :is(th, td).is-num {
  text-align: end;
  white-space: nowrap;
}
.post-template .s-entry-content .nm-tw :is(th.is-num, td.is-num.nm-wrap) { white-space: normal; }
/* compact: tighter padding only. Words are never broken mid-word (overflow-wrap: anywhere split 'T-mon ey' on 2033);
   if the table still overflows or squeezes a column, tables.js switches to stack. */
.post-template .s-entry-content .nm-tw.is-compact > table :is(th, td) { padding: 10px 8px; }
/* scroll: last resort only (first column sticky, hint line, fade at the hidden edge) */
.post-template .s-entry-content .nm-tw.is-scroll > table :is(th, td):first-child {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: #fff;
  box-shadow: inset -1px 0 0 var(--nm-t-border, #e6e6e6);
  min-width: 7.5rem;
}
.post-template .s-entry-content .nm-tw.is-scroll > table th:first-child { background: var(--nm-t-head-bg, #f5f5f5); }
.post-template .s-entry-content .nm-tw.is-scroll:not(.is-end) {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), rgba(0, 0, 0, 0.25));
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), rgba(0, 0, 0, 0.25));
}
.post-template .s-entry-content .nm-tw-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 1.5rem 0 -1.25rem;
  color: #575757;
  font-family: "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
}
.post-template .s-entry-content .nm-tw-hint::after { content: "\2192"; color: #111; font-weight: 700; }
/* stack (phone): one card per row, header text as labels */
.post-template .s-entry-content .nm-tw.is-stack {
  overflow: visible;
  border: 0;
  border-radius: 0;
  border-top: 2px solid var(--ghost-accent-color, #111111);
  background: transparent;
}
.post-template .s-entry-content .nm-tw.is-stack > table,
.post-template .s-entry-content .nm-tw.is-stack > table > tbody,
.post-template .s-entry-content .nm-tw.is-stack > table > tbody > tr { display: block; width: 100%; }
.post-template .s-entry-content .nm-tw.is-stack > table > thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.post-template .s-entry-content .nm-tw.is-stack > table > tbody > tr {
  padding: 14px 4px;
  border-bottom: 1px solid var(--nm-t-border, #e6e6e6);
  background: transparent;
}
.post-template .s-entry-content .nm-tw.is-stack > table > tbody > tr > :is(td, th) {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
  column-gap: 12px;
  align-items: baseline;
  padding: 4px 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  line-height: 1.55;
  white-space: normal;
  text-align: start;
  overflow-wrap: break-word;
}
.post-template .s-entry-content .nm-tw.is-stack > table > tbody > tr > :is(td, th)::before {
  content: attr(data-label);
  color: #575757;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
.post-template .s-entry-content .nm-tw.is-stack > table > tbody > tr > :is(td, th):first-child:not(.is-num) {
  display: block;
  padding: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}
.post-template .s-entry-content .nm-tw.is-stack > table > tbody > tr > :is(td, th):first-child:not(.is-num)::before,
.post-template .s-entry-content .nm-tw.is-stack > table > tbody > tr > :is(td, th)[data-label=""]::before { content: none; }
.post-template .s-entry-content .nm-tw.is-stack > table > tbody > tr > :is(td, th)[data-label=""] { display: block; }
@media (max-width: 600px) {
  .post-template .s-entry-content table { font-size: 14px; }
  .post-template .s-entry-content table :is(th, td) { padding: 10px 10px; }
  .post-template .s-entry-content table thead th { font-size: 14px; }
}
