/* Imported Tistory/Velog post content */
.post-content img { max-width: 100%; height: auto; }
.post-content figure { max-width: 100%; margin-left: 0; margin-right: 0; }
.post-content iframe { max-width: 100%; }
.post-content table { display: table; width: 100%; max-width: 100%; }
.post-content th, .post-content td { word-break: keep-all; overflow-wrap: anywhere; }
.post-content .math, .post-content mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; }

:root {
  --syntax-comment: #6b7280;
  --syntax-keyword: #a626a4;
  --syntax-string: #2f7d45;
  --syntax-number: #b45309;
  --syntax-title: #3d55d9;
  --syntax-type: #946200;
  --syntax-variable: #c0365a;
}
:root[data-theme="dark"] {
  --syntax-comment: #98a0b0;
  --syntax-keyword: #d8a0f0;
  --syntax-string: #9fd89b;
  --syntax-number: #f5bd7a;
  --syntax-title: #9fb1ff;
  --syntax-type: #edd28f;
  --syntax-variable: #fb93ad;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --syntax-comment: #98a0b0;
    --syntax-keyword: #d8a0f0;
    --syntax-string: #9fd89b;
    --syntax-number: #f5bd7a;
    --syntax-title: #9fb1ff;
    --syntax-type: #edd28f;
    --syntax-variable: #fb93ad;
  }
}
.post-content pre code.hljs { background: transparent; padding: 0; }

/* Tistory link previews */
.post-content figure[data-ke-type="opengraph"] {
  margin: 1.5em 0;
}
.post-content figure[data-ke-type="opengraph"] > a {
  display: flex;
  min-height: 140px;
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}
.post-content figure[data-ke-type="opengraph"] > a:hover,
.post-content figure[data-ke-type="opengraph"] > a:focus-visible {
  border-color: var(--accent);
}
.post-content figure[data-ke-type="opengraph"] .og-image {
  flex: 0 0 160px;
  background: center / cover no-repeat;
}
.post-content figure[data-ke-type="opengraph"] .og-text {
  min-width: 0;
  padding: 16px 18px;
}
.post-content figure[data-ke-type="opengraph"] .og-text p {
  margin: 0;
  overflow-wrap: anywhere;
}
.post-content figure[data-ke-type="opengraph"] .og-title {
  font-weight: 600;
}
.post-content figure[data-ke-type="opengraph"] .og-text .og-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-content figure[data-ke-type="opengraph"] .og-text .og-host {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85em;
}
@media (max-width: 480px) {
  .post-content figure[data-ke-type="opengraph"] .og-image { flex-basis: 96px; }
  .post-content figure[data-ke-type="opengraph"] .og-text { padding: 12px; }
}

/* Syntax highlighting */
.hljs-comment, .hljs-quote { color: var(--syntax-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag { color: var(--syntax-keyword); }
.hljs-string, .hljs-regexp, .hljs-attr { color: var(--syntax-string); }
.hljs-number, .hljs-symbol, .hljs-bullet { color: var(--syntax-number); }
.hljs-title, .hljs-title.function_, .hljs-section { color: var(--syntax-title); }
.hljs-built_in, .hljs-type, .hljs-class .hljs-title { color: var(--syntax-type); }
.hljs-variable, .hljs-template-variable, .hljs-params { color: var(--syntax-variable); }
.hljs-meta { color: var(--syntax-comment); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Notion page embed */
.post-content .notion-embed { margin: 1.6em 0; }
.notion-embed__frame {
  display: block;
  width: 100%;
  height: 640px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.post-content .notion-embed__card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.post-content .notion-embed__card:hover { border-color: var(--accent); transform: translateY(-2px); }
.notion-embed__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}
.notion-embed__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notion-embed__title { font-size: 17px; font-weight: 800; }
.notion-embed__desc { color: var(--muted); font-size: 14px; line-height: 1.55; }
.notion-embed__host { margin-top: 4px; color: var(--accent); font-size: 13px; font-weight: 700; }
@media (max-width: 600px) { .notion-embed__frame { height: 480px; } }

/* Wide tables and code blocks scroll inside the post column */
.post-content .table-scroll { max-width: 100%; margin: 1.4em 0; overflow-x: auto; }
.post-content .table-scroll > table { margin: 0; }
.post-content pre { max-width: 100%; overflow-x: auto; }
.post-content a { overflow-wrap: anywhere; }

/* Side-by-side figures in posts */
.post-content .figure-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 1.5em 0; }
.post-content .figure-row figure { margin: 0; }
.post-content figure img { display: block; margin: 0 auto; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 600px) { .post-content .figure-row { grid-template-columns: minmax(0, 1fr); } }
.post-content figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; }
