/* Decent Site — modern default theme (plain HTML, minimal JS) */
:root {
  color-scheme: light;
  --bg0: #faf6ef;
  --bg1: #f0e8d8;
  --surface: rgba(255, 252, 245, 0.88);
  --surface-solid: #fffdf8;
  --ink: #1c1917;
  --muted: #6b5e4f;
  --faint: #a89880;
  --accent: #b45309;
  --accent-deep: #9a3412;
  --accent-soft: rgba(180, 83, 9, 0.12);
  --border: rgba(28, 25, 23, 0.1);
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 12px 32px rgba(28, 25, 23, 0.07);
  --radius: 16px;
  --radius-sm: 12px;
  --content: 44rem;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Georgia", serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.65;
  background:
    radial-gradient(1100px 560px at 8% -8%, rgba(180, 83, 9, 0.10), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(120, 53, 15, 0.06), transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-attachment: fixed;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent); }

.wrap {
  width: min(calc(100% - 2rem), calc(var(--content) + 4rem));
  margin: 0 auto;
  padding: 1.5rem 0 3.5rem;
}
/* Wider when site asides (sidebar blocks) are present */
.wrap.has-asides {
  width: min(calc(100% - 2rem), calc(var(--content) + 22rem));
}

/* —— Page body + site asides (multi-page sidebar blocks) —— */
.page-body {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}
.page-body > main { min-width: 0; }

.site-asides {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.aside-block {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.aside-block > h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.aside-body {
  font-size: 0.92rem;
  color: var(--ink);
}
.aside-body > *:first-child { margin-top: 0; }
.aside-body > *:last-child { margin-bottom: 0; }
.aside-body ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}
.aside-body li { margin: 0.35rem 0; }
.aside-body p { margin: 0.4rem 0; }

@media (min-width: 960px) {
  .page-body.placement-sidebar-end {
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem);
  }
  .page-body.placement-sidebar-start {
    grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  }
  .page-body.placement-sidebar-start .site-asides-side {
    order: -1;
  }
  .site-asides-side {
    position: sticky;
    top: 5.5rem;
  }
}

/* —— Header —— */
header.site {
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

header.site h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
header.site h1 a {
  color: inherit;
  text-decoration: none;
}
header.site h1 a:hover { color: var(--accent-deep); }

.tagline {
  color: var(--muted);
  margin: 0.35rem 0 0.9rem;
  font-size: 0.95rem;
  max-width: 36rem;
}

nav[aria-label="Main"] ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

nav[aria-label="Main"] a {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
nav[aria-label="Main"] a:hover {
  background: var(--accent-soft);
  border-color: rgba(13, 148, 136, 0.2);
  color: var(--accent-deep);
  text-decoration: none;
}

/* —— Main article —— */
main {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
}

article > h1:first-child {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 3.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
}

/* Prose */
article h2 {
  margin: 2rem 0 0.65rem;
  font-size: 1.3rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
article h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}
article p { margin: 0 0 1rem; }
article ul, article ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
article li { margin: 0.25rem 0; }
article li::marker { color: var(--accent); }
article blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #134e4a;
}
article blockquote p:last-child { margin-bottom: 0; }
article code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}
article pre {
  overflow-x: auto;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
article pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
article strong { font-weight: 700; }

article img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
  margin: 1rem 0 1.25rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* —— Later-added / retrospective notes —— */
article .update-note {
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem 1.05rem;
  background:
    linear-gradient(135deg, rgba(120, 53, 15, 0.06), transparent 55%),
    #f7f1e6;
  border: 1px dashed rgba(120, 53, 15, 0.35);
  border-left: 4px solid #92400e;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  color: #44403c;
  font-size: 0.95rem;
  line-height: 1.55;
}
article .update-note > .update-label {
  display: inline-block;
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #92400e;
  background: rgba(146, 64, 14, 0.12);
  border: 1px solid rgba(146, 64, 14, 0.22);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}
article .update-note > p {
  margin: 0 0 0.65rem;
}
article .update-note > p:last-child {
  margin-bottom: 0;
}
article .update-note strong {
  color: #78350f;
}

/* —— Post index —— */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: grid;
  gap: 0.85rem;
}
.post-list li {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.post-list li:hover {
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.08);
  transform: translateY(-1px);
}
.post-list li.has-thumb {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.85rem 1rem;
  align-items: start;
}
.post-list .thumb {
  display: block;
  margin: 0;
  border-radius: calc(var(--radius-sm) - 4px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg1, #f1f5f9);
  aspect-ratio: 4 / 3;
}
.post-list .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.post-list .post-list-body {
  min-width: 0;
}
@media (max-width: 520px) {
  .post-list li.has-thumb {
    grid-template-columns: 1fr;
  }
  .post-list .thumb {
    max-width: 12rem;
  }
}
.post-list a {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.post-list a:hover { color: var(--accent-deep); }
.post-list .meta { margin: 0.25rem 0 0.4rem; }
.post-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* —— Footer —— */
footer.site {
  margin-top: 1.5rem;
  padding: 1rem 0.25rem 0;
  color: var(--faint);
  font-size: 0.85rem;
  text-align: center;
}
footer.site p { margin: 0; }
footer.site .feeds {
  margin-top: 0.35rem;
}
footer.site .feeds a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
footer.site .feeds a:hover { color: var(--accent-deep); }

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid rgba(13, 148, 136, 0.2);
}

@media (max-width: 560px) {
  header.site { top: 0.5rem; padding: 0.85rem 1rem; }
  main { padding: 1.1rem; border-radius: var(--radius-sm); }
  nav[aria-label="Main"] a { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
}
