/* ==========================================================================
   Post — /blog/<slug>/

   Loaded after blog.css, which already carries the band ground (.gw-blog__bg),
   the 1264 measure (.gw-blog__wrap), the label row, the byline, the image
   slot, the promo card, the pill and the index card (used again for related
   articles). This sheet adds only what a post has and the index does not: the
   breadcrumb, the two-column band, the article measure and its typography,
   the sticky sidebar, the author box.

   Structure follows the Kissflow article (breadcrumb → image-left band → body
   beside a sticky contents list → related). Every value is this theme's.
   ========================================================================== */

/* ---- band --------------------------------------------------------------- */
.gw-post__band {
  position: relative;
  padding-block: 32px 64px;
  background: var(--gw-white);
  overflow: clip;
}
.gw-post__band-inner { position: relative; z-index: 1; }

.gw-crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-gray-500);
}
.gw-crumbs__list li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gw-crumbs__list li + li::before { content: "/"; color: var(--gw-line); }
.gw-crumbs__list a { transition: color var(--gw-dur-fast) var(--gw-ease); }
.gw-crumbs__list a:hover { color: var(--gw-violet); }
/* the post's own name is the last crumb; on one line, cut with an ellipsis */
.gw-crumbs__list [aria-current] {
  color: var(--gw-ink);
  max-width: 48ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.gw-post__lead {
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 48px;
  align-items: center;
}
.gw-post__intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.gw-post__title {
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 48px;
  color: var(--gw-black);
  text-wrap: balance;
}
.gw-post__byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-gray-500);
}
.gw-post__updated { font-variant-numeric: tabular-nums; }

/* ---- layout: article + sidebar ------------------------------------------ */
.gw-post__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  column-gap: 64px;
  align-items: start;
  padding-block: 24px 0;
}
.gw-post__main {
  max-width: 760px;
  min-width: 0;
}
.gw-post__side {
  min-width: 0;
  /* sticky only works inside its parent's box, and the grid's align-items:start
     would size the aside to its content — the whole row height is needed */
  align-self: stretch;
}
.gw-post__sticky {
  position: sticky;
  top: calc(var(--gw-nav-h) + var(--gw-gutter));   /* the bar plus one gutter */
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* on a short laptop screen the block scrolls inside itself rather than
     leaving the promo card forever below the fold */
  max-height: calc(100vh - var(--gw-nav-h) - var(--gw-gutter) * 2);
  overflow-y: auto;
  scrollbar-width: none;
}
.gw-post__sticky::-webkit-scrollbar { display: none; }
/* the sidebar promo drops its illustration: beside an article it is a card of
   copy and a button, and with the picture it did not fit a 1000px viewport
   under the contents list */
.gw-post__sticky .gw-promo { padding-bottom: 28px; align-self: auto; }
.gw-post__sticky .gw-promo__img { display: none; }

/* ---- article typography -------------------------------------------------
   Everything the live posts actually contain: p, h2–h4, ul/ol, b/strong, em,
   a, table, figure + img, blockquote, a YouTube embed, and Google-Docs
   leftovers (spans with inline font-weight, <h2><b>). Flow spacing is done
   with `* + *` so no element carries a margin of its own that could collapse
   or double.                                                                 */
.gw-prose {
  font-size: 18px;
  line-height: 29px;
  color: var(--gw-ink);
  overflow-wrap: anywhere;
}
.gw-prose > * + * { margin-top: 20px; }

.gw-prose h2,
.gw-prose h3,
.gw-prose h4 {
  font-family: var(--gw-font-display);
  font-weight: 400;
  color: var(--gw-black);
  text-wrap: balance;
  scroll-margin-top: calc(var(--gw-nav-h) + var(--gw-gutter));   /* lands under the bar */
}
.gw-prose h2 { font-size: 28px; line-height: 36px; }
.gw-prose h3 { font-size: 22px; line-height: 28px; }
.gw-prose h4 { font-size: 18px; line-height: 26px; }
.gw-prose > * + h2 { margin-top: 48px; }
.gw-prose > * + h3 { margin-top: 36px; }
.gw-prose > * + h4 { margin-top: 28px; }
.gw-prose h2 + *,
.gw-prose h3 + *,
.gw-prose h4 + * { margin-top: 12px; }
/* the exporter wraps heading text in <b>; the heading is already bold */
.gw-prose :is(h2, h3, h4) :is(b, strong) { font-weight: inherit; }

