/* ==========================================================================
   dannyjoo.io Editorial Skin
   Apple-inspired high-end editorial blog theme for Tistory
   ========================================================================== */

/* ---- CSS Custom Properties (Design Tokens) ---- */
:root,
[data-theme="light"] {
  /* Surface */
  --surface:                #f9f9fb;
  --surface-dim:            #d9dadc;
  --surface-bright:         #f9f9fb;
  --surface-container-lowest: #ffffff;
  --surface-container-low:  #f3f3f5;
  --surface-container:      #eeeef0;
  --surface-container-high: #e8e8ea;
  --surface-container-highest: #e2e2e4;

  /* On-surface */
  --on-surface:             #1a1c1d;
  --on-surface-variant:     #414755;
  --on-background:          #1a1c1d;

  /* Primary */
  --primary:                #0058bc;
  --primary-container:      #0070eb;
  --on-primary:             #ffffff;
  --on-primary-container:   #fefcff;

  /* Secondary */
  --secondary:              #5d5e63;
  --on-secondary:           #ffffff;
  --secondary-container:    #e0dfe4;

  /* Outline */
  --outline:                #717786;
  --outline-variant:        #c1c6d7;

  /* Error */
  --error:                  #ba1a1a;

  /* Inverse */
  --inverse-surface:        #2f3132;
  --inverse-on-surface:     #f0f0f2;

  /* Elevation */
  --shadow-ambient:         0 10px 40px rgba(26, 28, 29, 0.04);
  --shadow-sm:              0 1px 3px rgba(26, 28, 29, 0.06);

  /* Glass */
  --glass-bg:               rgba(255, 255, 255, 0.72);
  --glass-border:           rgba(193, 198, 215, 0.2);
}

[data-theme="dark"] {
  /* Surface — dark palette */
  --surface:                #121314;
  --surface-dim:            #121314;
  --surface-bright:         #383a3b;
  --surface-container-lowest: #0d0e0f;
  --surface-container-low:  #1a1c1d;
  --surface-container:      #1e2021;
  --surface-container-high: #292b2c;
  --surface-container-highest: #333537;

  /* On-surface */
  --on-surface:             #e2e2e4;
  --on-surface-variant:     #c1c6d7;
  --on-background:          #e2e2e4;

  /* Primary */
  --primary:                #adc6ff;
  --primary-container:      #004493;
  --on-primary:             #002e6a;
  --on-primary-container:   #d8e2ff;

  /* Secondary */
  --secondary:              #c6c6cb;
  --on-secondary:           #2e2f33;
  --secondary-container:    #46464b;

  /* Outline */
  --outline:                #8b9198;
  --outline-variant:        #414755;

  /* Error */
  --error:                  #ffb4ab;

  /* Inverse */
  --inverse-surface:        #e2e2e4;
  --inverse-on-surface:     #2f3132;

  /* Elevation */
  --shadow-ambient:         0 10px 40px rgba(0, 0, 0, 0.3);
  --shadow-sm:              0 1px 3px rgba(0, 0, 0, 0.2);

  /* Glass */
  --glass-bg:               rgba(18, 19, 20, 0.8);
  --glass-border:           rgba(65, 71, 85, 0.3);
}

/* Dark mode icon toggle */
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"]  .icon-sun  { display: block; }
[data-theme="dark"]  .icon-moon { display: none; }


/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-surface);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

/* ---- Layout ---- */
.main {
  min-height: 100vh;
  padding-top: 6rem; /* nav height + spacing */
}


/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 4rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.nav.is-scrolled {
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav__brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--on-surface);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--secondary);
  transition: color 0.2s ease;
  letter-spacing: -0.01em;
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--on-surface);
}

/* -- Archive Dropdown -- */
.nav__dropdown {
  position: relative;
}

.nav__link--toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
}

.nav__chevron {
  transition: transform 0.2s ease;
}

.nav__dropdown:hover .nav__chevron,
.nav__dropdown.is-open .nav__chevron {
  transform: rotate(180deg);
}

.nav__dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 11rem;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface-container-lowest);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  padding: 0.5rem;
  box-shadow: var(--shadow-ambient);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 110;
}

/* Desktop: hover로 열기 */
@media (hover: hover) {
  .nav__dropdown:hover .nav__dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

/* Click으로도 열기 (모바일 + 데스크톱) */
.nav__dropdown.is-open .nav__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav__dropdown-item {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--on-surface);
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav__dropdown-item:hover {
  background-color: var(--surface-container-high);
  color: var(--primary);
}

/* "All Posts" 링크 */
.nav__dropdown-item--all {
  color: var(--primary);
  font-weight: 600;
}

/* 구분선 */
.nav__dropdown-divider {
  height: 1px;
  background: var(--outline-variant);
  margin: 0.35rem 0.5rem;
  opacity: 0.3;
}

/* 하위 카테고리 (들여쓰기) */
.nav__dropdown-item--sub {
  padding-left: 1.5rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--secondary);
}

.nav__dropdown-item--sub:hover {
  color: var(--primary);
}

