/* Ultra-minimal blog styles — single file, no frameworks */

/* Two themes only — `data-theme` is always set by a small script (system or saved choice). */

html[data-theme="light"] {
  color-scheme: light;
  /* Same structure as dark: neutral top → soft blue (lightened from #0b0b0b / #2b396d) */
  --bg: #F6ECCE;
  --background: linear-gradient(180deg, #fbf8f0  0%, #fff0d1 100%);
  --fg: #1a1a1a;
  --muted: #5c5c5c;
  --muted-bg: #E9CF83;
  --border: #E9CF83;
  --link: #0b57d0;
  --link-hover: #0842a0;
  --brand: #2b396d;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #2b396d82;
  --background: linear-gradient(180deg, #0b0b0b 0%, #2b396d 100%);
  --fg: #ececec;
  --muted: #a3a3a3;
  --muted-bg: #2b396df1;
  /* Lighter than #333 so 1px rules read on near-black and on #2b396d; hue aligns with the gradient */
  --border: rgba(200, 212, 245, 0.38);
  --link: #E9CF83;
  --link-hover: #c5d9fc;
  --brand: #c4ccec;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--background);
}

.site-main,
.site-footer {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  width: 100%;
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding: 0.5rem 1.25rem 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}

.site-title:hover {
  text-decoration: underline;
}

.theme-toggle {
  font: inherit;
  font-size: .75rem;
  color: var(--link);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-underline-offset: 0.15em;
}

.theme-toggle:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.site-main {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.site-footer {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

.home-intro {
  margin-bottom: 2rem;
}

.home-intro p:last-child {
  margin-bottom: 0;
}

.post-index-heading {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.post-list-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list-item:first-child {
  padding-top: 0;
}

.post-list-item a {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  text-decoration: none;
  font-size: 1.675rem;
}

.post-list-item a:hover {
  text-decoration: underline;
}

.post-list-date {
  font-size: 0.875rem;
  color: var(--muted);
}

.post-header {
  margin-top: 2rem;
  margin-bottom: 8rem;
}

.post-title {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  line-height: 1;
  margin: 0 0 0.5rem;
}

.post-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.post-body > *:first-child {
  margin-top: 0;
}

.post-body > *:last-child {
  margin-bottom: 0;
}

.post-body p {
  margin: 1rem 0;
}

.post-body h2 {
  font-size: 1.5rem;
  margin: 2.25rem 0 0.85rem;
}

.post-body h3 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  color: var(--brand);
}

.post-body ul,
.post-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.post-body li {
  margin: 0.35rem 0;
}

.post-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem;
  border-left: 3px solid var(--muted-bg);
  color: var(--fg);
  font-size: 2rem;
  background-color: var(--bg);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  line-height: 1.2;
  text-wrap: balance;
}

.post-body code {
  font-size: 0.9em;
  padding: 0.15em 0.35em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.post-read-next {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-read-next-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 1rem;
}

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

.post-read-next-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.post-read-next-item:first-child {
  padding-top: 0;
}

.post-read-next-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.post-read-next-item a {
  font-size: 2rem;
  color: var(--link);
  text-decoration: none;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
}

.post-read-next-item a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.post-read-next-date {
  font-size: 0.875rem;
  color: var(--muted);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 2rem 0;
}
