/* =========================================================
   기술자료 (guide CPT) 전용 스타일
   - 빌드 환경 불필요. Tailwind 의존 없음
   - 색상은 --wd-* 토큰. functions.php 의 inline_style 에서 주입
   - 테마 전역 리셋(a{color:unset}, ul{padding:0}, li margin 0)을 본문에서 되돌린다
   ========================================================= */

.gd-shell {
  width: 100%;
  background: var(--wd-surface-white);
  padding: 64px 20px 96px;
}

.gd-container {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}

.gd-container-archive {
  display: block;
  max-width: 1280px;
}

/* ── 사이드바 ───────────────────────────────── */

.gd-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  border-right: 1px solid var(--wd-border-light);
  padding-right: 8px;
}

.gd-sidebar-mobile-toggle {
  display: none;
}

.gd-sidebar-head {
  padding: 4px 16px 14px;
}

.gd-sidebar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--wd-text-primary);
}

.gd-cat-group {
  margin-bottom: 4px;
}

.gd-cat-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.gd-cat-toggle:hover {
  background: var(--wd-surface-light);
}

.gd-cat-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--wd-text-secondary);
}

.gd-cat-name-sub {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--wd-text-muted);
}

.gd-cat-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--wd-text-muted);
  border-bottom: 1.5px solid var(--wd-text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: -3px;
}

.gd-cat-toggle[aria-expanded="false"] .gd-cat-chevron {
  transform: rotate(-45deg);
  margin-top: 0;
}

.gd-cat-list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
}

.gd-cat-toggle[aria-expanded="false"] + .gd-cat-list {
  display: none;
}

.gd-cat-item {
  margin: 0 12px;
}

.gd-cat-sub {
  margin-top: 4px;
  list-style: none;
}

.gd-cat-list-sub {
  padding-bottom: 0;
}

.gd-cat-list-sub .gd-cat-item {
  margin-left: 12px;
}

.gd-cat-link {
  display: block;
  padding: 7px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--wd-text-secondary);
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.gd-cat-link:hover {
  background: var(--wd-surface-light);
  color: var(--wd-text-primary);
}

.gd-cat-link.is-active {
  background: var(--wd-primary-soft);
  color: var(--wd-primary);
  font-weight: 600;
}

/* ── 본문 ───────────────────────────────────── */

.gd-main {
  min-width: 0;
}

.gd-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--wd-text-muted);
  margin-bottom: 16px;
}

.gd-breadcrumb a {
  color: var(--wd-text-muted);
  transition: color 0.15s ease;
}

.gd-breadcrumb a:hover {
  color: var(--wd-primary);
}

.gd-breadcrumb-sep {
  color: var(--wd-border-default);
}

.gd-article-head {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--wd-border-light);
  margin-bottom: 40px;
}

.gd-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.04em;
  color: var(--wd-text-primary);
  margin-bottom: 12px;
}

.gd-meta {
  font-size: 13.5px;
  color: var(--wd-text-muted);
}

/* ── 본문 타이포그래피 ──────────────────────── */

.gd-body {
  font-size: 16.5px;
  line-height: 1.85;
  letter-spacing: -0.02em;
  color: var(--wd-text-body);
}

.gd-body > * + * {
  margin-top: 20px;
}

.gd-body h2 {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.035em;
  color: var(--wd-text-primary);
  margin-top: 56px;
  padding-top: 8px;
  scroll-margin-top: 100px;
}

.gd-body h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.03em;
  color: var(--wd-text-primary);
  margin-top: 40px;
  scroll-margin-top: 100px;
}

.gd-body h4 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--wd-text-primary);
  margin-top: 28px;
}

.gd-body p {
  margin: 0;
}

.gd-body a {
  color: var(--wd-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.gd-body a:hover {
  color: var(--wd-primary-hover);
}

.gd-body ul,
.gd-body ol {
  padding-left: 22px;
  margin: 0;
}

.gd-body ul {
  list-style: disc;
}

.gd-body ol {
  list-style: decimal;
}

.gd-body li {
  margin: 6px 0;
}

.gd-body li::marker {
  color: var(--wd-text-muted);
}

.gd-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.gd-body figure {
  margin: 0;
}

.gd-body figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--wd-text-muted);
  text-align: center;
}

.gd-body blockquote {
  margin: 0;
  padding: 20px 24px;
  background: var(--wd-surface-light);
  border-radius: 10px;
  color: var(--wd-text-body);
}

.gd-body blockquote p + p {
  margin-top: 12px;
}