/* 드롭다운 화살표 */
.nav__dropdown-menu::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--surface-container-lowest);
  border-top: 1px solid var(--glass-border);
  border-left: 1px solid var(--glass-border);
}

/* Info 드롭다운 (넓은 카드형) */
.nav__dropdown-menu--info {
  min-width: 16rem;
  padding: 0;
  overflow: hidden;
}

.nav__info-card {
  padding: 1.25rem 1.25rem 1rem;
}

.nav__info-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.nav__info-desc {
  font-size: 0.8rem;
  color: var(--secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.nav__info-links {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--outline-variant);
}

.nav__info-link {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  transition: opacity 0.2s ease;
}

.nav__info-link:hover {
  opacity: 0.7;
}

/* hover 영역 브릿지 */
.nav__dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.75rem;
}

/* -- Mobile Hamburger & Menu -- */
.nav__hamburger {
  display: none;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--on-surface);
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.nav__btn:hover {
  background-color: var(--surface-container-high);
}


/* ==========================================================================
   SEARCH OVERLAY
   ========================================================================== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-overlay__inner {
  width: 100%;
  max-width: 40rem;
  padding: 0 2rem;
}

.search-form {
  display: flex;
  align-items: center;
  background: var(--surface-container-lowest);
  border-radius: 1rem;
  padding: 0.25rem 0.25rem 0.25rem 1.5rem;
  box-shadow: var(--shadow-ambient);
}

.search-form__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.125rem;
  font-family: inherit;
  color: var(--on-surface);
  padding: 1rem 0;
}

.search-form__input::placeholder {
  color: var(--outline);
}

.search-form__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  color: var(--secondary);
  transition: background-color 0.2s ease;
}

.search-form__close:hover {
  background-color: var(--surface-container-high);
}


/* ==========================================================================
   INDEX / ARTICLE LIST
   ========================================================================== */

/* -- Standard Card — Apple Style -- */
.article-card {
  padding: 0 2rem;
  max-width: 40rem;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .main.is-list {
    display: grid;
    grid-template-columns: repeat(2, 40rem);
    justify-content: center;
    max-width: 86rem;
    margin: 0 auto;
    padding: 6rem 2rem 0;
    gap: 0 2rem;
  }

  .main.is-list > .article-card {
    padding: 0;
    max-width: none;
    margin: 0;
  }

  .main.is-list > .article-card--hero {
    grid-column: 1 / -1;
    max-width: none;
    margin: 0;
    padding: 2rem 0 0;
  }

  .main.is-list > .pagination,
  .main.is-list > s_paging {
    grid-column: 1 / -1;
  }
}

/* 화면이 2열에 비해 좁으면 1열로 */
@media (min-width: 900px) and (max-width: 1399px) {
  .main.is-list {
    grid-template-columns: 1fr;
    max-width: 40rem;
    margin: 0 auto;
    padding: 6rem 2rem 0;
  }
}

.article-card__link {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--outline-variant);
  transition: opacity 0.2s ease;
  text-decoration: none;
}

.article-card__link:hover {
  opacity: 0.7;
}

.article-card__thumb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--surface-container);
}

.article-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card__body {
  flex: 1;
  min-width: 0;
}

.article-card__category {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.article-card__title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--on-surface);
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__link:hover .article-card__title {
  color: var(--on-surface);
}

.article-card__summary {
  font-size: 0.8125rem;
  color: var(--on-surface-variant);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.125rem;
}

.article-card__date {
  font-size: 0.6875rem;
  color: var(--outline);
  font-variant-numeric: tabular-nums;
}


/* -- Hero Card (first article on index) -- */
.article-card--hero {
  padding: 0 2rem 0.5rem;
  margin-top: 2rem;
  margin-bottom: 0;
}

.article-card--hero .article-card__link {
  flex-direction: column;
  align-items: stretch;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid var(--outline-variant);
  gap: 0;
}

.article-card--hero .article-card__thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}


.article-card--hero .article-card__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  -webkit-line-clamp: 2;
  margin-bottom: 0.5rem;
}

.article-card--hero .article-card__summary {
  font-size: 0.9375rem;
  -webkit-line-clamp: 2;
  color: var(--on-surface-variant);
  line-height: 1.6;
  margin-bottom: 0.375rem;
}

.article-card--hero .article-card__date {
  font-size: 0.75rem;
}

.article-card--hero .article-card__category {
  font-size: 0.6875rem;
  margin-bottom: 0.5rem;
}


/* ==========================================================================
   PAGINATION
   ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 4rem 2rem 5rem;
}

.pagination__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background-color: var(--surface-container-lowest);
  color: var(--on-surface);
  transition: background-color 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.pagination__btn:hover {
  background-color: var(--surface-container-high);
}

.pagination__nums {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.75rem;
}

.pagination__num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--secondary);
  transition: all 0.2s ease;
}

.pagination__num:hover {
  color: var(--on-surface);
  background-color: var(--surface-container-low);
}

/* Tistory adds "selected" class for current page */
.pagination__num.selected,
.pagination__num.active {
  background-color: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}


