/* Article shell — hero, table of contents, and the post body. */

:root {
  /* Reading measure for the article column. ~84 characters at 18px. */
  --sm-blog-measure: 46rem;
  /* Sidebar that holds the sticky table of contents on wide screens. */
  --sm-blog-aside: 18rem;
  --sm-blog-gutter: var(--sm-space-10);
}

.sm-blog-hero,
.sm-blog-toc,
.sm-blog-content {
  box-sizing: border-box;
  width: 100%;
  color: var(--sm-body);
  font-family: var(--sm-font-body);
  font-size: var(--sm-text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.sm-blog-hero *,
.sm-blog-toc *,
.sm-blog-content * {
  box-sizing: border-box;
}

.sm-blog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  align-items: center;
  gap: var(--sm-space-8);
  max-width: var(--sm-max-width);
  margin: 0 auto var(--sm-space-10);
  padding: var(--sm-space-10) var(--sm-section-h);
}
.sm-blog-hero:not(:has(.sm-blog-hero__figure)) {
  grid-template-columns: minmax(0, 1fr);
  max-width: 52rem;
}
.sm-blog-hero__cats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sm-space-2);
  margin: 0 0 var(--sm-space-4);
}
.sm-blog-hero__cat {
  padding: 5px 13px;
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-full);
  background: var(--sm-linen);
  color: var(--sm-purple);
  font-family: var(--sm-font-head);
  font-size: var(--sm-text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}
a.sm-blog-hero__cat:hover {
  border-color: var(--sm-orange);
  color: var(--sm-orange);
}
.sm-blog-hero__title {
  margin: 0;
  color: var(--sm-purple);
  font-family: var(--sm-font-head);
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.sm-blog-hero__date {
  margin: var(--sm-space-4) 0 0;
  color: var(--sm-muted);
  font-size: var(--sm-text-sm);
}
.sm-blog-hero__date + .sm-blog-byline {
  margin-top: var(--sm-space-1);
}
.sm-blog-hero__figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--sm-radius-lg);
}
.sm-blog-hero__img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.sm-blog-toc {
  max-width: var(--sm-blog-measure);
  margin: 0 auto var(--sm-space-8);
  padding: var(--sm-space-5) var(--sm-space-6);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-lg);
  background: var(--sm-linen);
}
.sm-blog-toc__title {
  margin: 0 0 var(--sm-space-3);
  color: var(--sm-orange);
  font-family: var(--sm-font-head);
  font-size: var(--sm-text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sm-blog-toc__list {
  margin: 0;
  padding: 0;
  counter-reset: sm-blog-toc;
  list-style: none;
}
.sm-blog-toc__list li {
  padding-left: 1.75rem;
  text-indent: -1.75rem;
}
.sm-blog-toc__list li + li {
  margin-top: var(--sm-space-2);
}
.sm-blog-toc__list li::before {
  display: inline-block;
  width: 1.75rem;
  color: var(--sm-orange);
  content: counter(sm-blog-toc) ".";
  counter-increment: sm-blog-toc;
  font-family: var(--sm-font-head);
  font-weight: 800;
  text-indent: 0;
}
.sm-blog-toc__list a {
  color: var(--sm-purple);
  font-size: var(--sm-text-sm);
  font-weight: 700;
  text-decoration: none;
}
.sm-blog-toc__list a:hover {
  color: var(--sm-orange);
  text-decoration: underline;
}

.sm-blog-content {
  max-width: var(--sm-blog-measure);
  margin: 0 auto var(--sm-space-8);
}
.sm-blog-content > * {
  margin-inline: auto;
}
.sm-blog-content > :first-child {
  margin-top: 0;
}
.sm-blog-content h2,
.sm-blog-content h3,
.sm-blog-content h4 {
  color: var(--sm-purple);
  font-family: var(--sm-font-head);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  scroll-margin-top: var(--sm-space-10);
}
.sm-blog-content h2 {
  margin: var(--sm-space-10) 0 var(--sm-space-3);
  font-size: clamp(24px, 3.2vw, 32px);
}
.sm-blog-content h3 {
  margin: var(--sm-space-8) 0 var(--sm-space-2);
  font-size: var(--sm-text-xl);
}
.sm-blog-content h4 {
  margin: var(--sm-space-6) 0 var(--sm-space-2);
  font-size: var(--sm-text-md);
}
.sm-blog-content p {
  margin: 0 0 var(--sm-space-5);
}
.sm-blog-content a {
  color: var(--sm-purple);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.sm-blog-content a:hover {
  color: var(--sm-orange);
}
.sm-blog-content ul,
.sm-blog-content ol {
  margin: 0 0 var(--sm-space-5);
  padding-left: 1.35rem;
}
.sm-blog-content li {
  margin-bottom: var(--sm-space-2);
}
.sm-blog-content li::marker {
  color: var(--sm-orange);
}
.sm-blog-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--sm-radius-md);
}
.sm-blog-content figure {
  margin: var(--sm-space-6) 0;
}
.sm-blog-content figcaption {
  margin-top: var(--sm-space-2);
  color: var(--sm-muted);
  font-size: var(--sm-text-sm);
}
.sm-blog-content blockquote {
  margin: var(--sm-space-6) 0;
  padding: var(--sm-space-2) 0 var(--sm-space-2) var(--sm-space-5);
  border-left: 3px solid var(--sm-orange);
  color: var(--sm-body);
  font-size: var(--sm-text-md);
}
.sm-blog-content blockquote p:last-child {
  margin-bottom: 0;
}
.sm-blog-content table {
  width: 100%;
  margin: 0 0 var(--sm-space-6);
  border-collapse: collapse;
  font-size: var(--sm-text-sm);
}
.sm-blog-content th,
.sm-blog-content td {
  padding: var(--sm-space-3);
  border-bottom: 1px solid var(--sm-border-lt);
  text-align: left;
  vertical-align: top;
}
.sm-blog-content th {
  color: var(--sm-purple);
  font-family: var(--sm-font-head);
  font-weight: 800;
}
.sm-blog-content hr {
  margin: var(--sm-space-8) 0;
  border: 0;
  border-top: 1px solid var(--sm-border);
}

/* The AEO blocks are injected around the body, so they clear the measure. */
.sm-blog-content > .sm-blog-answer,
.sm-blog-content > .sm-blog-takeaways,
.sm-blog-content > .sm-blog-howto,
.sm-blog-content > .sm-blog-faq,
.sm-blog-content > .sm-blog-sources {
  max-width: none;
}

@media (max-width: 860px) {
  .sm-blog-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sm-space-6);
    padding-top: var(--sm-space-8);
  }
  .sm-blog-hero__figure {
    order: -1;
  }
}

