/* BUB opt-in mobile hero Stories. Desktop Elementor hero remains unchanged. */
.bubcv-stories { display: none !important; }

@media (max-width: 767px) {
  .elementor-widget-slides.bubcv-source-swapped { display: none !important; }
  .bubcv-stories {
    display: block !important;
    flex: 0 0 100%;
    width: min(100%, 550px);
    max-width: 100%;
    min-width: 0;
    margin: 0 auto 20px;
    padding: 9px 9px 0;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    font-family: inherit;
  }
  .bubcv-story-frame {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: #153e57;
    color: #fff;
    box-shadow: 0 14px 30px rgba(1, 36, 58, .16);
    isolation: isolate;
  }
  .bubcv-story-progress {
    display: flex;
    gap: 5px;
    padding: 14px 15px 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
  }
  .bubcv-story-segment {
    flex: 1;
    min-width: 0;
    height: 3px;
    border-radius: 100px;
    background: rgba(255,255,255,.38);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
  }
  .bubcv-story-fill {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #fff;
  }
  .bubcv-story-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    position: absolute;
    z-index: 10;
    left: 0;
    right: 0;
    top: 17px;
    padding: 15px 18px 0;
    color: #fff;
  }
  .bubcv-story-label {
    color: #fff;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: .12em;
    font-weight: 850;
    text-shadow: 0 2px 5px rgba(0,0,0,.45);
    white-space: nowrap;
  }
  .bubcv-story-count {
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
    white-space: nowrap;
    text-shadow: 0 2px 5px rgba(0,0,0,.5);
  }
  .bubcv-story-media {
    position: relative;
    width: 100%;
    height: clamp(390px, 113vw, 475px);
    overflow: hidden;
    background: #123d58;
    isolation: isolate;
  }
  .bubcv-story-ambient { display: none !important; }
  /* The whole image is the destination link; arrow controls retain their own layer. */
  .bubcv-story-image-link {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: block;
    background: transparent !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .bubcv-story-image-link[hidden] { display: none !important; }
  .bubcv-story-image-link:focus-visible { outline: 3px solid #83d4f8; outline-offset: -4px; }
  .bubcv-story-frame.bubcv-story-image-only .bubcv-story-media::after { background: none !important; }
  .bubcv-story-footer[hidden],
  .bubcv-story-copy[hidden],
  .bubcv-story-eyebrow[hidden],
  .bubcv-story-title[hidden],
  .bubcv-story-description[hidden] { display: none !important; }
  .bubcv-story-art {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: none;
  }
  /* Elementor's generic img rule forces height:auto even on an absolutely
     positioned image; the higher-specificity rule makes the photo truly full bleed. */
  .bubcv-stories .bubcv-story-media img.bubcv-story-art {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }
  .bubcv-story-media::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg,
      rgba(0,23,37,.12) 0%,
      rgba(0,23,37,0) 34%,
      rgba(0,23,37,0) 55%,
      rgba(0,23,37,.10) 67%,
      rgba(0,23,37,.36) 84%,
      rgba(0,23,37,.60) 100%);
  }

  /* The cropped original desktop luau artwork is now a portrait file.
     Preserve it using the normal full-bleed sizing; all lettering is
     inside the file's safe area, above live overlay copy. */
  .bubcv-stories.bubcv-original-luau .bubcv-story-media img.bubcv-story-art {
    object-fit: cover !important;
    object-position: center center !important;
  }
  .bubcv-stories.bubcv-original-luau .bubcv-story-media::after {
    background: linear-gradient(180deg,
      rgba(0,15,34,.24) 0%,
      rgba(0,15,34,0) 16%,
      rgba(0,15,34,0) 52%,
      rgba(0,15,34,.38) 73%,
      rgba(0,15,34,.76) 100%);
  }
  .bubcv-story-tap {
    position: absolute;
    top: 64px;
    bottom: 164px;
    z-index: 4;
    width: 29%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
  }
  /* Elementor theme applies bright promotional backgrounds to all buttons.
     Override every interactive state so invisible tap regions stay invisible. */
  .bubcv-stories .bubcv-story-frame button.bubcv-story-tap,
  .bubcv-stories .bubcv-story-frame button.bubcv-story-tap:hover,
  .bubcv-stories .bubcv-story-frame button.bubcv-story-tap:focus,
  .bubcv-stories .bubcv-story-frame button.bubcv-story-tap:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }
  .bubcv-story-tap--prev { left: 0; }
  .bubcv-story-tap--next { right: 0; }
  .bubcv-story-tap::before {
    position: absolute;
    top: 52%;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 50%;
    background: rgba(3,26,45,.24);
    color: #fff;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    transform: translateY(-50%);
  }
  .bubcv-story-tap--prev::before { content: '‹'; left: 10px; }
  .bubcv-story-tap--next::before { content: '›'; right: 10px; }
  .bubcv-story-tap:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -5px;
    border-radius: 15px;
  }
  .bubcv-story-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 0 21px 22px;
    background: transparent;
    color: #fff;
    box-sizing: border-box;
  }
  .bubcv-story-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    width: 100%;
    min-width: 0;
  }
  .bubcv-story-eyebrow {
    display: block;
    color: #f7ce86;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
    /* Preserve the gold brand color without backing plates or overlays.
       A hairline navy edge separates it from bright photography. */
    -webkit-text-stroke: .4px rgba(0, 28, 45, .88);
    text-shadow: 0 1px 1px rgba(0, 21, 38, .96),
                 1px 0 1px rgba(0, 21, 38, .83),
                -1px 0 1px rgba(0, 21, 38, .83),
                 0 0 3px rgba(0, 21, 38, .8);
  }
  .bubcv-story-title {
    font-size: clamp(27px, 7.3vw, 36px);
    line-height: 1.08;
    letter-spacing: -.035em;
    font-weight: 850;
    color: #fff;
    text-wrap: balance;
    text-shadow: 0 2px 9px rgba(0,0,0,.28);
    overflow-wrap: normal;
  }
  .bubcv-story-description {
    max-width: 30ch;
    color: rgba(255,255,255,.93);
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: .001em;
    font-weight: 520;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
  }
  .bubcv-story-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 19px;
    min-height: 44px;
    border-radius: 100px;
    background: #fff;
    border: 1px solid #fff;
    color: #133b55 !important;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 850;
    text-decoration: none !important;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(0,20,38,.12);
  }
  .bubcv-story-cta::after { content: '↗'; font-size: 16px; font-weight: 600; line-height: 1; }
  .bubcv-story-cta:hover,
  .bubcv-story-cta:focus-visible { background: #f0fbff; color: #0b2d45 !important; }
  .bubcv-story-cta:focus-visible { outline: 3px solid #83d4f8; outline-offset: 3px; }
  .bubcv-story-cta[hidden] { display: none !important; }
  .bubcv-story-hint {
    padding: 10px 0 0;
    color: #2d627a;
    text-align: center;
    font-size: 11px;
    line-height: 1.3;
    letter-spacing: .025em;
  }
  .bubcv-story-hint::before { content: '‹  '; font-size: 16px; vertical-align: -1px; }
  .bubcv-story-hint::after { content: '  ›'; font-size: 16px; vertical-align: -1px; }
}
@media (max-width: 360px) {
  .bubcv-stories { padding: 8px 6px 0; }
  .bubcv-story-frame { border-radius: 18px; }
  .bubcv-story-media { height: 398px; }
  .bubcv-story-footer { padding: 0 16px 18px; gap: 10px; }
  .bubcv-story-title { font-size: 27px; }
  .bubcv-story-description { font-size: 13px; }
  .bubcv-story-tap { bottom: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .bubcv-story-fill { transition: none !important; }
}