/* ==========================================================================
   ARTICLE DETAIL — Apple Editorial Style
   ========================================================================== */
.article-detail__hero {
  padding: 5rem 2rem 2rem;
  text-align: left;
  margin-bottom: 0;
}

.article-detail__hero-inner {
  max-width: 42rem;
  margin: 0 auto;
}

.article-detail__category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: opacity 0.2s ease;
}

.article-detail__category:hover {
  opacity: 0.7;
}

.article-detail__title {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--on-surface);
  margin-bottom: 1rem;
}

.article-detail__date {
  font-size: 0.8125rem;
  color: var(--outline);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.article-detail__meta {
  margin-bottom: 0.5rem;
}


/* -- Article Content — Apple Typography -- */
.article-detail__content {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  font-size: 1.0625rem;
  line-height: 1.882;
  color: var(--on-surface);
  word-break: keep-all;
  letter-spacing: -0.003em;
}

.article-detail__content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--outline-variant);
  color: var(--on-surface);
  scroll-margin-top: 5rem;
}

.article-detail__content h2:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.article-detail__content h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--on-surface);
  scroll-margin-top: 5rem;
}

.article-detail__content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.375rem;
  color: var(--on-surface);
}

.article-detail__content p {
  margin-bottom: 1.25rem;
}

.article-detail__content a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(0, 88, 188, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}

.article-detail__content a:hover {
  text-decoration-color: var(--primary);
}

.article-detail__content img {
  width: 100%;
  border-radius: 12px;
  margin: 2rem 0;
}

.article-detail__content figure {
  margin: 2.5rem 0;
}

.article-detail__content figure img {
  margin-bottom: 0.5rem;
}

.article-detail__content figcaption {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--outline);
  font-weight: 400;
  line-height: 1.5;
}

/* Blockquote — Apple Aside Style */
.article-detail__content blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--outline-variant);
  text-align: left;
}

.article-detail__content blockquote p {
  font-size: 1rem;
  font-weight: 400;
  color: var(--on-surface-variant);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.article-detail__content blockquote p:last-child {
  margin-bottom: 0;
}

.article-detail__content blockquote h3 {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
  padding: 0.3rem 0;
  line-height: 1.5;
}

.article-detail__content blockquote h3 strong {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary);
}

.article-detail__content blockquote h3 a {
  color: var(--on-surface);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-detail__content blockquote h3 a:hover {
  color: var(--primary);
}

/* Lists */
.article-detail__content ul,
.article-detail__content ol {
  padding-left: 1.375rem;
  margin-bottom: 1.25rem;
}

.article-detail__content li {
  margin-bottom: 0.375rem;
  line-height: 1.7;
}

.article-detail__content li::marker {
  color: var(--outline);
}

/* Code — Apple Developer Docs Style */
.article-detail__content pre {
  background-color: var(--surface-container);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.8125rem;
  line-height: 1.65;
  border: 1px solid var(--outline-variant);
}

.article-detail__content code {
  font-family: 'SF Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.85em;
  background-color: var(--surface-container);
  padding: 0.125em 0.375em;
  border-radius: 4px;
  color: var(--on-surface);
}

.article-detail__content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* HR — minimal divider */
.article-detail__content hr {
  border: none;
  height: 1px;
  background: var(--outline-variant);
  margin: 3rem 0;
  opacity: 0.6;
}

/* Tistory image containers */
.article-detail__content .imageblock,
.article-detail__content [data-ke-type="moreLess"],
.article-detail__content .tt_article_useless_p_margin p {
  margin-bottom: 1.25rem;
}

.article-detail__content .imageblock img {
  border-radius: 12px;
}

/* Tistory file/code block */
.article-detail__content .tt-code-block,
.article-detail__content .colorscripter-code {
  border-radius: 12px !important;
  overflow: hidden;
  margin: 1.5rem 0 !important;
}

/* Table — Clean Apple Style */
.article-detail__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

.article-detail__content th,
.article-detail__content td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--outline-variant);
}

.article-detail__content th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--on-surface-variant);
}


/* -- Tags -- */
.article-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 45rem;
  margin: 0 auto;
  padding: 2rem 2rem 0;
  border-top: 1px solid var(--outline-variant);
}

.tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--secondary);
  background-color: var(--surface-container-low);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--outline-variant);
  transition: all 0.2s ease;
}

.tag:hover {
  color: var(--primary);
  border-color: var(--primary);
  background-color: var(--surface-container-lowest);
}


/* ==========================================================================
   POST NAVIGATION (Prev / Next)
   ========================================================================== */
.post-nav {
  display: flex;
  max-width: 45rem;
  margin: 4rem auto 0;
  border-top: 1px solid var(--outline-variant);
  border-bottom: 1px solid var(--outline-variant);
}

.post-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  transition: background-color 0.3s ease;
  min-height: 8rem;
}

.post-nav__item:hover {
  background-color: var(--surface-container-low);
}

.post-nav__prev {
  border-right: 1px solid var(--outline-variant);
}

.post-nav__next {
  text-align: right;
  align-items: flex-end;
}

