/**
 * stebipost 메인 스타일시트
 * "잘 사는 일상"을 다루는 에디토리얼 블로그
 */

/* ========================================
   CSS 변수 - 컬러 시스템
   ======================================== */
:root {
  --bg: #f5f3ee;
  --surface: #eceae3;
  --surface-dark: #1c1c1a;
  --ink: #111111;
  --ink-soft: #2e2e2c;
  --muted: #767672;
  --hint: #b0ada6;
  --border: #d8d4cc;
  --border-light: #e8e5df;
  --accent: #e8572a;
  --accent-soft: #fdf0eb;
}

/* ========================================
   리셋 & 기본 스타일
   ======================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 로딩 중 overflow:hidden ↔ 일반 스크롤 전환 시 스크롤바 유무로 폭이 바뀌는 현상 방지 */
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

body {
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

/* 단일 글 본문 페이지는 흰 배경 */
body.single-post {
  background: #fff;
}

body.is-loading {
  overflow: hidden;
}

/* ── 로딩 스피너 (로고 펄스) ── */
.loader-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  align-items: center;
  justify-content: center;
}

.loader-logo {
  font-family: "Pretendard", sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  animation: logoPulse 1.4s ease-in-out infinite;
}

/* 오렌지 언더라인 포인트 */
.loader-logo::after {
  content: ".";
  color: var(--accent);
}

@keyframes logoPulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
  100% {
    opacity: 1;
  }
}

/* 로딩 완료 — 페이드아웃 */
.loader-overlay.is-done {
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

a {
  text-decoration: none;
  color: inherit;
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

ul,
ol {
  list-style: none;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ========================================
   상단 띠배너 (.top-bar)
   ======================================== */
.top-bar {
  background: var(--surface-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 10px 44px 10px 20px;
  position: relative;
}

.top-bar.is-hidden {
  display: none;
}

.top-bar p {
  margin: 0;
}

.top-bar a {
  color: #fff;
}

.top-bar a:hover {
  color: var(--accent);
}

.top-bar-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.top-bar-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ========================================
   헤더 (.site-header)
   ======================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: 76px;
  display: flex;
  align-items: center;
}

/* 메인 화면에서는 헤더 하단 구분선 제거 */
body.home .site-header,
body.blog .site-header {
  border-bottom: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  height: 76px;
}

.site-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-left: 8px;
}

.site-logo:hover {
  opacity: 1;
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 햄버거 메뉴 토글 */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 36px;
  height: 36px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.menu-toggle:active {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 auto;
}

/* 햄버거 X 애니메이션 */
.menu-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}
.menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 모바일 전용 요소 - 데스크탑에서 숨김 */
.mobile-overlay,
.mobile-nav {
  display: none;
}

/* 페이지 래퍼 */
.page-wrap {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* 메인 네비게이션 */
.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

#primary-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

#primary-menu li a {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.1em;
  transition: color 0.2s;
}

#primary-menu li a:hover,
#primary-menu li.current-menu-item > a,
#primary-menu li.current-menu-parent > a,
#primary-menu li.current-menu-ancestor > a,
#primary-menu li.current_page_item > a,
#primary-menu li.current-page-ancestor > a,
#primary-menu li.current-post-ancestor > a,
#primary-menu li.current-cat > a,
#primary-menu li.current-category-ancestor > a {
  color: var(--accent);
}

#primary-menu li.current-menu-item > a,
#primary-menu li.current-menu-parent > a,
#primary-menu li.current-menu-ancestor > a,
#primary-menu li.current_page_item > a,
#primary-menu li.current-page-ancestor > a,
#primary-menu li.current-post-ancestor > a,
#primary-menu li.current-cat > a,
#primary-menu li.current-category-ancestor > a {
  display: inline-block;
  position: relative;
}

