/* Softkleenex Archive — 공통 토큰과 페이지 셸(헤더·푸터·카드) */

:root {
  color-scheme: light dark;

  --paper: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --ink: #101827;
  --body: #334155;
  --muted: #526173;
  --line: #d8dee8;

  --accent: #1d4ed8;
  --accent-deep: #1e40af;
  --accent-soft: #eef4ff;
  --accent-ring: rgba(29, 78, 216, 0.5);

  --pre-bg: #0f172a;
  --pre-ink: #e2e8f0;
  --focus: #b45309;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 12px 30px rgba(29, 78, 216, 0.12);

  --shell: min(100% - 32px, 1040px);
  --reading: min(100% - 32px, 780px);
}

/* 장미빛 팔레트: THE COLOR HOUSE 계열 글에서 사용 */
[data-accent="rose"] {
  --paper: #fff9fa;
  --surface: #ffffff;
  --surface-2: #fff0f3;
  --ink: #24151b;
  --body: #4a3540;
  --muted: #76616b;
  --line: #ead9df;

  --accent: #a3284b;
  --accent-deep: #711d36;
  --accent-soft: #fff0f3;
  --accent-ring: rgba(163, 40, 75, 0.5);

  --pre-bg: #2c1921;
  --pre-ink: #fff5f7;
  --shadow: 0 24px 70px rgba(113, 29, 54, 0.12);
  --shadow-hover: 0 12px 30px rgba(163, 40, 75, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1117;
    --surface: #161b22;
    --surface-2: #1c2430;
    --ink: #e6edf3;
    --body: #c3ccd7;
    --muted: #8b98a9;
    --line: #2a323d;

    --accent: #7aa2f7;
    --accent-deep: #a5c0ff;
    --accent-soft: #16202f;
    --accent-ring: rgba(122, 162, 247, 0.55);

    --pre-bg: #0b1020;
    --pre-ink: #dbe4f4;
    --focus: #fbbf24;
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 12px 30px rgba(122, 162, 247, 0.18);
  }

  [data-accent="rose"] {
    --paper: #14090e;
    --surface: #1e1017;
    --surface-2: #2a1620;
    --ink: #f7e8ec;
    --body: #ddc7cf;
    --muted: #a98d97;
    --line: #3a2028;

    --accent: #f2879f;
    --accent-deep: #ffb3c4;
    --accent-soft: #2a1620;
    --accent-ring: rgba(242, 135, 159, 0.55);

    --pre-bg: #170b11;
    --pre-ink: #ffe9ee;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Pretendard", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent-deep);
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 14px;
  transform: translateY(-180%);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  text-decoration: none;
}

.skip:focus {
  transform: translateY(0);
}

/* 헤더 · 푸터 */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header nav {
  width: var(--shell);
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 700;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent-deep);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer div {
  width: var(--shell);
  margin: 0 auto;
  padding: 25px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

/* 빵부스러기 */

.breadcrumb {
  padding: 20px 0 0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--line);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

/* 카드 */

.card-grid {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease,
    box-shadow 160ms ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.card .kicker {
  margin: 0;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card h3 {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
}

.card p:not(.kicker) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.card time {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card {
    transition: none;
  }

  .card:hover,
  .card:focus-visible {
    transform: none;
  }
}

/* ── 셸과 탐색기 레이아웃 ─────────────────────────────── */

.shell {
  width: min(100% - 32px, 1240px);
  margin: 0 auto;
}

.shell.with-explorer {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

/* post.css 의 main 폭 고정을 그리드 안에서만 해제한다 */
.with-explorer main {
  width: 100%;
  max-width: 780px;
  margin: 0;
}

.explorer {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 28px 0 48px;
  scrollbar-width: thin;
}

.ex-group + .ex-group {
  margin-top: 26px;
}

.ex-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ex-n {
  margin-left: auto;
  font-weight: 600;
  letter-spacing: 0;
  opacity: 0.7;
}

/* 들여쓰기를 border-left 로 처리해 제목이 쓸 폭을 최대로 확보한다 */
.explorer ul {
  margin: 0;
  padding: 0 0 0 11px;
  border-left: 1px solid var(--line);
  list-style: none;
}

.explorer li a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-left: -1px;
  padding: 5px 8px 5px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  color: var(--body);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
}

.explorer li a:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.explorer li a[aria-current="page"] {
  border-left-color: var(--accent);
  color: var(--accent-deep);
  font-weight: 700;
}

@media (max-width: 1080px) {
  .shell.with-explorer {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .with-explorer main {
    max-width: none;
    order: 1;
  }

  .explorer {
    order: 2;
    position: static;
    max-height: none;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
  }

  .explorer::before {
    content: "다른 글";
    display: block;
    margin-bottom: 18px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
  }
}

/* ── 이전·다음 글 ─────────────────────────────────────── */

.postnav {
  display: grid;
  gap: 12px;
  margin: 56px 0 80px;
}

@media (min-width: 640px) {
  .postnav {
    grid-template-columns: 1fr 1fr;
  }
}

.pn {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.pn:hover {
  border-color: var(--accent-ring);
}

.pn.next {
  text-align: right;
}

.postnav .pn:only-child.next {
  grid-column: 2;
}

.pn span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pn strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

/* ── 목록 페이지 ──────────────────────────────────────── */

.year {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 48px 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.year span {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.entry {
  display: block;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.entry:hover h2,
.entry:focus-visible h2 {
  color: var(--accent-deep);
}

.entry .kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.entry h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.entry .sub {
  margin: 8px 0 0;
  color: var(--body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}

.entry .desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.entry time {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ── 홈 ───────────────────────────────────────────────── */

.intro {
  display: grid;
  gap: 32px;
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 860px) {
  .intro {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
    gap: 56px;
  }
}

.intro h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.profile {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
}

.profile img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.profile p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.profile p strong {
  color: var(--ink);
  font-size: 16px;
}

.band {
  padding: 48px 0 8px;
}

.band h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.band:last-of-type {
  padding-bottom: 80px;
}

/* ── 카테고리 스트립 ──────────────────────────────────── */

.cat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.cat-strip a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--body);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.cat-strip a:hover {
  border-color: var(--accent-ring);
  color: var(--accent-deep);
}

.cat-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
