/*
 * Vital Alignments — blog
 *
 * Loaded alongside css/site.css, never instead of it. Everything the blog can
 * borrow it borrows: .banner for the dark header, .article for the 760px
 * reading column, .eyebrow, .btn-primary, .related, .footer. What follows is
 * only what those don't already cover.
 *
 * The index has no thumbnails on purpose — see §04 of
 * sprints/blog-implementation-plan.html. A post that needs an image to look
 * finished is a post that doesn't get written.
 */

/* ── index: featured post ────────────────────────────────────────────────
   The newest published post, automatically. There is no "featured" flag to
   set and no editorial decision to make — it is simply the top of the feed
   rendered larger. */
.feed { padding: 56px 0 20px; }
.feed .wrap { max-width: 820px; }

.feed-featured {
  display: block;
  text-decoration: none;
  background: #fff;
  border: 1px solid rgba(16,42,60,.09);
  border-radius: var(--radius);
  padding: 34px 36px;
  margin-bottom: 46px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.feed-featured:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(2,54,83,.09);
  border-color: rgba(201,154,70,.4);
}
.feed-featured h2 {
  font-family: var(--serif);
  font-size: clamp(25px, 3.4vw, 34px);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.16;
  letter-spacing: -.012em;
  margin: 10px 0 12px;
}
.feed-featured p { font-size: 16.5px; color: var(--text-body); line-height: 1.75; margin: 0; }

/* Shared meta line: CATEGORY · DATE · N MIN. Tabular figures so a column of
   dates doesn't shimmer as the numbers change width. */
.post-meta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sea);
  font-variant-numeric: tabular-nums;
}
.post-meta .sep { opacity: .45; margin: 0 7px; }

/* ── index: the rest, as hairline rows ─────────────────────────────────── */
.feed-list { list-style: none; }
.feed-row { border-top: 1px solid rgba(16,42,60,.1); }
.feed-row:last-child { border-bottom: 1px solid rgba(16,42,60,.1); }
.feed-row a {
  display: block;
  text-decoration: none;
  padding: 24px 4px;
  transition: background .2s, padding-left .2s;
}
.feed-row a:hover { background: rgba(255,255,255,.7); padding-left: 12px; }
.feed-row h3 {
  font-family: var(--serif);
  font-size: clamp(19px, 2.3vw, 23px);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  margin-top: 7px;
}
.feed-row a:hover h3 { color: var(--sea-deep); }

/* ── index: empty state ──────────────────────────────────────────────────
   Reachable in production only in the window between launch and the first
   post. Worth designing anyway: an empty page that looks broken is worse
   than one that says what's coming. */
.feed-empty {
  text-align: center;
  padding: 70px 0 90px;
  max-width: 52ch;
  margin: 0 auto;
}
.feed-empty h2 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 12px;
}

/* ── post: header ───────────────────────────────────────────────────────── */
.post-head { padding: 132px 0 8px; }
.post-head .wrap { max-width: 760px; }
.post-back {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--sea-deep);
  text-decoration: none;
  margin-bottom: 26px;
}
.post-back:hover { text-decoration: underline; }
.post-head h1 {
  font-family: var(--serif);
  font-size: clamp(31px, 4.6vw, 49px);
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.1;
  letter-spacing: -.017em;
  margin: 12px 0 16px;
}
.post-dek {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-body);
  line-height: 1.6;
  max-width: 62ch;
  margin-bottom: 26px;
}

/* The byline. Credentials are the strongest trust signal a health blog has,
   so the name is never abbreviated here and never dropped. */
.post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid rgba(16,42,60,.1);
  border-bottom: 1px solid rgba(16,42,60,.1);
  font-size: 14px;
  color: var(--text-body);
}
.post-byline strong { color: var(--text-dark); font-weight: 600; }
.post-byline .sep { opacity: .4; }

.post-hero {
  margin: 34px 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-surface);
}
.post-hero img { width: 100%; height: auto; }

/* ── post: body ──────────────────────────────────────────────────────────
   Inherits .article for the column width and paragraph rhythm. These are the
   elements the Markdown renderer can emit that .article doesn't already cover. */
