/* ==========================================================================
   안심개통 가이드 - Tistory Skin
   Sections:
     1. Tokens
     2. Reset & base
     3. Typography
     4. Layout primitives
     5. Header
     6. Footer
     7. Article view
     8. Sticky CTA bar
     9. Related posts
    10. Comments
    11. List pages (home/category/tag/search)
    12. Pagination
    13. Mobile nav
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Brand */
  --brand-green: #B2D235;
  --brand-green-dark: #9BBF2A;
  --brand-green-light: #E8F5C8;
  --brand-green-bg: #F6FAE8;
  --brand-green-text: #5a7a14;

  /* Kakao */
  --kakao-yellow: #FEE500;
  --kakao-yellow-bg: #FFF9D6;

  /* Ink */
  --ink-900: #1A1A1A;
  --ink-700: #2C2C2E;
  --ink-500: #6E6E73;
  --ink-300: #A1A1A6;

  /* Surfaces */
  --surface: #FFFFFF;
  --surface-2: #FAFAFB;
  --surface-3: #F5F5F7;
  --line: #E5E5EA;

  /* Type */
  --font-sans: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Radius */
  --r-card: 8px;
  --r-pill: 999px;

  /* Layout */
  --content-max: 720px;
  --pad-mobile: 16px;
  --pad-desktop: 24px;

  /* Z */
  --z-header: 50;
  --z-sticky: 40;
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-700);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; }

/* ---------- 3. Typography ---------- */
@media (min-width: 768px) {
  body { font-size: 17px; }
}

.entry__body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--brand-green);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  transition: color .15s ease;
}
.entry__body a:hover { color: var(--brand-green-dark); }

/* ---------- 4. Layout primitives ---------- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--pad-mobile);
  padding-right: var(--pad-mobile);
}
@media (min-width: 768px) {
  .container { padding-left: var(--pad-desktop); padding-right: var(--pad-desktop); }
}

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.site-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 12px var(--pad-mobile);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
@media (min-width: 768px) {
  .site-header__inner { padding: 14px var(--pad-desktop); max-width: 1100px; }
}

.logo { display: flex; align-items: center; gap: 8px; color: var(--ink-900); font-weight: 800; font-size: 15px; letter-spacing: -0.3px; }
.logo__dot { width: 10px; height: 10px; border-radius: 2px; background: var(--brand-green-dark); }
.logo__text { white-space: nowrap; }
@media (min-width: 768px) { .logo { font-size: 17px; } }

.nav--desktop { display: none; }
@media (min-width: 768px) {
  .nav--desktop { display: flex; align-items: center; gap: 18px; }
  .nav__item { font-size: 14px; color: var(--ink-500); font-weight: 500; transition: color .15s; }
  .nav__item:hover { color: var(--brand-green-dark); }
  .nav__search-toggle { font-size: 16px; color: var(--ink-500); padding: 4px; }
  .hamburger { display: none; }
}

.hamburger { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--ink-900); border-radius: 1px; }

.mobile-nav { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px var(--pad-mobile) 16px; }
.mobile-nav[hidden] { display: none; }
@media (min-width: 768px) {
  .mobile-nav { max-width: 1100px; margin: 0 auto; padding: 12px var(--pad-desktop) 16px; border-top: 1px solid var(--line); border-bottom: none; }
}
.mobile-nav__search { display: flex; gap: 6px; margin-bottom: 12px; }
.mobile-nav__search input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-card); font-size: 14px; background: var(--surface-3); }
.mobile-nav__search input:focus { outline: 2px solid var(--brand-green); outline-offset: -1px; border-color: var(--brand-green); }
.mobile-nav__search button { padding: 10px 14px; background: var(--brand-green-dark); color: white; border-radius: var(--r-card); font-weight: 600; }
.mobile-nav__list { display: grid; gap: 4px; }
.mobile-nav__list a { display: block; padding: 10px 12px; border-radius: var(--r-card); font-size: 15px; color: var(--ink-900); }
.mobile-nav__list a:hover { background: var(--surface-3); }
@media (min-width: 768px) {
  .mobile-nav__list { grid-template-columns: repeat(4, 1fr); gap: 6px; }
}

/* ---------- 6. Footer ---------- */
.site-footer {
  background: var(--ink-900);
  color: var(--surface-3);
  padding: 28px var(--pad-mobile);
  text-align: center;
  margin-top: 40px;
}
@media (min-width: 768px) { .site-footer { padding: 36px var(--pad-desktop); } }
.site-footer__brand { font-weight: 800; font-size: 16px; margin-bottom: 8px; color: var(--surface); }
.site-footer__meta { font-size: 13px; color: var(--ink-300); }
.site-footer__meta a { color: var(--brand-green); text-decoration: underline; text-underline-offset: 2px; }
.site-footer__meta .muted { color: var(--ink-500); }