.gd-body code {
  padding: 2px 6px;
  background: var(--wd-surface-light);
  border: 1px solid var(--wd-border-light);
  border-radius: 4px;
  font-size: 0.92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.gd-body pre {
  padding: 18px 20px;
  background: var(--wd-surface-dark);
  color: #e8eaf0;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
}

.gd-body pre code {
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
}

.gd-body hr {
  border: 0;
  border-top: 1px solid var(--wd-border-light);
  margin: 40px 0;
}

/* 표 — 사양·비교표가 많은 업종이라 가로 스크롤 보장 */
.gd-table-scroll,
.gd-body figure.wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gd-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.65;
}

.gd-body th,
.gd-body td {
  padding: 12px 14px;
  border: 1px solid var(--wd-border-light);
  text-align: left;
  vertical-align: top;
}

.gd-body th {
  background: var(--wd-surface-light);
  font-weight: 600;
  color: var(--wd-text-primary);
  white-space: nowrap;
}

/* 도입 요약 단락 */
.gd-body .guide-intro {
  font-size: 17.5px;
  line-height: 1.8;
  color: var(--wd-text-secondary);
  padding-bottom: 8px;
}

/* ── 이전 / 다음 ────────────────────────────── */

.gd-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--wd-border-light);
}

.gd-pager-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--wd-border-default);
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gd-pager-link:hover {
  border-color: var(--wd-primary);
  background: var(--wd-surface-light);
}

.gd-pager-next {
  text-align: right;
}

.gd-pager-label {
  font-size: 12.5px;
  color: var(--wd-text-muted);
}

.gd-pager-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--wd-text-primary);
  line-height: 1.5;
}

/* ── 아카이브 ───────────────────────────────── */

.gd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}

.gd-chip {
  padding: 9px 18px;
  border: 1px solid var(--wd-border-default);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--wd-text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.gd-chip:hover {
  border-color: var(--wd-primary);
  color: var(--wd-primary);
}

.gd-chip.is-active {
  background: var(--wd-primary);
  border-color: var(--wd-primary);
  color: #fff;
  font-weight: 600;
}

.gd-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.gd-archive-card {
  border: 1px solid var(--wd-border-light);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.gd-archive-card:hover {
  border-color: var(--wd-primary);
  transform: translateY(-2px);
}

.gd-archive-link {
  display: block;
  height: 100%;
}

.gd-archive-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--wd-surface-light);
}

.gd-archive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gd-archive-body {
  padding: 22px 22px 24px;
}

.gd-archive-cat {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--wd-primary);
  margin-bottom: 10px;
}

.gd-archive-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.03em;
  color: var(--wd-text-primary);
  margin-bottom: 10px;
}

.gd-archive-excerpt {
  font-size: 14.5px;
  line-height: 1.7;
  letter-spacing: -0.02em;
  color: var(--wd-text-secondary);
  margin-bottom: 14px;
}

.gd-archive-date {
  font-size: 12.5px;
  color: var(--wd-text-muted);
}

.gd-empty {
  padding: 80px 0;
  text-align: center;
  color: var(--wd-text-muted);
}

.gd-pagination {
  display: flex;
  justify-content: center;
  margin-top: 56px;
}

.gd-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  margin: 0 3px;
  border: 1px solid var(--wd-border-default);
  border-radius: 8px;
  font-size: 14px;
  color: var(--wd-text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.gd-pagination .page-numbers:hover {
  border-color: var(--wd-primary);
  color: var(--wd-primary);
}

.gd-pagination .page-numbers.current {
  background: var(--wd-primary);
  border-color: var(--wd-primary);
  color: #fff;
  font-weight: 600;
}

/* ── 슬라이드 CTA ───────────────────────────── */

.gd-cta-wrapper {
  position: fixed;
  bottom: 120px;
  right: 24px;
  z-index: 45;
  width: 340px;
  pointer-events: none;
}

.gd-cta-card {
  position: relative;
  background: var(--wd-surface-white);
  border: 1px solid var(--wd-border-light);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.gd-cta-card.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.gd-cta-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--wd-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.gd-cta-close:hover {
  background: var(--wd-surface-light);
  color: var(--wd-text-primary);
}

.gd-cta-header {
  margin-bottom: 14px;
  padding-right: 20px;
}

.gd-cta-headline {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.03em;
  color: var(--wd-text-primary);
  margin-bottom: 10px;
}

.gd-cta-desc {
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.02em;
  color: var(--wd-text-secondary);
}

.gd-cta-benefits {
  list-style: none;
  margin: 0 0 18px;
  padding: 14px 0;
  border-top: 1px solid var(--wd-border-light);
  border-bottom: 1px solid var(--wd-border-light);
}

.gd-cta-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--wd-text-body);
}

.gd-cta-benefits li svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--wd-primary);
}

.gd-cta-submit {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--wd-primary);
  color: #fff;
  border-radius: 6px;
  font-size: 15.5px;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s ease;
}

.gd-cta-submit:hover {
  background: var(--wd-primary-hover);
  color: #fff;
}

