/* [kirocrew 2026-09-29] Renewal layer: typography, compact hero, readable articles, mobile polish.
   Loaded last; only overrides. Delete this file (and its <link>) to roll back. */

:root {
  --renew-font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --renew-radius: 16px;
  --renew-read: 760px;
}

body {
  font-family: var(--renew-font);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* Sidebar close button is for the mobile drawer only */
@media (min-width: 861px) {
  .soft-sidebar-head .mobile-only,
  .soft-sidebar-head [data-sidebar-close] {
    display: none !important;
  }
}

/* ---------- Home ---------- */
.tv-home-hero {
  grid-template-columns: minmax(0, 1fr) !important; /* old layout reserved an empty 300px column */
  padding: clamp(28px, 5vw, 48px) clamp(22px, 4vw, 44px) !important;
  min-height: 0 !important;
  border-radius: var(--renew-radius) !important;
}

.tv-home-hero h1 {
  white-space: normal !important;
  overflow-wrap: break-word;
  font-size: clamp(26px, 3.4vw, 40px) !important;
  line-height: 1.25 !important;
  letter-spacing: -0.02em;
  margin: 8px 0 12px !important;
  max-width: 18em;
}

.tv-home-hero p {
  font-size: clamp(15px, 1.4vw, 17px) !important;
  line-height: 1.7 !important;
  max-width: 34em;
  color: var(--muted);
}

.tv-card-grid {
  gap: 16px !important;
}

.tv-doc-card {
  border-radius: var(--renew-radius) !important;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.tv-doc-card:hover,
.tv-doc-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent) !important;
  box-shadow: var(--shadow);
}

.tv-doc-card strong {
  font-size: 17px !important;
  line-height: 1.45 !important;
  letter-spacing: -0.01em;
}

.tv-doc-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.65 !important;
  color: var(--muted);
}

/* ---------- Article ---------- */
.doc-content-page {
  max-width: var(--renew-read);
  width: 100%;
}

.doc-content-head h1 {
  font-size: clamp(26px, 3.2vw, 36px) !important;
  line-height: 1.3 !important;
  letter-spacing: -0.02em;
}

.doc-body.markdown {
  font-size: 17px;
  line-height: 1.85;
}

.doc-body.markdown h2 {
  margin-top: 2.2em !important;
  padding-top: 0.2em;
  font-size: 1.4em !important;
  line-height: 1.4;
  scroll-margin-top: 80px;
}

.doc-body.markdown h3 {
  margin-top: 1.6em !important;
  font-size: 1.15em !important;
  scroll-margin-top: 80px;
}

.doc-body.markdown p,
.doc-body.markdown li {
  color: var(--ink);
}

.doc-body.markdown img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.doc-body.markdown .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.doc-body.markdown table {
  min-width: 520px;
  font-size: 15px;
}

.doc-body.markdown pre {
  max-width: 100%;
  overflow-x: auto;
}

.doc-right-toc {
  position: sticky;
  top: 84px;
  align-self: start;
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .doc-right-toc {
    position: static;
  }

  .doc-right-toc .doc-toc-card:first-child {
    display: none; /* TOC is long on phones; content first */
  }
}

@media (max-width: 640px) {
  .doc-body.markdown {
    font-size: 16px;
    line-height: 1.8;
  }

  .tv-home-hero {
    padding: 24px 18px !important;
  }

  .tv-card-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .topbar-search {
    display: none;
  }
}
