.blog-layout {
  --blog-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px var(--padding-desktop) 48px;
}

.blog-title {
  margin-bottom: 24px;
  font-size: var(--font-size-3xl);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-dark);
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.blog-layout > .pdp-ad-bb {
  margin-bottom: 24px;
}

.blog-index-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 24px;
}

.blog-index-head .blog-title {
  margin-bottom: 0;
}

.blog-index-page {
  font-size: var(--font-size-md);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

/* The cards' big sibling: photo on the left and wider, flush to the edges. */
.blog-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  margin-bottom: 32px;
  overflow: hidden;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
  transition: border-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .blog-hero:hover {
    border-color: var(--color-border-strong);
  }
}

.blog-hero:active {
  border-color: var(--color-border-strong);
}

.blog-hero:not(:has(.blog-hero-image)) {
  grid-template-columns: 1fr;
}

.blog-hero-text {
  align-self: center;
  padding: 56px;
}

.blog-hero:has(.blog-hero-link:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.blog-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: var(--font-size-md);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-dark);
}

.blog-hero-eyebrow .home-chevrons {
  flex: 0 0 auto;
  color: var(--color-primary);
}

.blog-hero-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.4px;
  text-wrap: balance;
  overflow-wrap: anywhere;
  hyphens: auto;
  hyphenate-limit-chars: 12 5 5;
}

.blog-hero-link,
.blog-card-link {
  -webkit-tap-highlight-color: transparent;
}

.blog-hero-link {
  color: var(--color-text-dark);
  text-decoration: none;
}

.blog-hero-link:focus-visible {
  outline: none;
}

.blog-hero-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.blog-hero-teaser {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 14px;
  font-size: var(--font-size-lg);
  line-height: 1.55;
}

.blog-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 16px;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
}

.blog-hero-cta {
  display: inline-flex;
  align-items: center;
  height: 52px;
  margin-top: 24px;
  padding: 0 28px;
  border-radius: var(--radius-md);
  background: var(--color-primary-strong);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: #fff;
  transition: background-color 0.2s ease, transform 0.16s var(--blog-ease-out);
  /* The press transform lifts it above the title link's overlay, so the release would miss the link. */
  pointer-events: none;
}

/* The band is one link, so the button mirrors its states: hover, keyboard focus and press. */
.blog-hero:has(.blog-hero-link:focus-visible) .blog-hero-cta {
  background: var(--color-primary-strong-hover);
}

@media (hover: hover) and (pointer: fine) {
  .blog-hero:hover .blog-hero-cta {
    background: var(--color-primary-strong-hover);
  }
}

.blog-hero:active .blog-hero-cta {
  transform: scale(0.97);
}

.blog-hero-image {
  order: -1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 440px;
  object-fit: cover;
  background: var(--color-border-light);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
  list-style: none;
}

.blog-card {
  grid-column: span 2;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .blog-card:hover {
    border-color: var(--color-border-strong);
  }
}

.blog-card:active {
  border-color: var(--color-border-strong);
}

.blog-card:has(.blog-card-link:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.blog-card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--color-border-light);
}

.blog-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border-light);
}

.blog-card-image-placeholder img {
  opacity: 0.35;
}

.blog-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px 20px 20px;
}

.blog-card-body .blog-meta {
  margin-top: auto;
  padding-top: 4px;
}

.blog-card-wide {
  grid-column: span 3;
}

.blog-card:not(.blog-card-wide) .blog-card-teaser {
  -webkit-line-clamp: 2;
}

.blog-card-wide .blog-card-title {
  text-wrap: balance;
  font-size: var(--font-size-xl);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.blog-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  hyphens: auto;
  hyphenate-limit-chars: 12 5 5;
}

.blog-card-link {
  color: var(--color-text-dark);
  text-decoration: none;
}

.blog-card-link:focus-visible {
  outline: none;
}

/* Stretches the title link over the whole card: one click target, one accessible name. */
.blog-card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.blog-card-teaser {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--font-size-md);
  line-height: 1.55;
  color: var(--color-text-muted);
}

.blog-empty {
  padding: 40px 24px;
  text-align: center;
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.blog-pagination-status {
  font-size: var(--font-size-md);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.blog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-white);
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.16s var(--blog-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .blog-btn:hover {
    border-color: var(--color-primary-text);
    color: var(--color-primary-text);
  }
}

.blog-btn:active {
  transform: scale(0.97);
}

.blog-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.blog-article {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px;
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.blog-article-header {
  margin-bottom: 24px;
}

.blog-article-header .blog-title {
  margin-bottom: 12px;
  font-size: 34px;
  letter-spacing: -0.4px;
}

.blog-article-header .blog-meta {
  font-size: var(--font-size-md);
}

.blog-article-image {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 32px;
  border-radius: var(--radius-md);
}

/* The PDP gallery outside its .pdp-layout, which defines the spacing it reads. */
.blog-gallery {
  --pdp-card-padding-tight: 12px;
  padding: 0;
  margin-bottom: 32px;
}

/* The stage the PDP's consent layer and frame are positioned in. */
.blog-video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 24px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.blog-body {
  font-size: 18px;
  line-height: 1.65;
  color: var(--color-text);
  overflow-wrap: break-word;
}

.blog-body > * + * {
  margin-top: 1em;
}

.blog-body :is(h2, h3, h4) {
  margin-top: 1.6em;
  line-height: 1.3;
  color: var(--color-text-dark);
}

.blog-body h2 {
  font-size: var(--font-size-2xl);
}

.blog-body :is(h3, h4) {
  font-size: var(--font-size-xl);
}

/* Only the editor's links: the video notice brings its own link colour for the dark panel. */
.blog-body a:not([class]) {
  color: var(--color-primary-text);
}

.blog-body :is(ul, ol) {
  padding-left: 1.5em;
}

.blog-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.blog-body blockquote {
  padding-left: 16px;
  border-left: 3px solid var(--color-primary);
  color: var(--color-text-muted);
}

/* Code scrolls inside the column instead of widening the page. */
.blog-body pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px;
  font-size: var(--font-size-sm);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
}

/* Tables wrap instead of scrolling: a hidden scroll position cut words in half on a phone
   and is unreachable by keyboard. The label column of a key/value row gets a fixed share
   and breaks only between syllables; `anywhere` on the values lowers their minimum width
   so a long unbreakable value cannot push the table past the column. */
.blog-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-lg);
  line-height: 1.5;
}

