/* Shared news cards keep the homepage and archive in step. */
.home-news {
  padding: clamp(2.2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.page--home .site-footer {
  margin-top: 0;
}

.home-news__header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.6rem;
}

.home-news > .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1rem;
}

.home-news__header {
  grid-column: 1;
  grid-row: 1;
}

.home-news__track {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

.home-news__controls {
  display: none;
}

.home-news__heading {
  margin: 0.35rem 0 0;
  color: var(--brand-strong);
  font-family: "Barlow Condensed", "Franklin Gothic Medium", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  line-height: 1.08;
}

.home-news__all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-shrink: 0;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  background: var(--brand-strong);
  color: var(--surface);
  font-weight: 700;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  margin-bottom: 1.6rem;
}

.home-news__all svg,
.news-card__cta svg,
.news-article__back svg,
.news-article-nav svg {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
}

.news-list,
.home-news .news-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.65rem);
}

.news-list .news-card,
.home-news .news-card {
  height: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: none;
}

.news-list .news-card__link,
.home-news .news-card__link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.news-list .news-card__media,
.home-news .news-card__media {
  order: 0;
  align-self: stretch;
  margin: 0;
  border-radius: 0;
  aspect-ratio: 16 / 10;
  background: var(--surface-soft);
}

.news-list .news-card__body,
.home-news .news-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: start;
  gap: 0.75rem;
  padding: clamp(1.15rem, 2vw, 1.6rem);
}

.news-list .news-card__meta,
.home-news .news-card__meta {
  min-height: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.news-list .news-card__body h2,
.home-news .news-card__body h2 {
  min-height: 0;
  color: var(--brand-strong);
  font-size: clamp(1.65rem, 2.2vw, 2.05rem);
  line-height: 1.12;
}

.news-list .news-card__body .news-card__summary,
.home-news .news-card__body .news-card__summary {
  -webkit-line-clamp: 3;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.5;
}

.news-list .news-card__cta,
.home-news .news-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding: 0.55rem 0 0;
  border-radius: 0;
  background: none;
  color: var(--brand-strong);
  font-size: 1.05rem;
  text-transform: none;
  text-decoration: none;
  box-shadow: none;
}

.news-card:hover .news-card__cta,
.news-card:focus-within .news-card__cta {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  box-shadow: none;
}

.news-card__cta svg {
  transition: transform 180ms ease;
}

.news-card:hover .news-card__cta svg,
.news-card:focus-within .news-card__cta svg {
  transform: translateX(3px);
}

.news-card__link:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: -3px;
}

.home-news__all:focus-visible,
.news-article__back:focus-visible,
.news-article-nav__link:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .news-card__cta svg {
    transition: none;
  }
}

.news-article {
  padding: clamp(1.5rem, 3vw, 3rem) 0 clamp(3rem, 6vw, 5rem);
}

.news-article__shell {
  width: min(1320px, calc(100% - 2.6rem));
}

.news-article__back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.3rem 0;
  color: var(--brand-strong);
  font-weight: 700;
}

.news-article__card {
  padding: clamp(1.3rem, 4vw, 3.6rem);
  border-color: var(--line);
  background: var(--surface);
}

.news-article__card h1 {
  max-width: 1120px;
  margin: 0.55rem auto 1.5rem;
  color: var(--brand-strong);
  font-size: clamp(2.3rem, 4vw, 3.7rem);
  line-height: 1.06;
}

.news-article__meta {
  max-width: 1120px;
  color: var(--muted);
}

.news-gallery__viewer {
  aspect-ratio: 16 / 8;
  max-height: 600px;
  background: var(--surface-soft);
}

.news-gallery__slide img,
.news-gallery__image {
  max-height: 600px;
}

.news-article__content {
  max-width: 1040px;
  color: var(--text);
  font-size: 1.14rem;
  line-height: 1.72;
}

.news-article__content h2,
.news-article__content h3 {
  color: var(--brand-strong);
}

.news-article__content a {
  color: var(--brand-strong);
  text-decoration-color: var(--line);
}

.news-article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
  margin-top: 2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.news-article-nav__link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  color: var(--brand-strong);
}

.news-article-nav__link--right {
  grid-column: 2;
  flex-direction: row-reverse;
  text-align: right;
}

.news-article-nav__label,
.news-article-nav__title {
  display: block;
}

.news-article-nav__label {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.news-article-nav__title {
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.3;
}

.news-article-nav__link:hover .news-article-nav__title {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

html[data-theme="dark"] .home-news__all {
  color: #10283a;
}

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

  .home-news .news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .home-news > .container {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-news__header {
    flex-direction: column;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1.2rem;
  }

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

  .home-news .home-news__track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem;
    margin: -0.25rem;
  }

  .home-news__track::-webkit-scrollbar {
    display: none;
  }

  .home-news .home-news__track .news-card {
    flex: 0 0 100%;
    min-width: 0;
    height: auto;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .home-news__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    grid-column: 1;
    grid-row: 3;
    margin-top: 1.1rem;
  }

  .home-news__control {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--brand-strong);
    cursor: pointer;
  }

  .home-news__control:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .home-news__dots {
    display: flex;
    align-items: center;
    gap: 0.2rem;
  }

  .home-news__dot {
    display: grid;
    place-items: center;
    width: 30px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .home-news__dot::after {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--line);
    border: 1px solid var(--muted);
  }

  .home-news__dot.is-active::after {
    background: var(--brand-strong);
    border-color: var(--brand-strong);
    width: 11px;
    height: 11px;
  }

  .home-news__all {
    grid-column: 1;
    grid-row: 4;
    justify-self: center;
    margin: 1rem 0 0;
  }

  .news-article__shell {
    width: calc(100% - 1.4rem);
  }

  .news-article__card {
    padding: 1.2rem;
  }

  .news-article__card h1 {
    font-size: 2.35rem;
  }

  .news-gallery__viewer {
    aspect-ratio: 4 / 3;
    max-height: none;
  }

  .news-article__content {
    font-size: 1.06rem;
    line-height: 1.66;
  }

  .news-article-nav {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 1.3rem;
    padding-top: 1rem;
  }

  .news-article-nav__link {
    padding: 0.9rem 0;
  }

  .news-article-nav__link--right {
    grid-column: auto;
  }

  .news-article-nav__link + .news-article-nav__link {
    border-top: 1px solid var(--line);
  }
}