.post-nav__label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--secondary);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.post-nav__item:hover .post-nav__label {
  color: var(--primary);
}

.post-nav__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--on-surface);
  letter-spacing: -0.01em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ==========================================================================
   COMMENTS
   ========================================================================== */
.comments {
  max-width: 45rem;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.comments__heading {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  color: var(--on-surface);
}

.comment {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--outline-variant);
}

.comment__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.comment__author {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--on-surface);
}

.comment__date {
  font-size: 0.75rem;
  color: var(--outline);
}

.comment__actions {
  font-size: 0.75rem;
  color: var(--secondary);
  margin-left: auto;
}

.comment__actions a {
  color: var(--secondary);
  transition: color 0.2s ease;
}

.comment__actions a:hover {
  color: var(--primary);
}

.comment__body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--on-surface-variant);
}

/* Comment form — Tistory injects its own form HTML */
.comment-form {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--outline-variant);
}

.comment-form textarea {
  width: 100%;
  min-height: 6rem;
  padding: 1rem;
  border: 1px solid var(--outline-variant);
  border-radius: 0.75rem;
  background-color: var(--surface-container-lowest);
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.comment-form input[type="text"],
.comment-form input[type="password"] {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--outline-variant);
  border-radius: 0.5rem;
  background-color: var(--surface-container-lowest);
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.875rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.2s ease;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
}

.comment-form input[type="submit"],
.comment-form button[type="submit"] {
  padding: 0.6rem 1.5rem;
  background-color: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.comment-form input[type="submit"]:hover,
.comment-form button[type="submit"]:hover {
  opacity: 0.85;
}


/* ==========================================================================
   GUESTBOOK
   ========================================================================== */
.guestbook {
  max-width: 45rem;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.guestbook__title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  color: var(--on-surface);
}


/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background-color: var(--surface-container-low);
  border-top: 1px solid var(--glass-border);
  padding: 4rem 2rem;
  transition: background-color 0.3s ease;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 72rem;
  margin: 0 auto;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer__name {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--on-surface);
  letter-spacing: -0.02em;
}

.footer__copy {
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--secondary);
}

.footer__links {
  display: flex;
  gap: 2rem;
}

.footer__link {
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--secondary);
  transition: color 0.2s ease;
}

.footer__link:hover {
  color: var(--primary);
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet and below */
@media (max-width: 768px) {
  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .nav__inner {
    padding: 0 1.25rem;
  }

  /* Hero card */
  .article-card--hero .article-card__title {
    font-size: 1.375rem;
  }

  .article-card--hero .article-card__thumb {
    aspect-ratio: 16 / 9;
  }

  .article-card--hero .article-card__summary {
    font-size: 0.875rem;
  }

  /* Standard card */
  .article-card {
    padding: 0 1.25rem;
  }

  .article-card__link {
    gap: 1rem;
    padding: 1rem 0;
  }

  .article-card__thumb {
    width: 3.5rem;
    height: 3.5rem;
  }

  .article-card__title {
    font-size: 0.9375rem;
  }

  .article-card__summary {
    display: none;
  }

  /* Article detail */
  .article-detail__hero {
    padding: 4rem 1.25rem 1.5rem;
  }

  .article-detail__title {
    font-size: 1.75rem;
    letter-spacing: -0.03em;
  }

  .article-detail__content {
    padding: 1.5rem 1.25rem 3rem;
    font-size: 1rem;
    line-height: 1.8;
  }

  .article-detail__content h2 {
    font-size: 1.3125rem;
  }

  .article-detail__content h3 {
    font-size: 1.0625rem;
  }

  .article-detail__content blockquote p {
    font-size: 0.9375rem;
  }

  .article-detail__tags {
    padding: 1.5rem 1.25rem 0;
  }

  /* Post nav */
  .post-nav {
    flex-direction: column;
    margin-left: 1.25rem;
    margin-right: 1.25rem;
  }

  .post-nav__prev {
    border-right: none;
    border-bottom: 1px solid var(--outline-variant);
  }

  .post-nav__next {
    text-align: left;
    align-items: flex-start;
  }

  /* Comments */
  .comments {
    padding: 2rem 1.25rem 3rem;
  }

  /* Footer */
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  /* Pagination */
  .pagination {
    padding: 3rem 1.25rem 4rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .article-card--hero .article-card__title {
    font-size: 1.5rem;
  }

  .article-detail__title {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .nav__brand {
    font-size: 1.05rem;
  }
}

/* Desktop — wider article images */
@media (min-width: 1024px) {
  .article-detail__content img,
  .article-detail__content figure {
    margin-left: -3rem;
    margin-right: -3rem;
    max-width: calc(100% + 6rem);
    width: calc(100% + 6rem);
  }

  .article-detail__content figure img {
    width: 100%;
  }
}


/* ==========================================================================
   TISTORY OVERRIDES
   ========================================================================== */

/* ==========================================================================
   LANDING PAGE (홈)
   ========================================================================== */
.landing {
  display: none;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 2rem;
}

/* -- Hero -- */
.landing__hero {
  padding: 6rem 0 4rem;
}

.landing__hero-inner {
  max-width: 40rem;
}

.landing__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--secondary);
  margin-bottom: 1.25rem;
}

.landing__title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--on-surface);
  margin-bottom: 1.5rem;
}