.blog-body :is(th, td) {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
  hyphens: auto;
}

/* Editors also lay out images side by side as a table: equal columns, no label column. */
.blog-body table:has(img) {
  table-layout: fixed;
}

.blog-body table:not(:has(img)) td:first-child:not(:only-child) {
  width: 35%;
}

.blog-body td:not(:first-child) {
  overflow-wrap: anywhere;
}

.blog-back {
  margin-top: 40px;
}

@media (max-width: 1200px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-card,
  .blog-card-wide {
    grid-column: span 1;
  }
}

/* An odd card out in the two-column tier takes the whole row, image beside the text. */
@media (max-width: 1200px) and (not (max-width: 768px)) {
  .blog-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .blog-card:last-child:nth-child(odd) .blog-card-image {
    flex: 0 0 calc(50% - 12px);
    width: calc(50% - 12px);
  }

  .blog-card:last-child:nth-child(odd) .blog-card-image-placeholder {
    border-bottom: 0;
    border-right: 1px solid var(--color-border-light);
  }

  .blog-card:last-child:nth-child(odd) .blog-card-body {
    justify-content: center;
    padding: 24px 32px;
  }

  .blog-card:last-child:nth-child(odd) .blog-meta {
    margin-top: 0;
  }
}

/* Keeps the headline above the title on one line down to the stacking point. */
@media (max-width: 1400px) {
  .blog-hero-text {
    padding: 48px;
  }
}

@media (max-width: 1200px) {
  .blog-hero {
    grid-template-columns: 1fr;
  }

  .blog-hero-text {
    padding: 32px 40px 40px;
  }

  .blog-hero-image {
    height: auto;
    min-height: 0;
    aspect-ratio: 21 / 9;
  }
}

@media (max-width: 768px) {
  .blog-layout {
    padding: 0 var(--padding-mobile) 32px;
  }

  .blog-title {
    margin-bottom: 16px;
    font-size: var(--font-size-2xl);
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Inset and rounded like the cards below, which read as list entries: a deliberate
     exception to the card layout rule's full-bleed cards. */
  .blog-hero {
    margin-bottom: 12px;
  }

  .blog-hero-text {
    padding: 24px var(--padding-mobile);
  }

  .blog-hero-image {
    aspect-ratio: 16 / 9;
  }

  .blog-hero-eyebrow {
    margin-bottom: 12px;
    font-size: var(--font-size-sm);
  }

  .blog-hero-title {
    font-size: var(--font-size-2xl);
    line-height: 1.2;
    letter-spacing: -0.2px;
  }

  .blog-hero-cta {
    display: flex;
    justify-content: center;
    height: 48px;
  }

  .blog-card:not(.blog-card-wide) {
    flex-direction: row;
  }

  .blog-card:not(.blog-card-wide) .blog-card-image {
    flex: 0 0 38%;
    width: 38%;
    aspect-ratio: auto;
  }

  .blog-card:not(.blog-card-wide) .blog-card-image-placeholder {
    border-bottom: 0;
    border-right: 1px solid var(--color-border-light);
  }

  .blog-card:not(.blog-card-wide) .blog-card-image-placeholder img {
    width: 70%;
    height: auto;
  }

  .blog-card:not(.blog-card-wide) .blog-card-body {
    justify-content: center;
    gap: 6px;
    padding: 12px;
  }

  .blog-card:not(.blog-card-wide) .blog-meta {
    margin-top: 0;
    padding-top: 0;
  }

  .blog-card:not(.blog-card-wide) .blog-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .blog-card:not(.blog-card-wide) .blog-card-teaser {
    display: none;
  }

  /* Card layout rule: the article is a full-width card, so it runs edge to edge. */
  .blog-layout:has(> .blog-article) {
    padding-left: 0;
    padding-right: 0;
  }

  .blog-layout:has(> .blog-article) > .pdp-ad-bb {
    padding: 0 var(--padding-mobile);
  }

  .blog-article {
    padding: 24px var(--padding-mobile);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .blog-article-image {
    margin-bottom: 24px;
  }

  .blog-article-header .blog-title {
    margin-bottom: 8px;
    font-size: var(--font-size-2xl);
    letter-spacing: normal;
  }

  .blog-article-header .blog-meta {
    font-size: var(--font-size-xs);
  }

  .blog-body {
    font-size: var(--font-size-lg);
    line-height: 1.7;
  }

  .blog-body h2 {
    font-size: var(--font-size-xl);
  }

  .blog-body :is(h3, h4) {
    font-size: var(--font-size-lg);
  }

  .blog-body table {
    font-size: var(--font-size-md);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-hero,
  .blog-hero-cta,
  .blog-btn {
    transition: none;
  }

  .blog-hero:active .blog-hero-cta,
  .blog-btn:active {
    transform: none;
  }
}
