/* ==========================================================================
   Blog article stylesheet - layered on top of css/style.css
   Keeps the vintage Windows chrome (tokens, bevels, window parts) and adds
   readable long-form typography for blog posts.
   ========================================================================== */

/* ---------- page & window ---------- */
html,
body {
  height: auto;
  min-height: 100%;
}

/* the main page locks body scroll (its .desktop container scrolls instead);
   the blog page must scroll normally */
html[data-layout="pc"] body {
  overflow: auto;
}

body {
  background: var(--win-teal) url("../assets/img/background.png") repeat;
  background-size: 32px 32px;
  padding: 16px 10px calc(16px + var(--taskbar-h));
}

.blog-window {
  width: min(920px, 100%);
  margin: 0 auto;
}

.blog-window .window-body {
  padding: 14px 18px 18px;
}

/* menu bar back button */
.menu-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel), serif;
  font-size: 13px;
  padding: 2px 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
}
.menu-back:hover {
  border-style: solid;
  border-color: var(--win-light) var(--win-dark) var(--win-dark) var(--win-light);
}

/* ---------- article typography ---------- */
.article {
  max-width: 76ch;
  margin: 0 auto;
  font-size: 14px;
}

.article > h1 {
  font-family: var(--font-pixel), serif;
  font-size: 22px;
  line-height: 1.35;
  margin: 4px 0 10px;
}

.article h2 {
  font-family: var(--font-pixel), serif;
  font-size: 17px;
  margin: 26px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--win-dark);
  scroll-margin-top: 12px;
}

.article h3 {
  font-family: var(--font-pixel), serif;
  font-size: 15px;
  margin: 20px 0 8px;
  scroll-margin-top: 12px;
}

.article p {
  margin: 0 0 10px;
  line-height: 1.7;
}

.article ul,
.article ol {
  margin: 0 0 10px;
  padding-left: 26px;
  line-height: 1.7;
}

.article li {
  margin-bottom: 4px;
}

.article .subtitle {
  font-size: 14px;
  color: var(--muted-text);
  margin-bottom: 14px;
}

.article strong {
  font-weight: bold;
}

.article hr {
  border: none;
  margin: 20px 0;
  box-shadow:
    inset 0 1px 0 var(--win-dark),
    inset 0 -1px 0 var(--win-white);
  height: 2px;
}

.article a {
  overflow-wrap: anywhere;
}

/* inline code */
.article code {
  font-family: "Courier New", monospace;
  font-size: 13px;
  background: var(--marquee-bg);
  border: 1px solid var(--win-dark);
  padding: 0 3px;
  white-space: nowrap;
}

/* fenced code blocks */
.article pre {
  background: var(--marquee-bg);
  box-shadow:
    inset 1px 1px 0 var(--win-darker),
    inset -1px -1px 0 var(--win-light),
    inset 2px 2px 0 var(--win-dark),
    inset -2px -2px 0 var(--win-white);
  padding: 10px 12px;
  margin: 0 0 12px;
  overflow-x: auto;
}
.article pre code {
  background: none;
  border: none;
  padding: 0;
  white-space: pre;
}

/* blockquotes */
.article blockquote {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 4px solid var(--win-navy);
  background: var(--marquee-bg);
  box-shadow:
    inset 1px 1px 0 var(--win-dark),
    inset -1px -1px 0 var(--win-light);
  line-height: 1.7;
}
.article blockquote p {
  margin: 0;
}

/* ---------- figures ---------- */
.article figure {
  margin: 14px 0 16px;
}

.article figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  image-rendering: auto;
  background: #ffffff;
  border: 1px solid var(--win-dark);
  box-shadow:
    inset 1px 1px 0 var(--win-darker),
    inset -1px -1px 0 var(--win-light);
  padding: 4px;
}

.article figcaption {
  font-size: 12px;
  color: var(--muted-text);
  line-height: 1.55;
  margin-top: 6px;
  max-width: 76ch;
}

/* ---------- tables ---------- */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 6px;
  box-shadow:
    inset 1px 1px 0 var(--win-darker),
    inset -1px -1px 0 var(--win-light),
    inset 2px 2px 0 var(--win-dark),
    inset -2px -2px 0 var(--win-white);
  background: var(--marquee-bg);
}

.article table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
  line-height: 1.5;
}

.article th,
.article td {
  border: 1px solid var(--win-dark);
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
}

.article th {
  font-family: var(--font-pixel), serif;
  font-weight: bold;
  background: var(--win-light);
  white-space: nowrap;
}

.article tbody tr:nth-child(even) td {
  background: rgba(128, 128, 128, 0.08);
}

/* numeric columns keep numbers intact on one line */
.article td {
  overflow-wrap: break-word;
}

/* caption paragraph directly under a table */
.table-note {
  font-size: 12px;
  color: var(--muted-text);
  line-height: 1.55;
  margin-bottom: 16px;
}

/* ---------- mobile ---------- */
html[data-layout="mobile"] body {
  padding: 8px 4px calc(8px + var(--taskbar-h));
}

html[data-layout="mobile"] .blog-window .window-body {
  padding: 12px;
}

html[data-layout="mobile"] .article > h1 {
  font-size: 19px;
}

html[data-layout="mobile"] .menu-back {
  font-size: 12px;
}