#primary-menu li.current-menu-item > a::after,
#primary-menu li.current-menu-parent > a::after,
#primary-menu li.current-menu-ancestor > a::after,
#primary-menu li.current_page_item > a::after,
#primary-menu li.current-page-ancestor > a::after,
#primary-menu li.current-post-ancestor > a::after,
#primary-menu li.current-cat > a::after,
#primary-menu li.current-category-ancestor > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* 헤더 쇼핑 버튼 */
.header-shop-btn {
  background: var(--ink);
  color: var(--bg);
  border-radius: 100px;
  padding: 8px 22px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.header-shop-btn:hover {
  opacity: 0.7;
}

/* ========================================
   히어로 섹션 (.hero-section)
   ======================================== */
.hero-section {
  position: relative;
  height: 580px;
  overflow: visible;
  margin-bottom: 0;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.25s ease;
}

/* PC에서는 히어로를 컨테이너 폭으로 제한 */
@media (min-width: 1025px) {
  .hero-section {
    max-width: 1120px;
    margin: 0 auto;
    border-radius: 14px;
  }

  .hero-image,
  .hero-overlay {
    border-radius: 14px;
  }
}

.hero-image {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.45s ease,
    filter 0.45s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.1) 60%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px 48px;
}

.hero-cat,
.entry-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: inline-block;
}

.hero-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 24px;
  max-width: 700px;
  word-break: keep-all;
}

.hero-title a {
  color: inherit;
  pointer-events: auto;
}

.hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* GSAP 대상: 과한 will-change는 레이어/이미지 합성 시 깜빡임을 유발할 수 있어 텍스트만 소폭 보정 */
.hero-overlay .entry-cat,
.hero-title,
.hero-bottom,
.section-header,
.latest-slider-header,
.single-title,
.archive-title,
.page-title {
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* GSAP 로드/초기화 전 FOUC 방지: 시작 상태를 CSS로 잠금 */
html.gsap-pending .hero-overlay .entry-cat,
html.gsap-pending .hero-title,
html.gsap-pending .hero-bottom,
html.gsap-pending .section-header,
html.gsap-pending .latest-slider-header,
html.gsap-pending .latest-slide,
html.gsap-pending .post-grid:not(.post-grid--archive) .post-card,
html.gsap-pending .post-grid--archive .post-card,
html.gsap-pending .single-meta,
html.gsap-pending .archive-title,
html.gsap-pending .archive-count,
html.gsap-pending .pagination-wrap,
html.gsap-pending .page-title {
  visibility: hidden;
}

/* 모바일 단일 포스트 헤더: GSAP 로드·delay 대기 없이 CSS만으로 즉시 표시 (대상은 page가 아닌 글 본문만) */
@keyframes single-header-entry-cat-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes single-header-title-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes single-header-meta-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .single-article:not(.page-main) .entry-cat {
    visibility: visible !important;
    opacity: 0;
    animation: single-header-entry-cat-in 0.4s cubic-bezier(0.33, 1, 0.68, 1)
      forwards;
  }

  .single-article:not(.page-main) .single-title {
    visibility: visible !important;
    opacity: 0;
    animation: single-header-title-in 0.55s cubic-bezier(0.33, 1, 0.68, 1)
      forwards;
  }

  .single-article:not(.page-main) .single-meta {
    visibility: visible !important;
    opacity: 0;
    animation: single-header-meta-in 0.4s cubic-bezier(0.33, 1, 0.68, 1)
      forwards;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .single-article:not(.page-main) .entry-cat,
  .single-article:not(.page-main) .single-title,
  .single-article:not(.page-main) .single-meta {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 단일 포스트 상단(카테고리/제목): GSAP 없이 순수 CSS로 동시에 즉시 진입 */
.single-article:not(.page-main) .entry-cat,
.single-article:not(.page-main) .single-title {
  visibility: visible !important;
  opacity: 0;
  transform: translateY(24px);
  animation: single-header-title-in 0.45s cubic-bezier(0.33, 1, 0.68, 1)
    forwards;
}

.hero-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.hero-read {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 100px;
  padding: 10px 24px;
  transition: all 0.2s ease;
  display: inline-block;
  pointer-events: auto;
}

.hero-read:hover {
  background: #fff;
  color: var(--ink);
  opacity: 1;
}

.hero-section {
  cursor: pointer;
}

.hero-section:hover {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.hero-section:hover .hero-image img {
  transform: scale(1.03);
  filter: brightness(0.92);
}

.hero-section:hover .hero-read {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

/* ── 최신글 슬라이드 ── */
.latest-slider-section {
  padding: 48px 0 60px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.latest-slider-header {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.latest-slider-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* 패딩은 바깥(.latest-swiper-outer) — Swiper 본체 너비와 slidesPerView 계산이 맞도록 */
.latest-swiper-outer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
  overflow: visible;
}

/*
 * 그림자 전용 여백: 좌우 margin 음수 + 같은 값 padding → 안쪽 슬라이드 폭은
 * gutter 없을 때와 동일, overflow 클립은 gutter에서만 잘라서 첫·끝 그림자·모서리 유지.
 */
.latest-swiper-gutter {
  overflow: hidden;
  box-sizing: border-box;
  margin-left: -22px;
  margin-right: -22px;
  padding-left: 22px;
  padding-right: 22px;
}

/* 상·하만: 좌우는 .latest-swiper-gutter가 담당 */
.latest-swiper {
  width: 100%;
  overflow: hidden !important;
  box-sizing: border-box;
  padding: 14px 0 48px;
}

.swiper-wrapper {
  align-items: stretch;
}

/* 슬라이드 카드 — PC(768px~)은 Swiper slidesPerView:4로 너비 계산 */
.latest-slide {
  height: auto !important;
  overflow: visible;
}

/*
 * 카드에 overflow:hidden을 두면 border-radius와 겹칠 때 자기 box-shadow·하단 모서리가
 * 잘리는 경우가 많음(호버 시 그림자 확대 시 더 두드러짐). 클립은 이미지 블록에만 둠.
 */
.latest-card {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  background: var(--bg);
  border-radius: 8px;
  overflow: visible;
  /* 슬라이드 나란히 배치: 위아래 번짐 줄이고 좌우 위주(첫·끝 카드 외곽이 또렷하게) */
  border: 1px solid var(--border-light);
  box-shadow:
    -10px 0 22px -10px rgba(0, 0, 0, 0.07),
    10px 0 22px -10px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.25s ease;
}

.latest-card:hover {
  box-shadow:
    -14px 0 30px -10px rgba(0, 0, 0, 0.11),
    14px 0 30px -10px rgba(0, 0, 0, 0.11);
}

.latest-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
  background: var(--surface);
}

.latest-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.latest-card:hover .latest-card-image img {
  transform: scale(1.04);
}

.latest-card-no-image {
  width: 100%;
  height: 100%;
  background: var(--surface);
}

.latest-card-body {
  padding: 14px 16px 16px;
  border-radius: 0 0 8px 8px;
}

.latest-card-body .entry-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  display: block;
}

.latest-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-card-meta {
  font-size: 11px;
  color: var(--hint);
  font-weight: 500;
}

/* 네비게이션 버튼 */
.latest-prev,
.latest-next {
  color: var(--ink) !important;
  width: 36px !important;
  height: 36px !important;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  top: 35% !important;
}

.latest-prev::after,
.latest-next::after {
  font-size: 13px !important;
  font-weight: 700;
}

.latest-prev {
  left: 8px !important;
}

.latest-next {
  right: 8px !important;
}

@media (max-width: 768px) {
  .latest-prev,
  .latest-next {
    display: none !important;
  }

  .latest-slider-section {
    padding: 28px 0 44px;
  }

  .latest-slider-header {
    padding: 0 20px;
    margin-bottom: 16px;
  }

  .latest-swiper-outer {
    padding: 0;
  }

  /* 모바일: 뷰포트 밖으로 음수 마진 확장 시 섹션 overflow에 잘릴 수 있어 양수 패딩만 사용 */
  .latest-swiper-gutter {
    margin-left: 0;
    margin-right: 0;
    padding-left: 14px;
    padding-right: 14px;
  }

  .latest-swiper {
    padding: 12px 0 40px !important;
    margin: 0 6px !important;
    overflow: hidden !important;
  }

  .latest-slide {
    width: 58vw !important;
  }

  .latest-card-image {
    aspect-ratio: 16 / 9;
    border-radius: 8px 8px 0 0;
    max-height: none;
  }

  .latest-card-body {
    padding: 10px 12px 12px;
    border-radius: 0 0 8px 8px;
  }

  .latest-card-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    word-break: keep-all;
  }

  .latest-card-meta {
    font-size: 11px;
    margin-top: 4px;
  }
}

/* ========================================
   섹션 헤더 (.section-header)
   ======================================== */
.section-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 52px 40px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-more {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.section-more:hover {
  opacity: 0.8;
}

/* ========================================
   포스트 그리드 (.post-grid)
   ======================================== */
.post-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

/* 아카이브 3열 그리드 */
.post-grid--archive {
  grid-template-columns: repeat(3, 1fr);
}

/* ========================================
   포스트 카드 (.post-card)
   ======================================== */
.post-card {
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.06);
  /* transform은 GSAP(y)와 겹치면 끝 프레임에서 버벅임 → 기본은 그림자만 보간 */
  transition: box-shadow 0.25s ease;
}

/* 아카이브/카테고리: GSAP 등장 후(.post-card--ready)에만 호버 상승을 부드럽게 보간 */
.post-grid--archive .post-card.post-card--ready {
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: block;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.post-card:hover .card-image img {
  transform: scale(1.05);
}

.card-body {
  padding: 20px;
}

.card-body .entry-cat {
  font-size: 10px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 10px;
}

.card-title a {
  color: inherit;
}

.card-title a:hover {
  color: var(--accent);
  opacity: 1;
}

.card-excerpt {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.75;
  margin-bottom: 14px;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 11px;
  color: var(--hint);
  font-weight: 500;
}

/* ========================================
   페이지네이션 (.pagination)
   ======================================== */
.pagination {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pagination .page-numbers {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.pagination .page-numbers:hover {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
  opacity: 1;
}

.pagination .page-numbers.current {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ========================================
   단일 포스트 (.single-article)
   ======================================== */
.single-article {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

.single-header {
  padding: 52px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.single-header .entry-cat {
  margin-bottom: 16px;
}

.single-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--ink);
  word-break: keep-all;
}

.single-meta {
  font-size: 12px;
  color: var(--hint);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-sep {
  color: var(--border);
}

/* 단일 포스트 히어로 이미지 */
.single-hero-img {
  margin: 0 0 44px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.single-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 단일 포스트 콘텐츠 */
.single-content {
  font-size: 18px;
  line-height: 2;
  color: var(--ink-soft);
}

.single-content h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 56px 0 16px;
  color: var(--ink);
  line-height: 1.4;
  word-break: keep-all;
}

.single-content h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 40px 0 12px;
  color: var(--ink);
  line-height: 1.5;
  word-break: keep-all;
}

.single-content p {
  margin-bottom: 26px;
}

.single-content ul,
.single-content ol {
  margin-bottom: 26px;
  padding-left: 24px;
  list-style: disc;
}

.single-content ol {
  list-style: decimal;
}

.single-content li {
  margin-bottom: 10px;
}

.single-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 20px 24px;
  font-size: 17px;
  font-weight: 500;
  border-radius: 0 8px 8px 0;
  margin: 32px 0;
  color: var(--ink-soft);
}

.single-content strong {
  font-weight: 700;
  color: var(--ink);
}

.single-content img {
  width: 100%;
  height: auto;
  margin: 36px auto;
}

/* 구텐베르크 이미지 블록 폭이 고정되는 경우를 방지 */
.single-content .wp-block-image,
.single-content figure {
  width: 100%;
  max-width: 100%;
  margin: 36px 0;
}

.single-content a {
  color: var(--accent);
  text-decoration: underline;
}

.single-content a:hover {
  opacity: 0.7;
}

/* ── stebi 상품 카드 ── */
.stebi-product-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 500px;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 36px auto;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s;
}

.stebi-product-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

/* 이미지 — 정사각, 여백 없이 꽉 채움 */
.spc-image-wrap {
  position: relative;
  flex: 0 0 160px;
  width: 160px;
  min-width: 160px;
  height: 160px;
  line-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.spc-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.stebi-product-card:hover .spc-image-wrap img {
  transform: scale(1.04);
}

/* 뱃지 */
.spc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
}

/* 텍스트 영역 */
.spc-body {
  padding: 10px 12px 10px 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
}

.spc-shop-label {
  display: none;
}

.spc-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 6px 0 2px;
}

.spc-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 0;
  margin-bottom: 5px;
}

.spc-original-price {
  font-size: 13px;
  font-weight: 400;
  color: var(--hint);
  text-decoration: line-through;
}

.spc-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* 구매 버튼 */
.spc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 100px;
  width: fit-content;
  transition: background 0.2s;
}

.stebi-product-card:hover .spc-btn {
  background: var(--accent);
}

/* 모바일 */
@media (max-width: 768px) {
  .stebi-product-card {
    width: 100%;
    max-width: 100%;
    margin: 24px auto;
    gap: 10px;
  }

  .spc-image-wrap {
    flex: 0 0 104px;
    width: 104px;
    min-width: 104px;
    height: auto;
    min-height: 104px;
    aspect-ratio: 1 / 1;
    align-self: stretch;
  }

  .spc-body {
    padding: 6px 10px 6px 6px;
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name name"
      "price btn";
    align-items: center;
    justify-content: stretch;
    column-gap: 6px;
    row-gap: 0;
  }

  .spc-name {
    grid-area: name;
    font-size: 15px;
    line-height: 1.4;
    margin-top: 3px;
    margin-bottom: 0;
    margin-left: -1px;
    overflow-wrap: anywhere;
    word-break: keep-all;
  }

  .spc-price-wrap {
    grid-area: price;
    margin-top: 16px;
    margin-bottom: 0;
    margin-left: -1px;
    align-items: center;
    align-self: center;
    min-width: 0;
  }

  .spc-price {
    font-size: 17px;
    line-height: 1;
  }

  .spc-btn {
    grid-area: btn;
    align-self: center;
    justify-self: end;
    margin-top: 16px;
    font-size: 11px;
    padding: 4px 10px;
    line-height: 1;
    min-height: 24px;
    white-space: nowrap;
  }
}

/* 카드 썸네일 하단 공백 방지 */
.stebi-product-card .spc-image-wrap img {
  margin: 0 !important;
  vertical-align: top;
}

/* 본문 링크 스타일(밑줄) 영향 차단 */
.single-content .stebi-product-card,
.single-content .stebi-product-card:hover {
  text-decoration: none;
  opacity: 1;
}

/* 본문 공통 이미지 margin 규칙이 썸네일에 적용되지 않도록 차단 */
.single-content .stebi-product-card .spc-image-wrap,
.single-content .stebi-product-card .spc-image-wrap img {
  margin: 0 !important;
}

/* 본문 기본 p 마진(26px)이 카드 내부에 적용되지 않도록 차단 */
.single-content .stebi-product-card p {
  margin: 0;
}

/* 상품명은 카드 디자인 기준으로 별도 마진/행간 사용 */
.single-content .stebi-product-card .spc-name {
  margin: 6px 0 2px;
  line-height: 1.28;
}

@media (max-width: 768px) {
  .single-content .stebi-product-card .spc-name {
    margin-top: 8px;
    margin-bottom: 0;
    line-height: 1.4;
  }
}

/* ========================================
   쇼핑 연결 배너 (.shop-banner)
   ======================================== */
.shop-banner {
  background: var(--surface-dark);
  border-radius: 12px;
  padding: 32px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 52px 0;
  gap: 24px;
}

.shop-banner-content {
  flex: 1;
}

.shop-banner-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.shop-banner-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.shop-banner-btn {
  background: #fff;
  color: var(--ink);
  border: none;
  border-radius: 100px;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.shop-banner-btn:hover {
  background: var(--bg);
  opacity: 1;
}

/* ========================================
   단일 포스트 태그 (.single-tags)
   ======================================== */
.single-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.single-tags a {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--muted);
  transition: all 0.2s ease;
}

.single-tags a:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  opacity: 1;
}

/* ========================================
   이전/다음 네비게이션 (.post-navigation)
   ======================================== */
.post-navigation {
  max-width: 940px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.nav-prev,
.nav-next {
  padding: 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-next {
  border-left: 1px solid var(--border);
  text-align: right;
  align-items: flex-end;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--hint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
}

.nav-title:hover {
  color: var(--accent);
  opacity: 1;
}

/* ========================================
   푸터 CTA (.footer-cta)
   ======================================== */
.footer-cta {
  background: var(--surface-dark);
  padding: 64px 40px;
  text-align: center;
}

.footer-cta-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-cta-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.footer-cta-title {
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  line-height: 1.3;
}

.footer-cta-btn {
  display: inline-flex;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  padding: 14px 36px;
  font-size: 14px;
  font-weight: 700;
  transition: opacity 0.2s ease;
}

.footer-cta-btn:hover {
  opacity: 0.85;
}

/* ========================================
   푸터 하단 (.footer-bottom-wrap)
   ======================================== */
.footer-bottom-wrap {
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-logo {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.footer-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

#footer-menu {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

#footer-menu li a {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

#footer-menu li a:hover {
  color: var(--ink);
  opacity: 1;
}

.footer-copy {
  font-size: 11px;
  color: var(--hint);
}

/* 우측 하단 플로팅 상단 이동 버튼 */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  color: var(--accent);
  border-color: var(--border);
}

.back-to-top:focus,
.back-to-top:focus-visible,
.back-to-top:active {
  outline: none !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
  border-color: var(--border) !important;
}

/* ========================================
   아카이브 (.archive-header)
   ======================================== */
.archive-header {
  background: var(--surface-dark);
  padding: 56px 40px;
  text-align: center;
  margin-bottom: 80px;
}

.archive-header-inner {
  max-width: 800px;
  margin: 0 auto;
}

.archive-title {
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.archive-count {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
  font-weight: 500;
}

.archive-description {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   결과 없음 (.no-results)
   ======================================== */
.no-results {
  max-width: 600px;
  margin: 80px auto;
  padding: 60px 40px;
  text-align: center;
}

.no-results-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ink);
}

.no-results-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 28px;
}

.no-results-btn {
  display: inline-flex;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 700;
  transition: opacity 0.2s ease;
}

.no-results-btn:hover {
  opacity: 0.85;
}

/* ========================================
   포스트 없음 안내 (.no-posts-notice)
   ======================================== */
.no-posts-notice {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  background: var(--bg);
}

.no-posts-inner {
  max-width: 600px;
  text-align: center;
}

.no-posts-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.3;
}

.no-posts-text {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 32px;
}

.no-posts-btn {
  display: inline-flex;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  padding: 14px 36px;
  font-size: 14px;
  font-weight: 700;
  transition: opacity 0.2s ease;
}

.no-posts-btn:hover {
  opacity: 0.85;
}

/* ========================================
   404 에러 페이지 (.error-404)
   ======================================== */
.error-404 {
  text-align: center;
  padding: 100px 40px;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-404-inner {
  max-width: 600px;
}

.error-404-number {
  font-size: 120px;
  font-weight: 800;
  color: var(--border);
  line-height: 1;
  margin-bottom: 20px;
  font-family: "DM Serif Display", serif;
}

.error-404-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--ink);
}

