/* Minimal, text-first theme ------------------------------------------- */
:root {
  --fg: #242424;
  --muted: #767676;
  --accent: #3a6ea5;                    /* calm blue */
  --accent-soft: rgba(58, 110, 165, 0.12);
  --chip: rgba(20, 20, 20, 0.06);       /* button fill, distinct from grey text */
  --line: #e8e8e8;
  --bg: #fcfcfc;
  --maxw: 42rem;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
          "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e4e4e4; --muted: #8a8a8a; --accent: #7aa7e0;
    --accent-soft: rgba(122, 167, 224, 0.16);
    --chip: rgba(255, 255, 255, 0.08);
    --line: #2a2a2a; --bg: #151515;
  }
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0; color: var(--fg); background: var(--bg);
  font-family: var(--sans); line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header, .site-main, .site-footer {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem;
}
.site-header { padding-top: 2.75rem; padding-bottom: 1rem; }
.site-title {
  display: inline-block;
  font-family: "Gaegu", var(--sans);          /* handwriting, matches the bubble */
  font-size: 2.15rem; font-weight: 700; line-height: 1.05; color: var(--fg);
  letter-spacing: 0;
  padding: 0 1.4rem 0.1rem 0;                  /* rule extends a touch past the text */
  border-bottom: 2px solid var(--line);        /* thin notebook-style rule */
}
.site-title:hover { text-decoration: none; }
.site-subtitle { color: var(--muted); margin: 0.15rem 0 0.7rem; font-size: 0.92rem; font-style: italic; }
.site-nav { margin-top: 0.4rem; }
.site-nav a {
  color: var(--fg); font-size: 0.82rem; font-weight: 600; margin-right: 1.25rem;
  letter-spacing: 0.01em;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }

.site-main { padding-top: 1.5rem; padding-bottom: 4rem; min-height: 50vh; }
.site-footer {
  border-top: 1px solid var(--line); padding-top: 1.25rem; padding-bottom: 2.5rem;
  color: var(--muted); font-size: 0.85rem;
}

