/* Detail banner (templates/components/detail-page.html.twig): a copy
   of the gradient banner with the content at the bottom and the color
   fading up from it. --gradient-color is set inline per microsite. */
.detail-banner {
  --image-position: top center;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: flex-start;
  min-height: 840px;
  overflow: hidden;
  color: var(--brand-off-white);
  /* Shows when the page has no banner image. */
  background-color: var(--gradient-color);
  border-radius: 0 0 2.5rem 2.5rem;
}

.detail-banner__image {
  z-index: 1;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--image-position);
}

.detail-banner::before {
  z-index: 2;
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to top, var(--gradient-color) 0, transparent 100%);
}

.detail-banner__content {
  z-index: 3;
  position: relative;
  width: 100%;
}

.detail-banner .section-title {
  max-width: 768px;
  margin-bottom: 0;
}

.detail-banner .section-description {
  max-width: unset;
  font-size: 20px;
}

/* An h1 for the page, sized as an h2. */
.detail-banner h1.section-title__heading.h2-style {
  font-size: 40px;
}

.detail-banner__date {
  font-size: 18px;
  line-height: 1.5;
}

.detail-body.max-width {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: 0;
}

.detail-body,
.detail-body * {
  font-family: var(--font-ideal-sans-regular);
}

/* Body text is 18px. Everything but the headings inherits it, so headings
   keep their h1-h6 sizes and text inside a heading (e.g. a <span>) keeps
   the heading's size. */
.detail-body {
  font-size: 18px;
}

.detail-body :not(h1, h2, h3, h4, h5, h6) {
  font-size: inherit;
}

/* Headings in the body are semibold, as .font-semibold. Their children
   too, as .detail-body * would set them back to regular. */
.detail-body :is(h1, h2, h3, h4, h5, h6),
.detail-body :is(h1, h2, h3, h4, h5, h6) * {
  font-family: var(--font-ideal-sans-semibold);
  font-weight: 600;
}

/* A phrase wrapped in a <span> in the editor is highlighted in the
   microsite color (--microsite-color, set inline). */
.detail-body span {
  color: var(--microsite-color);
}

/* Captioned images: no gray background behind the image or caption
   (from Olivero's embedded-media.css). */
.detail-body figure,
.detail-body figcaption {
  background: none;
}

/* An image given the full-width class in the editor breaks out of the
   1080px body to the full viewport width; the rest of the body stays at
   1080px. 50% is the center of the (centered) body column. A captioned
   image is wrapped in a figure, and the class moves to the figure, so the
   whole figure (image and caption) breaks out. */
.detail-body img.full-width,
.detail-body figure.full-width {
  display: block;
  float: none;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: 0;
}

.detail-body img.full-width,
.detail-body figure.full-width > img {
  height: 760px;
  object-fit: cover;
}

.detail-body figure.full-width > img {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
}

/* The caption spans the full width too, inset by the side padding of
   .max-width (mirrors its breakpoints in style.css, in the media queries
   below). */
.detail-body figure.full-width > figcaption {
  display: block;
  max-width: none;
  margin-top: 0.75rem;
  padding-inline: 1.25rem;
}

/* 100vw includes the scrollbar, so clip the few pixels it overflows by
   instead of adding a horizontal scrollbar. clip (not hidden) keeps
   position: sticky working. */
body:has(.detail-body :is(img, figure).full-width) {
  overflow-x: clip;
}

/* Read more: other stories from the microsite. The background is the
   microsite color (--microsite-color, set inline) at the lightness and
   softness of the design sample (#E94E35 -> #FFE0B6), keeping its own hue. */
.detail-read-more {
  /* For browsers without relative color syntax. */
  background: var(--brand-neutral-2);
  background: oklch(from var(--microsite-color) 0.922 calc(c * 0.33) h);
}

.detail-read-more .three-column-grid {
  gap: 40px;
}

/* Read more as the last section (no footer CTA): the footer is pulled up
   over it by the height of its rounded top (64px), so the corners show the
   Read more color instead of the page background. Read more gets that
   much more bottom padding to make room. */
.detail-read-more--before-footer {
  padding-bottom: 64px;
}

body:has(.detail-read-more--before-footer) :is(.main-footer, .home-footer, .branded-footer) {
  position: relative;
  z-index: 2;
  margin-top: -64px;
}

.detail-read-more__title {
  margin-bottom: 1.5rem;
}

.detail-read-more .latest-stories-card__eyebrow {
  font-family: var(--font-ideal-sans-regular);
  font-weight: 400;
  font-size: 14px;
}

@media (min-width: 768px) {
  .detail-banner {
    --image-position: 75% center;
    border-radius: 0;
    min-height: 760px;
  }
}

@media (min-width: 1080px) {
  .detail-banner h1.section-title__heading.h2-style {
    font-size: 48px;
  }

  .detail-banner .section-description {
    font-size: 22px;
  }

  .detail-banner__date {
    font-size: 20px;
  }

  .detail-body figure.full-width > figcaption {
    padding-inline: 2.188rem;
  }
}

@media (min-width: 1280px) {
  .detail-body figure.full-width > figcaption {
    padding-inline: 4rem;
  }
}

@media (min-width: 1440px) {
  .detail-banner h1.section-title__heading.h2-style {
    font-size: 64px;
  }
}

@media (min-width: 1600px) {
  .detail-banner {
    --image-position: center right;
  }

  .detail-body figure.full-width > figcaption {
    padding-inline: 7.5rem;
  }
}
