/* DeSpy blog — shared styles for the generated /blog pages (ADR 0007).
   Palette mirrors the marketing site (index.html): forest / paper / sage. */
:root {
  color-scheme: light;
  --forest: #061513;
  --forest-2: #0b2821;
  --forest-3: #12392f;
  --ink: #101915;
  --muted: #54625b;
  --paper: #fbf8f1;
  --paper-2: #f4f0e7;
  --line: #ddd8ce;
  --sage: #bfe0b9;
  --sage-2: #8eb487;
  --cream: #fffdf8;
  --link: #1c6b52;
  --serif: Georgia, "Times New Roman", ui-serif, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.65;
}
img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
a { color: var(--link); }

/* --- admin preview banner (not used on published pages) --- */
.preview-banner {
  background: var(--sage-2);
  color: #04150c;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 18px;
}

/* --- top bar: compact, stylized, mirrors the main-site menu --- */
.blog-top {
  background: linear-gradient(180deg, var(--forest-2), var(--forest));
  color: #f4f7f2;
  border-bottom: 1px solid rgba(191, 224, 185, .14);
}
.blog-top .bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 26px);
  display: flex;
  align-items: center;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.blog-top .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f4f7f2;
  text-decoration: none;
  font-weight: 850;
  letter-spacing: .06em;
  font-size: 15px;
}
.blog-top .brand svg { width: 24px; height: 24px; color: var(--sage); }
.blog-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px 18px;
  flex-wrap: wrap;
}
.blog-links a {
  color: #c8dccb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 3px 1px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.blog-links a:hover { color: #fff; }
.blog-links a[aria-current="page"] { color: #fff; border-bottom-color: var(--sage-2); }
.blog-cta {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 750;
  color: #06231a;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(180deg, #c7e6bf, var(--sage-2));
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.blog-cta:hover { filter: brightness(1.05); }
@media (max-width: 660px) {
  .blog-links { margin-left: 0; order: 3; width: 100%; }
}

/* --- layout --- */
main { max-width: 760px; margin: 0 auto; padding: 40px 22px 64px; }
main.index { max-width: 900px; }
h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.01em; }
.page-head { margin-bottom: 8px; }
.page-head p { color: var(--muted); font-size: 17px; margin: 0; }
.post-meta { color: var(--muted); font-size: 14px; margin: 0 0 28px; }

/* --- article body --- */
article { font-size: 18px; }
article h2 { font-size: 26px; margin: 40px 0 12px; letter-spacing: -.01em; }
article h3 { font-size: 21px; margin: 30px 0 10px; }
article p { margin: 0 0 20px; }
article a { text-decoration: underline; text-underline-offset: 2px; }
article ul, article ol { margin: 0 0 20px; padding-left: 24px; }
article li { margin: 6px 0; }
article blockquote {
  margin: 24px 0;
  padding: 8px 20px;
  border-left: 3px solid var(--sage-2);
  color: var(--forest-3);
  background: var(--paper-2);
  border-radius: 0 10px 10px 0;
}
article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}
article pre {
  background: var(--forest);
  color: #e7f0e8;
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 22px;
}
article pre code { background: none; border: 0; padding: 0; color: inherit; font-size: .88em; }
article img { margin: 24px 0; box-shadow: 0 16px 40px rgba(20, 31, 24, .12); }
.article-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: 14px; margin: 4px 0 26px; box-shadow: 0 16px 40px rgba(20, 31, 24, .12); }
article video { display: block; width: 100%; margin: 24px 0; border-radius: 12px; background: #000; box-shadow: 0 16px 40px rgba(20, 31, 24, .12); }
article audio { display: block; width: 100%; margin: 20px 0; }
.embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 24px 0; border-radius: 12px; overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
article hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
article table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 16px; }
article th, article td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
article th { background: var(--paper-2); }

/* --- index tiles --- */
.post-list {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.post-card {
  display: flex; flex-direction: column;
  background: var(--cream); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; text-decoration: none; color: var(--ink);
  transition: box-shadow .18s ease, transform .18s ease;
}
.post-card:hover { box-shadow: 0 18px 44px rgba(20, 31, 24, .12); transform: translateY(-2px); }
.card-media {
  aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; margin: 0; box-shadow: none; }
.card-media.no-cover { background: linear-gradient(135deg, var(--forest-3), var(--forest)); }
.card-media .tile-icon { width: 54px; height: 54px; color: var(--sage); opacity: .92; }
.card-body { padding: 16px 18px 20px; }
.card-body h2 { font-size: 19px; margin: 0 0 4px; line-height: 1.25; }
.post-card:hover .card-body h2 { color: var(--link); }
.card-body .post-meta { margin: 0 0 8px; }
.card-body .summary { color: var(--muted); margin: 0; font-size: 15px; }
.empty { color: var(--muted); font-size: 17px; padding: 30px 0; }

/* --- Q&A page --- */
.qa-cat { font-size: 22px; margin: 36px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.qa-cat:first-of-type { margin-top: 12px; }
.qa-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 8px; }
.qa-item { background: var(--cream); border: 1px solid var(--line); border-radius: 12px; }
.qa-item summary { cursor: pointer; padding: 16px 20px; font-weight: 650; font-size: 17px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.qa-item summary::-webkit-details-marker { display: none; }
.qa-item summary::after { content: "+"; color: var(--sage-2); font-weight: 700; font-size: 22px; line-height: 1; }
.qa-item[open] summary::after { content: "\2013"; }
.qa-item summary:hover { color: var(--link); }
.qa-answer { padding: 0 20px 18px; }
.qa-answer > :first-child { margin-top: 0; }
.qa-answer > :last-child { margin-bottom: 0; }

/* --- newsletter subscribe CTA (archive + issue pages) --- */
.nl-subscribe {
  margin: 36px 0 10px;
  padding: 22px 26px;
  background: linear-gradient(135deg, var(--forest-3), var(--forest));
  color: #eef5ee;
  border-radius: 16px;
}
.nl-subscribe h2 { margin: 0 0 6px; font-size: 21px; color: #fff; }
.nl-subscribe p { margin: 0 0 16px; color: #c8dccb; font-size: 15px; max-width: 46ch; }

/* --- footer --- */
.blog-foot {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.blog-foot .inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.blog-foot a { color: var(--forest-3); text-decoration: none; }
.blog-foot a:hover { text-decoration: underline; }
.blog-foot .sep { margin-left: auto; }