/* ---------- 7. Article view ---------- */
.entry { padding-top: 24px; padding-bottom: 16px; }
@media (min-width: 768px) { .entry { padding-top: 36px; } }

.entry__header { margin-bottom: 18px; }
.entry__crumb { font-size: 13px; color: var(--ink-500); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.entry__category { color: var(--brand-green-text); font-weight: 600; }
.entry__crumb .dot { color: var(--ink-300); }
.entry__readtime { color: var(--ink-500); }

.entry__title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.5px;
  color: var(--ink-900);
}
@media (min-width: 768px) { .entry__title { font-size: 32px; } }

.entry__body { color: var(--ink-700); margin-top: 24px; }
.entry__body > p { margin: 0 0 1em; }
.entry__body h2 { font-size: 1.4em; font-weight: 700; color: var(--ink-900); margin: 1.6em 0 0.6em; line-height: 1.4; }
.entry__body h3 { font-size: 1.2em; font-weight: 700; color: var(--ink-900); margin: 1.4em 0 0.5em; line-height: 1.4; }
.entry__body h4 { font-size: 1.1em; font-weight: 700; color: var(--ink-900); margin: 1.2em 0 0.4em; }
.entry__body blockquote {
  border-left: 3px solid var(--brand-green-dark);
  background: var(--brand-green-bg);
  padding: 12px 16px;
  margin: 1.2em 0;
  border-radius: 0 var(--r-card) var(--r-card) 0;
  color: var(--ink-700);
  font-style: normal;
}
.entry__body blockquote p:last-child { margin-bottom: 0; }
.entry__body img { border-radius: var(--r-card); margin: 1.2em auto; }
.entry__body figure { margin: 1.2em 0; }
.entry__body figure figcaption { font-size: 0.85em; color: var(--ink-500); text-align: center; margin-top: 8px; }
.entry__body pre {
  background: var(--surface-3);
  border-radius: var(--r-card);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.55;
}
.entry__body code {
  background: var(--surface-3);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.9em;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
}
.entry__body pre code { background: none; padding: 0; }
.entry__body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.95em; }
.entry__body th, .entry__body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry__body th { background: var(--surface-3); font-weight: 700; }
.entry__body hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }
.entry__body ul, .entry__body ol { padding-left: 1.4em; margin: 0.8em 0; }
.entry__body ul { list-style: disc; }
.entry__body ol { list-style: decimal; }
.entry__body li { margin: 0.3em 0; }

.entry__tags { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  background: var(--surface-3);
  color: var(--ink-700);
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
}
.tag:hover { background: var(--brand-green-bg); color: var(--brand-green-text); }

/* ---------- 8. Sticky CTA bar ---------- */
.ctabar {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
  padding: 8px var(--pad-mobile);
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  margin-top: 32px;
}
@media (min-width: 768px) { .ctabar { padding-left: var(--pad-desktop); padding-right: var(--pad-desktop); } }

.ctabar__inner { max-width: var(--content-max); margin: 0 auto; }

.ctabar__chips {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ctabar__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-green-bg);
  color: var(--brand-green-text);
  border: 1px solid var(--brand-green-light);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  min-height: 32px;
  transition: transform .12s ease, box-shadow .15s ease;
}
.ctabar__chip:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(155,191,42,0.2); }
.ctabar__chip:active { transform: translateY(0); }

.ctabar__chip--kakao {
  background: var(--kakao-yellow-bg);
  color: #3c1e1e;
  border-color: var(--kakao-yellow);
}
.ctabar__chip--kakao:hover { box-shadow: 0 2px 8px rgba(254,229,0,0.3); }

.ctabar__primary {
  display: block;
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);
  color: #ffffff;
  text-align: center;
  padding: 13px 16px;
  border-radius: var(--r-card);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  min-height: 44px;
  box-shadow: 0 3px 10px rgba(155,191,42,0.3);
  transition: transform .12s ease, box-shadow .15s ease;
}
.ctabar__primary:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(155,191,42,0.4); }
.ctabar__primary:active { transform: translateY(0); }

/* ---------- 9. Related posts ---------- */
.related { background: var(--surface-2); border-top: 1px solid var(--line); padding: 28px 0; }
.related__inner { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--pad-mobile); }
@media (min-width: 768px) { .related__inner { padding: 0 var(--pad-desktop); } }