.gd-cta-overlay {
  display: none;
}

/* ── 반응형 ─────────────────────────────────── */

@media (max-width: 1279px) {
  .gd-container {
    grid-template-columns: 224px minmax(0, 1fr);
    gap: 32px;
  }

  .gd-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gd-cta-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 44;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .gd-cta-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .gd-cta-wrapper {
    right: auto;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 400px;
  }

  .gd-cta-card {
    transform: translateY(120%);
  }

  .gd-cta-card.is-visible {
    transform: translateY(0);
  }
}

@media (max-width: 1023px) {
  .gd-shell {
    padding: 40px 20px 72px;
  }

  .gd-container {
    display: block;
  }

  .gd-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--wd-border-light);
    padding: 0 0 16px;
    margin-bottom: 32px;
  }

  .gd-sidebar-head {
    display: none;
  }

  .gd-sidebar-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--wd-border-default);
    border-radius: 10px;
    background: var(--wd-surface-white);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--wd-text-primary);
    cursor: pointer;
  }

  .gd-sidebar-body {
    display: none;
    padding-top: 12px;
  }

  .gd-sidebar-body.is-open {
    display: block;
  }

  .gd-title {
    font-size: 28px;
  }

  .gd-body {
    font-size: 16px;
  }

  .gd-body h2 {
    font-size: 22px;
    margin-top: 44px;
  }

  .gd-body h3 {
    font-size: 18.5px;
  }

  .gd-pager {
    grid-template-columns: 1fr;
  }

  .gd-cta-wrapper {
    bottom: 80px;
  }
}

@media (max-width: 767px) {
  .gd-archive-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gd-title {
    font-size: 24px;
  }
}

/* =========================================================
   guide-format.md 박스 유형
   좌측 컬러 보더 대신 배경 채움 + 균일 보더로 구성한다
   ========================================================= */

.gd-body .toc-box,
.gd-body .info-box,
.gd-body .term-box,
.gd-body .tip-box,
.gd-body .warning-box,
.gd-body .summary-box,
.gd-body .related-box,
.gd-body .service-box {
  padding: 20px 22px;
  border: 1px solid var(--wd-border-light);
  border-radius: 10px;
  background: var(--wd-surface-light);
  font-size: 15.5px;
  line-height: 1.75;
}

.gd-body .toc-box > * + *,
.gd-body .info-box > * + *,
.gd-body .term-box > * + *,
.gd-body .tip-box > * + *,
.gd-body .warning-box > * + *,
.gd-body .summary-box > * + *,
.gd-body .related-box > * + *,
.gd-body .service-box > * + * {
  margin-top: 10px;
}

.gd-body .toc-box strong,
.gd-body .info-box strong,
.gd-body .term-box strong,
.gd-body .tip-box strong,
.gd-body .warning-box strong,
.gd-body .summary-box strong,
.gd-body .related-box strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--wd-text-primary);
}

.gd-body .toc-box ul,
.gd-body .summary-box ul,
.gd-body .related-box ul {
  padding-left: 20px;
}

.gd-body .toc-box li,
.gd-body .related-box li {
  margin: 4px 0;
}

/* 목차 — 문서 상단 */
.gd-body .toc-box {
  background: var(--wd-surface-white);
  border-color: var(--wd-border-default);
}

.gd-body .toc-box a {
  color: var(--wd-text-body);
  text-decoration: none;
}

.gd-body .toc-box a:hover {
  color: var(--wd-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 용어 설명 */
.gd-body .term-box {
  background: var(--wd-primary-soft);
  border-color: transparent;
}

/* 주의 */
.gd-body .warning-box {
  background: #FDF3F3;
  border-color: #F3DADA;
}

.gd-body .warning-box strong {
  color: #B4322F;
}

/* 핵심 정리 */
.gd-body .summary-box {
  background: var(--wd-surface-white);
  border-color: var(--wd-primary);
}

/* 관련 자료 · 서비스 연결 — 본문과 간격을 벌린다 */
.gd-body .related-box {
  margin-top: 56px;
}

.gd-body .service-box {
  margin-top: 16px;
  background: var(--wd-primary);
  border-color: var(--wd-primary);
  color: #fff;
}

.gd-body .service-box a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.gd-body .service-box a:hover {
  color: #fff;
  opacity: 0.85;
}

/* 표 래퍼 — 사양·비교표 가로 스크롤 */
.gd-body .guide-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gd-body .guide-table table {
  min-width: 520px;
}

@media (max-width: 767px) {
  .gd-body .toc-box,
  .gd-body .info-box,
  .gd-body .term-box,
  .gd-body .tip-box,
  .gd-body .warning-box,
  .gd-body .summary-box,
  .gd-body .related-box,
  .gd-body .service-box {
    padding: 16px 18px;
    font-size: 15px;
  }
}
