:root {
  --post-green: #087f5b;
  --post-green-dark: #075c43;
  --post-lime: #9bbf2a;
  --post-lime-soft: #f6fae8;
  --post-ink: #17211c;
  --post-copy: #404c46;
  --post-muted: #7a8780;
  --post-line: #e3e9e5;
  --post-surface: #fafcfb;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body.nts-post-page {
  min-width: 320px;
  margin: 0;
  color: #333;
  background: transparent;
  font-family: "Noto Sans KR", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  overflow-x: hidden;
}

#readingProgress {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--post-green), #b7d43b);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 120ms linear;
}

.nts-post-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 18px 64px;
}

.nts-post-main > .cat {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  color: #7da21f;
  background: var(--post-lime-soft);
  font-size: 12px;
  font-weight: 700;
}

.nts-post-main > h1 {
  margin: 8px 0 0;
  color: #333;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
}

.nts-post-main .meta {
  margin: 12px 0 26px;
  color: #888;
  font-size: 13px;
}

.nts-post-main .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.nts-post-main .reading-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  color: #888;
  background: #f4f4f4;
  font-weight: 700;
}

.nts-post-main .share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0 0;
}

.nts-post-main .share-btn {
  padding: 6px 10px;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  color: #333;
  background: #fff;
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nts-post-main .share-btn:hover {
  border-color: #9fc9b6;
  color: var(--post-green-dark);
  background: #f7fbf9;
}

.nts-post-main .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.nts-post-main .tag-chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #eee;
  border-radius: 999px;
  color: #666;
  background: #f8f8f8;
  font-size: 12px;
  font-weight: 400;
}

.nts-post-article {
  color: #333;
  font-size: 16px;
  line-height: 1.9;
}

.nts-post-article p {
  margin: 0 0 17px;
}

.nts-post-article > p:first-of-type {
  color: #33413a;
}

.nts-post-article h2 {
  margin: 38px 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--post-lime);
  color: #333;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  scroll-margin-top: 96px;
}

.nts-post-article h3 {
  margin: 28px 0 12px;
  color: #333;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  scroll-margin-top: 96px;
}

.nts-post-article ul,
.nts-post-article ol {
  margin: 9px 0 19px 23px;
  padding: 0;
}

.nts-post-article li {
  margin: 6px 0;
}

.nts-post-article a:not(.post-cta-btn):not(.related-item) {
  color: var(--post-green-dark);
  text-underline-offset: 3px;
}

.nts-post-article figure {
  max-width: 100%;
  margin: 24px 0;
}

.nts-post-article img {
  max-width: 100%;
  height: auto;
  margin: 12px 0 8px;
  border: 1px solid #eee;
  border-radius: 12px;
}

.nts-post-article .img-caption {
  margin: 0 0 15px;
  color: #8d9993;
  font-size: 13px;
  text-align: center;
}

.nts-post-article table {
  width: 100%;
  margin: 16px 0 22px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
}

.nts-post-article th,
.nts-post-article td {
  padding: 10px 12px;
  border: 1px solid #e9e9e9;
  font-size: 14px;
  text-align: left;
  vertical-align: middle;
}

.nts-post-article th {
  color: #333;
  background: #f7f7f7;
  font-weight: 700;
}

.nts-post-article .info-box {
  margin: 18px 0;
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--post-lime-soft);
}

.nts-post-article .warning-box {
  margin: 18px 0;
  padding: 18px 20px;
  border-left: 4px solid #f5a623;
  border-radius: 12px;
  background: #fff8f0;
}

.nts-post-article .toc {
  margin: 16px 0 24px;
  padding: 16px 18px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fcfcfc;
}

.nts-post-article .toc-title {
  margin-bottom: 10px;
  color: #333;
  font-weight: 800;
}

.nts-post-article .toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nts-post-article .toc-list li {
  margin: 0 0 8px;
}

.nts-post-article .toc-list li:last-child {
  margin-bottom: 0;
}