.related__title {
  font-size: 15px; font-weight: 700; color: var(--ink-900);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.related__title::before {
  content: ""; width: 3px; height: 16px; background: var(--brand-green-dark); border-radius: 2px;
}

.related__list { display: grid; gap: 8px; }
@media (min-width: 768px) { .related__list { grid-template-columns: 1fr 1fr; gap: 12px; } }

.related__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); transition: border-color .15s, transform .15s; }
.related__item:hover { border-color: var(--brand-green-dark); transform: translateY(-1px); }
.related__link { display: flex; gap: 10px; align-items: center; padding: 10px; }
.related__thumb { width: 44px; height: 44px; border-radius: 6px; background-color: var(--surface-3); background-size: cover; background-position: center; flex-shrink: 0; }
.related__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.related__heading { font-size: 13px; font-weight: 600; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.related__date { font-size: 11px; color: var(--ink-500); }

/* ---------- 10. Comments ---------- */
.comments { padding: 28px 0 8px; max-width: var(--content-max); margin: 0 auto; padding-left: var(--pad-mobile); padding-right: var(--pad-mobile); }
@media (min-width: 768px) { .comments { padding-left: var(--pad-desktop); padding-right: var(--pad-desktop); } }

.comments__title { font-size: 15px; font-weight: 700; color: var(--ink-900); margin-bottom: 14px; }
.comments__count { color: var(--brand-green-dark); }

.comments__list { display: grid; gap: 10px; margin-bottom: 18px; }
.comments__item { background: var(--surface-3); border-radius: var(--r-card); padding: 12px 14px; }
.comments__head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.comments__name { font-weight: 700; font-size: 13px; color: var(--ink-900); }
.comments__date { font-size: 12px; color: var(--ink-500); }
.comments__body { font-size: 14px; color: var(--ink-700); line-height: 1.6; }

.comments__form { display: grid; gap: 8px; }
.comments__form input, .comments__form textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-card); font: inherit; font-size: 14px; background: var(--surface); font-family: var(--font-sans); }
.comments__form textarea { resize: vertical; min-height: 84px; }
.comments__form input:focus, .comments__form textarea:focus { outline: 2px solid var(--brand-green); outline-offset: -1px; border-color: var(--brand-green); }
.comments__submit { background: var(--brand-green-dark); color: white; padding: 11px 18px; border-radius: var(--r-card); font-weight: 700; justify-self: end; min-width: 110px; }
.comments__submit:hover { background: #88a824; }

/* ---------- 11. List pages ---------- */
.list-page { padding-top: 24px; padding-bottom: 24px; }
@media (min-width: 768px) { .list-page { padding-top: 36px; padding-bottom: 36px; max-width: 1100px; } }

.cards { display: grid; gap: 14px; }
@media (min-width: 768px) { .cards { grid-template-columns: 1fr 1fr; gap: 20px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card:hover { border-color: var(--brand-green-dark); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.05); }
.card__link { display: flex; flex-direction: column; }
.card__thumb { display: block; width: 100%; aspect-ratio: 16/9; background-color: var(--surface-3); background-size: cover; background-position: center; }
.card__body { padding: 14px 16px 18px; }
.card__meta { font-size: 12px; color: var(--ink-500); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.card__category { color: var(--brand-green-text); font-weight: 600; }
.card__meta .dot { color: var(--ink-300); }
.card__title { font-size: 17px; font-weight: 700; color: var(--ink-900); line-height: 1.4; margin-bottom: 6px; letter-spacing: -0.3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__excerpt { font-size: 13px; color: var(--ink-500); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }

.archive-title { font-size: 22px; font-weight: 800; color: var(--ink-900); margin-bottom: 18px; }

.tag-archive { padding-top: 24px; padding-bottom: 24px; }
.tag--cloud { background: var(--surface-3); color: var(--ink-700); padding: 5px 10px; border-radius: var(--r-pill); margin: 4px 2px; display: inline-block; }

/* ---------- 12. Pagination ---------- */
.paging { margin: 30px 0 10px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.paging__prev, .paging__next { padding: 8px 14px; border-radius: var(--r-card); font-size: 14px; color: var(--ink-700); background: var(--surface-3); font-weight: 600; }
.paging__prev:hover, .paging__next:hover { background: var(--brand-green-bg); color: var(--brand-green-text); }
.paging__nums { display: inline-flex; gap: 4px; }
.paging__num { padding: 8px 12px; border-radius: var(--r-card); font-size: 14px; color: var(--ink-500); font-weight: 600; min-width: 36px; text-align: center; }
.paging__num:hover { color: var(--brand-green-dark); background: var(--brand-green-bg); }
.paging__num.selected { background: var(--brand-green-dark); color: white; }
