/* Sparkle in Blue blog. Loads after preview.css and reuses its tokens.
   Callout boxes and the quote card use the brand's soft blue (--blue-soft), the
   Brand & Content Style Guide's colour for light blue cards. Body text on it uses
   --ink for strong contrast. Linen and sand stay defined for editorial accents. */
:root {
  --linen: #f4eee7;
  --sand: #dcc7ae;
  --post-measure: 49rem;
  --post-shell: 80rem;
  --rail-width: 21.5rem;
}

.post-header {
  padding-block: clamp(2.25rem, 6vw, 4.25rem) clamp(1.25rem, 3vw, 2rem);
}

.post-header .eyebrow,
.post-header h1,
.post-meta,
.post-index-intro {
  max-width: 52rem;
}

.post-header h1 {
  margin-block: 0.75rem 1rem;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.35rem + 2.7vw, 3.25rem);
  line-height: 1.12;
  text-wrap: balance;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  color: var(--body);
  font-size: 0.875rem;
}

.breadcrumb li + li::before {
  margin-right: 0.5rem;
  content: "/";
}

.breadcrumb a {
  color: var(--blue);
  text-underline-offset: 0.2em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  color: var(--body);
  font-size: 0.9rem;
}

.post-index-intro {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
}

.post-body {
  width: min(100%, var(--post-measure));
}

.post-body [id] {
  scroll-margin-top: 7rem;
}

.post-body h2 {
  margin: 3rem 0 0.85rem;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 1.3rem + 1.3vw, 2.25rem);
  line-height: 1.2;
}

.post-body h3 {
  margin: 1.9rem 0 0.45rem;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.35;
}

.post-body p,
.post-body li {
  font-size: 1.15rem;
  line-height: 1.7;
}

.post-body p {
  margin: 0 0 1.15rem;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.3rem;
}

.post-body li + li {
  margin-top: 0.4rem;
}

.post-body a {
  color: var(--blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.quick-answer {
  margin: 0 0 2rem;
  padding: 1.4rem 1.75rem;
  border-left: 4px solid var(--navy);
  border-radius: 0 12px 12px 0;
  background: var(--blue-soft);
  color: var(--ink);
}

.quick-answer p {
  margin: 0;
}

.quick-answer__label {
  margin: 0 0 0.4rem !important;
  color: var(--navy);
  font-size: 0.75rem !important;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.3 !important;
  text-transform: uppercase;
}

.post-figure {
  margin: 0 0 2rem;
}

.post-figure img {
  width: 100%;
  border-radius: 12px;
}

.post-figure figcaption {
  margin-top: 0.5rem;
  color: var(--body);
  font-size: 0.875rem;
}

.post-callout {
  margin: 1.75rem 0;
  padding: 1.1rem 1.4rem;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--ink);
}

.post-callout > :last-child {
  margin-bottom: 0;
}

.post-faq {
  margin-top: 3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.post-sources {
  margin-top: 2rem;
  color: var(--body);
  font-size: 0.9rem;
}

.post-index {
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 7vw, 5.5rem);
}

.post-empty {
  max-width: 40rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--ink);
}

.post-empty h2 {
  margin: 0 0 0.5rem;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 1.8rem);
}

.post-empty p {
  margin: 0;
}

.post-empty a {
  color: var(--blue);
}

.post-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.post-card__media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-card__body {
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.post-card__audience {
  margin: 0;
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.post-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.2;
}

.post-card__title a {
  color: var(--navy);
  text-decoration: none;
}

.post-card__title a:hover,
.post-card__title a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.post-card__excerpt {
  margin: 0;
}

.post-card__date {
  margin: 0;
  color: var(--body);
  font-size: 0.875rem;
}

/* ---- Article layout: reading column plus a right-hand rail ----
   The rail (quote form, then a sticky table of contents) shows on wide screens only.
   Below 70rem the article is one centred column and the quote band at the foot of the page does the job. */
.shell--post {
  --shell: var(--post-shell);
}

.post-header > .shell--post,
.post-layout {
  max-width: calc(var(--post-measure) + var(--gutter) * 2);
}

.post-layout {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.post-rail {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (min-width: 70rem) {
  .post-header > .shell--post,
  .post-layout {
    max-width: none;
  }

  .post-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--post-measure)) var(--rail-width);
    column-gap: clamp(2.5rem, 4vw, 3.5rem);
    justify-content: start;
  }

  .post-rail {
    display: block;
    align-self: stretch;
  }
}

