/* Lightweight scroll reveals (used everywhere except the two homepage flagships).
   Elements only get hidden once JS arms them (.js-armed) - without JS, content
   stays visible by default. */
.reveal.js-armed { opacity: 0; transform: translateY(40px); }
.reveal--left.js-armed { transform: translateX(-50px); }
.reveal--right.js-armed { transform: translateX(50px); }
.reveal--scale.js-armed { transform: scale(0.92); }

.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-standard), transform 0.7s var(--ease-standard);
}

@media (prefers-reduced-motion: reduce) {
  .reveal.js-armed { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Flagship pinned scroll sections (Desbrozadoras / Cajas de Transporte) */
.flagship {
  position: relative;
  background: var(--color-bg);
}

.flagship__pin {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-bg);
}

.flagship__bg {
  position: absolute;
  inset: 0;
  background-image: url('../assets/img/textures/hex-pattern.svg');
  background-size: 160px 277px;
  opacity: 0.6;
}

/* Stage is height-capped (not just width-capped) so the photo can never grow
   tall enough to crowd the heading above or the caption/CTA row below. */
.flagship__stage {
  position: relative;
  width: min(60vw, 760px);
  height: min(48vh, 460px);
  margin-inline: auto;
  z-index: 1;
  flex: 0 0 auto;
}

.flagship__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  will-change: transform, opacity;
  border-radius: var(--radius-md);
  filter: hue-rotate(90deg) saturate(0.65) brightness(1.05);
}
/* No-JS default: only the first photo of a multi-photo sequence shows, no overlap */
.flagship__layer:not(:first-of-type) { display: none; }

.flagship__intro {
  position: relative;
  z-index: 2;
  max-width: 50ch;
  margin-inline: auto;
  text-align: center;
  flex: 0 0 auto;
}
.flagship__intro .eyebrow {
  font-family: var(--font-ui);
  color: var(--color-accent-yellow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-sm);
}
.flagship__intro h2 { margin-bottom: 0; }

.flagship__footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  flex: 0 0 auto;
  width: min(60vw, 760px);
  margin-inline: auto;
}

.flagship__captions { flex: 1 1 auto; min-height: 5.5rem; }

.flagship__caption {
  max-width: 40ch;
  color: var(--color-text-inverse);
  background: rgba(10, 10, 10, 0.55);
  padding: 0.9rem 1.2rem;
  border-left: 3px solid var(--color-accent-red);
  border-radius: var(--radius-sm);
}
.flagship__caption h3 { margin-bottom: 0.25rem; color: var(--color-accent-yellow); }
.flagship__caption p { margin: 0; color: var(--color-text); font-size: var(--text-sm); }

.flagship__cta { flex: 0 0 auto; }

/* Static fallback state (mobile / reduced-motion): no pin, no scroll runway. */
.flagship--static .flagship__pin { height: auto; }
.flagship--static .flagship__stage {
  width: min(92vw, 600px);
  height: 55vw;
  min-height: 200px;
  max-height: 380px;
}
.flagship--static .flagship__footer { width: min(92vw, 600px); height: auto; max-height: none; flex-direction: column; align-items: stretch; }

@media (max-width: 768px) {
  .flagship .flagship__pin { height: auto; }
  .flagship .flagship__stage {
    width: min(92vw, 600px);
    height: 55vw;
    min-height: 200px;
    max-height: 380px;
  }
  .flagship .flagship__footer { width: min(92vw, 600px); height: auto; max-height: none; flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .flagship .flagship__pin { height: auto; }
  .flagship .flagship__stage {
    width: min(92vw, 600px);
    height: 55vw;
    min-height: 200px;
    max-height: 380px;
  }
  .flagship .flagship__footer { width: min(92vw, 600px); height: auto; max-height: none; flex-direction: column; align-items: stretch; }
}
