/*
 * Global styles for jinwoojeo.ng
 */

/* ── Theme custom properties ─────────────────────── */

:root {
  --bg: #fbfbfb;
  --text: oklch(10% 0 0);
  --text-muted: oklch(60% 0 0);
  --text-code-background: oklch(90% 0 0);
  --link: oklch(0.5 0.17 282.27);
  --border: oklch(87% 0 0);
  --border-muted: oklch(92.2% 0 0);
  --quote-bar: #a3a3a3;
}

.dark {
  --bg: oklch(18% 0 0);
  --text: oklch(90% 0 0);
  --text-muted: oklch(60% 0 0);
  --text-code-background: oklch(30% 0 0);
  --link: oklch(0.6 0.2 282.51);
  --border: oklch(43.9% 0 0);
  --border-muted: oklch(37.1% 0 0);
  --quote-bar: #d4d4d4;
}

/* ── Base ────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: "BareunBatang", serif;
  font-size: 13.4pt;
  line-height: 1.95;
  text-align: justify;
  font-weight: 300;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ── Typography ─────────────────────────────────── */

p {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

a {
  color: var(--link);
  text-decoration: none;
}

strong {
  font-weight: 500;
}

h1, h2, h3, h4 {
  border: 0 solid;
  padding: 0;
  scroll-margin-top: 30px;
}

h1 {
  margin-top: 2rem;
  margin-bottom: .6rem;
  font-size: 1.802rem;
  font-weight: 500;
  line-height: 1.5;
}

h2 {
  margin-top: 1.5rem;
  margin-bottom: .6rem;
  font-size: 1.602rem;
  font-weight: 500;
  line-height: 1.5;
}

h3 {
  margin-top: 1.6rem;
  margin-bottom: .6rem;
  font-size: 1.424em;
  font-weight: 500;
  line-height: 1.5;
}

h4 {
  margin-top: 1.5em;
  margin-bottom: .5em;
  font-size: 1.266rem;
  font-weight: 500;
  line-height: 1.5;
}

ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-inline-start: 1.625em;
  list-style-type: decimal;
}

ul {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-inline-start: 1.625em;
  list-style-type: disc;
}

ol > li::marker {
  color: var(--text-muted);
}

ul > li::marker {
  color: var(--border);
}

ol > li,
ul > li {
  padding-inline-start: .375em;
}

ul ul, ul ol, ol ul, ol ol {
  margin-top: .75em;
  margin-bottom: .75em;
}

dl { margin-top: 1.25em; margin-bottom: 1.25em; }
dt { margin-top: 1.25em; font-weight: 600; }
dd { margin-top: .5em; padding-inline-start: 1.625em; }

hr {
  border: none;
  border-top: 1px solid var(--border-muted);
  margin-top: 3em;
  margin-bottom: 3em;
}

blockquote {
  quotes: "\201C" "\201D" "\2018" "\2019";
  margin: 1.6rem 0;
  padding-inline-start: 1.2rem;
  font-style: italic;
}

blockquote p:first-of-type::before {
  content: open-quote;
}

blockquote p:last-of-type::after {
  content: close-quote;
}

img, picture {
  margin-top: 2em;
  margin-bottom: 2em;
}

picture {
  display: block;
}

picture > img {
  margin-top: 0;
  margin-bottom: 0;
}

video {
  margin-top: 2em;
  margin-bottom: 2em;
}

code {
  font-size: .8rem;
  background-color: var(--text-code-background);
  padding: 0.2rem;
  border-radius: 4px;
}

code::before,
code::after {
  content: "";
}

h3 code { font-size: .9em; }

pre {
  margin: 1rem 0;
  font-size: .8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

pre code {
  font-weight: inherit;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  background-color: transparent;
  border-width: 0;
  border-radius: 6px;
  padding: 0;
}

pre code::before,
pre code::after {
  content: none;
}

table {
  table-layout: auto;
  text-align: start;
  width: 100%;
  margin-top: 2em;
  margin-bottom: 2em;
  font-size: .875em;
  line-height: 1.71429;
}

thead {
  border-bottom-width: 1px;
  border-bottom-color: var(--border);
}

thead th {
  vertical-align: bottom;
  padding: 0 .571429em .571429em;
}

thead th:first-child { padding-inline-start: 0; }
thead th:last-child { padding-inline-end: 0; }

tbody tr {
  border-bottom-width: 1px;
  border-bottom-color: var(--border-muted);
}

tbody tr:last-child {
  border-bottom-width: 0;
}

tbody td,
tfoot td {
  vertical-align: baseline;
  padding: .571429em;
}

tbody td:first-child, tfoot td:first-child { padding-inline-start: 0; }
tbody td:last-child, tfoot td:last-child { padding-inline-end: 0; }

tfoot {
  border-top-width: 1px;
  border-top-color: var(--border);
}

figure { margin-top: 2em; margin-bottom: 2em; }
figure > * { margin-top: 0; margin-bottom: 0; }

figcaption {
  color: var(--text-muted);
  margin-top: .857143em;
  font-size: .875em;
  line-height: 1.42857;
}

hr + *,
h2 + *,
h3 + *,
h4 + * {
  margin-top: 0;
}


/* ── About page sections ─────────────────────────── */

.section {
  margin-top: 1.5rem;
}

.disc-list {
  list-style: disc inside;
}

/* ── Post preview (listing page) ─────────────────── */

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list a {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.post-item {
  margin-bottom: 1.5rem;
}

.post-item-title {
  font-weight: 500;
}

.post-item-meta {
  color: var(--text-muted);
}

.post-item-desc {
  color: var(--text-muted);
}

/* ── Single post page ────────────────────────────── */

.post-title {
  margin-top: 0;
  font-size: 2.027rem;
  font-weight: 700;
  line-height: 2.45rem;
}

.post-meta {
  color: var(--text-muted);
}

.post-spacer {
  margin: 1.5rem 0;
}

/* ── Post image ──────────────────────────────────── */

.post-image {
  display: block;
  max-width: 100%;
  margin: 1.5rem auto;
  border-radius: 0.375rem;
}

/* ── Footnotes ──────────────────────────────────── */

.footnotes {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  word-break: break-all;
}

.footnotes hr {
  border: none;
  border-top: 1px solid var(--border-muted);
  margin-bottom: 1em;
}

.footnotes ol {
  padding-inline-start: 1.5em;
}

.footnotes li {
  margin-bottom: 0.5em;
}

.footnotes li p {
  margin: 0;
  font-size: 0.9rem;
  display: inline;
}

.footnote-backref {
  color: inherit;
  text-decoration: none;
}

/* ── Giscus comments ─────────────────────────────── */

#comment-container {
  margin-top: 2rem;
}
