/* ── POST LAYOUT ── */
.post-layout {
  position: relative;
}

/* ── TOC ── */
.toc-panel {
  position: fixed;
  top: 44px;
  left: 0;
  width: 220px;
  padding: 32px 24px 48px 40px;
  max-height: calc(100vh - 44px);
  overflow-y: auto;
}

/* ── CONTENT COLUMN (article + related, centered) ── */
.post-content-col {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

.toc-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #aaa;
  margin-bottom: 14px;
}

.toc-list {
  list-style: none;
}

.toc-item {
  margin-bottom: 2px;
}

.toc-h2 { padding-left: 10px; }
.toc-h3 { padding-left: 20px; }

.toc-link {
  display: block;
  font-size: 11px;
  color: #999;
  line-height: 1.5;
  padding: 3px 0;
  text-decoration: none;
  transition: color 0.15s;
  white-space: normal;
  cursor: pointer;
}

.toc-link:hover,
.toc-link.active {
  color: #000;
}

/* ── POST PAGE ── */
.post-page {
  padding: 56px 0 48px;
}

.post-loading,
.post-error {
  font-size: 12px;
  color: #aaa;
  padding: 60px 28px;
  text-align: center;
}

/* ── HEADER ── */
.post-cover {
  width: 100%;
  display: block;
  margin-bottom: 36px;
}

.post-meta-top {
  display: flex;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 12px;
}

.post-category {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
}

.post-date-label {
  font-size: 10px;
  color: #aaa;
}

.post-title {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 40px;
}

/* ── BODY ── */
.post-body p {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
  color: #111;
}

.post-body .ph1 {
  font-size: 20px;
  font-weight: 500;
  margin: 36px 0 12px;
  scroll-margin-top: 72px;
}

.post-body .ph2 {
  font-size: 16px;
  font-weight: 500;
  margin: 28px 0 10px;
  scroll-margin-top: 72px;
}

.post-body .ph3 {
  font-size: 14px;
  font-weight: 500;
  margin: 22px 0 8px;
  scroll-margin-top: 72px;
}

.post-body ul,
.post-body ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.post-body li {
  font-size: 14px;
  line-height: 1.8;
  color: #111;
  margin-bottom: 4px;
}

.post-body blockquote {
  border-left: 2px solid #000;
  padding-left: 18px;
  margin: 28px 0;
  font-style: italic;
  color: #333;
}

.post-body hr {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 36px 0;
}

.post-body figure {
  margin: 28px 0;
}

.post-body figure img,
.post-body figure video {
  width: 100%;
  display: block;
}

.post-body figcaption {
  font-size: 11px;
  color: #888;
  margin-top: 8px;
}

.post-body code {
  font-family: monospace;
  font-size: 12px;
  background: #f4f4f4;
  padding: 1px 5px;
}

.post-video {
  width: 100%;
  margin: 28px 0;
  aspect-ratio: 16 / 9;
}

.post-video iframe,
.post-video video {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── LIGHTBOX ── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

#lightbox.open {
  display: flex;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.zoomable {
  cursor: zoom-in;
  user-select: none;
}

.post-bookmark {
  display: block;
  font-size: 11px;
  color: #555;
  word-break: break-all;
  padding: 12px;
  border: 1px solid #e8e8e8;
  margin: 16px 0;
  text-decoration: none;
}

.post-bookmark:hover {
  border-color: #000;
}

/* ── COPYRIGHT ── */
.post-copyright {
  padding: 24px;
  font-size: 11px;
  color: #aaa;
  max-width: 780px;
  margin: 0 auto;
}

/* ── RELATED ── */
.related-section {
  padding: 0 0 60px;
  border-top: 1px solid #e8e8e8;
}

.related-header {
  margin-bottom: 24px;
}

.related-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.related-card a {
  display: block;
  text-decoration: none;
  color: #000;
}

.related-card .card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  margin-bottom: 10px;
}

.related-card .card-title {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 6px;
}

.related-card .card-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
}

.related-card a:hover .card-title {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .toc-panel {
    display: none !important;
  }

  .post-copyright {
    padding: 24px 16px;
  }

  .post-content-col {
    padding: 0 16px;
  }

  .post-title {
    font-size: 20px;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Notion column layout */
.notion-columns {
  display: flex;
  gap: 16px;
  width: 100%;
}

.notion-column {
  flex: 1;
  min-width: 0;
}

.notion-column figure {
  margin: 0;
}

.notion-column figure img,
.notion-column figure video {
  width: 100%;
  height: auto;
  object-fit: cover;
}

@media (max-width: 480px) {
  .notion-columns {
    flex-direction: column;
  }
}

