/* 메통디 이슈 페이지.
   팔레트는 랜딩 본페이지(landing.src.html)의 토큰을 그대로 가져왔다.
   한글 웹폰트는 본페이지에 쓰인 글자만 서브셋돼 있어 이슈 본문의 새 글자가
   깨진다. 그래서 여기서는 시스템 폰트 스택을 쓴다. */
:root {
  --bg: #EDE4D4;
  --card-bg: #FBF6EB;
  --card-hover: #FFFDF6;
  --inset: #F4EDE0;
  --ink-block: #2B241B;
  --accent-blue: #56708F;
  --accent-taupe: #8A7A5E;
  --live: #4E8A5C;
  --text-main: #241E15;
  --text-muted: #7C6F5C;
  --border: #DCCFB8;
  --border-hover: #C3B092;
  --c-hot: #B4453C;
  --c-info: #56708F;
  --c-price: #A8802E;
  --c-warn: #C1732F;
  --c-talk: #7A5F92;
  --c-notice: #4E8A5C;
  --mono: ui-monospace, Consolas, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

/* ── 상단 ── */
.top {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand {
  font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  color: var(--text-main); text-decoration: none;
  display: inline-flex; align-items: center; gap: 9px;
}
.brand img {
  width: 30px; height: 30px; border-radius: 8px; display: block;
  border: 1px solid var(--border);
}
.top nav { display: flex; gap: 16px; font-size: 13.5px; }
.top nav a { color: var(--text-muted); text-decoration: none; }
.top nav a:hover { color: var(--text-main); }
.top nav a.on { color: var(--text-main); font-weight: 700; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.crumb { font-size: 12.5px; color: var(--text-muted); font-family: var(--mono); }
.crumb a { color: var(--text-muted); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb b { color: var(--text-main); font-weight: 600; }

h1 { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance; }
.lede { margin: 0; color: var(--text-muted); font-size: 15px; max-width: 62ch; }

.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--live); font-weight: 700; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex-shrink: 0; }

/* ── 게임 탭 / 허브 ── */
.gtabs { display: flex; gap: 7px; flex-wrap: wrap; }
.gtab {
  font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text-muted); text-decoration: none;
}
.gtab:hover { border-color: var(--border-hover); color: var(--text-main); }
.gtab.on { background: var(--ink-block); border-color: var(--ink-block); color: #F4EDE0; }

/* ── 게임 블록 (허브) ── */
.ghome { display: flex; flex-direction: column; gap: 11px; }
.ghome-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ghome-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.015em; }
.ghome-head .g-meta {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.ghome-head .g-all {
  margin-left: auto; font-size: 12.5px; font-weight: 700;
  color: var(--accent-blue); text-decoration: none; white-space: nowrap;
}
.ghome-head .g-all:hover { text-decoration: underline; }

/* ── 레일 ──
   넘기기식 슬라이드가 아니라 옆으로 계속 흐르는 띠.
   카드를 두 벌 찍어 -50% 까지 이동시키면 이음매 없이 순환한다(JS 불필요).
   마우스를 올리면 그 자리에서 멈춘다. */
.rail { display: flex; flex-direction: column; gap: 10px; }
.rail-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.rail-head .h { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.rail-head .m {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.more {
  margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--accent-blue);
  text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
}
.more::after { content: "→"; transition: transform .18s; }
.more:hover { text-decoration: underline; }
.more:hover::after { transform: translateX(3px); }

.rail-view {
  overflow: hidden;
  /* 양 끝을 흐리게 해서 잘린 카드가 어색하지 않게 */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.rail-track {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: rail-scroll var(--dur, 30s) linear infinite;
}
.rail-dup { display: flex; gap: 10px; margin-left: 10px; }
.rail:hover .rail-track,
.rail:focus-within .rail-track { animation-play-state: paused; }
@keyframes rail-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 5px)); }
}

