/* ============================================
   FULL WIDTH IMAGE HEADER
   Edge-to-edge image (or auto-rotating slideshow)
   with header / body / buttons positioned on top
   and a bottom gradient between images & content.
   ============================================ */

.fwih {
  position: relative;
  width: 100%;
  overflow: hidden;
  isolation: isolate;

  /* Standard (default) heights — a touch shorter than Revamp Hero (~700–730px). */
  --fwih-h-mobile:  clamp(420px, 70vh, 540px);
  --fwih-h-tablet:  clamp(480px, 65vh, 600px);
  --fwih-h-desktop: clamp(540px, 60vh, 640px);
}

.fwih[data-height="compact"] {
  --fwih-h-mobile:  clamp(320px, 55vh, 400px);
  --fwih-h-tablet:  clamp(380px, 50vh, 460px);
  --fwih-h-desktop: clamp(420px, 50vh, 480px);
}

.fwih[data-height="tall"] {
  --fwih-h-mobile:  clamp(480px, 80vh, 620px);
  --fwih-h-tablet:  clamp(560px, 75vh, 680px);
  --fwih-h-desktop: clamp(620px, 75vh, 760px);
}

.fwih__frame {
  position: relative;
  width: 100%;
  min-height: var(--fwih-h-mobile);
}

@media (min-width: 768px) {
  .fwih__frame { min-height: var(--fwih-h-tablet); }
}

@media (min-width: 1024px) {
  .fwih__frame { min-height: var(--fwih-h-desktop); }
}

/* ============================================
   Image layer — absolute, edge-to-edge
   ============================================ */
.fwih__slides {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--clr-neutral-light, #DDE0D5);
}

.fwih__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  will-change: opacity;
}

.fwih__slide.is-active {
  opacity: 1;
}

/* Single-image case — always visible */
.fwih__slides[data-count="1"] .fwih__slide {
  opacity: 1;
}

.fwih__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.fwih__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8d9c9 0%, #d4ccbb 45%, #c9bfaa 100%);
}

/* ============================================
   Gradient overlay — sits BETWEEN images & content
   Color via --fwih-gradient-color, strength via
   --fwih-gradient-strength (0–1). Fades out toward
   the top via mask-image.
   ============================================ */
.fwih__gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-color: var(--fwih-gradient-color, #000);
  opacity: var(--fwih-gradient-strength, 0.55);
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.55) 35%, transparent 82%);
          mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.55) 35%, transparent 82%);
}

/* ============================================
   Content layer — sits ABOVE gradient
   ============================================ */
.fwih__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
}

@media (min-width: 1024px) {
  .fwih__content {
    padding: var(--space-2xl) var(--space-xl);
  }
}

.fwih__inner {
  /* Mirrors .container max-width so text/buttons don't span ultra-wide on big screens,
     while images stay edge-to-edge. */
  width: 100%;
  max-width: 1600px;
  display: flex;
  flex-direction: column;
  /* Default sits children at the bottom; text margins below shift its position. */
  justify-content: flex-end;
  gap: var(--space-lg);
}

/* Content position controls — buttons always anchor at bottom,
   the text block shifts via margins. */
.fwih__inner[data-position="top"]    .fwih__text { margin-bottom: auto; }
.fwih__inner[data-position="middle"] .fwih__text { margin-top: auto; margin-bottom: auto; }
/* position="bottom" — no extra margin; text and buttons stack at the bottom in DOM order */

.fwih__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 720px;
  min-width: 0;
}

.fwih__inner[data-text-align="center"] {
  align-items: center;
  text-align: center;
}
.fwih__inner[data-text-align="center"] .fwih__text {
  align-items: center;
}

.fwih__inner[data-text-align="right"] {
  align-items: flex-end;
  text-align: right;
}
.fwih__inner[data-text-align="right"] .fwih__text {
  align-items: flex-end;
}

/* ============================================
   Heading — mirrors Revamp Hero's two-line pattern
   ============================================ */
.fwih__heading {
  margin: 0;
  line-height: 0.98;
  letter-spacing: 0.01em;
  font-size: clamp(2.25rem, 6.5vw, 5rem);
  overflow-wrap: break-word;
  text-wrap: balance;
  color: var(--clr-text-inverse, #FDFCFA);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

.fwih__heading-line1 {
  display: block;
  text-transform: uppercase;
  font-weight: 600;
}

.fwih__heading-line2 {
  display: block;
  font-weight: 400;
  letter-spacing: 0;
  font-size: 0.9em;
  line-height: 1.05;
  margin-top: var(--space-xs);
  color: var(--clr-brand-accent, #B5A882);
}

/* Body / subtext */
.fwih__subtext {
  margin: 0;
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--clr-text-inverse, #FDFCFA);
  opacity: 0.92;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.22);
  text-wrap: pretty;
  max-width: 60ch;
}

/* ============================================
   Buttons — horizontal row, always near the bottom
   ============================================ */
.fwih__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  /* When text is positioned top or middle, ctas float on their own at the bottom.
     For "bottom" position they sit just below the text via flex gap. */
}

.fwih__inner[data-text-align="center"] .fwih__ctas { justify-content: center; }
.fwih__inner[data-text-align="right"]  .fwih__ctas { justify-content: flex-end; }

.fwih__btn-primary,
.fwih__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px var(--space-xl);
  border-radius: var(--radius-md, 6px);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

/* Primary — filled, light-on-dark (works against image + gradient) */
.fwih__btn-primary {
  background: var(--clr-text-inverse, #FDFCFA);
  color: var(--clr-primary, #3c422e);
  border: 1px solid transparent;
}
.fwih__btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Secondary — outline, light text */
.fwih__btn-secondary {
  background: transparent;
  color: var(--clr-text-inverse, #FDFCFA);
  border: 1px solid var(--clr-text-inverse, #FDFCFA);
}
.fwih__btn-secondary:hover {
  background: var(--clr-text-inverse, #FDFCFA);
  color: var(--clr-primary, #3c422e);
}

.fwih__btn-secondary svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.fwih__btn-secondary:hover svg {
  transform: translateX(2px);
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .fwih__slide { transition: none; }
}
