/*
 * Front page news module (#newsHero), in the visual language of the hero:
 * same overlay, title typography and arrows as hero.css; smaller title, ~70vh.
 * Spacing comes from layout tokens (variables.css, task A); fallbacks equal
 * the desktop token values.
 */

.news-hero {
  --nh-ink: var(--color-ink, #16192B);
  --nh-navy: var(--color-navy, #1a1f36);
  --nh-accent: var(--color-accent, #F16F24);
  --nh-white: var(--color-white, #ffffff);
  --nh-muted: #E0DED9; /* .hero-subtitle */
  --nh-py: var(--section-py, 96px);
  --nh-head-gap: var(--section-header-gap, 48px);
  --nh-gap: var(--grid-gap, 24px);
  --nh-fade: 0.9s;
  --nh-font-display: var(--font-display, "Outfit", sans-serif);
  --nh-font-body: var(--font-body, "Plus Jakarta Sans", sans-serif);
  --nh-title-size: var(--text-h2, 36px); /* hero title uses --text-h1 */
  --nh-arrow: 44px;

  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: max(480px, 70vh);
  margin: 0;
  padding: var(--nh-py) 0;
  overflow: hidden;
  background-color: var(--nh-ink);
  color: var(--nh-white);
  touch-action: pan-y pinch-zoom;
}

/* Header: section title and link to the blog, over the photo */

.news-hero .news-hero__head {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: var(--nh-head-gap);
}

.news-hero .news-hero__heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: var(--nh-font-display);
  font-size: var(--text-h3, 22px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--nh-white);
}

.news-hero .news-hero__heading::before {
  content: "";
  flex: none;
  width: 32px;
  height: 2px;
  background-color: var(--nh-accent);
}

.news-hero .news-hero__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  font-family: var(--nh-font-body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--nh-white);
  text-decoration: none;
  transition: border-color var(--transition, 0.2s ease);
}

.news-hero .news-hero__all svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition, 0.2s ease);
}

.news-hero .news-hero__all:hover {
  border-bottom-color: var(--nh-accent);
  color: var(--nh-white);
}

.news-hero .news-hero__all:hover svg {
  transform: translateX(3px);
}

/* Slides: stacked in one grid cell, so the block takes the tallest slide */

.news-hero .news-hero__slides {
  display: grid;
  flex: 1 1 auto;
}

.news-hero .news-hero__slide {
  grid-area: 1 / 1;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--nh-fade) ease, visibility 0s linear var(--nh-fade);
}

.news-hero .news-hero__slide[data-active] {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transition: opacity var(--nh-fade) ease, visibility 0s;
}

/* Photo covers the whole block, header and controls included: positioned
   against .news-hero, painted inside its slide, so it fades with it. */
.news-hero .news-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--nh-ink);
  background-image: linear-gradient(135deg, var(--nh-navy) 0%, var(--nh-ink) 70%);
}

/* Same overlay as .hero-overlay */
.news-hero .news-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.7);
}

.news-hero .news-hero__media--empty::after {
  background: radial-gradient(120% 90% at 85% 10%, rgba(241, 111, 36, 0.14) 0%, rgba(241, 111, 36, 0) 55%);
  background: radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--nh-accent) 14%, transparent) 0%, transparent 55%);
}

/* An image optimiser may wrap the <img> in <picture>. */
.news-hero .news-hero__media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.news-hero .news-hero__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.news-hero .news-hero__body {
  position: relative;
  z-index: 2;
  width: 100%;
}

.news-hero .news-hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--nh-font-body);
  font-size: var(--text-label, 11px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--nh-muted);
}

.news-hero .news-hero__meta::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--nh-accent);
}

/* .hero-title, one step smaller */
.news-hero .news-hero__title {
  display: -webkit-box;
  max-width: min(860px, 100%);
  margin: 0 0 20px;
  overflow: hidden;
  font-family: var(--nh-font-display);
  font-size: var(--nh-title-size);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--nh-white);
  overflow-wrap: break-word;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* .hero-subtitle */
.news-hero .news-hero__lead {
  display: -webkit-box;
  max-width: 560px;
  margin: 0 0 32px;
  overflow: hidden;
  font-family: var(--nh-font-body);
  font-size: var(--text-body, 15px);
  font-weight: 300;
  line-height: var(--lh-body, 1.7);
  color: var(--nh-muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.news-hero .news-hero__cta {
  display: inline-flex;
}

/* Controls: arrows as .slider-arrow */

.news-hero .news-hero__controls {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: var(--nh-gap);
}

.news-hero .news-hero__controls[hidden] {
  display: none !important;
}

.news-hero .news-hero__arrow {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--nh-arrow);
  height: var(--nh-arrow);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--nh-white);
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: var(--transition, 0.2s ease);
}

.news-hero .news-hero__arrow svg {
  width: 22px;
  height: 22px;
}

.news-hero .news-hero__arrow:hover {
  border-color: var(--nh-accent);
  background-color: var(--nh-accent);
}

.news-hero .news-hero__dots {
  display: flex;
  align-items: center;
}

/* 32×24 hit area around a small pill: WCAG 2.5.8 target size */
.news-hero .news-hero__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.news-hero .news-hero__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.45);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.news-hero .news-hero__dot:hover::before {
  background-color: var(--nh-white);
}

.news-hero .news-hero__dot[aria-current="true"]::before {
  width: 22px;
  background-color: var(--nh-accent);
}

.news-hero .news-hero__all:focus-visible,
.news-hero .news-hero__cta:focus-visible,
.news-hero .news-hero__arrow:focus-visible,
.news-hero .news-hero__dot:focus-visible {
  outline: 2px solid var(--nh-white);
  outline-offset: 3px;
}

/* Desktop: controls share the CTA row, so the block stays close to 70vh.
   The wrapper lets clicks through to the CTA underneath; buttons take them back. */

@media (min-width: 1025px) {
  .news-hero .news-hero__controls {
    position: absolute;
    right: 0;
    bottom: var(--nh-py);
    left: 0;
    margin-top: 0;
    pointer-events: none;
  }

  .news-hero .news-hero__controls > * {
    pointer-events: auto;
  }
}

/* Tablet */

@media (max-width: 1024px) {
  .news-hero {
    --nh-title-size: 30px;
  }
}

/* Mobile: height follows the content */

@media (max-width: 768px) {
  .news-hero {
    --nh-title-size: 24px;

    min-height: 0;
  }

  .news-hero .news-hero__slides {
    flex: none;
  }

  /* Leaves a strip of the photo visible above the text */
  .news-hero .news-hero__slide {
    padding-top: clamp(96px, 28vw, 180px);
  }

  .news-hero .news-hero__controls {
    justify-content: space-between;
  }
}

@media (max-width: 375px) {
  .news-hero {
    --nh-title-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-hero {
    --nh-fade: 0.2s;
  }

  .news-hero .news-hero__all svg,
  .news-hero .news-hero__dot::before {
    transition: none;
  }
}
