/* blog.css — journal stylesheet.

   The design tokens, header, skip link and theme button are lifted from the
   shrine's src/gallery.css so the journal reads as the same site rather than a
   themed third-party blog. The journal has no minify step: this file is served
   as written, so keep it readable.

   Theme contract (matches ~/sites/README.md): localStorage "site:theme" is
   "light" or "dark"; blog.js sets <html data-theme> before first paint. */

:root {
  --bg: #1a0b2e;
  --bg-deep: #110722;
  --text: #5aead2;
  --link: #4be3a0;
  --warn: #ff9900;
  --surface: rgba(26, 11, 46, 0.55);
  --border: rgba(90, 234, 210, 0.2);
  --edge: rgba(255, 255, 255, 0.16);
  --font: "Nunito", "Varela Round", system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fbf3fb;
  --bg-deep: #f2e6fa;
  --text: #7d6bb3;
  --link: #6aa8c4;
  --warn: #ff8fb2;
  --surface: rgba(255, 250, 253, 0.72);
  --border: rgba(197, 163, 224, 0.32);
  --edge: rgba(255, 255, 255, 0.8);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #fbf3fb;
    --bg-deep: #f2e6fa;
    --text: #7d6bb3;
    --link: #6aa8c4;
    --warn: #ff8fb2;
    --surface: rgba(255, 250, 253, 0.72);
    --border: rgba(197, 163, 224, 0.32);
    --edge: rgba(255, 255, 255, 0.8);
    color-scheme: light;
  }
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  background-image:
    radial-gradient(
      1000px 600px at 85% -10%,
      rgba(255, 153, 0, 0.05),
      transparent 60%
    ),
    radial-gradient(
      900px 600px at 50% 120%,
      rgba(90, 234, 210, 0.06),
      transparent 60%
    );
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}
:root[data-theme="light"] body {
  background: var(--bg);
  background-image:
    radial-gradient(
      1000px 620px at 85% -10%,
      rgba(255, 199, 222, 0.5),
      transparent 60%
    ),
    radial-gradient(
      1000px 700px at -10% 110%,
      rgba(196, 226, 255, 0.45),
      transparent 60%
    ),
    radial-gradient(
      900px 620px at 50% 120%,
      rgba(221, 199, 255, 0.45),
      transparent 60%
    );
  background-attachment: fixed;
}
::selection {
  background: var(--link);
  color: var(--bg);
}

/* ---- chrome (lifted from src/gallery.css) ------------------------------- */

.g-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 16px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  z-index: 600;
  border-radius: 0 0 8px 0;
}
.g-skip:focus {
  left: 0;
}
.g-header {
  position: sticky;
  top: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% - 32px);
  max-width: 1100px;
  margin: 12px auto 0;
  padding: 10px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 var(--edge);
}
.g-brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 2px;
  text-decoration: none;
  font-size: 0.95rem;
}
.g-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.g-back {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.08);
  transition: all 0.25s;
  white-space: nowrap;
}
.g-back:hover {
  background: var(--link);
  color: var(--bg);
}
.g-theme {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.1);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--edge);
  transition: all 0.25s;
}
.g-theme:hover {
  background: rgba(127, 127, 127, 0.22);
}
.g-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 16px 60px;
}
.g-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.g-sub {
  opacity: 0.75;
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* ---- entry list --------------------------------------------------------- */

.b-list {
  list-style: none;
  display: grid;
  gap: 12px;
}
.b-card {
  display: block;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 var(--edge),
    0 10px 30px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.b-card:hover {
  transform: translateY(-3px);
  border-color: var(--link);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.22),
    0 0 24px rgba(75, 227, 160, 0.16);
}
.b-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.b-card:hover .b-card-title {
  color: var(--link);
}
.b-card-desc {
  opacity: 0.8;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.b-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.78rem;
  letter-spacing: 1px;
  opacity: 0.65;
}
.b-more {
  margin-top: 22px;
}
.b-empty {
  opacity: 0.6;
}

/* ---- single entry ------------------------------------------------------- */

.b-post {
  max-width: 760px;
  margin: 0 auto;
}
.b-post-head {
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.b-post-head .g-title {
  font-size: 1.7rem;
  line-height: 1.25;
  letter-spacing: 1px;
}
.b-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.8rem;
  letter-spacing: 1px;
  opacity: 0.7;
  margin-top: 8px;
}
.b-post-cover {
  width: 100%;
  margin-top: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.b-draft {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--warn);
  color: var(--warn);
  font-weight: 700;
}
.b-post-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.b-post-nav a {
  color: var(--link);
  text-decoration: none;
}
.b-post-nav a:hover {
  text-decoration: underline;
}
.b-post-nav-side {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- tags --------------------------------------------------------------- */

.b-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.b-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--link);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}
.b-tag:hover {
  background: var(--link);
  color: var(--bg);
}
.b-terms {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.b-term-count {
  opacity: 0.55;
  font-weight: 400;
}
.b-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  font-size: 0.85rem;
}
.b-pager-void {
  color: var(--link);
  opacity: 0.3;
  font-weight: 700;
  padding: 8px 14px;
}
.b-pager-count {
  opacity: 0.6;
  letter-spacing: 1px;
}

