/* Blog post extras (plan ten-blog-post, 2026-11-07). Loaded by blog/_brand_bar.html through cache_bust, after
   blog.css: blog.css is pinned at ?v=20261019 in every post and cached for a year, so a change there would not
   reach a returning reader. Consumes site-tokens.css. Opt-in classes (cost-table--stack, fig--dual,
   toc-phone) only change the posts that carry them.

   Nothing here is under 15px. The floating pieces are built by blog-post.js but take no space in the article:
   the phone bar is fixed, and the desktop card sits in the contents list's own column (layout shift measured 0
   at 1280x720, 1440x900 and 1280x600). */

/* ---------- The floating ask (static/js/blog-post.js builds it) ---------- */
/* Phones and tablets: the homepage's bottom bar, one blue pill on a short fade of the page. */
/* Its content box is the reading column (blog.css: .shell gutter 20px, 16px at 700 and under; .article
   max-width var(--measure), left-aligned), so the pill centres on the text, not on the window: on a tablet the
   column sits left and a window-centred pill hung up to 150px off it (round 2 judge). 100% here is the
   viewport's width. */
.try-float {
  --col-gutter: 20px;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 24px max(var(--col-gutter), calc(100% - var(--col-gutter) - var(--measure)), env(safe-area-inset-right, 0px))
    calc(12px + env(safe-area-inset-bottom, 0px)) max(var(--col-gutter), env(safe-area-inset-left, 0px));
  background: linear-gradient(to top, var(--bg) 55%, transparent);
  pointer-events: none;
  transform: translateY(100%); opacity: 0; visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0s 0.35s;
}
.try-float.is-shown {
  transform: none; opacity: 1; visibility: visible;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0s;
}
.try-float__btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box; width: 100%; max-width: 480px; min-height: 52px; margin: 0 auto; padding: 12px 24px;
  border: 0; border-radius: var(--r-pill); background: var(--cta-blue); color: #fff;
  font-family: var(--font-text); font-size: var(--fs-body); font-weight: 600; line-height: 1.2; text-decoration: none;
  cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--cta-blue) 35%, transparent);
}
@media (max-width: 700px) { .try-float { --col-gutter: 16px; } }
/* A short screen (a phone on its side, a window zoomed to 200% or more): no bar. At 88px it took a quarter of
   a landscape phone and half of a 400% zoom (round 2 judge); the boxes stay in the page. Same idea as the
   desktop card's short-window rule below. */
@media (max-height: 480px) { .try-float { display: none; } }
.try-float__btn:hover { background: var(--cta-blue-hover); }
.try-float__btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

/* blog-post.js's two invisible bands (start of post to end of "Bottom line up front"; last box to end). */
.try-float-band { position: absolute; left: 0; width: 1px; opacity: 0; pointer-events: none; }

/* A desktop: the contents list's column, the card under it (blog-post.js wraps the list in .toc-rail). */
.toc-rail, .try-rail { display: none; }
@media (min-width: 1000px) {
  .try-float { display: none; }
  .toc-rail { display: block; position: sticky; top: 32px; align-self: start; }
  .toc-rail > .toc { position: static; }
  .try-rail {
    display: block; margin-top: 32px; padding: 16px 12px;
    background: var(--panel-top); border: 1px solid var(--line); border-radius: var(--r-card);
    opacity: 0; transform: translateY(8px); visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0s 0.35s;
  }
  .try-rail.is-shown {
    opacity: 1; transform: none; visibility: visible;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0s;
  }
  .try-rail__title { margin: 0; color: var(--strong); font-size: 15px; font-weight: 600; line-height: 1.35; }
  .try-rail__sub { margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
  /* One line: the label needs about 147px of the column's 174 (it wrapped at 12px side padding). */
  .try-rail .try-rail__btn { min-height: 44px; margin-top: 16px; padding: 8px; font-size: 15px; white-space: nowrap; box-shadow: none; }
  /* Where you are: the section on screen, by colour only (no weight change, so nothing reflows). */
  .toc a[aria-current] { color: var(--strong); border-left-color: var(--blue); }
}
/* A desktop window too short for the list and the card together: the card never hangs off the screen. */
@media (min-width: 1000px) and (max-height: 599px) {
  .try-rail { display: none; }
}

/* ---------- The phone's contents list ---------- */
.toc-phone {
  margin: 24px 0 8px; background: var(--panel-top); border: 1px solid var(--line); border-radius: var(--r-card);
}
.toc-phone summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 0 16px; list-style: none; cursor: pointer;
  color: var(--strong); font-size: var(--fs-body); font-weight: 600; -webkit-tap-highlight-color: transparent;
}
.toc-phone summary::-webkit-details-marker { display: none; }
/* The chevron is a drawn shape in the text's muted colour (the policy allows data: images), not two borders:
   the page's lines stay one weight. */