/* quote card */
.rail-card {
  padding: 1.35rem 0.875rem 0.5rem;
  border: 1px solid rgba(10, 109, 191, 0.22);
  border-top: 4px solid var(--navy);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 14px 34px rgba(11, 49, 83, 0.1);
  color: var(--ink);
}

.rail-card__eyebrow {
  margin: 0 0 0.35rem;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.rail-card__title {
  margin: 0 0 0.45rem;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

.rail-card__text {
  margin: 0 0 1.1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.rail-form {
  display: grid;
  gap: 0.85rem;
}

.rail-form .form-field input {
  min-height: 46px;
}

.rail-form__optional {
  color: var(--body);
  font-weight: 500;
}

.rail-form .form-consent {
  font-size: 0.8rem;
  font-weight: 500;
}

.rail-form__submit {
  width: 100%;
  cursor: pointer;
}

.rail-card__call {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 0.35rem;
  margin: 1rem 0 0;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.rail-card__call a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--blue);
  font-weight: 700;
  text-underline-offset: 0.2em;
}

/* table of contents: sticks under the site header while the article scrolls */
.toc {
  position: sticky;
  top: 7rem;
  max-height: calc(100vh - 8.5rem);
  margin-top: 1.75rem;
  overflow-y: auto;
}

.toc__title {
  margin: 0 0 0.6rem;
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.toc__list {
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
  list-style: none;
}

.toc__list a {
  display: block;
  margin-left: -2px;
  padding: 0.45rem 0 0.45rem 1rem;
  border-left: 2px solid transparent;
  color: var(--body);
  font-size: 0.9375rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc__list a:hover {
  color: var(--navy);
}

.toc__list a:focus-visible {
  outline: 3px solid rgba(39, 169, 232, 0.4);
  outline-offset: 2px;
}

.toc__list a.is-active {
  border-left-color: var(--navy);
  color: var(--navy);
  font-weight: 700;
}

/* ---- Sparkles: the homepage's "✦" (see .results and .why in preview.css) ----
   Small stars run down both page margins for the full length of the article. One big, very faint
   star fills the header's empty top-right and another is cut off at the bottom-left. All of it is
   decoration drawn with pseudo-elements, behind the content, with no markup and nothing to read.
   The margin stars appear from 70rem up, where the margins are wide enough to hold them. */
.post {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.post-header,
.post-layout {
  position: relative;
}

.post-header > .shell,
.post-layout > * {
  position: relative;
  z-index: 1;
}

.post-header::before,
.post-header::after,
.post-layout::after {
  position: absolute;
  z-index: 0;
  font-family: Georgia, serif;
  line-height: 1;
  content: "✦";
  pointer-events: none;
}

/* small cluster at the top-left of the header (phones and tablets; wide screens use the margin stars) */
.post-header::before {
  top: 3rem;
  left: clamp(0.2rem, 2vw, 1.5rem);
  color: rgba(39, 169, 232, 0.16);
  font-size: clamp(0.95rem, 1.6vw, 1.3rem);
  text-shadow: 2.45rem 3.35rem 0 rgba(39, 169, 232, 0.1);
}

/* big faint star, top-right of the header */
.post-header::after {
  top: 0.5rem;
  right: clamp(-3rem, 3vw, 5rem);
  color: rgba(39, 169, 232, 0.1);
  font-size: clamp(8rem, 17vw, 16rem);
  transform: rotate(9deg);
}

/* big faint star, cut off at the bottom-left of the article */
.post-layout::after {
  bottom: 2rem;
  left: -9rem;
  color: rgba(39, 169, 232, 0.08);
  font-size: clamp(9rem, 14vw, 13rem);
  transform: rotate(-8deg);
}

@supports not (overflow: clip) {
  .post-header::after,
  .post-layout::after {
    display: none;
  }
}

@media (min-width: 70rem) {
  .post {
    --spread: 0.15;
  }

  .post-header::before {
    display: none;
  }

  .post::before,
  .post::after {
    position: absolute;
    z-index: 0;
    top: 7rem;
    font-family: Georgia, serif;
    line-height: 1;
    content: "✦";
    pointer-events: none;
  }

  /* left margin */
  .post::before {
    left: 0.4rem;
    color: rgba(39, 169, 232, 0.27);
    font-size: 1.7rem;
    text-shadow:
      calc(2.6rem * var(--spread)) 14rem 0 rgba(10, 109, 191, 0.18),
      calc(0.4rem * var(--spread)) 31rem 0 rgba(39, 169, 232, 0.23),
      calc(3.9rem * var(--spread)) 47rem 0 rgba(39, 169, 232, 0.2),
      calc(1.2rem * var(--spread)) 66rem 0 rgba(10, 109, 191, 0.17),
      calc(4.4rem * var(--spread)) 79rem 0 rgba(39, 169, 232, 0.25),
      calc(0.2rem * var(--spread)) 98rem 0 rgba(39, 169, 232, 0.2),
      calc(3rem * var(--spread)) 113rem 0 rgba(10, 109, 191, 0.17),
      calc(1.8rem * var(--spread)) 134rem 0 rgba(39, 169, 232, 0.24),
      calc(4.2rem * var(--spread)) 152rem 0 rgba(39, 169, 232, 0.18),
      calc(0.6rem * var(--spread)) 171rem 0 rgba(10, 109, 191, 0.17),
      calc(3.4rem * var(--spread)) 188rem 0 rgba(39, 169, 232, 0.23),
      calc(1rem * var(--spread)) 209rem 0 rgba(39, 169, 232, 0.2),
      calc(4rem * var(--spread)) 226rem 0 rgba(10, 109, 191, 0.17),
      calc(2.2rem * var(--spread)) 247rem 0 rgba(39, 169, 232, 0.25),
      calc(0.3rem * var(--spread)) 268rem 0 rgba(39, 169, 232, 0.2),
      calc(3.6rem * var(--spread)) 287rem 0 rgba(10, 109, 191, 0.17),
      calc(1.4rem * var(--spread)) 309rem 0 rgba(39, 169, 232, 0.23),
      calc(4.1rem * var(--spread)) 330rem 0 rgba(39, 169, 232, 0.2);
  }

  /* right margin, offset down the page so the two sides never line up */
  .post::after {
    top: 21rem;
    right: 0.5rem;
    color: rgba(39, 169, 232, 0.25);
    font-size: 1.3rem;
    text-shadow:
      calc(-1.1rem * var(--spread)) 17rem 0 rgba(10, 109, 191, 0.17),
      calc(-3.7rem * var(--spread)) 34rem 0 rgba(39, 169, 232, 0.21),
      calc(-0.5rem * var(--spread)) 52rem 0 rgba(39, 169, 232, 0.18),
      calc(-4.3rem * var(--spread)) 71rem 0 rgba(10, 109, 191, 0.17),
      calc(-2rem * var(--spread)) 88rem 0 rgba(39, 169, 232, 0.24),
      calc(-3.2rem * var(--spread)) 106rem 0 rgba(39, 169, 232, 0.2),
      calc(-0.3rem * var(--spread)) 125rem 0 rgba(10, 109, 191, 0.17),
      calc(-4rem * var(--spread)) 143rem 0 rgba(39, 169, 232, 0.23),
      calc(-1.6rem * var(--spread)) 164rem 0 rgba(39, 169, 232, 0.18),
      calc(-3.5rem * var(--spread)) 182rem 0 rgba(10, 109, 191, 0.17),
      calc(-0.8rem * var(--spread)) 201rem 0 rgba(39, 169, 232, 0.24),
      calc(-4.4rem * var(--spread)) 219rem 0 rgba(39, 169, 232, 0.2),
      calc(-2.4rem * var(--spread)) 240rem 0 rgba(10, 109, 191, 0.17),
      calc(-0.4rem * var(--spread)) 258rem 0 rgba(39, 169, 232, 0.23),
      calc(-3.8rem * var(--spread)) 279rem 0 rgba(39, 169, 232, 0.2),
      calc(-1.3rem * var(--spread)) 297rem 0 rgba(10, 109, 191, 0.17),
      calc(-4.2rem * var(--spread)) 318rem 0 rgba(39, 169, 232, 0.21);
  }
}

/* wide screens have 8rem or more of margin, so the stars can spread out */
@media (min-width: 90rem) {
  .post {
    --spread: 1;
  }
}
