/*
 * NPC Back Office - public homepage module. Neutral grayscale, system fonts, scoped to .npc-bo-home.
 * Nothing here touches the page hero or H1. Motion stops under prefers-reduced-motion.
 */

.npc-bo-home {
  --npc-bo-ink: #1a1a1a;
  --npc-bo-paper: #ffffff;
  --npc-bo-muted: #4d4d4d;
  --npc-bo-control-hover: #ededed;
  --npc-bo-focus: #0b57d0;
  --npc-bo-ticker-bg: #1a1a1a;
  --npc-bo-ticker-ink: #ffffff;
  --npc-bo-ticker-focus: #ffd23f;
  --npc-bo-ticker-duration: 30s;

  width: 100%;
  max-width: 100%;
  margin: 0 0 1.5rem;
  color: var(--npc-bo-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
}

.npc-bo-home *,
.npc-bo-home *::before,
.npc-bo-home *::after {
  box-sizing: border-box;
}

.npc-bo-home [hidden] {
  display: none !important;
}

/* Carousel */

.npc-bo-home .npc-bo-banner {
  position: relative;
  min-width: 0;
  margin: 0 0 1rem;
}

.npc-bo-home .npc-bo-banner__viewport {
  position: relative;
  width: 100%;
  min-width: 0;
  touch-action: pan-y;
}

.npc-bo-home .npc-bo-banner__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Every slide shares one grid cell, so the region is as tall as the tallest slide and nothing jumps. */
.npc-bo-home .npc-bo-banner__slide {
  grid-area: 1 / 1;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 450ms ease, visibility 450ms ease;
}

.npc-bo-home .npc-bo-banner__slide.is-active {
  opacity: 1;
  visibility: visible;
}

.npc-bo-home .npc-bo-banner__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.npc-bo-home .npc-bo-banner__image {
  display: block;
  width: 100%;
  height: auto;
}

.npc-bo-home .npc-bo-banner__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0 0;
}

.npc-bo-home .npc-bo-banner__counter {
  min-width: 4.5rem;
  margin: 0 auto 0 0;
  color: var(--npc-bo-muted);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

/* Controls */

.npc-bo-home .npc-bo-btn {
  appearance: none;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--npc-bo-ink);
  border-radius: 4px;
  background: var(--npc-bo-paper);
  color: var(--npc-bo-ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
}

.npc-bo-home .npc-bo-btn:hover {
  background: var(--npc-bo-control-hover);
}

.npc-bo-home .npc-bo-banner__link:focus-visible,
.npc-bo-home .npc-bo-btn:focus-visible {
  outline: 3px solid var(--npc-bo-focus);
  outline-offset: 3px;
}

.npc-bo-home .npc-bo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Ticker */

.npc-bo-home .npc-bo-ticker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background: var(--npc-bo-ticker-bg);
  color: var(--npc-bo-ticker-ink);
}

.npc-bo-home .npc-bo-ticker .npc-bo-btn {
  flex: none;
  background: transparent;
  border-color: var(--npc-bo-ticker-ink);
  color: var(--npc-bo-ticker-ink);
}

.npc-bo-home .npc-bo-ticker .npc-bo-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.npc-bo-home .npc-bo-ticker .npc-bo-btn:focus-visible {
  outline-color: var(--npc-bo-ticker-focus);
}

.npc-bo-home .npc-bo-ticker__viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.npc-bo-home .npc-bo-ticker__track {
  display: flex;
  width: max-content;
  animation: npc-bo-ticker-scroll var(--npc-bo-ticker-duration, 30s) linear infinite;
  will-change: transform;
}

.npc-bo-home .npc-bo-ticker.is-paused .npc-bo-ticker__track {
  animation-play-state: paused;
}

.npc-bo-home .npc-bo-ticker__list {
  display: flex;
  flex: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.npc-bo-home .npc-bo-ticker__item {
  flex: none;
  padding-right: 3rem;
  font-weight: 600;
  white-space: nowrap;
}

@keyframes npc-bo-ticker-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* Reduced motion: no rotation, no marquee. Ticker text wraps and stays readable. */
@media (prefers-reduced-motion: reduce) {
  .npc-bo-home .npc-bo-banner__slide {
    transition: none;
  }

  .npc-bo-home .npc-bo-ticker__track {
    display: block;
    width: auto;
    animation: none;
  }

  .npc-bo-home .npc-bo-ticker__list {
    flex-wrap: wrap;
    min-width: 0 !important;
  }

  .npc-bo-home .npc-bo-ticker__list--clone {
    display: none;
  }

  .npc-bo-home .npc-bo-ticker__item {
    padding-right: 1.5rem;
    white-space: normal;
  }
}
