/*
 * Public-side article styling for posts authored with the Notion (BlockNote) editor.
 * Targets the standard HTML output of @blocknote/core blocksToHTMLLossy:
 *   <h1>/<h2>/<h3>, <p>, <ul>/<ol>/<li>, <blockquote>, <pre><code>, <code>,
 *   <strong>/<em>/<u>/<s>, <a>, <img>, <hr>
 *
 * Scoped under [data-type="post_content"] so it only applies to the post body
 * and never leaks into other pages.
 */

[data-type="post_content"] {
  font-family: 'Pretendard Variable', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a2e;
  font-size: 17px;
  line-height: 1.85;
  word-break: keep-all;
}

/* Headings */
[data-type="post_content"] h1,
[data-type="post_content"] h2,
[data-type="post_content"] h3 {
  font-weight: 700;
  line-height: 1.35;
  color: #1a1a2e;
  word-break: keep-all;
}

[data-type="post_content"] h1 {
  font-size: 32px;
  margin: 1.6em 0 0.6em;
}

[data-type="post_content"] h2 {
  font-size: 26px;
  margin: 1.4em 0 0.5em;
}

[data-type="post_content"] h3 {
  font-size: 21px;
  margin: 1.2em 0 0.4em;
}

[data-type="post_content"] h1:first-child,
[data-type="post_content"] h2:first-child,
[data-type="post_content"] h3:first-child {
  margin-top: 0;
}

/* Paragraph */
[data-type="post_content"] p {
  font-size: 17px;
  line-height: 1.85;
  margin: 0 0 1em;
}

[data-type="post_content"] p:last-child:empty {
  display: none;
}

/* Lists */
[data-type="post_content"] ul,
[data-type="post_content"] ol {
  padding-left: 1.6em;
  margin: 0.8em 0 1.2em;
  line-height: 1.85;
}

[data-type="post_content"] ul { list-style: disc; }
[data-type="post_content"] ol { list-style: decimal; }

[data-type="post_content"] li { margin: 0.3em 0; }

[data-type="post_content"] ul ul,
[data-type="post_content"] ol ol,
[data-type="post_content"] ul ol,
[data-type="post_content"] ol ul {
  margin: 0.3em 0;
}

/* Blockquote */
[data-type="post_content"] blockquote {
  border-left: 3px solid #2AC1BC;
  padding: 8px 18px;
  background: #f6fafa;
  color: #444;
  margin: 1.2em 0;
  font-style: normal;
}

[data-type="post_content"] blockquote p {
  margin: 0.3em 0;
}

/* Code block */
[data-type="post_content"] pre {
  background: #1a1a2e;
  color: #f5f5f5;
  padding: 18px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.65;
  margin: 1.2em 0;
  white-space: pre;
}

[data-type="post_content"] pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
}

/* Inline code */
[data-type="post_content"] code {
  background: #f3f4f6;
  color: #1a1a2e;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

/* Inline marks */
[data-type="post_content"] strong { font-weight: 700; color: inherit; }
[data-type="post_content"] em     { font-style: italic; }
[data-type="post_content"] u      { text-decoration: underline; }
[data-type="post_content"] s      { text-decoration: line-through; color: #888; }

/* Link */
[data-type="post_content"] a {
  color: #2AC1BC;
  text-decoration: underline;
  text-underline-offset: 3px;
}

[data-type="post_content"] a:hover {
  color: #1fa8a3;
}

/* Image */
[data-type="post_content"] img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 1.2em auto;
}

/* Horizontal rule */
[data-type="post_content"] hr {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 2em 0;
}

/* Tables (BlockNote supports tables) */
[data-type="post_content"] table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 15px;
}

[data-type="post_content"] th,
[data-type="post_content"] td {
  border: 1px solid #e5e5e5;
  padding: 10px 14px;
  text-align: left;
}

[data-type="post_content"] th {
  background: #fafafa;
  font-weight: 600;
}

/* Mobile */
@media (max-width: 768px) {
  [data-type="post_content"] { font-size: 16px; line-height: 1.8; }
  [data-type="post_content"] h1 { font-size: 26px; }
  [data-type="post_content"] h2 { font-size: 22px; }
  [data-type="post_content"] h3 { font-size: 19px; }
  [data-type="post_content"] pre { font-size: 13px; padding: 14px 16px; }
}