/*
 * Wide screens: the article column and a sticky table of contents sit
 * side by side instead of leaving ~560px of empty margin.
 *
 * The Breakdance template puts every blog shortcode element inside one Div,
 * so the Div becomes the grid and each .bde-shortcode child becomes a grid
 * item. Matched structurally rather than by Breakdance's generated id class
 * so it survives template revisions.
 */
@media (min-width: 1100px) {
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-toc):has(> .bde-shortcode > .sm-blog-content) {
    display: grid;
    grid-template-columns: minmax(0, var(--sm-blog-measure)) minmax(0, var(--sm-blog-aside));
    column-gap: var(--sm-blog-gutter);
    align-items: start;
    justify-content: center;
    max-width: var(--sm-max-width);
    margin-inline: auto;
  }

  /* Article flow stacks down the first column. */
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-toc):has(> .bde-shortcode > .sm-blog-content) > .bde-shortcode {
    grid-column: 1;
    min-width: 0;
  }

  /*
   * The TOC spans every row so the grid item is as tall as the article,
   * which is what gives position: sticky room to travel.
   */
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-toc):has(> .bde-shortcode > .sm-blog-content) > .bde-shortcode:has(> .sm-blog-toc) {
    grid-column: 2;
    grid-row: 1 / -1;
    position: sticky;
    top: var(--sm-space-8);
    align-self: start;
  }

  /* Inside the grid the columns already set the width; drop the centring. */
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-toc) .sm-blog-toc,
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-content) .sm-blog-content,
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-content) .sm-blog-answer,
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-content) .sm-blog-takeaways,
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-content) .sm-blog-howto,
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-content) .sm-blog-faq,
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-content) .sm-blog-sources {
    max-width: none;
    margin-inline: 0;
  }

  /* Compact the sidebar TOC — it is chrome now, not a content block. */
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-content) .sm-blog-toc {
    padding: var(--sm-space-4) var(--sm-space-5);
  }
  .breakdance .bde-div:has(> .bde-shortcode > .sm-blog-content) .sm-blog-toc__list a {
    font-size: var(--sm-text-xs);
    line-height: 1.45;
  }
}