.gw-prose a {
  color: var(--gw-violet);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--gw-dur-fast) var(--gw-ease);
}
.gw-prose a:hover { color: var(--gw-black); }
.gw-prose :is(b, strong) { font-weight: 600; color: var(--gw-black); }
.gw-prose :is(em, i) { font-style: italic; }

.gw-prose :is(ul, ol) {
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gw-prose ul { list-style: disc; }
.gw-prose ol { list-style: decimal; }
.gw-prose li::marker { color: var(--gw-violet); }
.gw-prose li > :is(ul, ol) { margin-top: 8px; }
/* the exporter puts a <p> inside each <li>; keep the item on one baseline */
.gw-prose li > p { display: inline; }

.gw-prose blockquote {
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--gw-violet);
  font-family: var(--gw-font-display);
  font-size: 22px;
  line-height: 30px;
  color: var(--gw-black);
}
.gw-prose blockquote > * + * { margin-top: 12px; }
/* the attribution: <cite>, or the <footer> the block editor writes */
.gw-prose blockquote :is(cite, footer) {
  display: block;
  font-family: var(--gw-font-body);
  font-style: normal;
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-gray-500);
}

.gw-prose figure { margin-block: 32px; }
.gw-prose img {
  border-radius: var(--gw-r-card);
  box-shadow: 0 0 0 1px var(--gw-line);   /* the card image's hairline */
}
.gw-prose .aligncenter { margin-inline: auto; }
.gw-prose figcaption {
  margin-top: 10px;
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-gray-500);
}

/* tables: the comparison section's hairline rules, a label-row header */
.gw-prose .wp-block-table { overflow-x: auto; }
.gw-prose table {
  width: 100%;
  font-size: var(--gw-t-body);
  line-height: var(--gw-lh-body);
}
.gw-prose th,
.gw-prose td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  /* the block library draws a full grid; this is rules only, like section 09 */
  border: 0;
  border-bottom: 1px solid var(--gw-line);
}
.gw-prose th {
  font-weight: 600;
  font-size: 12px;
  line-height: 16.8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gw-gray-500);
}
.gw-prose tr:first-child td { border-top: 1px solid var(--gw-line); }
.gw-prose thead + tbody tr:first-child td { border-top: 0; }
.gw-prose td:first-child { color: var(--gw-black); font-weight: 600; }

.gw-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: var(--gw-r-xs);
  background: var(--gw-gray-50);
}
.gw-prose pre {
  padding: 20px;
  border-radius: var(--gw-r-card);
  background: var(--gw-footer-bg);
  color: var(--gw-white);
  font-size: var(--gw-t-body-sm);
  line-height: 22px;
  overflow-x: auto;
}
.gw-prose pre code { padding: 0; background: none; font-size: inherit; }

.gw-prose hr { margin-block: 40px; border: 0; border-top: 1px solid var(--gw-line); }

/* embeds (YouTube): a 16:9 frame on the image slot's radius + hairline */
.gw-prose .wp-block-embed__wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--gw-r-card);
  box-shadow: 0 0 0 1px var(--gw-line);
  overflow: hidden;
}
.gw-prose .wp-block-embed__wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- tags --------------------------------------------------------------- */
.gw-post__tags {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.gw-pill--sm { padding: 6px 14px; font-size: var(--gw-t-body-sm); line-height: var(--gw-lh-body-sm); font-family: var(--gw-font-body); }

/* ---- author box --------------------------------------------------------- */
.gw-authorbox {
  margin-top: 56px;
  display: flex;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-card);
  background: var(--gw-white);
}
.gw-authorbox__avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gw-gray-100);
}
.gw-authorbox__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gw-authorbox__kicker {
  font-weight: 600;
  font-size: 12px;
  line-height: 16.8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gw-gray-500);
}
.gw-authorbox__name {
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 26px;
  color: var(--gw-black);
}
.gw-authorbox__bio {
  font-size: var(--gw-t-body);
  line-height: var(--gw-lh-body);
  color: var(--gw-gray-700);
}
.gw-authorbox__more {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-family: var(--gw-font-display);
  font-size: var(--gw-t-btn-sm);
  line-height: var(--gw-lh-btn-sm);
  color: var(--gw-violet);
}
.gw-authorbox__arrow { width: 18px; height: 18px; transition: transform var(--gw-dur) var(--gw-ease); }
.gw-authorbox__more:hover .gw-authorbox__arrow { transform: translate(2px, -2px); }

