/* Blog article — a PORT of the design
   (.local/simoptions.com/Blog-Article.dc.html). Declarations are the design's,
   verbatim, on readable class names, because this is maintained by hand rather
   than regenerated; the two brand hexes resolve through the theme tokens so a
   palette change lands in one place.

   Not here, because no article carries the content: the key-takeaways card,
   the per-article FAQ block, the "Mentioned in this article" rail and the rich
   link-preview popovers. See the note on <ArticleTemplate>. */

.ar { background: #fff; }

/* --- hero ---------------------------------------------------------------- */
/* Not clipped itself: a byline card hangs below the hero. The glows are
   clipped by their own layer instead. */
.ar-hero { position: relative; background: var(--tint-1); }
.ar-hero__glows { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.ar-hero__rule {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.ar-hero__glow { position: absolute; border-radius: 50%; pointer-events: none; }
.ar-hero__glow--a {
  top: -170px; right: -120px; width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(131, 87, 249, .13), transparent 70%);
}
.ar-hero__glow--b {
  bottom: -200px; left: -140px; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(81, 149, 255, .11), transparent 70%);
}
.ar-hero__fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 110px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff);
  pointer-events: none;
}

.ar-hero__inner {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 34px 20px 30px;
}

.ar-crumbs {
  font-size: var(--text-xs);
  color: var(--ink-400);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.ar-crumbs__item { display: inline-flex; align-items: center; gap: 7px; }
.ar-crumbs a { color: var(--ink-400); text-decoration: none; }
.ar-crumbs i { font-size: var(--text-xs); opacity: .5; }
.ar-crumbs__current { color: var(--color-primary); }

.ar-h1 {
  font-size: var(--text-h2);
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.18;
  letter-spacing: -.6px;
  margin: 0 0 15px;
}

.ar-standfirst {
  font-size: var(--text-lg);
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-500);
  margin: 0 0 22px;
}

.ar-byline { display: grid; gap: 14px; }
.ar-byline__text {
  font-size: var(--text-sm); color: var(--ink-600);
  padding-top: 14px; border-top: 1px solid var(--line-field);
}
.ar-byline__meta { color: var(--ink-400); }
.ar-byline__dates { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-left: 10px; vertical-align: middle; }
/* Desktop: one line (read time, the "Updated" pill, first published).
   Phones: "Updated" is plain green text on a second line. */
@media (max-width: 599px) {
  .ar-byline__dates { display: flex; margin: 2px 0 0; gap: 0; font-size: var(--text-xs); }
  .ar-byline__dates .updated-pill { padding: 0; background: none; gap: 4px; }
  .ar-byline__dates .ar-byline__meta::before { content: " · "; white-space: pre; }
}

/* --- byline people (views/site/article/Byline.tsx) ------------------------
   One block per person; each name opens the person's card. Desktop: the card
   hangs under the name on hover or focus. Phones: a tap opens it as a bottom
   sheet (js/byline.js). */
.ar-people { display: flex; align-items: center; flex-wrap: wrap; row-gap: 12px; }
.ar-person { position: relative; display: flex; align-items: center; gap: 12px; padding-right: 26px; }
.ar-person + .ar-person { padding-left: 26px; border-left: 1px solid var(--line-field); }
.ar-person__id { display: grid; justify-items: start; line-height: 1.3; min-width: 0; }
.ar-person__label {
  font-size: var(--text-2xs); letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-400); font-weight: 600;
}
.ar-person__name {
  font: inherit; font-size: var(--text-sm); font-weight: 600; color: var(--ink-800);
  background: none; border: 0; padding: 0; margin: 1px 0; cursor: pointer; text-align: left;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
}
.ar-person__name:hover, .ar-person__name[aria-expanded="true"] { color: var(--color-primary); text-decoration-color: var(--color-primary); }
.ar-person__role { font-size: var(--text-xs); color: var(--ink-500); }
.ar-person__scrim { display: none; }

