.aptly-news-showcase,
.aptly-news-archive {
  --aptly-news-title-font: var(
    --wp--preset--font-family--dream-orphans,
    "Dream Orphans",
    "Arial Narrow",
    sans-serif
  );
  --aptly-news-ink: #191919;
  --aptly-news-muted: #66645f;
  --aptly-news-teal: #0092aa;
  --aptly-news-gold: #eba748;
}

.aptly-news-showcase {
  background: #f7f7f1;
  color: var(--aptly-news-ink);
  padding: 0 clamp(1.5rem, 6vw, 5.5rem) clamp(3.5rem, 7vw, 6rem);
  position: relative;
  padding-top: 3.5rem;
}

@font-face {
  font-family: "Dream Orphans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/wp-content/uploads/fonts/Dream-Orphans-Bd.otf") format("opentype");
}

.aptly-news-showcase::before,
.aptly-news-showcase::after {
  content: "";
  display: block;
  margin-inline: auto;
  max-width: 1200px;
}

.aptly-news-showcase__inner,
.aptly-news-archive {
  margin-inline: auto;
  max-width: 1200px;
}

.aptly-news-headline {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.25fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.aptly-news-headline__image-link,
.aptly-news-card__image-link {
  display: block;
  overflow: hidden;
  position: relative;
}

.aptly-news-headline__image-link {
  aspect-ratio: 16 / 9;
}

.aptly-news__image {
  display: block;
  height: 100%;
  inset: 0;
  max-width: none;
  object-fit: cover;
  object-position: center;
  position: absolute;
  transition: transform 0.25s ease;
  width: 100%;
}

.aptly-news__image--placeholder {
  background: linear-gradient(
    135deg,
    var(--aptly-news-teal),
    #006a7d 55%,
    var(--aptly-news-gold)
  );
}

.aptly-news-headline__image-link:hover .aptly-news__image,
.aptly-news-card__image-link:hover .aptly-news__image {
  transform: scale(1.035);
}

.aptly-news-headline__time,
.aptly-news-card__meta {
  color: var(--aptly-news-muted);
  font-size: 0.72rem;
  line-height: 1.25;
  margin: 0 0 0.7rem;
}

.aptly-news-headline__title,
.aptly-news-card__title {
  font-family: var(--aptly-news-title-font);
  font-weight: 700;
  line-height: 1.03;
  margin: 0;
}

.aptly-news-headline__title {
  font-size: clamp(1.5rem, 2.6vw, 2.5rem);
}

.aptly-news-headline__title a,
.aptly-news-card__title a {
  color: inherit;
  font-family: inherit;
  text-decoration: none;
}

.aptly-news-headline__title a:hover,
.aptly-news-headline__title a:focus-visible,
.aptly-news-card__title a:hover,
.aptly-news-card__title a:focus-visible {
  color: var(--aptly-news-teal);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.aptly-news-headline__excerpt,
.aptly-news-card__excerpt {
  color: var(--aptly-news-muted);
  font-size: 0.9rem;
  line-height: 1.35;
  margin: 1rem 0 0;
}

.aptly-news-headline__meta,
.aptly-news-card__meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.aptly-news-headline__meta {
  font-size: 0.75rem;
  margin: 1.1rem 0 0;
}

.aptly-news-headline__meta span:first-child,
.aptly-news-card__meta span:first-child {
  color: var(--aptly-news-teal);
  font-weight: 700;
  text-transform: uppercase;
}

.aptly-news-showcase__header {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  margin-top: clamp(3.5rem, 7vw, 6rem);
}

.aptly-news-showcase__header h2 {
  font-size: clamp(1.5rem, 2.2vw, 2.25rem);
  line-height: 1;
  margin: 0;
}

.aptly-news-showcase__all-link {
  color: var(--aptly-news-teal);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.aptly-news-showcase__all-link:hover,
.aptly-news-showcase__all-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.aptly-news-showcase__cards {
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.aptly-news-archive__grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.aptly-news-card {
  background: #fff;
  border-radius: 0.65rem;
  overflow: hidden;
  min-width: 0;
}

.aptly-news-card__image-link {
  aspect-ratio: 16 / 10;
}

.aptly-news-showcase__cards .aptly-news-card {
  aspect-ratio: 2 / 3;
  border-radius: 1rem;
  display: flex;
  flex: 0 0 clamp(14rem, 21vw, 17.5rem);
  flex-direction: column;
  scroll-snap-align: start;
}

.aptly-news-showcase__cards .aptly-news-card__image-link {
  aspect-ratio: 16 / 10;
  flex: 0 0 auto;
}

.aptly-news-showcase__cards .aptly-news-card__content {
  flex: 1 1 auto;
  padding: 1.25rem 1.5rem 1.5rem;
}

.aptly-news-showcase__cards .aptly-news-card__title {
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  line-height: 0.98;
}

.aptly-news-showcase__cards .aptly-news-card__meta {
  font-size: 0.75rem;
  margin-bottom: 0.9rem;
}

.aptly-news-showcase__cards .aptly-news-card__excerpt {
  font-size: 0.85rem;
  margin-top: 0.9rem;
}

.aptly-news-card__content {
  padding: 1rem 1rem 1.25rem;
}

.aptly-news-card__meta {
  font-size: 0.64rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.aptly-news-card__title {
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
}

.aptly-news-card__excerpt {
  font-size: 0.72rem;
  margin-top: 0.75rem;
}

.aptly-news-archive {
  margin-top: 0;
  max-width: unset !important;
}

/* Gutenberg-only wrapper used by the archive preview. */
.aptly-news-archive-editor-preview {
  margin-inline: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/*
 * Gutenberg does not load a Group block's Additional CSS into its canvas.
 * The news page's Stack is intentionally capped at 1200px on the frontend,
 * so reproduce that editor-only constraint when it contains this archive.
 */
.editor-styles-wrapper .wp-block-group:has(.aptly-news-archive-editor-preview) {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 1200px !important;
}

.aptly-news-archive__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 4vw, 4.5rem);
  margin-top: 0;
  row-gap: clamp(2.5rem, 5vw, 5rem);
}

/*
 * The archive uses a two-up editorial list: each story keeps its image and
 * copy together, rather than stacking into a conventional card grid. The
 * showcase cards above deliberately retain their existing treatment.
 */
.aptly-news-archive__grid .aptly-news-card {
  align-items: center;
  background: transparent;
  border-radius: 0;
  display: grid;
  gap: clamp(1rem, 2vw, 1.75rem);
  grid-template-columns: minmax(8.5rem, 0.9fr) minmax(0, 1.1fr);
  min-height: 0;
  overflow: visible;
}

.aptly-news-archive__grid .aptly-news-card__image-link {
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  width: 100%;
}

.aptly-news-archive__grid .aptly-news-card__content {
  align-self: center;
  padding: 0;
}

.aptly-news-card__read-link {
  align-items: center;
  color: inherit;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 0.55rem;
  margin-top: 1.1rem;
  text-decoration: none;
}

.aptly-news-card__read-link span {
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: inline-flex;
  height: 1.55em;
  justify-content: center;
  line-height: 1;
  width: 1.55em;
}

.aptly-news-card__read-link:hover,
.aptly-news-card__read-link:focus-visible {
  color: var(--aptly-news-teal);
}

.aptly-news-archive__pagination {
  margin-top: 3rem;
}

.aptly-news-archive__pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.aptly-news-archive__pagination ul {
  justify-content: center;
}

.aptly-news-archive__pagination li .prev,
.aptly-news-archive__pagination li .next {
  padding: 4px 16px;
  height: 40px;
}

.aptly-news-archive__pagination li :not(.prev, .next).page-numbers {
  width: 40px;
  height: 40px;
}

.aptly-news-archive__pagination a,
.aptly-news-archive__pagination .current {
  border: 1px solid var(--aptly-news-teal);
  color: var(--aptly-news-teal);
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.aptly-news-archive__pagination .current {
  background: var(--aptly-news-teal);
  color: #fff;
}

@media (max-width: 47.99rem) {
  .aptly-news-showcase {
    padding-inline: 1.5rem 0;
  }

  .aptly-news-showcase::before {
    margin-right: 0;
  }

  .aptly-news-showcase::after {
    margin-right: 0;
  }

  .aptly-news-showcase__inner {
    padding-right: 1.5rem;
  }

  .aptly-news-headline {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .aptly-news-showcase__header {
    margin-top: 3.5rem;
  }

  .aptly-news-showcase__cards {
    padding: 0 1.5rem 0.75rem 0;
  }

  .aptly-news-showcase__cards .aptly-news-card {
    flex: 0 0 min(78vw, 18rem);
  }

  .aptly-news-archive__grid {
    grid-template-columns: 1fr;
  }

  .aptly-news-archive__grid .aptly-news-card {
    gap: 1rem;
    grid-template-columns: minmax(7.5rem, 0.85fr) minmax(0, 1.15fr);
  }
}

@media (min-width: 48rem) and (max-width: 74.99rem) {
  .aptly-news-archive__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