.rcard {
  flex: 0 0 268px;
  width: 268px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px 14px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition: background .15s, border-color .15s;
}
.rcard:hover { background: var(--card-hover); border-color: var(--border-hover); }
.rcard.hot { border-left-color: var(--c-hot); }
.rcard.info { border-left-color: var(--c-info); }
.rcard.price { border-left-color: var(--c-price); }
.rcard.warn { border-left-color: var(--c-warn); }
.rcard.talk { border-left-color: var(--c-talk); }
.rcard.notice { border-left-color: var(--c-notice); }
.rcard .chip { align-self: flex-start; margin-top: 0; }
.rcard .r-title {
  font-size: 14px; font-weight: 800; letter-spacing: -.01em; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rcard .r-teaser {
  font-size: 12.5px; line-height: 1.5; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rcard .r-more { font-size: 11.5px; font-weight: 700; color: var(--accent-blue); margin-top: 1px; }

/* ── 날짜 · 회차 ── */
.day { display: flex; flex-direction: column; gap: 10px; }
.day-head { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 7px; }
.day-head .d { font-family: var(--mono); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.day-head .rel { font-size: 12px; color: var(--text-muted); }

.ed { display: flex; flex-direction: column; gap: 7px; margin-top: 6px; scroll-margin-top: 16px; }
.ed-head { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--text-muted); }
.ed-head .badge {
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text-main);
  background: var(--inset); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 9px; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.ed-head .anchor { color: var(--border-hover); text-decoration: none; font-family: var(--mono); opacity: 0; }
.ed:hover .ed-head .anchor { opacity: 1; }
.ed-head::after { content: ""; flex: 1; height: 1px; background: var(--border); order: 9; }

/* ── 날짜 카드 목록 + 페이지 넘김 ── */
.past { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.past-head {
  display: flex; align-items: baseline; gap: 9px;
  border-bottom: 1px solid var(--border); padding-bottom: 7px;
}
.past-head .t { font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.past-head .m { font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); }

.daylist { display: flex; flex-direction: column; gap: 9px; }
.daycard {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px 13px; display: flex; flex-direction: column; gap: 9px;
}
.daycard:hover { border-color: var(--border-hover); }
.dc-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
}
.dc-head:hover .dc-date { text-decoration: underline; }
.dc-date {
  font-family: var(--mono); font-size: 13.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dc-rel { font-size: 12.5px; color: var(--text-muted); }
.dc-meta {
  margin-left: auto; font-size: 11.5px; color: var(--text-muted);
  font-family: var(--mono); flex-shrink: 0;
}

.dc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.dc-item { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; line-height: 1.5; }
.dc-item .chip { align-self: center; }
.dc-t {
  font-size: 14px; font-weight: 600; color: var(--text-main);
  text-decoration: none;
}
.dc-t:hover { text-decoration: underline; }
.dc-teaser {
  flex: 1 1 100%; font-size: 12.5px; color: var(--text-muted);
  padding-left: 44px;
}
.dc-all { align-self: flex-start; font-size: 12.5px; }

/* ── 가이드 허브 ── */
.gcards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gcard {
  display: flex; flex-direction: column; gap: 7px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 15px 16px; text-decoration: none; color: inherit;
}
.gcard:hover { background: var(--card-hover); border-color: var(--border-hover); }
.gc-tag {
  align-self: flex-start; font-family: var(--mono); font-size: 11px;
  letter-spacing: .04em; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px;
}
.gc-t { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.4; }
.gc-d { font-size: 13px; color: var(--text-muted); line-height: 1.65; }

/* ── 상록 가이드 ── */
.eg-sec { display: flex; flex-direction: column; gap: 11px; }
.eg-sec h2, .eg-auto h2, .eg-faq h2 {
  margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.015em;
  border-bottom: 1px solid var(--border); padding-bottom: 7px;
}
.eg-sec p, .eg-auto-item p { margin: 0; font-size: 15px; line-height: 1.75; }

.eg-steps {
  margin: 0; padding: 14px 14px 14px 34px;
  background: var(--inset, var(--card-bg)); border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 9px;
  font-size: 14.5px; line-height: 1.65;
}

/* 자동 갱신 구역 — 고정부와 눈으로 구분되게 왼쪽 선을 준다 */
.eg-auto {
  display: flex; flex-direction: column; gap: 13px;
  border-left: 3px solid var(--accent-blue, var(--border-hover));
  padding-left: 14px;
}
.eg-auto-head { display: flex; flex-direction: column; gap: 5px; }
.eg-auto-head h2 { border: 0; padding: 0; }
.eg-upd { font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); }
.eg-auto-item { display: flex; flex-direction: column; gap: 9px; }
.eg-auto-item h3 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }

.eg-faq { display: flex; flex-direction: column; gap: 9px; }
.eg-faq .item > summary { font-weight: 600; }

/* ── 날짜 페이지: 앞뒤 날짜 이동 ── */
.daynav { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 4px; }
.daynav a {
  padding: 8px 13px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--card-bg); color: var(--text-muted);
  font-size: 13px; text-decoration: none;
}
.daynav a:hover { border-color: var(--border-hover); color: var(--text-main); background: var(--card-hover); }
.daynav .dn-next { margin-left: auto; }