.ar-pcard { display: none; background: #fff; text-align: left; }
.ar-pcard__top { display: flex; gap: 12px; align-items: center; }
.ar-pcard__id { display: grid; line-height: 1.35; min-width: 0; flex: 1; }
.ar-pcard__name { font-size: var(--text-base); font-weight: 600; color: var(--ink-900); }
.ar-pcard__role { font-size: var(--text-xs); color: var(--ink-500); }
.ar-pcard__x {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--so-tint-2); color: var(--ink-600); display: grid; place-items: center;
  font-size: var(--text-lg);
}
.ar-pcard__bio {
  margin: 0; font-size: var(--text-xs); line-height: 1.6; color: var(--ink-600);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ar-pcard__chk {
  margin: 0; display: flex; align-items: center; gap: 7px;
  font-size: var(--text-xs); font-weight: 500; border-radius: var(--r-sm); padding: 6px 10px;
  background: color-mix(in srgb, var(--color-sale) 12%, #fff);
  color: color-mix(in srgb, var(--color-sale), #000 38%);
}
.ar-pcard__all {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 2px -6px -6px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--tint-1); color: var(--color-primary); text-decoration: none;
  font-weight: 600; font-size: var(--text-sm);
}
.ar-pcard__all:hover { background: var(--tint-2); }
.ar-pcard__all > span { display: grid; line-height: 1.35; }
.ar-pcard__all small { font-size: var(--text-2xs); font-weight: 400; color: var(--ink-500); }
.ar-pcard__all i { font-size: var(--text-lg); }

@media (min-width: 600px) {
  .ar-pcard {
    position: absolute; left: -6px; top: calc(100% + 12px); width: 336px; z-index: var(--z-anchored);
    border: 1px solid var(--line-field); border-radius: var(--r-2xl); padding: 18px; gap: 12px;
    box-shadow: 0 18px 44px rgba(48, 28, 110, .16), 0 3px 8px rgba(48, 28, 110, .08);
  }
  /* The arrow, and an invisible bridge so the pointer can cross the gap. */
  .ar-pcard::before {
    content: ""; position: absolute; top: -7px; left: 20px; width: 12px; height: 12px;
    background: #fff; border-left: 1px solid var(--line-field); border-top: 1px solid var(--line-field);
    transform: rotate(45deg);
  }
  .ar-pcard::after { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
  .ar-person + .ar-person .ar-pcard { left: 20px; }
  .ar-person:hover .ar-pcard, .ar-person:focus-within .ar-pcard { display: grid; }
  .ar-person.is-hushed .ar-pcard, .ar-pcard__x { display: none; }
}

@media (max-width: 599px) {
  .ar-people { flex-direction: column; align-items: stretch; row-gap: 0; }
  .ar-person { padding: 0; }
  .ar-person + .ar-person {
    padding: 12px 0 0; margin-top: 12px;
    border-left: 0; border-top: 1px solid var(--line-field);
  }
  .ar-person__name { padding: 4px 0; margin: -3px 0; }
  .ar-person.is-open .ar-person__scrim {
    display: block; position: fixed; inset: 0; z-index: var(--z-scrim); background: rgba(22, 14, 48, .46);
  }
  .ar-person.is-open .ar-pcard {
    display: grid; gap: 14px; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-dialog);
    border-radius: 22px 22px 0 0; padding: 20px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(22, 14, 48, .25);
  }
  .ar-pcard__bio { font-size: var(--text-sm); -webkit-line-clamp: 3; }
  .ar-pcard .au-chip { min-height: 44px; padding: 0 16px; }
  .ar-pcard__all {
    margin: 0; justify-content: center; text-align: center; min-height: 50px;
    border-radius: var(--r-pill); background: var(--so-grad-btn); color: #fff; font-weight: 500;
  }
  .ar-pcard__all:hover { background: var(--so-grad-btn); }
  .ar-pcard__all > span { justify-items: center; }
  .ar-pcard__all small { color: rgba(255, 255, 255, .85); }
}

/* --- lead image ---------------------------------------------------------- */
.ar-lead { max-width: 1040px; margin: 0 auto; padding: 24px 20px 0; }
.ar-lead__img { display: block; width: 100%; border-radius: var(--r-xl); }

/* --- body + rail --------------------------------------------------------- */
.ar-sec { padding: 44px 20px; }

.ar-split {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.ar-body { min-width: 0; }
.ar-body h2 {
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.3;
  margin: 38px 0 14px;
  /* The TOC links jump here; the sticky header must not cover the heading. */
  scroll-margin-top: 100px;
}
.ar-body p, .ar-body li {
  font-size: var(--text-md);
  line-height: 1.78;
  color: var(--ink-700);
}
.ar-body p { margin: 0 0 20px; }
.ar-body a {
  position: relative;
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1.5px solid #DCCFFB;
  font-weight: 500;
}
.ar-body a:hover { border-bottom-color: var(--color-primary); }
.ar-body img { max-width: 100%; height: auto; border-radius: var(--r-lg); }

.ar-aside { min-height: 100%; }
.ar-rail { display: flex; flex-direction: column; gap: 16px; }

.ar-card {
  background: #fff;
  border: 1px solid var(--line-tinted);
  border-radius: var(--r-xl);
  padding: 20px 22px;
}
.ar-toccard { background: var(--tint-1); }

.ar-card__head { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.ar-card__head i { color: var(--color-primary); font-size: var(--text-md); }
.ar-card__head h2 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0;
  color: var(--ink-800);
}

.ar-toc { display: flex; flex-direction: column; gap: 2px; }
.ar-toc a {
  font-size: var(--text-sm);
  line-height: 1.5;
  padding: 5px 0;
  color: var(--ink-600);
  text-decoration: none;
}
.ar-toc a:hover { color: var(--color-primary); }

.ar-siderel { display: flex; flex-direction: column; gap: 14px; }
.ar-siderel a { text-decoration: none; color: inherit; }
.ar-siderel__title {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-800);
  line-height: 1.45;
}
.ar-siderel__meta {
  display: block;
  font-size: var(--text-2xs);
  color: var(--ink-400);
  margin-top: 3px;
}

/* --- keep reading -------------------------------------------------------- */
.ar-keep { background: var(--tint-1); }
.ar-keep__inner { max-width: 1140px; margin: 0 auto; }
.ar-keep__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.ar-keep__head h2 {
  font-size: var(--text-h3);
  font-weight: 500;
  color: var(--ink-900);
  margin: 0;
}
.ar-keep__head a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--color-primary);
  text-decoration: none;
}

@media (min-width: 700px) {
  .ar-h1 { font-size: var(--text-h2); }
}

@media (min-width: 1000px) {
  .ar-split { grid-template-columns: 1fr 300px; align-items: stretch; }
  .ar-sec { padding: 60px 24px; }
  .ar-h1 { font-size: var(--text-h1); }
  /* The rail follows the reader down the article. */
  .ar-rail { position: sticky; top: 88px; }
}
