/* Home origins: dark carousel of origin cards (neighbours peek). Each card is a photo with its technical
   info box attached underneath, so the whole card slides together.
   Surface and type tokens come from the theme (.nc-section--dark). */
.nc-origins {
  --nc-origins-speed: 800ms; /* caption fade */
  --origin-w: min(64rem, 66vw);
  --origin-ratio: 2 / 1;
  --origin-gap: clamp(0.75rem, 2vw, 1.5rem);
  --origin-radius: 0.3rem;
  --origin-info-bg: #1e1714; /* espresso raised: slightly lighter than the section */
  position: relative;
  padding-block: clamp(3rem, 6vw, 5.5rem);
  overflow: hidden;
}

/* Without JS: every origin stacks as a full card. */
.nc-origins__viewport {
  position: relative;
  width: 100%;
}
.nc-origins__track {
  display: grid;
  gap: 1.5rem;
  width: min(100% - 2 * var(--origin-gap), 64rem);
  margin-inline: auto;
}
.nc-origin__slide {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border-radius: var(--origin-radius);
  background: var(--origin-info-bg);
}

/* Photo. */
.nc-origin__media {
  position: relative;
  aspect-ratio: var(--origin-ratio);
  overflow: hidden;
  background: var(--nc-surface-dark-raised, #1f1713);
}
.nc-origin__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.nc-origin__media::after {
  content: "";
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgb(18 13 10 / 82%));
  pointer-events: none;
}

.nc-origin__caption {
  position: absolute;
  z-index: 1;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(0.9rem, 2.6vw, 1.9rem);
  left: clamp(1rem, 3vw, 2rem);
  display: grid;
  gap: 0.35rem;
}
.nc-origin__country {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--nc-on-dark, #f4f1ea);
  font: 700 0.78rem/1.2 var(--nc-body-font, Manrope, sans-serif);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nc-origin__flag {
  display: block;
  flex: none;
  width: clamp(2.5rem, 1.9rem + 1.6vw, 2.75rem);
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 0.2rem;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 28%),
    0 2px 8px rgb(0 0 0 / 35%);
}
.nc-origin__title {
  margin: 0;
  color: var(--nc-on-dark-accent, #edcfa9);
  font-size: clamp(2.1rem, 1.2rem + 4vw, 4.4rem);
  font-style: italic;
  line-height: 0.95;
}

/* Info box: attached to the photo, sharing its width and the card's bottom corners. */
.nc-origin__info {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 0.75rem clamp(1.5rem, 4vw, 3.5rem);
  min-height: 11.5rem;
  min-width: 0;
  padding: clamp(1rem, 2.4vw, 1.6rem) clamp(1.1rem, 3vw, 2rem)
    clamp(1.1rem, 2.4vw, 1.75rem);
  border-top: 1px solid var(--nc-line-dark, rgb(237 207 169 / 22%));
  background: var(--origin-info-bg);
}
.nc-origin__eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}
.nc-origin__spec {
  width: 100%;
  align-self: start;
}
.nc-origin__spec > div {
  padding-block: 0.7rem;
}
.nc-origin__spec dd {
  font-size: 0.95rem;
}
.nc-origin__aside {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.1rem;
  grid-column: 2;
}
/* When there is no spec sheet the aside takes the whole row. */
.nc-origin__eyebrow + .nc-origin__aside {
  grid-column: 1 / -1;
}
.nc-origin__notes li {
  border-color: var(--nc-line-dark, rgb(237 207 169 / 22%));
}
.nc-origin__aside > :only-child:is(.nc-origin__cta) {
  margin-top: auto;
}