.landing__accent {
  color: var(--primary);
}

.landing__desc {
  font-size: 1.125rem;
  color: var(--on-surface-variant);
  line-height: 1.7;
  max-width: 28rem;
}

/* -- Profile -- */
.landing__profile {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 4rem;
  padding: 5rem 0;
  background-color: var(--surface-container-low);
  margin: 0 -2rem;
  padding-left: 3rem;
  padding-right: 3rem;
  border-radius: 1rem;
}

.landing__profile-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 0.75rem;
}

.landing__profile-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--on-surface);
  margin-bottom: 2rem;
}

.landing__profile-bio {
  color: var(--on-surface-variant);
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.landing__profile-bio p {
  margin-bottom: 1rem;
}

.landing__profile-bio p:last-child {
  margin-bottom: 0;
}

.landing__profile-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--outline-variant);
}

.landing__profile-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.landing__profile-col li {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--on-surface);
  margin-bottom: 0.3rem;
}

.landing__profile-col a {
  color: var(--primary);
  transition: opacity 0.2s ease;
}

.landing__profile-col a:hover {
  opacity: 0.7;
}

.landing__profile-role {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary);
}

/* -- CTA -- */
.landing__cta {
  padding: 5rem 0 6rem;
  text-align: center;
}

.landing__cta-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface);
  margin-bottom: 1.5rem;
}

.landing__cta-btn {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  background: var(--on-surface);
  color: var(--surface);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.landing__cta-btn:hover {
  box-shadow: var(--shadow-ambient);
  transform: translateY(-2px);
}

/* -- Responsive -- */
@media (max-width: 768px) {
  .landing {
    padding: 0 1.25rem;
  }

  .landing__hero {
    padding: 3rem 0 2rem;
  }

  .landing__title {
    font-size: 2.25rem;
  }

  .landing__profile {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem 1.5rem;
    margin: 0 -1.25rem;
  }

  .landing__profile-title {
    font-size: 1.5rem;
  }

  .landing__profile-meta {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .landing__cta {
    padding: 3rem 0 4rem;
  }

  .landing__cta-title {
    font-size: 1.35rem;
  }
}


/* ---- List vs Detail 전환 ---- */
.article-detail {
  display: none;
  pointer-events: none;
}

/* ---- Detail Sidebar (글 상세 좌측 사이드바) ---- */
.article-detail-wrapper {
  display: none;
}

.detail-sidebar {
  display: none;
}

@media (min-width: 1200px) {
  .article-detail-wrapper.is-visible {
    display: block;
  }

  .article-detail-wrapper.is-visible .article-detail {
    display: block;
    pointer-events: auto;
    max-width: 50rem;
    margin: 0 auto;
  }

  .detail-sidebar {
    display: block;
    position: fixed;
    left: 0;
    top: 3.5rem;
    width: 15rem;
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
    padding: 2rem 1rem;
    border-right: 1px solid var(--outline-variant);
    background: var(--surface);
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: var(--outline-variant) transparent;
  }

  .detail-sidebar::-webkit-scrollbar {
    width: 3px;
  }

  .detail-sidebar::-webkit-scrollbar-thumb {
    background: var(--outline-variant);
    border-radius: 3px;
  }
}

/* 1200px 미만에서는 사이드바 숨기고 기존 레이아웃 유지 */
@media (max-width: 1199px) {
  .article-detail-wrapper.is-visible {
    display: block;
  }

  .article-detail-wrapper.is-visible .article-detail {
    display: block;
    pointer-events: auto;
  }

  .detail-sidebar {
    display: none;
  }
}

.detail-sidebar__section {
  margin-bottom: 2rem;
}

.detail-sidebar__heading {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--secondary);
  margin-bottom: 0.75rem;
  margin-top: 0.75rem;
  padding: 0 0.5rem;
}

.detail-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.detail-sidebar__link {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--on-surface-variant);
  border-radius: 0.375rem;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.4;
}

.detail-sidebar__link:hover {
  background: var(--surface-container-low);
  color: var(--on-surface);
}

.detail-sidebar__link.is-active {
  background: var(--surface-container-high);
  color: var(--primary);
  font-weight: 600;
}

.detail-sidebar__link--sub {
  padding-left: 1.5rem;
  font-size: 0.775rem;
}

/* -- Sidebar Divider -- */
.detail-sidebar__divider {
  height: 1px;
  background: var(--outline-variant);
  margin: 0.25rem -1rem;
}

/* -- Sidebar Profile -- */
.detail-sidebar__profile {
  text-align: center;
  padding-bottom: 0.25rem;
}

.detail-sidebar__profile-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 0.625rem;
  border: 2px solid var(--outline-variant);
}

.detail-sidebar__profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-sidebar__profile-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 0.25rem;
}