.error-404-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

.error-404-btn {
  display: inline-flex;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  padding: 14px 36px;
  font-size: 14px;
  font-weight: 700;
  transition: opacity 0.2s ease;
}

.error-404-btn:hover {
  opacity: 0.85;
}

/* ========================================
   반응형 디자인
   ======================================== */

/* 1024px 이하 */
@media (max-width: 1024px) {
  .post-grid--archive {
    grid-template-columns: 1fr 1fr;
  }

  .hero-title {
    font-size: 36px;
  }
}

/* 768px 이하 (태블릿/모바일) */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 20px;
  }

  /* 햄버거 메뉴 표시 */
  .menu-toggle {
    display: flex !important;
  }

  /* 데스크탑 네비/쇼핑버튼 숨김 */
  .site-nav,
  .header-shop-btn {
    display: none !important;
  }

  /* 메뉴 열릴 때 body 스크롤 잠금 */
  body.menu-open {
    overflow: hidden;
  }

  /* 본문 왼쪽 밀기 */
  body.menu-open .page-wrap {
    transform: translateX(-280px);
  }

  /* 오버레이 */
  .mobile-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease;
  }

  .mobile-overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }

  /* 모바일 사이드 메뉴 */
  .mobile-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    border-left: 1px solid var(--border);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav.is-open {
    transform: translateX(0);
  }

  /* 사이드메뉴 헤더 — 부모 헤더(76px) 높이에 맞춤 */
  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 76px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .mobile-nav-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.03em;
  }

  .mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
  }

  .mobile-nav-close:hover {
    background: var(--surface);
    color: var(--ink);
  }

  /* 메뉴 열린 상태에서 햄버거 버튼 즉시 숨김 */
  body.menu-open .menu-toggle {
    display: none !important;
  }

  /* 모바일 메뉴 항목 */
  .mobile-menu-list,
  .mobile-nav > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .mobile-menu-list li,
  .mobile-nav > ul > li {
    display: block;
    width: 100%;
    margin: 0;
  }

  .mobile-menu-list li a,
  .mobile-nav > ul > li > a {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    text-decoration: none;
    transition:
      background 0.15s ease,
      color 0.15s ease;
    border-bottom: 1px solid var(--border-light);
  }

  .mobile-menu-list li:last-child a,
  .mobile-nav > ul > li:last-child > a {
    border-bottom: none;
  }

  .mobile-menu-list li a:hover,
  .mobile-menu-list li a:active,
  .mobile-nav > ul > li > a:hover,
  .mobile-nav > ul > li > a:active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  /* 모바일 현재 메뉴 표시 */
  .mobile-menu-list li.current-menu-item > a,
  .mobile-menu-list li.current_page_item > a,
  .mobile-nav > ul > li.current-menu-item > a,
  .mobile-nav > ul > li.current_page_item > a {
    color: var(--accent);
  }

  /* 사이드메뉴 하단 쇼핑 버튼 */
  .mobile-nav-footer {
    padding: 16px 24px 24px;
    flex-shrink: 0;
  }

  .mobile-shop-btn {
    display: block;
    text-align: center;
    background: var(--accent);
    color: #fff;
    border-radius: 100px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    transition: opacity 0.2s ease;
  }

  .mobile-shop-btn:hover {
    opacity: 0.85;
    color: #fff;
  }

  /* 히어로 섹션 */
  .hero-section {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .hero-image {
    position: absolute;
    inset: 0;
    height: 100%;
  }

  .hero-overlay {
    padding: 36px 24px;
  }

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

  /* 포스트 그리드 */
  .post-grid,
  .post-grid--archive {
    grid-template-columns: 1fr;
    padding: 0 20px 40px;
  }

  .section-header {
    padding: 40px 20px 20px;
  }

  /* 단일 포스트 */
  .single-article {
    padding: 0 20px 60px;
  }

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

  .single-content {
    font-size: 17px;
  }

  .single-content h2 {
    font-size: 22px;
    margin: 44px 0 14px;
  }

  .single-content h3 {
    font-size: 18px;
    margin: 32px 0 10px;
  }

  /* 쇼핑 배너 */
  .shop-banner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    padding: 28px 24px;
  }

  /* 이전/다음 네비 */
  .post-navigation {
    grid-template-columns: 1fr;
  }

  .nav-next {
    border-left: none;
    border-top: 1px solid var(--border);
    text-align: left;
    align-items: flex-start;
  }

  .nav-prev,
  .nav-next {
    padding: 20px;
  }

  /* 푸터 */
  .footer-cta {
    padding: 48px 20px;
  }

  .footer-cta-title {
    font-size: 26px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 20px;
  }

  .footer-nav {
    order: 2;
  }

  .footer-copy {
    order: 3;
  }

  /* 아카이브 */
  .archive-header {
    padding: 48px 20px;
    margin-bottom: 48px;
  }

  .archive-title {
    font-size: 32px;
  }
}

/* 480px 이하 (모바일) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 22px;
  }

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

  .single-title {
    font-size: 22px;
  }

  .hero-overlay {
    padding: 28px 20px;
  }

  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-cta-title {
    font-size: 22px;
  }

  .error-404-number {
    font-size: 80px;
  }

  .error-404-title {
    font-size: 20px;
  }
}

/* 읽기 진행률 바 — .site-header(z-index:100) 위에 그려야 보임 */
/* scaleX + transform 전환: width 보간보다 부드럽고 GPU 합성에 유리 */
.reading-progress-bar {
  position: fixed;
  top: 76px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(var(--reading-progress, 0));
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 101;
  pointer-events: none;
}

/* 모바일: 긴 ease 전환 + 관성 스크롤이 겹치면 밀려 보이고 프레임 드랍처럼 느껴짐 → 즉시 반영 */
@media (max-width: 768px) {
  .reading-progress-bar {
    transition: none;
  }
}
