/* Landscape Polaroid / postcard story gallery
   Robust inside Elementor columns (no collapsed middle grid track). */

/* Force Elementor shortcode widget to take the column width */
.elementor-widget-shortcode:has(.amb-story),
.elementor-element.elementor-widget-shortcode:has(.amb-story),
.elementor-shortcode:has(.amb-story) {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
  align-self: stretch !important;
  min-width: 0 !important;
}

.elementor-widget-shortcode .amb-story,
.elementor-shortcode .amb-story,
.amb-story {
  --amb-story-nav: 2.75rem;
  --amb-story-max: 680px;
  position: relative !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 1.75rem var(--amb-story-nav) 1.1rem !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  background: transparent !important;
  font-family: var(--amb-font-body, Montserrat, sans-serif);
  color: var(--amb-navy, #032046);
}

.amb-story__stage {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  max-width: var(--amb-story-max) !important;
  margin: 0 auto !important;
  aspect-ratio: 16 / 10;
  min-width: min(100%, 280px) !important;
  width: min(100%, var(--amb-story-max)) !important;
  min-height: 260px !important;
  height: auto !important;
  padding-bottom: 0;
  box-sizing: border-box;
  overflow: visible;
}

@supports not (aspect-ratio: 1) {
  .amb-story__stage {
    height: 0 !important;
    padding-bottom: 62.5% !important;
  }
}

.amb-story__card {
  position: absolute !important;
  inset: 0 !important;
  margin: 0 !important;
  padding: 0.55rem 0.55rem 0 !important;
  background: #fefcf8 !important;
  box-shadow: 0 14px 34px rgba(3, 32, 70, 0.18);
  display: flex !important;
  flex-direction: column !important;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.94) rotate(-1.4deg);
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
  z-index: 1;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
}

.amb-story__card.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1) rotate(-0.55deg);
  box-shadow: 0 18px 40px rgba(3, 32, 70, 0.22);
  z-index: 3;
}

.amb-story__card.is-prev,
.amb-story__card.is-next {
  opacity: 0.4;
  z-index: 2;
}

.amb-story__card.is-prev {
  transform: translate(-16px, 12px) scale(0.93) rotate(-4.2deg);
}

.amb-story__card.is-next {
  transform: translate(16px, 12px) scale(0.93) rotate(3.6deg);
}

.amb-story__media {
  position: relative !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  background: #fdf7f0;
  min-height: 0 !important;
  width: 100% !important;
}

.amb-story__media > img,
.amb-story__play img,
.amb-story__embed iframe {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  border: 0 !important;
  max-width: none !important;
}

.amb-story__play {
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #111;
  cursor: pointer;
}

.amb-story__play img {
  opacity: 0.92;
}

.amb-story__play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 999px;
  background: rgba(3, 32, 70, 0.84);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.amb-story__play:hover .amb-story__play-icon,
.amb-story__play:focus-visible .amb-story__play-icon {
  background: var(--amb-blue, #335da4);
}

.amb-story__embed {
  position: absolute;
  inset: 0;
  background: #000;
}

.amb-story__caption {
  flex: 0 0 auto !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0.7rem 0.55rem 0.85rem !important;
  margin: 0 !important;
  text-align: center !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere;
  font-family: var(--amb-font-quote, "Courier Prime", "Courier New", Courier, monospace);
  font-size: clamp(0.82rem, 1.55vw, 0.98rem) !important;
  line-height: 1.35 !important;
  color: var(--amb-navy, #032046) !important;
}

.amb-story__controls {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.85rem !important;
  width: 100%;
  margin-top: 0.95rem;
}

.amb-story__nav {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  z-index: 5;
  flex: 0 0 auto !important;
  width: var(--amb-story-nav) !important;
  height: var(--amb-story-nav) !important;
  border-radius: 999px !important;
  border: 1.5px solid var(--amb-navy, #032046) !important;
  background: #fff !important;
  color: var(--amb-navy, #032046) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: 0 4px 14px rgba(3, 32, 70, 0.14);
}

.amb-story__nav--prev,
.amb-story__nav--next {
  left: auto;
  right: auto;
}

.amb-story__nav:hover,
.amb-story__nav:focus-visible {
  background: var(--amb-azzurro, var(--amb-card, #e6eff4)) !important;
  border-color: var(--amb-blue, #335da4) !important;
  color: var(--amb-navy, #032046) !important;
  outline: none;
}

.amb-story__nav:active {
  background: #d7e6ef !important;
  border-color: var(--amb-blue, #335da4) !important;
  color: var(--amb-navy, #032046) !important;
}

.amb-story__counter {
  display: block !important;
  width: auto !important;
  min-width: 3.5rem;
  flex: 0 0 auto !important;
  margin: 0 !important;
  text-align: center !important;
  font-family: var(--amb-font-body, Montserrat, sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.amb-story:not(.amb-story--on-dark) .amb-story__counter {
  color: var(--amb-navy, #032046);
  text-shadow: none;
}

.amb-story--on-dark .amb-story__counter,
.elementor-section[data-settings*="C35E3E"] .amb-story__counter {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.elementor-element[style*="c35e3e"] .amb-story__counter,
.elementor-element[style*="C35E3E"] .amb-story__counter,
.elementor-element[style*="a05744"] .amb-story__counter {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

@media (max-width: 900px) {
  .elementor-widget-shortcode .amb-story,
  .elementor-shortcode .amb-story,
  .amb-story {
    --amb-story-max: 100%;
    --amb-story-nav: 2.5rem;
    padding: 0.85rem 0.4rem 0.75rem !important;
  }

  .amb-story__stage {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    aspect-ratio: 3 / 2 !important;
  }

  /* Keep only the active card visible — cleaner + larger feel */
  .amb-story__card.is-prev,
  .amb-story__card.is-next {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: none !important;
  }

  .amb-story__card {
    padding: 0.4rem 0.4rem 0 !important;
    transform: none !important;
  }

  .amb-story__card.is-active {
    transform: none !important;
  }

  .amb-story__caption {
    font-size: 0.78rem !important;
    padding: 0.55rem 0.35rem 0.65rem !important;
    line-height: 1.3 !important;
  }

  .amb-story__controls {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.85rem !important;
    width: 100% !important;
    margin-top: 0.7rem !important;
  }

  .amb-story__nav {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    flex: 0 0 auto !important;
  }

  .amb-story__counter {
    width: auto !important;
    min-width: 3.5rem;
    margin: 0 !important;
    flex: 0 0 auto !important;
  }
}

@media (max-width: 560px) {
  .elementor-widget-shortcode .amb-story,
  .elementor-shortcode .amb-story,
  .amb-story {
    --amb-story-nav: 2.35rem;
    padding: 0.65rem 0.2rem 0.55rem !important;
  }

  .amb-story__stage {
    aspect-ratio: 3 / 2 !important;
  }

  .amb-story__controls {
    gap: 0.7rem !important;
  }

  .amb-story__caption {
    font-size: 0.74rem !important;
  }
}
