/*
 * Home V3 — Precision in Practice
 * Swiper carousel: 1-up mobile → 2-up desktop
 * Mobile-first.
 */

/* ─────────────────────────────────────────────
   Section wrapper
───────────────────────────────────────────── */
.hv3-precision {
  padding: var(--space-9) var(--space-5);
  background: var(--color-surface-secondary);
  overflow: hidden; /* prevent horizontal scroll from swiper */
}

.hv3-precision__inner {
  max-width: 75rem; /* 1200px */
  margin: 0 auto;
}

/* ─────────────────────────────────────────────
   Section header row
   Mobile: stacked column
   Tablet+: headline left, nav arrows right
───────────────────────────────────────────── */
.hv3-precision__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-7);
}

@media (min-width: 768px) {
  .hv3-precision__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.hv3-precision__header-text {
  flex: 1;
  max-width: 36rem;
}

.hv3-precision__headline {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-3);
}

.hv3-precision__subheadline {
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
  margin: 0;
  max-width: 28rem;
}

/* ─────────────────────────────────────────────
   Nav arrow buttons
───────────────────────────────────────────── */
.hv3-precision__nav {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
  /* On mobile align to the left before the header becomes a row */
  align-self: flex-start;
}

@media (min-width: 768px) {
  .hv3-precision__nav {
    /* Vertically centre arrows relative to the first line of the headline */
    padding-top: 0.25rem;
  }
}

.hv3-precision__nav-btn {
  width: 2.5rem;   /* 40px */
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-tertiary);
  border: 1px solid var(--color-border-default);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  transition:
    color        var(--transition-fast),
    background   var(--transition-fast),
    border-color var(--transition-fast);
  padding: 0;
  line-height: 1;
}

.hv3-precision__nav-btn:hover {
  color: var(--color-brand-primary);
  background: var(--color-surface-highest, var(--color-surface-tertiary));
  border-color: var(--color-brand-primary);
}

.hv3-precision__nav-btn:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}

/* Swiper adds .swiper-button-disabled to custom nav elements via the API */
.hv3-precision__nav-btn.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ─────────────────────────────────────────────
   Swiper container
   overflow:visible so the right-hand card's
   edge can peek on large screens.
   clip-path clips only the sides, not top/bottom.
───────────────────────────────────────────── */
.hv3-precision__swiper {
  overflow: visible;
  /* Clip horizontally to prevent overflow scrollbar; allow vertical breathing room */
  clip-path: inset(0 0 0 0);
}

/* ─────────────────────────────────────────────
   Slides
───────────────────────────────────────────── */
.hv3-precision__slide {
  /* Allow cards to stretch to equal height within the row */
  height: auto;
  box-sizing: border-box;
}

/* ─────────────────────────────────────────────
   Cards
───────────────────────────────────────────── */
.hv3-precision__card {
  position: relative;
  /* Full height of the slide so equal-height works */
  height: 18rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: block;
  background: var(--color-surface-tertiary);
  /* Subtle border so card edges read on dark backgrounds */
  border: 1px solid var(--color-border-default);
}

@media (min-width: 768px) {
  .hv3-precision__card {
    height: 22rem;
  }
}

@media (min-width: 1024px) {
  .hv3-precision__card {
    height: 24rem;
  }
}

/* ── Card image ─────────────────────────── */
.hv3-precision__card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
  transition:
    transform var(--transition-slow),
    opacity  var(--transition-normal);
  display: block;
}

.hv3-precision__card:hover .hv3-precision__card-img {
  transform: scale(1.04);
  opacity: 0.78;
}

/* ── Placeholder when no image uploaded ─ */
.hv3-precision__card-img--placeholder {
  position: absolute;
  inset: 0;
  /* Subtle gradient that reads like an empty chart area */
  background: linear-gradient(
    145deg,
    var(--color-surface-tertiary) 0%,
    var(--color-surface-secondary) 100%
  );
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--space-7); /* leave room for the overlay */
}

/* Decorative fake chart line inside placeholder */
.hv3-precision__card-placeholder-chart {
  width: 100%;
  height: 5rem;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 255, 178, 0.08) 20%,
    rgba(0, 255, 178, 0.15) 50%,
    rgba(0, 212, 255, 0.08) 80%,
    transparent 100%
  );
  /* Simple zigzag SVG mask to look like a price chart */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60'%3E%3Cpolyline points='0,50 25,35 50,42 75,20 100,28 125,10 150,18 175,5 200,12' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60'%3E%3Cpolyline points='0,50 25,35 50,42 75,20 100,28 125,10 150,18 175,5 200,12' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}

/* ── Card overlay: gradient + metadata ── */
.hv3-precision__card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-8) var(--space-5) var(--space-5);
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.90) 0%,
    rgba(0, 0, 0, 0.55) 50%,
    transparent 100%
  );
  z-index: 2;
}

/* ── Badge + chart label row ──────────── */
.hv3-precision__card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.hv3-precision__card-chart-label {
  font-family: var(--font-family-body);
  font-size: 0.6875rem; /* 11px — deliberately small */
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Card title ─────────────────────── */
.hv3-precision__card-title {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  margin: 0;
}

@media (min-width: 768px) {
  .hv3-precision__card-title {
    font-size: var(--font-size-xl);
  }
}

/* ─────────────────────────────────────────────
   Badge styles
   Shared with other hv3 components; scoped here
   in case global styles aren't loaded.
───────────────────────────────────────────── */
.hv3-badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
  font-size: 0.625rem;  /* 10px */
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
}

/* Green badge — primary brand accent */
.hv3-badge--secondary {
  background: rgba(0, 255, 178, 0.15);
  color: var(--color-brand-primary);
  border: 1px solid rgba(0, 255, 178, 0.30);
}

/* Blue badge — secondary brand accent */
.hv3-badge--tertiary {
  background: rgba(0, 212, 255, 0.15);
  color: var(--color-brand-secondary);
  border: 1px solid rgba(0, 212, 255, 0.30);
}
