/* CareHaven blog — shared styles for /blog and every post under it. */

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

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #FAF6F0;
  color: #2C2621;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* === Top chrome === */
.blog-header {
  background: #FFFFFF;
  border-bottom: 1px solid #EDE8E3;
  padding: 18px 24px;
}
.blog-header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 500;
  color: #2C2621;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark .blog-tag {
  font-size: 12px;
  color: #5E6E45;
  font-style: italic;
  margin-left: 6px;
}
.blog-nav a {
  font-size: 14px;
  color: #4A6741;
  text-decoration: none;
  font-weight: 600;
}
.blog-nav a:hover { text-decoration: underline; }

/* === Container === */
.blog-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* === Post header === */
.post-header { margin-bottom: 36px; }
.post-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4A6741;
  margin-bottom: 14px;
}
.post-title {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 500;
  line-height: 1.15;
  color: #2C2621;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.post-meta {
  font-size: 14px;
  color: #6A5E55;
}
.post-meta time { color: #2C2621; }
.post-meta .sep { margin: 0 8px; color: #D9D1C4; }

/* === Body === */
.post-body p,
.post-body ul,
.post-body ol {
  font-size: 17px;
  line-height: 1.7;
  color: #2C2621;
  margin-bottom: 18px;
}
.post-body p:last-child { margin-bottom: 0; }
.post-body h2 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  color: #2C2621;
  letter-spacing: -0.01em;
  margin: 40px 0 14px;
}
.post-body h3 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  color: #2C2621;
  margin: 28px 0 10px;
}
.post-body ul, .post-body ol { padding-left: 22px; }
.post-body li { margin-bottom: 6px; }
.post-body a {
  color: #4A6741;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-body a:hover { color: #324D29; }
.post-body blockquote {
  border-left: 4px solid #C4CEB0;
  padding: 4px 0 4px 18px;
  margin: 24px 0;
  color: #534A42;
  font-style: italic;
}
.post-body code {
  background: #F4EFE7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.95em;
  color: #2C2621;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* === Lead-magnet capture (inline, embedded mid-post or end-of-post) === */
.magnet-card {
  background: #FFFFFF;
  border: 1px solid #C4CEB0;
  border-left: 4px solid #4A6741;
  border-radius: 10px;
  padding: 22px 24px;
  margin: 36px 0;
}
.magnet-card .magnet-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4A6741;
  margin-bottom: 8px;
}
.magnet-card h3 {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 500;
  color: #2C2621;
  margin: 0 0 8px;
  line-height: 1.25;
}
.magnet-card p {
  font-size: 15px;
  color: #5D534A;
  margin-bottom: 14px;
  line-height: 1.55;
}
.magnet-card .magnet-cta {
  display: inline-block;
  padding: 11px 20px;
  background: #4A6741;
  color: #FFFFFF;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.magnet-card .magnet-cta:hover { background: #324D29; }

/* === Author + footer === */
.post-author {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #EDE8E3;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.post-author .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: none;
  background: #EEF2E5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Georgia', serif;
  color: #4A6741;
  font-size: 20px;
  font-weight: 500;
}
.post-author .author-text {
  font-size: 14px;
  color: #5D534A;
  line-height: 1.5;
}
.post-author .author-text strong { color: #2C2621; }

.related-reading {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #EDE8E3;
}
.related-reading h3 {
  font-family: 'Georgia', serif;
  font-size: 18px;
  font-weight: 500;
  color: #2C2621;
  margin-bottom: 12px;
}
.related-reading ul {
  list-style: none;
  padding: 0;
}
.related-reading li { margin-bottom: 8px; }
.related-reading a {
  color: #4A6741;
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid #C4CEB0;
}
.related-reading a:hover { color: #324D29; }

/* === Blog index === */
.post-list { list-style: none; padding: 0; }
.post-list li {
  padding: 18px 0;
  border-bottom: 1px solid #EDE8E3;
}
.post-list li:last-child { border-bottom: 0; }
.post-list a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.post-list h2 {
  font-family: 'Georgia', serif;
  font-size: 22px;
  font-weight: 500;
  color: #2C2621;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 6px;
}
.post-list .post-list-meta {
  font-size: 13px;
  color: #6A5E55;
  margin-bottom: 8px;
}
.post-list .post-list-excerpt {
  font-size: 15px;
  color: #5D534A;
  line-height: 1.55;
}
.post-list a:hover h2 { color: #4A6741; }

.empty-state {
  padding: 48px 0;
  text-align: center;
  color: #6A5E55;
}
.empty-state h2 {
  font-family: 'Georgia', serif;
  font-size: 22px;
  color: #2C2621;
  margin-bottom: 8px;
}

/* === Mobile === */
@media (max-width: 600px) {
  .blog-container { padding: 32px 20px 64px; }
  .post-body p, .post-body ul, .post-body ol { font-size: 16px; }
  .magnet-card { padding: 18px 18px; }
}


/* ==========================================================================
   Post media — heroes, figures, credits, app screenshots
   Append-only. Adds the dark layer the stylesheet never had.
   Dark mode: html[data-theme="dark"], set by the bootstrap in §5.1.
   ========================================================================== */

.post-body img { max-width: 100%; height: auto; vertical-align: middle; }

/* --- Hero ----------------------------------------------------------------- */
.post-hero {
  margin: 28px 0 32px; padding: 0;
  background: #FFFFFF; border: 1px solid #C4CEB0; border-radius: 10px;
  overflow: hidden;
}
.post-hero__img { display: block; width: 100%; height: auto; margin: 0; }

/* --- Photo credit --------------------------------------------------------- */
.post-photo-credit {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px; line-height: 1.45; color: #6A5E55; text-align: left;
}
.post-hero > .post-photo-credit {
  padding: 10px 14px 12px; background: #FFFFFF; border-top: 1px solid #EDE8E3;
}
.post-figure > .post-photo-credit { margin-top: 6px; }
.post-photo-credit a { color: #4A6741; text-decoration: underline; text-underline-offset: 2px; }
.post-photo-credit a:hover, .post-photo-credit a:focus { color: #324D29; }
.post-photo-credit a:focus-visible { outline: 2px solid #4A6741; outline-offset: 2px; }

/* --- Figures -------------------------------------------------------------- */
.post-figure {
  margin: 32px 0; padding: 16px 16px 14px;
  background: #FFFFFF; border: 1px solid #C4CEB0; border-radius: 10px;
}
.post-figure__img { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 6px; }
.post-figure__caption {
  margin: 12px 4px 2px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: #5D534A;
}

/* --- Screenshots ---------------------------------------------------------- */
/* Four selectors, every one at or above .post-body img's (0,1,1), so neither a
   missing modifier NOR a present class can lose the cap. */
.post-figure--screenshot { text-align: center; }
.post-body .post-screenshot,
img.post-screenshot,
.post-screenshot-stage img,
.post-figure--screenshot img {
  display: block; width: auto; max-width: 280px; height: auto; margin: 0 auto;
  border: 1px solid #C4CEB0; border-radius: 12px; background: #FFFFFF;
}
.post-screenshot-stage {
  display: block; margin: 0 auto; max-width: 100%;
  padding: 0; background: transparent; border: 0; border-radius: 12px;
}
.post-figure--screenshot .post-figure__caption { text-align: left; margin-top: 14px; }

/* --- Sequences ------------------------------------------------------------ */
.post-body .post-screenshot-sequence,
ol.post-screenshot-sequence {
  list-style: none;              /* role="list" in markup restores semantics */
  margin: 36px 0; padding: 0; padding-left: 0;
  counter-reset: ch-shot-step;
}
.post-body .post-screenshot-sequence__step,
.post-screenshot-sequence > .post-screenshot-sequence__step {
  margin: 0 0 28px; padding: 0; counter-increment: ch-shot-step;
}
.post-body .post-screenshot-sequence__step:last-child { margin-bottom: 0; }
.post-screenshot-sequence__step::before {
  content: "Step " counter(ch-shot-step);
  display: block; margin: 0 0 8px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.3;
  color: #4A6741;
}
.post-screenshot-sequence .post-figure { margin: 0; }

/* --- Narrow screens ------------------------------------------------------- */
@media (max-width: 600px) {
  .post-hero { margin: 22px 0 28px; }
  .post-figure { margin: 28px 0; padding: 12px; }
  .post-body .post-screenshot,
  img.post-screenshot,
  .post-screenshot-stage img,
  .post-figure--screenshot img { max-width: min(52vw, 220px); }
  .post-hero > .post-photo-credit { padding: 9px 12px 11px; }
  .post-photo-credit { font-size: 12px; }
  .post-figure__caption { font-size: 13px; }
  .post-body .post-screenshot-sequence { margin: 28px 0; }
  .post-body .post-screenshot-sequence__step { margin-bottom: 24px; }
}

/* ==========================================================================
   DARK MODE — html[data-theme="dark"]
   Site tokens adopted BY VALUE. Every rule targets the selector that actually
   sets the colour, never an ancestor.
   ========================================================================== */

html[data-theme="dark"] body { background: #1C1B18; color: #F2EDE6; }
html[data-theme="dark"] .blog-header { background: #1C1B18; border-bottom-color: #36332F; }

/* --- Headings and body copy ----------------------------------------------- */
html[data-theme="dark"] .wordmark,
html[data-theme="dark"] .post-title,
html[data-theme="dark"] .post-body h2,
html[data-theme="dark"] .post-body h3,
html[data-theme="dark"] .post-body p,
html[data-theme="dark"] .post-body li,
html[data-theme="dark"] .post-body ul,
html[data-theme="dark"] .post-body ol,
html[data-theme="dark"] .post-list h2,
html[data-theme="dark"] .magnet-card h3,
html[data-theme="dark"] .related-reading h3,
html[data-theme="dark"] .empty-state h2 { color: #F2EDE6; }

html[data-theme="dark"] .post-body blockquote,
html[data-theme="dark"] .post-body blockquote p,
html[data-theme="dark"] .post-body blockquote li { color: #C0B8AE; }
html[data-theme="dark"] .post-body blockquote { border-left-color: #48433D; }

/* --- Secondary text ------------------------------------------------------- */
html[data-theme="dark"] .post-meta,
html[data-theme="dark"] .post-meta time,
html[data-theme="dark"] .post-author,
html[data-theme="dark"] .post-author .author-text,
html[data-theme="dark"] .post-author .author-text strong,
html[data-theme="dark"] .post-list .post-list-meta,
html[data-theme="dark"] .post-list .post-list-excerpt,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .empty-state p,
html[data-theme="dark"] .magnet-card p { color: #C0B8AE; }
html[data-theme="dark"] .post-meta .sep { color: #48433D; }

/* --- Accents: links, eyebrows, labels ------------------------------------- */
html[data-theme="dark"] .blog-nav a,
html[data-theme="dark"] .post-body a,
html[data-theme="dark"] .related-reading a,
html[data-theme="dark"] .wordmark .blog-tag,
html[data-theme="dark"] .post-eyebrow,
html[data-theme="dark"] .magnet-card .magnet-eyebrow { color: #9DAE7A; }
html[data-theme="dark"] .post-list a:hover h2,
html[data-theme="dark"] .post-body a:hover,
html[data-theme="dark"] .related-reading a:hover { color: #B8C68F; }
/* the underline is a separate property and was missed twice */
html[data-theme="dark"] .related-reading a { border-bottom-color: #48433D; }

/* --- Separators ----------------------------------------------------------- */
html[data-theme="dark"] .related-reading,
html[data-theme="dark"] .post-author { border-top-color: #36332F; }
html[data-theme="dark"] .post-list li { border-bottom-color: #36332F; }
html[data-theme="dark"] .post-body code { background: #262420; color: #F2EDE6; }

/* --- Author avatar: the site's own --hv-l pair ---------------------------- */
html[data-theme="dark"] .post-author .avatar { background: #2B3520; color: #9DAE7A; }

/* --- Magnet card: keep the brand rail; invert the hover direction --------- */
html[data-theme="dark"] .magnet-card {
  background: #262420;
  border-top-color: #48433D;
  border-right-color: #48433D;
  border-bottom-color: #48433D;
  border-left-color: #9DAE7A;
}
/* The BACKGROUND is intentionally theme-invariant (§5.3); the LABEL is not, and must
   be pinned: html[data-theme="dark"] .post-body a is (0,2,2) and outranks
   .magnet-card .magnet-cta at (0,2,0), repainting the label #9DAE7A on #4A6741 =
   2.65:1. Only the mid-post magnets are inside .post-body, so the index page looks
   fine while every post page fails. (0,3,0) below wins. */
html[data-theme="dark"] .magnet-card .magnet-cta,
html[data-theme="dark"] .magnet-card .magnet-cta:hover { color: #FFFFFF; }
/* Hover lightens rather than darkens, because darkening on a dark card makes the
   primary action recede. */
html[data-theme="dark"] .magnet-card .magnet-cta:hover { background: #5C7D50; }

/* --- Media ---------------------------------------------------------------- */
html[data-theme="dark"] .post-hero,
html[data-theme="dark"] .post-figure { background: #262420; border-color: #48433D; }
html[data-theme="dark"] .post-hero > .post-photo-credit {
  background: #262420; border-top-color: #36332F;
}
html[data-theme="dark"] .post-photo-credit,
html[data-theme="dark"] .post-figure__caption { color: #C0B8AE; }
html[data-theme="dark"] .post-photo-credit a { color: #9DAE7A; }
html[data-theme="dark"] .post-photo-credit a:hover,
html[data-theme="dark"] .post-photo-credit a:focus { color: #B8C68F; }
html[data-theme="dark"] .post-photo-credit a:focus-visible { outline-color: #9DAE7A; }

html[data-theme="dark"] .post-screenshot-stage {
  padding: 14px 12px; background: #131211; border: 1px solid #36332F;
}
html[data-theme="dark"] .post-body .post-screenshot,
html[data-theme="dark"] img.post-screenshot,
html[data-theme="dark"] .post-screenshot-stage img,
html[data-theme="dark"] .post-figure--screenshot img { border-color: #48433D; }
html[data-theme="dark"] .post-screenshot-sequence__step::before { color: #9DAE7A; }
