:root {
  --aps-editorial-max: 1180px;
  --aps-editorial-line: color-mix(in srgb, var(--aps-color-ink, #211f1c) 16%, transparent);
  --aps-editorial-paper: color-mix(in srgb, var(--aps-color-paper, #f7f2eb) 92%, white);
  --aps-editorial-blue: #2d566b;
  --aps-editorial-green: #55785d;
  --aps-editorial-plum: #744d70;
  --aps-editorial-earth: #b85238;
  --aps-editorial-gold: #dfaa00;
}

.aps-page-main > .wp-block-post-content > .aps-editorial-page,
.aps-page-main > .wp-block-post-content > .aps-editorial-section,
.aps-page-main > .wp-block-post-content > .wp-block-buttons {
  box-sizing: border-box;
  width: min(100%, var(--aps-editorial-max)) !important;
  max-width: var(--aps-editorial-max) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

.aps-editorial-page {
  display: grid;
  gap: clamp(3.5rem, 7vw, 7.5rem);
}

.aps-editorial-page__intro {
  position: relative;
  display: grid;
  gap: 1.4rem;
  width: 100%;
  min-width: 0;
}

.aps-editorial-page__intro .aps-kicker,
.aps-editorial-page__intro .aps-editorial-lead,
.aps-editorial-page__intro .aps-editorial-buttons {
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

.aps-editorial-page__intro .aps-editorial-lead {
  max-width: 52ch !important;
  font-size: clamp(1.28rem, 2vw, 1.75rem) !important;
  line-height: 1.48;
}

.aps-editorial-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(2rem, 5vw, 5.2rem);
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin: 0 !important;
  padding-top: clamp(2rem, 4vw, 3.8rem);
  border-top: 1px solid var(--aps-editorial-line);
}

.aps-editorial-section__heading,
.aps-editorial-section__content {
  min-width: 0;
}

.aps-editorial-section__heading {
  align-self: start;
}

.aps-editorial-section h2 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 4.8rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.aps-editorial-section p,
.aps-editorial-section li {
  font-size: clamp(1rem, 1.25vw, 1.16rem);
  line-height: 1.65;
}

.aps-editorial-section__content > p:first-child {
  margin-top: 0;
  font-size: clamp(1.08rem, 1.6vw, 1.38rem);
  line-height: 1.55;
}

.aps-editorial-section__content > *:last-child {
  margin-bottom: 0;
}

.aps-editorial-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.aps-editorial-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.aps-editorial-list li {
  position: relative;
  padding: 1rem 1rem 1rem 3rem;
  border: 1px solid var(--aps-editorial-line);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--aps-editorial-paper) 84%, transparent);
}

.aps-editorial-list li::before {
  position: absolute;
  top: 1.15rem;
  left: 1rem;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid var(--aps-editorial-gold);
  border-radius: 50% 50% 50% 0;
  content: "";
  transform: rotate(-45deg);
}

.aps-editorial-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.aps-editorial-card-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aps-editorial-card-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.aps-editorial-card-grid--5,
.aps-editorial-card-grid--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aps-editorial-card {
  position: relative;
  min-width: 0;
  min-height: 230px;
  padding: clamp(1.25rem, 2.2vw, 2rem);
  overflow: hidden;
  border: 1px solid var(--aps-editorial-line);
  border-top: 4px solid var(--aps-editorial-blue);
  border-radius: 1.25rem;
  background: var(--aps-editorial-paper);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.aps-editorial-card:nth-child(3n + 2) {
  border-top-color: var(--aps-editorial-green);
}

.aps-editorial-card:nth-child(3n + 3) {
  border-top-color: var(--aps-editorial-plum);
}

.aps-editorial-card:hover,
.aps-editorial-card:focus-within {
  z-index: 1;
  border-color: color-mix(in srgb, var(--aps-editorial-gold) 65%, var(--aps-editorial-line));
  box-shadow: 0 24px 55px color-mix(in srgb, #211f1c 16%, transparent);
  transform: translateY(-6px) rotate(-0.35deg);
}

.aps-editorial-card__number {
  position: absolute;
  top: 0.7rem;
  right: 1rem;
  color: color-mix(in srgb, currentColor 11%, transparent);
  font-family: var(--wp--preset--font-family--display, Georgia, serif);
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: 1;
}

.aps-editorial-icon {
  display: block;
  width: 42px;
  height: 42px;
  margin-bottom: clamp(2rem, 4vw, 4rem);
  object-fit: contain;
}

.aps-editorial-card h3 {
  position: relative;
  max-width: 12ch;
  margin: 0 0 0.85rem;
  font-size: clamp(1.55rem, 2.25vw, 2.45rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.aps-editorial-card p,
.aps-editorial-card li {
  position: relative;
  margin-bottom: 0;
  font-size: 0.98rem;
  line-height: 1.55;
}

.aps-editorial-card--compact {
  min-height: 190px;
}

.aps-editorial-card--compact .aps-editorial-icon {
  margin-bottom: 2rem;
}

.aps-editorial-section--spotlight,
.aps-editorial-section--cta,
.aps-editorial-section--closing,
.aps-editorial-section--transparency,
.aps-editorial-section--membership {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: clamp(2rem, 5vw, 5rem);
  overflow: hidden;
  border: 1px solid var(--aps-editorial-line);
  border-radius: clamp(1.25rem, 3vw, 2.5rem);
  background: linear-gradient(135deg, color-mix(in srgb, var(--aps-editorial-blue) 11%, var(--aps-editorial-paper)), var(--aps-editorial-paper) 58%);
}

.aps-editorial-section--spotlight h2,
.aps-editorial-section--cta h2,
.aps-editorial-section--closing h2,
.aps-editorial-section--transparency h2,
.aps-editorial-section--membership h2 {
  max-width: 16ch;
  font-size: clamp(2.2rem, 2.9vw, 3.35rem);
}

.aps-editorial-section--spotlight::after,
.aps-editorial-section--closing::after {
  position: absolute;
  right: -6rem;
  bottom: -9rem;
  width: 27rem;
  height: 34rem;
  border: 1px solid color-mix(in srgb, var(--aps-editorial-blue) 45%, transparent);
  border-radius: 14rem 14rem 2rem 2rem;
  background:
    radial-gradient(circle at 35% 70%, color-mix(in srgb, var(--aps-editorial-green) 55%, transparent) 0 34%, transparent 35%),
    radial-gradient(circle at 60% 25%, color-mix(in srgb, var(--aps-editorial-gold) 38%, transparent) 0 24%, transparent 25%);
  content: "";
  pointer-events: none;
  transform: rotate(8deg);
  animation: aps-editorial-drift 8s ease-in-out infinite alternate;
}

.aps-editorial-section--cta {
  background: linear-gradient(120deg, color-mix(in srgb, var(--aps-editorial-gold) 20%, var(--aps-editorial-paper)), var(--aps-editorial-paper));
}

.aps-editorial-section--transparency {
  background: linear-gradient(135deg, color-mix(in srgb, var(--aps-editorial-green) 17%, var(--aps-editorial-paper)), var(--aps-editorial-paper));
}

.aps-editorial-section--membership {
  background: linear-gradient(135deg, color-mix(in srgb, var(--aps-editorial-plum) 14%, var(--aps-editorial-paper)), var(--aps-editorial-paper));
}

.aps-editorial-section--spotlight > *,
.aps-editorial-section--closing > * {
  position: relative;
  z-index: 1;
}

.aps-editorial-section--cards,
.aps-editorial-section--steps,
.aps-editorial-section--documents,
.aps-editorial-section--timeline,
.aps-editorial-section--pathways {
  display: block;
}

.aps-editorial-section--cards .aps-editorial-section__heading h2,
.aps-editorial-section--steps .aps-editorial-section__heading h2,
.aps-editorial-section--documents .aps-editorial-section__heading h2,
.aps-editorial-section--timeline .aps-editorial-section__heading h2,
.aps-editorial-section--pathways .aps-editorial-section__heading h2 {
  max-width: 18ch;
  margin-bottom: 1.2rem;
}

.aps-editorial-section--cards .aps-editorial-section__content > p,
.aps-editorial-section--steps .aps-editorial-section__content > p,
.aps-editorial-section--documents .aps-editorial-section__content > p,
.aps-editorial-section--timeline .aps-editorial-section__content > p,
.aps-editorial-section--pathways .aps-editorial-section__content > p {
  max-width: 67ch;
}

.aps-editorial-section--steps .aps-editorial-card {
  min-height: 300px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--aps-editorial-paper) 86%, white), color-mix(in srgb, var(--aps-editorial-blue) 9%, var(--aps-editorial-paper)));
}

.aps-editorial-section--steps .aps-editorial-card:nth-child(2) {
  background: linear-gradient(165deg, var(--aps-editorial-paper), color-mix(in srgb, var(--aps-editorial-plum) 12%, var(--aps-editorial-paper)));
}

.aps-editorial-section--steps .aps-editorial-card:nth-child(3) {
  background: linear-gradient(165deg, var(--aps-editorial-paper), color-mix(in srgb, var(--aps-editorial-earth) 12%, var(--aps-editorial-paper)));
}

.aps-editorial-section--steps .aps-editorial-card:nth-child(4) {
  background: linear-gradient(165deg, var(--aps-editorial-paper), color-mix(in srgb, var(--aps-editorial-green) 12%, var(--aps-editorial-paper)));
}

.aps-editorial-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: calc(-1 * clamp(2rem, 5vw, 5rem)) calc(-1 * clamp(2rem, 5vw, 5rem)) clamp(2rem, 4vw, 4rem);
  background: var(--aps-editorial-line);
  border-bottom: 1px solid var(--aps-editorial-line);
}

.aps-editorial-stat {
  display: grid;
  gap: 0.35rem;
  padding: clamp(1.5rem, 3vw, 2.6rem);
  background: var(--aps-editorial-paper);
}

.aps-editorial-stat strong {
  font-family: var(--wp--preset--font-family--display, Georgia, serif);
  font-size: clamp(1.65rem, 3vw, 3.4rem);
  line-height: 1;
}

.aps-editorial-stat span {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aps-editorial-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: aps-year;
}

.aps-editorial-timeline li {
  position: relative;
  min-height: 180px;
  padding: 2.3rem 1.2rem 1rem;
  border-top: 2px solid var(--aps-editorial-gold);
}

.aps-editorial-timeline li::before {
  position: absolute;
  top: -0.55rem;
  left: 1rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--aps-editorial-paper);
  border-radius: 50%;
  background: var(--aps-editorial-gold);
  content: "";
}

.aps-editorial-section blockquote {
  margin: 2rem 0 0;
  padding: 1.5rem 0 0 1.5rem;
  border: 0;
  border-left: 4px solid var(--aps-editorial-gold);
}

.aps-editorial-section blockquote p {
  max-width: 28ch;
  font-family: var(--wp--preset--font-family--display, Georgia, serif);
  font-size: clamp(1.8rem, 3.6vw, 3.6rem);
  line-height: 1.03;
}

.aps-page-slug-gazette .aps-editorial-section {
  display: block;
}

.aps-page-slug-gazette .aps-editorial-section > h2 {
  width: 100% !important;
  max-width: none !important;
  margin-bottom: 2rem;
}

.aps-page-slug-gazette .aps-editorial-section > .wp-block-post-template {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

.aps-page-slug-gazette .wp-block-post-template > li {
  min-width: 0;
}

.aps-page-slug-gazette .wp-block-post-template .wp-block-post-title {
  overflow-wrap: anywhere;
}

.single-post main > .wp-block-post-content,
.single-post main > article,
.blog .aps-page-main > .wp-block-post-content,
.archive .aps-page-main > .wp-block-post-content {
  width: min(100%, var(--aps-editorial-max)) !important;
  max-width: var(--aps-editorial-max) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

.single-post .wp-block-post-content > :where(p, ul, ol, h2, h3, h4, blockquote) {
  width: min(100%, 78ch) !important;
  max-width: 78ch !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

.single-post .wp-block-post-content > :where(.wp-block-image, .wp-block-gallery, .wp-block-cover, .wp-block-group, figure) {
  width: 100% !important;
  max-width: var(--aps-editorial-max) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

html[data-theme="dark"] {
  --aps-editorial-line: color-mix(in srgb, #f7f2eb 19%, transparent);
  --aps-editorial-paper: color-mix(in srgb, #211f1c 88%, #2d566b);
}

html[data-theme="dark"] .aps-editorial-card,
html[data-theme="dark"] .aps-editorial-section--spotlight,
html[data-theme="dark"] .aps-editorial-section--cta,
html[data-theme="dark"] .aps-editorial-section--closing,
html[data-theme="dark"] .aps-editorial-section--transparency,
html[data-theme="dark"] .aps-editorial-section--membership {
  color: #f7f2eb;
}

@keyframes aps-editorial-drift {
  from { transform: translate3d(0, 0, 0) rotate(8deg); }
  to { transform: translate3d(-1rem, -0.8rem, 0) rotate(5deg); }
}

@media (max-width: 980px) {
  .aps-editorial-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .aps-editorial-section h2 {
    max-width: 17ch;
  }

  .aps-editorial-card-grid--3,
  .aps-editorial-card-grid--4,
  .aps-editorial-card-grid--5,
  .aps-editorial-card-grid--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .aps-editorial-timeline {
    grid-template-columns: 1fr;
  }

  .aps-editorial-timeline li {
    min-height: 0;
    padding: 1.2rem 1rem 1.2rem 2.2rem;
    border-top: 0;
    border-left: 2px solid var(--aps-editorial-gold);
  }

  .aps-editorial-timeline li::before {
    top: 1.45rem;
    left: -0.55rem;
  }

  .aps-page-slug-gazette .aps-editorial-section > .wp-block-post-template {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .aps-editorial-page {
    gap: 3.5rem;
  }

  .aps-editorial-card-grid,
  .aps-editorial-card-grid--2,
  .aps-editorial-card-grid--3,
  .aps-editorial-card-grid--4,
  .aps-editorial-card-grid--5,
  .aps-editorial-card-grid--6,
  .aps-editorial-stats {
    grid-template-columns: 1fr;
  }

  .aps-page-slug-gazette .aps-editorial-section > .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }

  .aps-editorial-card {
    min-height: 0;
  }

  .aps-editorial-section--spotlight,
  .aps-editorial-section--cta,
  .aps-editorial-section--closing,
  .aps-editorial-section--transparency,
  .aps-editorial-section--membership {
    padding: 1.4rem;
  }

  .aps-editorial-stats {
    margin: -1.4rem -1.4rem 1.8rem;
  }

  .aps-editorial-section--spotlight::after,
  .aps-editorial-section--closing::after {
    right: -12rem;
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aps-editorial-section--spotlight::after,
  .aps-editorial-section--closing::after {
    animation: none;
  }

  .aps-editorial-card {
    transition: none;
  }
}