.nts-post-article .toc-list .toc-sub {
  padding-left: 14px;
}

.nts-post-article .toc-list a {
  color: #45534c;
  text-decoration: none;
}

.nts-post-article .toc-list a:hover {
  color: var(--post-green-dark);
  text-decoration: underline;
}

.post-faq-section,
.post-related-section,
.post-cta-section {
  margin-top: 42px;
  padding: 24px;
  border: 1px solid var(--post-line);
  border-radius: 16px;
  background: #fbfcfb;
}

.post-faq-section > h2,
.post-related-section > h2 {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  font-size: 22px;
}

.post-faq-section .faq-item {
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid #e7ece9;
  border-radius: 12px;
  background: #fff;
}

.post-faq-section .faq-item:last-child {
  margin-bottom: 0;
}

.post-faq-section summary {
  position: relative;
  padding: 14px 42px 14px 16px;
  color: var(--post-ink);
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.post-faq-section summary::-webkit-details-marker {
  display: none;
}

.post-faq-section summary::after {
  position: absolute;
  right: 16px;
  top: 13px;
  color: var(--post-green);
  content: "▾";
}

.post-faq-section details[open] summary::after {
  content: "▴";
}

.post-faq-section .faq-answer {
  padding: 0 16px 15px;
  color: #56635d;
  line-height: 1.78;
}

.related-list {
  display: grid;
  gap: 10px;
}

.related-item {
  display: flex;
  gap: 11px;
  align-items: center;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid #e6ece8;
  border-radius: 11px;
  color: var(--post-ink);
  background: #fff;
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.related-item:hover {
  border-color: #9fc9b6;
  transform: translateX(2px);
}

.related-badge {
  flex: none;
  padding: 5px 9px;
  border-radius: 999px;
  color: #698b16;
  background: #eaf4cf;
  font-size: 11px;
  font-weight: 850;
}

.related-title {
  color: var(--post-ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.post-cta-section {
  border-color: #deebc1;
  background: var(--post-lime-soft);
  text-align: center;
}

.post-cta-section p {
  margin: 0 0 14px;
  color: #39433e;
  font-weight: 800;
}

.post-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 22px;
  border-radius: 12px;
  color: #fff;
  background: var(--post-green);
  font-weight: 850;
  text-decoration: none;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--post-line);
}

.post-nav > a,
.post-nav > span {
  display: block;
  min-width: 0;
  padding: 13px 14px;
  border-radius: 11px;
  color: var(--post-ink);
  background: #f7f9f8;
  text-decoration: none;
}

.post-nav .label {
  margin-bottom: 4px;
  color: var(--post-muted);
  font-size: 11px;
  font-weight: 700;
}

.post-nav .nav-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.back-to-list {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 26px;
  padding: 10px 16px;
  border: 1px solid #dce5e0;
  border-radius: 11px;
  color: var(--post-green-dark);
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.post-preview-error {
  width: min(720px, calc(100% - 32px));
  margin: 72px auto;
  padding: 40px 24px;
  border: 1px solid var(--post-line);
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.nts-post-page a:focus-visible,
.nts-post-page button:focus-visible,
.nts-post-page summary:focus-visible {
  outline: 3px solid rgba(183, 212, 59, 0.9);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .nts-post-main > h1 {
    font-size: 24px;
  }

  .nts-post-article {
    font-size: 15px;
    line-height: 1.85;
  }

  .nts-post-article h2 {
    margin-top: 30px;
    font-size: 20px;
  }

  .nts-post-article h3 {
    font-size: 18px;
  }

  .nts-post-article table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .post-faq-section,
  .post-related-section,
  .post-cta-section {
    padding: 16px;
  }

  .post-faq-section > h2,
  .post-related-section > h2 {
    font-size: 19px;
  }

  .related-item {
    align-items: flex-start;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav > span:empty {
    display: none;
  }

  .back-to-list {
    width: 100%;
  }
}

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

  .nts-post-page *,
  .nts-post-page *::before,
  .nts-post-page *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
