/* moe-blog.css: essay pages for moe.st, generated by scripts/build-blog.py.
   Palette, borders and radii follow assets/desktop/styles.css. */

:root {
  /* palette (:root in styles.css) */
  --text: #edf1e8;
  --body: #dcebd1;            /* .terminal-body */
  --muted: #9da796;
  --line: #333a31;
  --hairline: #20271d;        /* .rofi-row */
  --accent: #a7d46f;
  --ink: #10110f;             /* text on accent */
  --term: #090b09;            /* .window-content */
  --chip: #1c201a;            /* .status-pill */
  --glass: rgba(20, 23, 19, 0.82);   /* .rofi-panel */
  --veil: linear-gradient(rgba(16, 17, 15, 0.58), rgba(16, 17, 15, 0.86)); /* .wm-shell */

  /* type: 15px base, 1.25 scale */
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --step--1: 0.8rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.563rem;
  --leading: 1.75;
  --rhythm: calc(var(--leading) * 1rem);

  /* spacing / shape (styles.css uses 4, 8, 12, 18px and 4/6px radii) */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1.125rem;
  --radius: 4px;
  --measure: 860px;
  --gutter: max(var(--s4), calc((100vw - var(--measure)) / 2));
  color-scheme: dark;
}

html { font-size: 15px; background: var(--term); }

body {
  margin: 0;
  color: var(--body);
  font: var(--step-0) / var(--leading) var(--mono);
  background: var(--veil), url("https://cdn.jsdelivr.net/gh/sakurakouji-luna/pic@main/blog/blog_wallpaper_1.png") center / cover fixed;
  background: var(--veil), image-set(
    url("/assets/desktop/wallpaper/blog_wallpaper_1.avif") type("image/avif"),
    url("/assets/desktop/wallpaper/blog_wallpaper_1.webp") type("image/webp"),
    url("https://cdn.jsdelivr.net/gh/sakurakouji-luna/pic@main/blog/blog_wallpaper_1.png") type("image/png")
  ) center / cover fixed;
}

::selection { color: var(--ink); background: var(--accent); }

/* full-bleed glass; the text column is centred by the gutter */
.moe-post {
  box-sizing: border-box;
  min-height: 100vh;
  padding: calc(var(--rhythm) * 1.5) var(--gutter) calc(var(--rhythm) * 3);
  background: var(--glass);
  backdrop-filter: blur(8px);
  overflow-wrap: anywhere;
}

/* vertical rhythm: one line of space between blocks */
.moe-post > * { margin: 0 0 var(--rhythm); }

/* header */
.crumbs, .post-meta, .post-foot, figcaption { color: var(--muted); font-size: var(--step--1); }
.crumbs { margin-bottom: var(--s1); }
.moe-post h1 {
  margin-bottom: var(--s1);
  color: var(--accent);
  font-size: var(--step-2);
  line-height: 1.3;
}
.moe-post .post-subtitle {
  margin-top: 0;
  margin-bottom: var(--s2);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 400;
  line-height: 1.5;
}
.post-meta {
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
}
.sep { margin: 0 var(--s2); color: var(--line); }

/* headings: size, weight and space only */
.moe-post h2, .moe-post h3, .moe-post h4 { color: var(--text); line-height: 1.4; }
.moe-post h2 { margin-top: calc(var(--rhythm) * 2); font-size: var(--step-1); }
.moe-post h3 { margin-top: calc(var(--rhythm) * 1.5); font-size: var(--step-0); }
.moe-post h4 { font-size: var(--step-0); font-weight: 400; color: var(--muted); }

/* inline */
.moe-post strong { color: var(--text); }
.moe-post a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-color: rgba(167, 212, 111, 0.4); }
.moe-post a:hover { text-decoration-color: currentColor; }
.moe-post .crumbs a { color: inherit; text-decoration: none; }
.moe-post .crumbs a:hover { color: var(--accent); }
:not(pre) > code {
  padding: 0 var(--s1);
  border-radius: var(--radius);
  background: var(--chip);
  font-size: 0.93em;
}

/* lists */
.moe-post ul, .moe-post ol { padding-left: var(--s4); }
.moe-post li::marker { color: var(--muted); }
.moe-post li > ul, .moe-post li > ol { margin: 0; }

/* blockquote, rule, image */
.moe-post blockquote {
  padding-left: var(--s3);
  border-left: 2px solid var(--line);
  color: var(--muted);
}
.moe-post blockquote > :last-child { margin-bottom: 0; }
.moe-post hr { border: 0; border-top: 1px solid var(--line); }
.moe-post img { display: block; max-width: 100%; border-radius: var(--radius); }

/* code: plain terminal panel with a small language label */
.code-window {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--term);
  overflow: hidden;
}
figcaption { padding: var(--s1) var(--s3); border-bottom: 1px solid var(--hairline); }
.code-window pre {
  margin: 0;
  padding: var(--s3);
  overflow-x: auto;
  font-size: var(--step--1);
  line-height: 1.6;
}
.code-window .highlight { background: none; }

/* table: hairline rows */
.moe-post table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.moe-post th { color: var(--muted); font-weight: 400; text-align: left; border-bottom: 1px solid var(--line); }
.moe-post th, .moe-post td { padding: var(--s2) var(--s3); }
.moe-post td { border-bottom: 1px solid var(--hairline); }

/* essay list: hairline-separated entries */
.moe-post .post-list { list-style: none; padding: 0; }
.post-list li { border-bottom: 1px solid var(--hairline); }
.post-card { display: block; padding: var(--s4) 0; text-decoration: none; }
.post-card-title { display: block; font-weight: 700; font-size: var(--step-1); line-height: 1.4; }
.post-card-subtitle { display: block; color: var(--muted); font-size: var(--step--1); font-weight: 400; line-height: 1.4; }
.post-card:hover .post-card-title { text-decoration: underline; text-underline-offset: 0.2em; }
.post-card-meta { display: block; color: var(--muted); font-size: var(--step--1); }
.post-card-desc { display: block; margin-top: var(--s1); color: var(--body); }
.post-empty { color: var(--muted); }

.post-foot { margin-top: calc(var(--rhythm) * 2); padding-top: var(--s4); border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  html { font-size: 14px; }
}