.pager { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding-top: 4px; }
.pager button {
  appearance: none; min-width: 30px; height: 30px; padding: 0 8px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text-muted); font: inherit; font-size: 13px;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text-main); background: var(--card-hover); }
.pager button.on {
  background: var(--ink-block); border-color: var(--ink-block);
  color: #F4EDE0; font-weight: 700;
}
.pager button:disabled { opacity: .35; cursor: default; }
.pager .gap { color: var(--text-muted); padding: 0 2px; }

.item { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.item[open] { background: var(--card-hover); border-color: var(--border-hover); }
.item > summary {
  list-style: none; cursor: pointer; padding: 11px 14px;
  display: flex; align-items: flex-start; gap: 10px;
  font-weight: 600; font-size: 14.5px; line-height: 1.45;
}
.item > summary::-webkit-details-marker { display: none; }
.item > summary::after {
  content: "+"; margin-left: auto; font-family: var(--mono);
  color: var(--text-muted); font-weight: 400; flex-shrink: 0; line-height: 1.45;
}
.item[open] > summary::after { content: "\2212"; }
.item .body { padding: 0 14px 14px 44px; font-size: 14.5px; display: flex; flex-direction: column; gap: 11px; }
.item .body p { margin: 0; }
.item .body strong { font-weight: 700; }

/* ── 칩 ── */
.chip {
  flex-shrink: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; color: #FBF6EB; margin-top: 2px; white-space: nowrap;
}
.chip.hot { background: var(--c-hot); }
.chip.info { background: var(--c-info); }
.chip.price { background: var(--c-price); }
.chip.warn { background: var(--c-warn); }
.chip.talk { background: var(--c-talk); }
.chip.notice { background: var(--c-notice); }

/* ── 아카이브 · CTA · 푸터 ── */
.archive { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.archive .t { color: var(--text-muted); font-weight: 700; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.archive a {
  color: var(--accent-blue); text-decoration: none; font-family: var(--mono);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; background: var(--card-bg);
}
.archive a:hover { border-color: var(--border-hover); }
.back { margin: 0; font-size: 13.5px; }
.back a { color: var(--accent-blue); }

.cta {
  background: var(--ink-block); color: #F4EDE0; border-radius: 14px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px;
}
.cta .h { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.cta .s { font-size: 13.5px; opacity: .78; }
.cta .btn {
  align-self: flex-start; background: #F4EDE0; color: #2B241B; font-weight: 800;
  font-size: 13.5px; padding: 8px 16px; border-radius: 7px; text-decoration: none; margin-top: 4px;
}

.foot {
  max-width: 760px; margin: 0 auto; padding: 22px 20px 46px;
  border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted);
  display: flex; flex-direction: column; gap: 6px;
}
.foot p { margin: 0; }
.foot .muted { opacity: .8; }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-blue); outline-offset: 2px; border-radius: 4px;
}

@media (max-width: 620px) {
  main { padding: 20px 14px 32px; }
  h1 { font-size: 23px; }
  .item .body { padding-left: 14px; }
  .gcards { grid-template-columns: 1fr; }
  .dc-teaser { padding-left: 0; }
  .dc-meta { margin-left: 0; flex-basis: 100%; }
  .rcard { flex-basis: 232px; width: 232px; }
}
@media (prefers-reduced-motion: reduce) {
  /* 움직임을 끄면 레일이 멈추므로 손으로 넘겨 볼 수 있게 바꾼다 */
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .rail-view { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .rail-dup { display: none; }
}
