/* ==========================================================================
   BLOG: the look of the blog list (blog/index.html) and of every post.
   Uses the same colors and fonts as the main page (css/tokens.css).
   These pages are plain reading pages with no scroll animation. Two small
   scripts run on them: js/menu.js (phone menu) and js/blog.js (waitlist form).
   ========================================================================== */

.blog { background: var(--bone); color: var(--ink); }
.blog .wrap { max-width: 92rem; }            /* blog pages use more of a wide screen than the main page */

/* The header is a plain solid bar here: it stays at the top of the page */
.blog .site-header {
  position: relative;                       /* not fixed: it scrolls away with the page */
  padding-block: 0.8rem;
  background: var(--ink);
  color: var(--bone);
}
@media (min-width: 900px) { .blog .nav__links a[aria-current="page"] { border-color: var(--ember); } }

/* ---- PAGE TOP: title and one line about the page ------------------------- */
.blog-top {
  background: var(--ink);
  color: var(--bone);
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2.5rem, 6vw, 4.5rem);
}
.blog-top .display { font-size: var(--text-display-md); max-width: 16em; }
.blog-top__lead { margin-top: 1.25rem; max-width: 38em; color: var(--sand); font-size: var(--text-lead); line-height: 1.5; }
.blog-top__meta { margin-top: 1.5rem; color: var(--sand); font-size: var(--text-small); }
.blog-top__back { display: inline-block; margin-bottom: 1.5rem; color: var(--sand); font-size: var(--text-small); text-underline-offset: 0.25em; }
.blog-top__back:hover { color: var(--bone); }

/* ---- LIST OF POSTS: one row per post, a line between rows ----------------- */
.post-list { list-style: none; margin: 0; padding: clamp(1.5rem, 4vw, 3rem) 0 0; }
.post-list li { border-bottom: 1px solid var(--line-on-light); }
.post-list a {
  display: grid;
  gap: 0.5rem 2.5rem;
  padding-block: 1.75rem;
  color: inherit;
  text-decoration: none;
}
@media (min-width: 800px) { .post-list a { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: baseline; } }
.post-list__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.02;
  text-transform: uppercase;
  text-wrap: balance;
}
.post-list a:hover .post-list__title { color: var(--ember); }
.post-list__summary { color: color-mix(in srgb, var(--ink) 78%, transparent); line-height: 1.55; max-width: 38em; }

/* ---- PAGE LAYOUT: the article (or the list) on the left, the waitlist form
   on the right. On wide screens the form stays in the middle of the screen
   while you scroll. On phones and tablets it sits below the article. -------- */
.blog-layout { display: grid; gap: clamp(2.5rem, 5vw, 5rem); padding-bottom: var(--section-pad); }
@media (min-width: 1000px) {
  .blog-layout { grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem); padding-bottom: 0; }
  .blog-side {
    position: sticky;                        /* this is what makes it follow the scroll */
    top: 0;
    align-self: start;
    display: grid;
    align-content: center;                   /* and this keeps the form in the middle of the screen */
    height: 100vh;
    height: 100svh;
    padding-block: 1.5rem;
  }
  .post, .post-list { padding-bottom: var(--section-pad); }
}

/* ---- THE WAITLIST FORM beside the article ---------------------------------- */
.side-form { padding: clamp(1.5rem, 3vw, 2.25rem); background: var(--ink); color: var(--bone); }
.side-form .display { font-size: clamp(1.9rem, 2.6vw, 2.5rem); }
.side-form > p { margin-top: 0.9rem; color: var(--sand); line-height: 1.55; }
.side-form__form { display: grid; gap: 0.6rem; margin-top: 1.5rem; }
.side-form__form label { font-size: var(--text-small); font-weight: 600; }
.side-form__form input[type="email"] {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.6rem 0.9rem;
  border: 2px solid transparent;
  border-radius: 0;
  background: var(--bone);
  color: var(--ink);
  font: inherit;
}
.side-form__form input[type="email"]:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; }
.side-form__form input[aria-invalid="true"] { border-color: var(--ember); }
.side-form__form .btn { justify-self: start; margin-top: 0.5rem; }
.side-form__form.is-sending .btn { opacity: 0.7; cursor: progress; }
.side-form__form.is-done .btn { cursor: default; }
.side-form__msg { min-height: 1.5em; font-size: var(--text-small); }
.side-form__msg.is-error { font-weight: 600; }
.side-form__fine { color: var(--sand); font-size: var(--text-small); }

/* ---- A POST ---------------------------------------------------------------- */
.post { min-width: 0; padding-top: clamp(2.5rem, 6vw, 4.5rem); font-size: clamp(1.0625rem, 1.25vw, 1.1875rem); line-height: 1.7; }
.post > * + * { margin-top: 1.25em; }
.post h2 {
  margin-top: 2.2em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
}
.post h3 { margin-top: 1.8em; font-size: 1.15em; font-weight: 600; }
.post ul, .post ol { padding-left: 1.3em; }
.post li + li { margin-top: 0.5em; }
.post a { color: inherit; text-decoration-color: var(--ember); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.post a:hover { color: var(--ember); }
.post table { width: 100%; border-collapse: collapse; font-size: 0.95em; line-height: 1.45; }
.post th, .post td { padding: 0.7rem 0.75rem 0.7rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-on-light); }
.post th { font-weight: 600; }
.post__table-scroll { overflow-x: auto; }

/* The honest note about the product */
.post__note {
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--ember);
  background: var(--bone-alt);
  font-size: 0.95em;
}
.blog .site-footer { padding-block: 3rem; }
.blog .site-footer a { color: inherit; }

/* Phones: keep table columns wide enough to read. The table scrolls sideways
   inside its own box instead of squeezing every word onto its own line. */
@media (max-width: 700px) {
  .post__table-scroll table { min-width: 36rem; }
  .post__table-scroll { margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); }
}