.detail-sidebar__profile-desc {
  font-size: 0.725rem;
  color: var(--on-surface-variant);
  line-height: 1.5;
  margin-bottom: 0.625rem;
}

.detail-sidebar__profile-links {
  display: flex;
  justify-content: center;
  gap: 0.625rem;
}

.detail-sidebar__profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  color: var(--on-surface-variant);
  transition: all 0.15s ease;
}

.detail-sidebar__profile-link:hover {
  color: var(--primary);
  background: var(--surface-container-low);
}

/* -- Sidebar TOC -- */
.detail-sidebar__toc-section {
  display: none;
}

.detail-sidebar__toc-section.is-visible {
  display: block;
}
.detail-sidebar__toc {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--outline-variant);
  margin-left: 0.25rem;
}

.detail-sidebar__toc-link {
  display: block;
  position: relative;
  padding: 0.3rem 0 0.3rem 1rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--on-surface-variant);
  text-decoration: none;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.detail-sidebar__toc-link::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  border-radius: 1px;
  transition: background 0.2s ease;
}

.detail-sidebar__toc-link:hover {
  color: var(--on-surface);
}

.detail-sidebar__toc-link.is-active {
  color: var(--on-surface);
  font-weight: 600;
}

.detail-sidebar__toc-link.is-active::before {
  background: var(--on-surface);
}

.detail-sidebar__toc-link--sub {
  padding-left: 1.75rem;
  font-size: 0.75rem;
}

/* ---- 공유 버튼 ---- */
.article-share {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--outline-variant);
  max-width: 45rem;
  margin: 0 auto;
}

.article-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--on-surface-variant);
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.article-share__btn:hover {
  background: var(--surface-container-high);
  color: var(--on-surface);
}

/* ---- 코드 블록 복사 버튼 ---- */
.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--on-surface-variant);
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  border-radius: 0.25rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

pre:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  background: var(--surface-container-highest);
  color: var(--on-surface);
}

/* ---- 맨 위로 가기 버튼 ---- */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: 50%;
  color: var(--on-surface-variant);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  z-index: 90;
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--surface-container-high);
  color: var(--on-surface);
}

/* ---- 모바일 햄버거 메뉴 ---- */
.nav__hamburger {
  display: none;
}

.hamburger-close {
  display: none;
}

.nav__hamburger.is-open .hamburger-icon {
  display: none;
}

.nav__hamburger.is-open .hamburger-close {
  display: block;
}

@media (max-width: 768px) {
  .nav__hamburger {
    display: flex;
  }
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 3.5rem;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  z-index: 999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu__inner {
  padding: 1.5rem;
  max-width: 30rem;
}

.mobile-menu__section {
  margin-bottom: 2rem;
}

.mobile-menu__heading {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--secondary);
  margin-bottom: 0.75rem;
}

.mobile-menu__desc {
  font-size: 0.875rem;
  color: var(--on-surface-variant);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.mobile-menu__links {
  display: flex;
  gap: 0.75rem;
}

.mobile-menu__link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
}

.mobile-menu__item {
  display: block;
  padding: 0.6rem 0.5rem;
  font-size: 0.9rem;
  color: var(--on-surface);
  text-decoration: none;
  border-bottom: 1px solid var(--outline-variant);
  transition: color 0.15s ease;
}

.mobile-menu__item:hover {
  color: var(--primary);
}

.mobile-menu__item--sub {
  padding-left: 1.5rem;
  font-size: 0.85rem;
  color: var(--on-surface-variant);
}

/* ---- 읽기 진행률 바 ---- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--outline);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ---- 글자 크기 조절 ---- */
.font-size-control {
  display: inline-flex;
  gap: 0.25rem;
  margin-top: 1rem;
}

.font-size-control__btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--on-surface-variant);
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.font-size-control__btn:hover {
  background: var(--surface-container-high);
  color: var(--on-surface);
}

/* ---- 이미지 라이트박스 ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox.is-active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.lightbox.is-active .lightbox__img {
  transform: scale(1);
}

.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---- 관련 글 ---- */
.related-posts {
  max-width: 45rem;
  margin: 0 auto;
  padding: 2rem 2rem 0;
  border-top: 1px solid var(--outline-variant);
}

.related-posts__heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 1.25rem;
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 480px) {
  .related-posts__grid {
    grid-template-columns: 1fr;
  }
}

.related-posts__card {
  display: block;
  text-decoration: none;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--outline-variant);
  transition: all 0.2s ease;
  background: var(--surface-container-lowest);
}

.related-posts__card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.related-posts__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-container);
}

.related-posts__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-posts__card:hover .related-posts__thumb img {
  transform: scale(1.05);
}

.related-posts__title {
  padding: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--on-surface);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- 스켈레톤 로딩 ---- */