/* ---- sidebar: share ----------------------------------------------------- */
.gw-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.gw-share__label {
  margin-right: 4px;
  font-weight: 600;
  font-size: 12px;
  line-height: 16.8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gw-gray-500);
}
/* the footer's round social button, on the light ground */
.gw-share__btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--gw-line);
  background: var(--gw-white);
  color: var(--gw-black);
  transition: border-color var(--gw-dur-fast) var(--gw-ease), color var(--gw-dur-fast) var(--gw-ease);
}
.gw-share__btn svg { width: 16px; height: 16px; }
.gw-share__btn:hover { border-color: var(--gw-violet); color: var(--gw-violet); }
.gw-share__btn.is-done { border-color: var(--gw-violet); color: var(--gw-violet); }
.gw-share__done {
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-violet);
}

/* ---- sidebar: in this article ------------------------------------------- */
.gw-toc {
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-card);
  background: var(--gw-white);
}
.gw-toc__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-family: var(--gw-font-display);
  font-weight: 400;
  font-size: 18px;
  line-height: 24px;
  color: var(--gw-black);
  list-style: none;
  cursor: default;
}
.gw-toc__summary::-webkit-details-marker { display: none; }
.gw-toc__chev { width: 20px; height: 20px; color: var(--gw-gray-500); display: none; }
.gw-toc__list {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  list-style: none;
  counter-reset: toc;
}
.gw-toc__link {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  font-size: var(--gw-t-body-sm);
  line-height: var(--gw-lh-body-sm);
  color: var(--gw-gray-700);
  transition: color var(--gw-dur-fast) var(--gw-ease);
}
/* numbered because the headings are a sequence through the piece */
.gw-toc__link::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  flex: none;
  font-family: var(--gw-font-display);
  color: var(--gw-gray-400);
  font-variant-numeric: tabular-nums;
}
.gw-toc__link:hover,
.gw-toc__link.is-active { color: var(--gw-violet); }
.gw-toc__link.is-active::before { color: var(--gw-violet); }

/* ---- related ------------------------------------------------------------ */
.gw-related { margin-top: 96px; }
.gw-related__grid { margin-top: 32px; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1023px) {
  .gw-post__band { padding-block: 24px 48px; }
  .gw-post__lead { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .gw-post__title { font-size: 32px; line-height: 40px; }
  .gw-post__layout { grid-template-columns: minmax(0, 1fr); row-gap: 40px; }
  .gw-post__main { max-width: none; }
  /* contents first, so it is a map and not an afterthought */
  .gw-post__side { order: -1; }
  .gw-post__sticky { position: static; }
  /* the promo card belongs after the reading, not before it */
  .gw-post__sticky .gw-promo { display: none; }
  .gw-toc__summary { cursor: pointer; }
  .gw-toc__chev { display: block; transition: transform var(--gw-dur) var(--gw-ease); }
  .gw-toc__details[open] .gw-toc__chev { transform: rotate(180deg); }
  .gw-related { margin-top: 72px; }
}

@media (max-width: 720px) {
  .gw-post__band { padding-block: 16px 40px; }
  .gw-post__lead { margin-top: 20px; }
  .gw-post__title { font-size: 26px; line-height: 32px; }
  .gw-crumbs__list [aria-current] { max-width: 22ch; }
  .gw-prose { font-size: 17px; line-height: 27px; }
  .gw-prose h2 { font-size: 24px; line-height: 31px; }
  .gw-prose h3 { font-size: 20px; line-height: 26px; }
  .gw-prose blockquote { font-size: 20px; line-height: 28px; padding-left: 18px; }
  .gw-authorbox { flex-direction: column; padding: 20px; }
  .gw-related { margin-top: 56px; }
}