/* ---- article body ------------------------------------------------------- */

.prose {
  font-size: 1rem;
  line-height: 1.78;
}
.prose > * + * {
  margin-top: 1.05em;
}
.prose h2,
.prose h3,
.prose h4 {
  letter-spacing: 1px;
  font-weight: 900;
  line-height: 1.3;
}
.prose h2 {
  font-size: 1.25rem;
  margin-top: 1.9em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--border);
}
.prose h3 {
  font-size: 1.07rem;
  margin-top: 1.6em;
}
.prose h4 {
  font-size: 0.97rem;
  margin-top: 1.4em;
  opacity: 0.85;
}
.prose a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover {
  background: var(--link);
  color: var(--bg);
  text-decoration: none;
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li + li {
  margin-top: 0.35em;
}
.prose li > ul,
.prose li > ol {
  margin-top: 0.35em;
}
.prose strong {
  font-weight: 800;
}
.prose blockquote {
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--link);
  opacity: 0.85;
  font-style: italic;
}
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.prose code {
  font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", monospace;
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
}
.prose pre {
  padding: 14px 16px;
  border-radius: 14px;
  overflow-x: auto;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  line-height: 1.55;
  font-size: 0.86rem;
}
.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.prose th,
.prose td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.prose th {
  font-weight: 800;
  letter-spacing: 0.5px;
}
/* Syntax highlighting: Zola (giallo) writes giallo-light.css / giallo-dark.css
   and blog.js enables the one matching the theme. Only the layout rules it
   cannot generate live here — see the lines/line-number docs. */
.giallo-l {
  display: inline-block;
  min-height: 1lh;
  width: 100%;
}
.giallo-ln {
  display: inline-block;
  user-select: none;
  margin-right: 0.4em;
  padding: 0.4em;
  min-width: 3ch;
  text-align: right;
  opacity: 0.8;
}
.giallo {
  background: none;
  border: 1px solid var(--border);
}

/* ---- footer ------------------------------------------------------------- */

.b-foot {
  flex: 0 0 auto;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 36px;
  font-size: 0.8rem;
  opacity: 0.6;
  letter-spacing: 1px;
}
.b-foot a {
  color: var(--link);
  text-decoration: none;
}
.b-foot a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .g-main {
    padding: 24px 14px 48px;
  }
  .g-header {
    top: 8px;
    margin-top: 8px;
    padding: 8px 12px;
  }
  .g-brand {
    letter-spacing: 1px;
    font-size: 0.85rem;
  }
  .b-post-head .g-title {
    font-size: 1.35rem;
  }
  .b-post-nav {
    align-items: flex-start;
    flex-direction: column;
  }
}