.skeleton-line {
  height: 0.8rem;
  background: var(--surface-container-high);
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line:nth-child(1) { width: 80%; }
.skeleton-line:nth-child(2) { width: 60%; }
.skeleton-line:nth-child(3) { width: 90%; }
.skeleton-line:nth-child(4) { width: 50%; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ---- Sidebar 숨김 (위젯 콘텐츠 누출 방지) ---- */
.sidebar-hidden {
  display: none;
}

/* ==========================================================================
   TISTORY 요소 재정의
   ========================================================================== */

/* ---- 불필요 요소 숨김 ---- */
#tistorySidebarContent,
.another_category,
.revenue_unit_wrap,
.tt-comment-area .tt-box-total,
.tt-comment-area .tt-box-account,
.tt_article_useless_p_margin br:only-child {
  display: none;
}

/* ---- 포스트 액션 버튼 (좋아요/공유 등) ---- */
.container_postbtn {
  max-width: 45rem;
  margin: 2rem auto 0;
  padding: 1.5rem 2rem;
  border: none;
  display: flex;
  gap: 0.5rem;
}

.container_postbtn .postbtn_like,
.container_postbtn .btn_post {
  border: 1px solid var(--outline-variant) !important;
  border-radius: 9999px !important;
  background: var(--surface-container-lowest) !important;
  color: var(--secondary) !important;
  font-family: inherit !important;
  font-size: 0.8rem !important;
  padding: 0.4rem 1rem !important;
  transition: all 0.2s ease;
}

.container_postbtn .postbtn_like:hover,
.container_postbtn .btn_post:hover {
  background: var(--surface-container-high) !important;
  color: var(--primary) !important;
}

/* ---- 구독 버튼 ---- */
.tt-comment-area .tt-box-subscription {
  max-width: 45rem;
  margin: 0 auto;
  padding: 0 2rem;
}

.tt-comment-area .tt-box-subscription .tt-btn-subscription {
  border: 1px solid var(--outline-variant) !important;
  border-radius: 9999px !important;
  background: var(--surface-container-lowest) !important;
  color: var(--on-surface) !important;
  font-family: inherit !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  padding: 0.5rem 1.25rem !important;
}

/* ---- 댓글 영역 (티스토리 기본) ---- */
.tt-comment-area {
  max-width: 45rem;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

.tt-comment-area .tt-area-write textarea {
  width: 100%;
  min-height: 5rem;
  padding: 1rem;
  border: 1px solid var(--outline-variant);
  border-radius: 0.75rem;
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.6;
  resize: vertical;
}

.tt-comment-area .tt-area-write textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.tt-comment-area .tt-area-write .tt-btn-register {
  background: var(--on-surface) !important;
  color: var(--surface) !important;
  border: none !important;
  border-radius: 0.5rem !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  padding: 0.5rem 1.25rem !important;
  cursor: pointer;
}

.tt-comment-area .tt-item-comment {
  padding: 1rem 0;
  border-bottom: 1px solid var(--outline-variant);
}

.tt-comment-area .tt-item-comment .tt-name-wrap {
  font-weight: 600;
  color: var(--on-surface);
}

.tt-comment-area .tt-item-comment .tt-date {
  font-size: 0.75rem;
  color: var(--outline);
}

.tt-comment-area .tt-item-comment .tt-desc {
  color: var(--on-surface-variant);
  line-height: 1.6;
}

/* ---- 카테고리 다른글 ---- */
.another_category {
  display: none !important;
}

/* ---- 보호글 폼 ---- */
.article-detail__content .protected_post {
  text-align: center;
  padding: 4rem 0;
}

.article-detail__content .protected_post input[type="password"] {
  padding: 0.75rem 1rem;
  border: 1px solid var(--outline-variant);
  border-radius: 0.75rem;
  background: var(--surface-container-lowest);
  color: var(--on-surface);
  font-family: inherit;
  font-size: 1rem;
  margin-right: 0.5rem;
}

.article-detail__content .protected_post input[type="submit"] {
  padding: 0.75rem 1.5rem;
  background: var(--on-surface);
  color: var(--surface);
  border: none;
  border-radius: 0.75rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ---- 본문 마진 보정 ---- */
.article-detail__content .tt_article_useless_p_margin p {
  margin-bottom: 0;
}

/* ---- 티스토리 이미지 (data-ke-type) ---- */
.article-detail__content figure[data-ke-type] {
  margin: 2rem 0;
  text-align: center;
}

.article-detail__content figure[data-ke-type] img {
  border-radius: 0.75rem;
  box-shadow: var(--shadow-ambient);
}

.article-detail__content figure[data-ke-type] figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--secondary);
}

/* ---- 티스토리 에디터 구분선 ---- */
.article-detail__content div[data-ke-type="horizontalRule"] {
  margin: 2.5rem 0;
}

.article-detail__content div[data-ke-type="horizontalRule"] hr {
  border: none;
  height: 1px;
  background: var(--outline-variant);
  opacity: 0.3;
}

/* ---- 관리자 바 호환 ---- */
body.tt-body-page .main {
  padding-top: 4rem;
}

/* ---- 선택 영역 색상 ---- */
::selection {
  background-color: rgba(0, 88, 188, 0.15);
  color: var(--on-surface);
}

/* ---- 스크롤바 (webkit) ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--outline);
}

/* ---- 이미지 로딩 placeholder ---- */
.article-card__thumb img,
.article-detail__content img {
  background-color: var(--surface-container);
}

/* ---- 링크 밑줄 애니메이션 (본문 내) ---- */
.article-detail__content a {
  text-decoration: none;
  background-image: linear-gradient(var(--primary), var(--primary));
  background-size: 0% 1px;
  background-position: left bottom;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.2s ease;
}

.article-detail__content a:hover {
  background-size: 100% 1px;
  opacity: 1;
}


/* ==========================================================================
   ABOUT PAGE (content pasted into Tistory page editor)
   ========================================================================== */
.about-page {
  max-width: 72rem;
  margin: 0 auto;
}

.about-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--secondary);
  margin-bottom: 1.5rem;
}