/* Language filter ----------------------------------------------------- */
.lang-filter { display: flex; gap: 0.4rem; margin: 0 0 1.5rem; flex-wrap: wrap; }
.lang-btn {
  font: inherit; font-size: 0.8rem; cursor: pointer;
  background: var(--chip); color: var(--fg);
  border: 1px solid transparent; border-radius: 999px; padding: 0.18rem 0.75rem;
  transition: background 0.12s ease, color 0.12s ease;
}
.lang-btn:hover { color: var(--accent); }
/* Active = filled accent pill: unmistakably selected, distinct from grey text */
.lang-btn.is-active { color: #fff; background: var(--accent); border-color: transparent; }

/* "Lately" speech balloon (pops up above the 60notes title) ------------ */
.lately-bubble {
  display: inline-flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap;
  position: relative; max-width: 100%;
  margin: 0 0 0.7rem; padding: 0.5rem 0.95rem;
  background: var(--accent-soft); border-radius: 16px;
  font-family: "Gaegu", var(--sans);
  line-height: 1.3;
}
/* little tail pointing down toward the title */
.lately-bubble::after {
  content: ""; position: absolute; bottom: -9px; left: 24px;
  border: 9px solid transparent; border-bottom: 0;
  border-top-color: var(--accent-soft);
}
.lately-bubble .lately-label { color: var(--accent); font-size: 1rem; font-weight: 700; }
.lately-bubble .lately-text { color: var(--fg); font-size: 1.1rem; }
.lately-bubble .lately-date { color: var(--muted); font-size: 0.8rem; font-family: var(--sans); }
.lately-bubble a { color: var(--accent); text-decoration: underline; }

/* Featured / pinned posts (one-line rows, subtly highlighted) ---------- */
.post-item.featured {
  background: var(--accent-soft); border-bottom-color: transparent;
  border-radius: 6px; padding-left: 0.5rem; padding-right: 0.5rem;
}
.featured-badge { color: var(--accent); font-size: 0.9rem; flex: 0 0 auto; line-height: 1; }
.post-item.featured .post-link { font-weight: 600; }

/* Post list ----------------------------------------------------------- */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-item {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.post-item time { color: var(--muted); font-family: var(--mono); font-size: 0.8rem; flex: 0 0 5.5rem; }
.post-link { font-weight: 500; }
.post-lang {
  font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 0.3rem;
}
.post-tags { font-size: 0.8rem; }
.post-tags a { color: var(--muted); margin-right: 0.4rem; }
.post-item.empty { color: var(--muted); border: 0; }

.pagination { display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.5rem; color: var(--muted); font-size: 0.9rem; }

/* Article ------------------------------------------------------------- */
.list-title { font-size: 1.4rem; margin: 0 0 1.2rem; }
.post-header h1 { font-size: 1.9rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.post-meta { color: var(--muted); font-size: 0.85rem; display: flex; gap: 0.6rem; align-items: center; }
.post-meta time { font-family: var(--mono); }
.post-translations { font-size: 0.85rem; color: var(--muted); }
.post-translations a { margin-left: 0.4rem; text-transform: uppercase; font-family: var(--mono); font-size: 0.75rem; }
.post-body { margin-top: 1.6rem; font-size: 1.05rem; }
.post-body h2 { margin-top: 2rem; font-size: 1.3rem; }
.post-body h3 { margin-top: 1.6rem; font-size: 1.1rem; }
.post-body img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: 1.4rem auto; }
.post-body figure { margin: 1.6rem 0; }
.post-body figcaption { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 0.4rem; }
.post-body blockquote {
  border-left: 3px solid var(--line); margin: 1.4rem 0; padding: 0.2rem 1rem; color: var(--muted);
}
.post-body pre {
  background: rgba(127,127,127,0.1); padding: 0.9rem 1rem; border-radius: 6px;
  overflow-x: auto; font-family: var(--mono); font-size: 0.85rem;
}
.post-body code { font-family: var(--mono); font-size: 0.88em; }
.post-body :not(pre) > code { background: rgba(127,127,127,0.14); padding: 0.05em 0.35em; border-radius: 3px; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
/* Responsive video embeds (wrap iframes in <div class="video">) */
.video { position: relative; padding-bottom: 56.25%; height: 0; margin: 1.6rem 0; }
.video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }

/* Tags page ----------------------------------------------------------- */
.tag-cloud { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.tag-cloud .count { color: var(--muted); font-size: 0.8rem; }

/* Search -------------------------------------------------------------- */
.search-box {
  width: 100%; font: inherit; padding: 0.6rem 0.8rem; margin-bottom: 1rem;
  border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--fg);
}

/* Comments ------------------------------------------------------------ */
.comments { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.5rem; }
.comments h2 { font-size: 1.2rem; }
.comment-list { margin: 1rem 0 2rem; }
.comment { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.comment .who { font-weight: 600; font-size: 0.92rem; }
.comment .when { color: var(--muted); font-family: var(--mono); font-size: 0.75rem; margin-left: 0.5rem; }
.comment .what { margin: 0.3rem 0 0; white-space: pre-wrap; }
.comment-form { display: flex; flex-direction: column; gap: 0.6rem; max-width: 32rem; }
.comment-form input, .comment-form textarea {
  font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line);
  border-radius: 6px; background: transparent; color: var(--fg); resize: vertical;
}
.comment-form .hp { position: absolute; left: -9999px; }
.comment-form button {
  align-self: flex-start; font: inherit; cursor: pointer; color: #fff; background: var(--accent);
  border: 0; border-radius: 6px; padding: 0.5rem 1.1rem;
}
.comment-form button:disabled { opacity: 0.5; cursor: default; }
.form-status { font-size: 0.85rem; color: var(--muted); margin: 0; }
.muted { color: var(--muted); }