/* The origin CTA reuses the button; give it the gold-on-espresso treatment used by the hero. */
.nc-origins .nc-origin__cta {
  margin-top: auto;
  border-radius: 0.2rem;
  background: var(--nc-gold, #e7c89e);
  color: var(--nc-dark, #120d0a);
}
.nc-origins .nc-origin__cta:hover {
  background: #f4d7ae;
}

/* Prev/next arrows: translucent espresso circles with a Crema hairline and a thin chevron. */
.nc-origins__arrow {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(237 207 169 / 55%);
  border-radius: 50%;
  background: rgb(18 13 10 / 55%);
  color: var(--nc-on-dark-accent, #edcfa9);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease;
}
.nc-origins__arrow svg {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nc-origins__arrow:hover {
  border-color: var(--nc-on-dark-accent, #edcfa9);
  background: var(--nc-on-dark-accent, #edcfa9);
  color: #1e1714;
}
.nc-origins__arrow:active {
  transform: translateY(-50%) scale(0.94);
}
.nc-origins :is(button, a):focus-visible {
  outline: 3px solid var(--nc-color-focus-dark, #edcfa9);
  outline-offset: 3px;
}

/* Prev/next sit over the edges of the active image, centred on it vertically. */
.nc-origins__viewport > .nc-origins__arrow {
  display: none;
  position: absolute;
  z-index: 3;
  top: calc(var(--origin-w) / 4);
  transform: translateY(-50%);
}
.nc-origins__arrow--prev {
  left: calc(50% - var(--origin-w) / 2 + 1.25rem);
}
.nc-origins__arrow--next {
  right: calc(50% - var(--origin-w) / 2 + 1.25rem);
}

/* Enhanced mode: cards share one grid cell (so they are all as tall as the tallest one) and are
   offset sideways; --pos is the slot relative to the active one. */
.nc-origins.is-js .nc-origins__viewport {
  overflow: hidden;
  touch-action: pan-y;
}
.nc-origins.is-js .nc-origins__viewport.is-dragging {
  user-select: none;
}
.nc-origins.is-js .nc-origins__track {
  display: grid;
  gap: 0;
  width: 100%;
  justify-items: center;
}
.nc-origins.is-js .nc-origin__slide {
  grid-area: 1 / 1;
  width: var(--origin-w);
  /* The script animates --o (slot distance from the centre), --s and opacity every frame, so the track
     follows the pointer 1:1 while dragging and the same path is used for eased settling. */
  opacity: 0.62;
  transform: translateX(
      calc(var(--o, var(--pos, 0)) * (var(--origin-w) + var(--origin-gap)))
    )
    scale(var(--s, 0.9));
  will-change: transform;
}
.nc-origins.is-js .nc-origins__viewport > .nc-origins__arrow {
  display: grid;
}
.nc-origins.is-js .nc-origin__caption {
  transition: opacity var(--nc-origins-speed) ease;
}
.nc-origins.is-js .nc-origin__slide:not(.is-active) .nc-origin__caption {
  opacity: 0.8;
}
.nc-origins.is-js .nc-origin__slide:not(.is-active) {
  pointer-events: none;
}

@media (max-width: 56rem) {
  .nc-origins {
    --origin-w: 84vw;
    --origin-ratio: 4 / 3;
  }
  .nc-origins__viewport > .nc-origins__arrow {
    top: calc(var(--origin-w) * 0.375);
  }
  .nc-origins__arrow {
    width: 2.75rem;
    height: 2.75rem;
  }
  .nc-origins__arrow--prev {
    left: calc(8vw + 0.6rem);
  }
  .nc-origins__arrow--next {
    right: calc(8vw + 0.6rem);
  }
  .nc-origin__info {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 0.9rem;
    min-height: 0;
  }
  .nc-origin__aside {
    grid-column: 1;
    gap: 1rem;
  }
  .nc-origin__aside > .nc-origin__cta {
    margin-top: 0;
  }
}

/* Reduced motion: no autoplay and settling is instant (script); fades are removed here. */
@media (prefers-reduced-motion: reduce) {
  .nc-origins.is-js .nc-origin__caption,
  .nc-origins__arrow {
    transition: none;
  }
}