/* Hero */
.about-hero {
  padding: 2rem 0 3rem;
}

.about-hero__title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--on-surface);
  margin-bottom: 1.5rem;
}

.about-hero__accent {
  color: var(--primary);
}

.about-hero__desc {
  font-size: 1.1rem;
  color: var(--on-surface-variant);
  line-height: 1.7;
  max-width: 32rem;
}

.about-hero__image {
  margin: 2rem 0 4rem;
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 21 / 9;
}

.about-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter 0.8s ease, transform 0.8s ease;
}

.about-hero__image:hover img {
  filter: grayscale(0%);
  transform: scale(1.03);
}

/* Profile */
.about-profile {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  padding: 5rem 0;
  background-color: var(--surface-container-low);
  margin: 0 -2rem;
  padding-left: 2rem;
  padding-right: 2rem;
  border-radius: 1rem;
}

.about-profile__photo {
  position: sticky;
  top: 6rem;
  align-self: start;
}

.about-profile__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 0.75rem;
}

.about-profile__title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 2rem;
  color: var(--on-surface);
}

.about-profile__bio {
  color: var(--on-surface-variant);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.about-profile__bio p {
  margin-bottom: 1.5rem;
}

.about-profile__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--outline-variant);
}

.about-profile__grid ul {
  list-style: none;
  padding: 0;
}

.about-profile__grid li {
  font-weight: 500;
  color: var(--on-surface);
  margin-bottom: 0.5rem;
}

/* Philosophy */
.about-philosophy {
  padding: 6rem 0;
  text-align: center;
}

.about-philosophy__title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4rem;
  color: var(--on-surface);
}

.about-philosophy__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  text-align: center;
}

.about-card {
  padding: 2.5rem 1.5rem;
}

.about-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--on-surface);
}

.about-card p {
  font-size: 0.9375rem;
  color: var(--on-surface-variant);
  line-height: 1.7;
}

/* Quote */
.about-quote {
  padding: 4rem 0;
  margin: 2rem 0;
}

.about-quote blockquote {
  background-color: var(--surface-container-high);
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
}

.about-quote blockquote p {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--on-surface);
}

/* About responsive */
@media (max-width: 768px) {
  .about-hero__title {
    font-size: 2rem;
  }

  .about-profile {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-profile__photo {
    position: static;
  }

  .about-profile__title {
    font-size: 1.5rem;
  }

  .about-philosophy__cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .about-philosophy__title {
    font-size: 1.75rem;
  }

  .about-quote blockquote p {
    font-size: 1.2rem;
  }
}


/* ==========================================================================
   404 ERROR PAGE
   ========================================================================== */

/*
   Tistory 404 적용법:
   관리자 → 꾸미기 → 스킨 편집 → HTML에서
   skin.html의 <s_error> 블록 안에 404 HTML을 넣거나,
   별도 error 페이지가 지원되지 않는 경우
   404.html 내용을 관리자 → 꾸미기 → 에러페이지에 붙여넣기
*/

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.error-page__code {
  font-size: 12rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--surface-container-highest);
  user-select: none;
  margin-bottom: 1rem;
}

.error-page__title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface);
  margin-bottom: 1rem;
}

.error-page__desc {
  font-size: 1.125rem;
  color: var(--secondary);
  line-height: 1.6;
  max-width: 28rem;
  margin: 0 auto 3rem;
}

.error-page__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: var(--on-primary);
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-ambient);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.error-page__cta:hover {
  transform: scale(1.03);
}

.error-page__cta:active {
  transform: scale(0.97);
}

.error-page__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
}

.error-page__link {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--secondary);
  transition: color 0.2s ease;
}

.error-page__link:hover {
  color: var(--primary);
}

.error-page__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: var(--outline-variant);
}

/* Decorative blurred circles */
.error-page__bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.4;
}

.error-page__bg-circle--1 {
  width: 500px;
  height: 500px;
  top: -10%;
  right: -5%;
  background-color: var(--surface-container-low);
}

.error-page__bg-circle--2 {
  width: 400px;
  height: 400px;
  bottom: -10%;
  left: -5%;
  background-color: var(--primary);
  opacity: 0.08;
}

@media (max-width: 768px) {
  .error-page__code {
    font-size: 7rem;
  }

  .error-page__title {
    font-size: 1.75rem;
  }

  .error-page__desc {
    font-size: 1rem;
  }
}