/* Optional blog AEO blocks — omitted entirely when ACF fields are empty. */

.sm-blog-answer,
.sm-blog-takeaways,
.sm-blog-howto,
.sm-blog-faq,
.sm-blog-sources {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--sm-blog-measure);
  margin: 0 auto var(--sm-space-8);
  color: var(--sm-body);
  font-family: var(--sm-font-body);
  font-size: var(--sm-text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.sm-blog-answer *,
.sm-blog-takeaways *,
.sm-blog-howto *,
.sm-blog-faq *,
.sm-blog-sources * {
  box-sizing: border-box;
}

.sm-blog-answer {
  padding: var(--sm-space-6);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-lg);
  background: var(--sm-linen);
}
.sm-blog-answer__eyebrow {
  margin: 0 0 var(--sm-space-2);
  color: var(--sm-orange);
  font-family: var(--sm-font-head);
  font-size: var(--sm-text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sm-blog-answer h2,
.sm-blog-takeaways h2,
.sm-blog-howto h2,
.sm-blog-faq h2,
.sm-blog-sources h2 {
  margin: 0;
  color: var(--sm-purple);
  font-family: var(--sm-font-head);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.sm-blog-byline,
.sm-blog-answer__who {
  margin: var(--sm-space-3) 0 0;
  color: var(--sm-muted);
  font-size: var(--sm-text-sm);
}
.sm-blog-answer__text {
  margin: var(--sm-space-4) 0 0;
  color: var(--sm-body);
}

.sm-blog-takeaways ul,
.sm-blog-sources ul,
.sm-blog-howto ol {
  margin: var(--sm-space-4) 0 0;
  padding: 0;
  list-style: none;
}
.sm-blog-takeaways li {
  position: relative;
  padding: var(--sm-space-3) 0 var(--sm-space-3) 1.6rem;
  border-top: 1px solid var(--sm-border-lt);
  color: var(--sm-body);
}
.sm-blog-takeaways li:first-child {
  border-top: 0;
  padding-top: 0;
}
.sm-blog-takeaways li::before {
  position: absolute;
  left: 0;
  color: var(--sm-orange);
  content: "•";
  font-weight: 800;
}

.sm-blog-howto ol {
  counter-reset: sm-blog-step;
}
.sm-blog-howto li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: var(--sm-space-4);
  padding: var(--sm-space-4) 0;
  border-top: 1px solid var(--sm-border-lt);
}
.sm-blog-howto li:first-child {
  border-top: 0;
  padding-top: 0;
}
.sm-blog-howto li::before {
  counter-increment: sm-blog-step;
  color: var(--sm-orange);
  content: counter(sm-blog-step);
  font-family: var(--sm-font-head);
  font-size: var(--sm-text-md);
  font-weight: 800;
}
.sm-blog-howto h3 {
  grid-column: 2;
  margin: 0;
  color: var(--sm-purple);
  font-family: var(--sm-font-head);
  font-size: var(--sm-text-md);
  font-weight: 800;
}
.sm-blog-howto p {
  grid-column: 2;
  margin: var(--sm-space-2) 0 0;
  color: var(--sm-muted);
}

.sm-blog-faq__list {
  margin-top: var(--sm-space-4);
  border-top: 1px solid var(--sm-border);
}
.sm-blog-faq__item {
  border-bottom: 1px solid var(--sm-border);
}
.sm-blog-faq__item summary {
  position: relative;
  display: block;
  padding: var(--sm-space-4) 42px var(--sm-space-4) 0;
  color: var(--sm-purple);
  font-family: var(--sm-font-head);
  font-size: var(--sm-text-sm);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.sm-blog-faq__item summary::-webkit-details-marker {
  display: none;
}
.sm-blog-faq__item summary span::before,
.sm-blog-faq__item summary span::after {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 16px;
  height: 2px;
  content: "";
  background: var(--sm-orange);
}
.sm-blog-faq__item summary span::after {
  transform: rotate(90deg);
}
.sm-blog-faq__item[open] summary span::after {
  transform: rotate(0);
}
.sm-blog-faq__item > div {
  padding: 0 42px var(--sm-space-5) 0;
}
.sm-blog-faq__item p {
  margin: 0;
  color: var(--sm-muted);
  font-size: var(--sm-text-sm);
}

.sm-blog-sources li {
  padding: 4px 0;
}
.sm-blog-sources a {
  color: var(--sm-purple);
  font-weight: 700;
}
