.hub-header {
  padding: clamp(4rem, 10vw, 8rem) 0 var(--cn-section-tight);
}

.hub-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: end;
}

.hub-header .eyebrow {
  margin-bottom: 0.9rem;
}

.hub-header h1 {
  margin: 0;
  font-family: var(--cn-font-display);
  font-size: var(--cn-h1);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: var(--cn-display-weight);
}

.hub-header__dek {
  color: var(--cn-muted);
  font-family: var(--cn-font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  line-height: 1.35;
  font-style: italic;
  margin: 1.25rem 0 0;
}

.hub-header__image {
  border-radius: var(--cn-image-radius);
  aspect-ratio: 16 / 10;
  background: var(--cn-card);
  overflow: hidden;
}

.hub-header__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hub-frame {
  margin-bottom: var(--cn-section-tight);
}

.hub-frame__box {
  padding: clamp(2rem, 5vw, 4rem);
  background: var(--cn-card);
  border: 1px solid var(--cn-border);
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(1.5rem, 5vw, 4rem);
}

.hub-frame h2 {
  margin: 0;
  font-family: var(--cn-font-display);
  font-size: var(--cn-h2);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: var(--cn-display-weight);
}

.hub-frame p {
  margin: 0;
  color: var(--cn-muted);
}

.hub-feature {
  margin-bottom: var(--cn-section-tight);
}

.hub-feature__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.hub-feature__image {
  border-radius: var(--cn-image-radius);
  aspect-ratio: 16 / 10;
  background: var(--cn-card);
  overflow: hidden;
}

.hub-feature__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hub-feature .eyebrow {
  margin-bottom: 0.9rem;
}

.hub-feature h2 {
  margin: 0 0 1rem;
  font-family: var(--cn-font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: var(--cn-display-weight);
}

.hub-feature h2 a {
  text-decoration: none;
}

.hub-feature p {
  color: var(--cn-muted);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

.hub-grid > .post-card {
  align-self: start;
  height: auto;
}

.hub-posts {
  padding: var(--cn-section-tight) 0 0;
}

.hub-pagination {
  margin-top: 3rem;
  font-size: 0.85rem;
}

.hub-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hub-pagination a,
.hub-pagination span {
  min-width: 2.4rem;
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cn-border);
  text-decoration: none;
}

.hub-pagination .current {
  background: var(--cn-accent);
  border-color: var(--cn-accent);
  color: #fff;
}

@media (max-width: 880px) {
  .hub-header__inner,
  .hub-frame__box,
  .hub-feature__grid,
  .hub-grid {
    grid-template-columns: 1fr;
  }
}


/* Category and tag collection hubs: preserve the source image aspect ratio instead of enforcing card crops. */
:is(.category, .tag) .hub-header__image,
:is(.category, .tag) .hub-feature__image,
:is(.category, .tag) .post-card__image {
  aspect-ratio: auto;
}

:is(.category, .tag) .hub-header__image img,
:is(.category, .tag) .hub-feature__image img,
:is(.category, .tag) .post-card__image img {
  width: 100%;
  height: auto;
  object-fit: initial;
  display: block;
}

/* Flexible Editorial text / image section on category hubs. */
:is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial--hub-editorial {
  max-width: none;
  display: block;
}

:is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__header {
  width: 100%;
  padding-bottom: 0.9rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--cn-border);
}

:is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__header .eyebrow {
  margin-bottom: 0.7rem;
}

:is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__header h2 {
  margin: 0;
  max-width: none;
  font-family: var(--cn-font-display);
  font-size: var(--cn-h2);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: var(--cn-display-weight);
}

:is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

:is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__copy,
:is(.category, .tag) .cn-flex-section--editorial .cn-flex-section__body {
  max-width: none;
}

:is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__image {
  margin: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--cn-card);
  align-self: start;
}

:is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 880px) {
  :is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__content {
    grid-template-columns: 1fr;
  }

  /* Mobile Editorial Text / Image: image first, natural source ratio, copy second. */
  :is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__image {
    order: 1;
    aspect-ratio: auto;
    overflow: visible;
    background: transparent;
  }

  :is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__image img {
    width: 100%;
    height: auto;
    object-fit: initial;
  }

  :is(.category, .tag) .cn-flex-section--editorial .cn-flex-editorial__copy {
    order: 2;
  }
}