.post-body h2 { font-size: clamp(23px, 2.9vw, 30px); }
.post-body h3 {
  font-family: var(--serif);
  font-size: clamp(19px, 2.2vw, 23px);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  margin: 34px 0 10px;
}
.post-body a { color: var(--sea-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body a:hover { color: var(--sun-gold-hover); }
.post-body ul, .post-body ol { margin: 0 0 20px 22px; }
.post-body li { font-size: 17px; line-height: 1.75; margin-bottom: 9px; color: var(--text-body); }
.post-body blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-dark);
  border-left: 2px solid var(--sun-gold);
  padding: 4px 0 4px 24px;
  margin: 28px 0;
}
.post-body hr { border: none; border-top: 1px solid rgba(16,42,60,.12); margin: 40px 0; }
.post-body code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--bg-surface);
  border: 1px solid rgba(16,42,60,.1);
  border-radius: 4px;
  padding: 1px 6px;
}
.post-figure { margin: 30px 0; }
.post-figure img { border-radius: 12px; width: 100%; }

/* 16:9 without a wrapper hack that breaks when the iframe fails to load. */
.post-video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 30px 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-deep);
}
.post-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── post: the close ─────────────────────────────────────────────────────
   Bio, then newsletter, then previous/next. In that order: who wrote this,
   how to hear more, what to read next. */
.post-close { padding: 10px 0 70px; }
.post-close .wrap { max-width: 760px; }

.post-disclaimer {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-body);
  opacity: .82;
  padding-top: 26px;
  border-top: 1px solid rgba(16,42,60,.1);
  margin-bottom: 34px;
}

.post-author {
  background: var(--bg-sand);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin-bottom: 30px;
}
.post-author-name { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--text-dark); margin-bottom: 8px; }
.post-author-bio { font-size: 15.5px; line-height: 1.7; color: var(--text-body); margin-bottom: 20px; }

.post-newsletter {
  background: var(--bg-deep);
  color: var(--text-light);
  border-radius: var(--radius);
  padding: 38px 34px;
  margin-bottom: 30px;
  text-align: center;
}
.post-newsletter h2 { font-family: var(--serif); font-size: 27px; font-weight: 500; margin-bottom: 10px; }
.post-newsletter h2 em { font-style: italic; color: var(--sea-light); }
.post-newsletter p { color: var(--text-light-mute); font-size: 15px; max-width: 46ch; margin: 0 auto 22px; }
.post-newsletter .newsletter-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 460px; margin: 0 auto; }
.post-newsletter .newsletter-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 13px 18px;
  border: 1px solid rgba(246,248,249,.25);
  border-radius: var(--radius-pill);
  background: rgba(246,248,249,.07);
  color: var(--text-light);
  font-family: var(--sans);
  font-size: 15px;
}
.post-newsletter .newsletter-form input::placeholder { color: rgba(246,248,249,.5); }
.post-newsletter .newsletter-form input:focus { outline: 2px solid var(--sun-gold); outline-offset: 1px; }
.post-newsletter .newsletter-form button {
  padding: 13px 26px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--sun-gold);
  color: var(--text-dark);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.post-newsletter .newsletter-form button:hover { background: var(--sun-gold-hover); }
.post-newsletter .newsletter-form button:disabled { opacity: .6; cursor: default; }
/* Off-screen rather than display:none — bots skip hidden fields but fill this. */
.nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.newsletter-status { font-size: 14px; margin-top: 14px; min-height: 1.2em; }
.post-newsletter .newsletter-status.is-error { color: #FFC9B4; }
.post-newsletter .newsletter-status.is-success { color: var(--sea-light); }
.post-newsletter .newsletter-status.is-notice { color: var(--text-light-mute); }

.post-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.post-nav a {
  flex: 1;
  min-width: 240px;
  text-decoration: none;
  background: #fff;
  border: 1px solid rgba(16,42,60,.09);
  border-radius: 14px;
  padding: 18px 22px;
  transition: border-color .2s, transform .2s;
}
.post-nav a:hover { border-color: rgba(201,154,70,.45); transform: translateY(-2px); }
.post-nav .dir { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sea); }
.post-nav .t { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--text-dark); line-height: 1.35; margin-top: 6px; }
.post-nav .next { text-align: right; }

/* ── draft banner ────────────────────────────────────────────────────────
   Rendered only for a signed-in author looking at an unpublished post.
   Deliberately loud: the failure this prevents is believing something is
   live when it isn't. */
.draft-banner {
  position: relative;
  z-index: 1000;
  background: var(--sun-gold);
  color: var(--text-dark);
  text-align: center;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
}
.draft-banner a { color: var(--text-dark); font-weight: 600; margin-left: 10px; }
body:has(.draft-banner) .nav { top: 43px; }

@media (max-width: 720px) {
  .feed-featured { padding: 26px 22px; }
  .post-head { padding: 108px 0 4px; }
  .post-author, .post-newsletter { padding: 26px 22px; }
  .post-nav .next { text-align: left; }
  body:has(.draft-banner) .nav { top: 62px; }
}