.toc-phone summary::after {
  content: ""; flex: none; width: 16px; height: 16px; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.toc-phone[open] summary::after { transform: rotate(180deg); }
.toc-phone summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--r-card); }
.toc-phone nav { padding: 0 16px 8px; }
.toc-phone nav a {
  display: flex; align-items: center; min-height: 44px; border-top: 1px solid var(--line);
  color: var(--text); font-size: var(--fs-body); text-decoration: none;
}
.toc-phone nav a:hover { color: var(--blue); }
@media (min-width: 1000px) { .toc-phone { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .toc-phone summary::after { transition: transform 150ms ease; }
}

/* ---------- Phone tables that stack instead of swiping ---------- */
/* Each row becomes a short block: the row's name, then each value under its column's name. The template gives
   these tables explicit table/row/cell roles, because Safari has dropped a table's meaning for VoiceOver when its
   rows stop displaying as table rows; Chromium keeps it either way (measured: 2 tables, 9 rows, 32 cells). */
@media (max-width: 591px) {
  .article .table-scroll.table-scroll--stack:has(.cost-table)::after { content: none; }
  .article .table-scroll.table-scroll--stack { overflow: visible; }
  .article .cost-table.cost-table--stack { min-width: 0; margin: 8px 0 24px; }
  .cost-table--stack, .cost-table--stack tbody, .cost-table--stack tr, .cost-table--stack td { display: block; }
  .cost-table--stack tr:first-child { display: none; }
  .cost-table--stack tr { padding: 16px 0; border-top: 1px solid var(--line); }
  .cost-table--stack td { padding: 0; border: 0; font-size: 15px; }
  .cost-table--stack td:first-child { margin-bottom: 8px; font-size: var(--fs-body); }
  .cost-table--stack td[data-label] {
    display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr); gap: 12px; padding: 4px 0;
  }
  .cost-table--stack td[data-label]::before { content: attr(data-label); color: var(--muted); }
}

/* ---------- Phone diagram: the same drawing, stacked ---------- */
.fig-phone { display: none; }
@media (max-width: 700px) {
  .article figure.fig--dual { overflow: visible; }
  .article figure.fig--dual::after { content: none; }
  .article figure.fig--dual .fig-wide { display: none; }
  .article figure.fig--dual .fig-phone { display: block; min-width: 0; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
}

/* Windows High Contrast: colours become the system's, so a fill-only button turned into loose text, the fade
   went clear over the article and the "you are here" mark matched every other link (round 3 judge, Chromium
   forced-colors). An edge, a solid backing and a mark that is not colour alone. System colours are kept. */
@media (forced-colors: active) {
  .try-float__btn { border: 1px solid ButtonText; }
  .try-float { background: Canvas; }
  .toc a[aria-current] { border-left-color: Highlight; text-decoration: underline; }
}

/* On paper: no floating pieces, no closed contents box (the side list and headings carry the structure). */
@media print {
  .try-float, .try-rail, .try-float-band, .toc-phone { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .try-float, .try-float.is-shown, .try-rail, .try-rail.is-shown { transition: none; }
  .try-rail, .try-rail.is-shown { transform: none; }
}

/* The ask every post ends with (blog/_post_cta.html, plan content-asks-to-homepage): the desktop card's words on
   the panel "Bottom line up front" sits on, with the blog's own end button. It opens the homepage. */
.post-ask {
  padding: 28px 20px; background: var(--panel-top); box-shadow: var(--card-shadow);
  border: 1px solid var(--line); border-radius: var(--r-card);
}
.post-ask__title { margin: 0; color: var(--strong); font-size: var(--fs-heading); font-weight: 700; line-height: 1.3; text-wrap: balance; }
.post-ask__sub { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-body); line-height: 1.45; }
.post-ask .post-cta-btn { margin-top: 20px; }

/* The iPhone app's Home card near the top of the group text post (plan group-text-fan-on-web): its words, its
   three-phone animation (partials/group_text_fan.html, static/css/group-text-fan.css) and its button, on the
   same panel as "Bottom line up front" just above it. */
.post-fan {
  margin: 24px 0 8px; padding: 28px 20px; text-align: center; background: var(--panel-top);
  box-shadow: var(--card-shadow); border: 1px solid var(--line); border-radius: var(--r-card);
}
.post-fan__title { margin: 0 0 20px; color: var(--strong); font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
.post-fan .gtf { margin: 0 auto 24px; }
