/* v1.5 reusable storytelling. Deliberately scoped to the story wrapper. */
#ceb-atlantic-story { --ceb-header-offset:72px; }
/* Entire photo/video sequence is a self-contained block, with controls on its parent Group. */
#ceb-atlantic-story .photo-scrolly.wp-block-group{
  display:grid!important;
  grid-template-columns:minmax(0,var(--ceb-media-width,55%)) minmax(0,1fr)!important;
  column-gap:var(--ceb-media-gap,40px)!important;
  align-items:start!important;
  width:100%!important;max-width:100%!important;
}
#ceb-atlantic-story .photo-scrolly.wp-block-group > .photo-stage.sticky-stage{
  grid-column:1;grid-row:1;top:var(--ceb-header-offset)!important;
  height:var(--ceb-scene-height,85svh)!important;max-height:100svh!important;
}
#ceb-atlantic-story .photo-scrolly.wp-block-group > .scroll-steps.wp-block-group{
  grid-column:2;grid-row:1;
  padding:0 clamp(22px,3vw,56px) 0 0!important;
  min-width:0!important;
}
#ceb-atlantic-story .photo-scrolly.wp-block-group[data-ceb-resolved-layout="right"]{
  grid-template-columns:minmax(0,1fr) minmax(0,var(--ceb-media-width,55%))!important;
}
#ceb-atlantic-story .photo-scrolly.wp-block-group[data-ceb-resolved-layout="right"] > .photo-stage.sticky-stage{
  grid-column:2;border-left:1px solid #e5e5e5;
}
#ceb-atlantic-story .photo-scrolly.wp-block-group[data-ceb-resolved-layout="right"] > .scroll-steps.wp-block-group{
  grid-column:1;padding:0 0 0 clamp(22px,3vw,56px)!important;
}
#ceb-atlantic-story .photo-scrolly.wp-block-group .photo-step.wp-block-group{
  min-height:var(--ceb-scene-height,85svh)!important;
  padding:clamp(48px,6svh,100px) 0!important;
}
/* Opacity is controlled continuously by scroll progress, not CSS timers. */
#ceb-atlantic-story .photo-scrolly .photo-layer{transition:none!important;will-change:opacity;}
#ceb-atlantic-story .ceb-stage-video{
  display:block;position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;object-position:center center;
}
#ceb-atlantic-story .ceb-stage-play-toggle,
#ceb-atlantic-story .ceb-hero-play-toggle{
  z-index:10;position:absolute;right:24px;bottom:24px;
  border:1px solid rgba(255,255,255,.72);border-radius:4px;
  background:rgba(15,22,25,.75);color:#fff;padding:9px 13px;
  font-size:12px;line-height:1.3;letter-spacing:.015em;cursor:pointer;
  backdrop-filter:blur(5px);
}
#ceb-atlantic-story .ceb-stage-play-toggle[hidden]{display:none!important;}
#ceb-atlantic-story :is(.ceb-stage-play-toggle,.ceb-hero-play-toggle):focus-visible,
#ceb-atlantic-story :is(.ceb-reading-switch,.ceb-chapter-menu summary,.ceb-chapter-menu a):focus-visible{
  outline:3px solid #D52B1E;outline-offset:3px;
}
#ceb-atlantic-story .ceb-stage-play-toggle{bottom:92px;}
#ceb-atlantic-story .ceb-hero-video{
  position:absolute;inset:0;width:100%;height:100%;z-index:0;
  object-fit:cover;object-position:var(--ceb-hero-focal,50% 50%);pointer-events:none;
}
#ceb-atlantic-story .hero.wp-block-group::after{z-index:2!important;}
#ceb-atlantic-story .hero.wp-block-group .hero-copy.wp-block-group{z-index:3!important;}
#ceb-atlantic-story .hero.wp-block-group .hero-bottom{z-index:4!important;}
#ceb-atlantic-story .ceb-hero-play-toggle{bottom:26px;right:30px;z-index:5;}
/* Light, unobtrusive tools: not another full-width header above the feature. */
#ceb-atlantic-story .ceb-story-tools{
  position:fixed;bottom:18px;right:18px;z-index:1002;
  display:flex;gap:8px;align-items:flex-end;
  font-family:var(--font);font-size:12px;
}
#ceb-atlantic-story .ceb-story-tools button,
#ceb-atlantic-story .ceb-story-tools summary{
  font-family:inherit;font-size:12px;line-height:1.45;font-weight:650;
  border:1px solid #c9d0cf;border-radius:5px;
  background:#fff;color:#252b2b;padding:10px 13px;cursor:pointer;
  box-shadow:0 4px 18px #0000001a;white-space:nowrap;
}
#ceb-atlantic-story .ceb-chapter-menu{position:relative;}
#ceb-atlantic-story .ceb-chapter-menu summary{list-style:none;}
#ceb-atlantic-story .ceb-chapter-menu summary::-webkit-details-marker{display:none;}
#ceb-atlantic-story .ceb-chapter-menu summary::before{content:"☰";margin-right:8px;color:#D52B1E;}
#ceb-atlantic-story .ceb-chapter-menu nav{
  position:absolute;bottom:calc(100% + 10px);right:0;
  width:min(320px,calc(100vw - 34px));max-height:min(55vh,440px);
  overflow:auto;background:white;border:1px solid #e2e4e1;
  border-radius:7px;padding:9px;box-shadow:0 12px 36px #00000027;
}
#ceb-atlantic-story .ceb-chapter-menu nav a{
  display:block;padding:10px 12px;border-radius:4px;color:#2b2b2b;
  font-size:13px;text-decoration:none;line-height:1.4;
}
#ceb-atlantic-story .ceb-chapter-menu nav a:hover{background:#f7f7f5;color:#D52B1E;}
#ceb-atlantic-story [data-ceb-chapter]{scroll-margin-top:85px;}
/* Calm, readable fallback, independent of sticky positioning or JS timing. */
#ceb-atlantic-story.ceb-reading-mode .scrolly.wp-block-group{
  display:block!important;max-width:960px!important;margin-inline:auto!important;
  padding:0 clamp(20px,4vw,55px)!important;
}
#ceb-atlantic-story.ceb-reading-mode .photo-scrolly > .photo-stage{display:none!important;}
#ceb-atlantic-story.ceb-reading-mode .map-scrolly > .map-stage{
  position:relative!important;top:auto!important;height:min(55vh,430px)!important;
  width:100%!important;margin:20px 0 45px!important;
}
#ceb-atlantic-story.ceb-reading-mode .scrolly > .scroll-steps.wp-block-group{
  padding:0!important;display:block!important;
}
#ceb-atlantic-story.ceb-reading-mode .scrolly .map-step.wp-block-group,
#ceb-atlantic-story.ceb-reading-mode .scrolly .photo-step.wp-block-group{
  display:block!important;min-height:0!important;padding:22px 0 38px!important;
  break-inside:avoid;
}
#ceb-atlantic-story.ceb-reading-mode .scrolly :is(.story-card,.photo-text-panel){
  opacity:1!important;transform:none!important;max-width:800px!important;
}
#ceb-atlantic-story.ceb-reading-mode .photo-step :is(.ceb-photo-source,.ceb-video-source){
  display:block!important;max-width:100%!important;margin:0 0 22px!important;
}
#ceb-atlantic-story.ceb-reading-mode .photo-step :is(.ceb-photo-source img,.ceb-video-source video){
  display:block;width:100%!important;max-height:560px;object-fit:contain;height:auto!important;
}
#ceb-atlantic-story.ceb-reading-mode .photo-step .ceb-video-source video{max-height:520px;}
#ceb-atlantic-story.ceb-reading-mode .ceb-hero-video{display:none!important;}
@media(max-width:950px) and (min-width:721px){
  #ceb-atlantic-story .photo-scrolly.wp-block-group{column-gap:24px!important;}
  #ceb-atlantic-story .photo-scrolly.wp-block-group > .scroll-steps.wp-block-group{padding:0 16px!important;}
}
@media(max-width:720px){
  #ceb-atlantic-story .photo-scrolly.wp-block-group,
  #ceb-atlantic-story .photo-scrolly.wp-block-group[data-ceb-resolved-layout="right"]{
    display:block!important;grid-template-columns:none!important;
  }
  #ceb-atlantic-story .photo-scrolly.wp-block-group > .photo-stage.sticky-stage{
    height:42svh!important;top:var(--ceb-header-offset,60px)!important;
    width:100%!important;
  }
  #ceb-atlantic-story .photo-scrolly.wp-block-group > .scroll-steps.wp-block-group,
  #ceb-atlantic-story .photo-scrolly.wp-block-group[data-ceb-resolved-layout="right"] > .scroll-steps.wp-block-group{
    padding:0 24px!important;
  }
  #ceb-atlantic-story .photo-scrolly.wp-block-group .photo-step.wp-block-group{
    min-height:67svh!important;padding:28px 0 40px!important;
  }
  #ceb-atlantic-story .ceb-story-tools{bottom:12px;right:12px;gap:5px;}
  #ceb-atlantic-story .ceb-story-tools button,
  #ceb-atlantic-story .ceb-story-tools summary{font-size:11px;padding:9px 10px;}
  #ceb-atlantic-story .ceb-stage-play-toggle{bottom:62px;right:12px;padding:7px 10px;}
  #ceb-atlantic-story .ceb-hero-play-toggle{bottom:12px;right:12px;}
  #ceb-atlantic-story .ceb-reading-mode .photo-scrolly > .photo-stage{display:none!important;}
  #ceb-atlantic-story.ceb-reading-mode .scrolly.wp-block-group{padding:0 22px!important;}
}
@media(prefers-reduced-motion:reduce){
  #ceb-atlantic-story .hero .scroll-cue:before{animation:none!important;}
  #ceb-atlantic-story .scrolly :is(.story-card,.photo-text-panel){transition:none!important;transform:none!important;}
  #ceb-atlantic-story .ceb-media-layer{transition:none!important;}
}
@media print{
  #ceb-atlantic-story .ceb-story-tools,#ceb-atlantic-story :is(.ceb-stage-play-toggle,.ceb-hero-play-toggle){display:none!important;}
  #ceb-atlantic-story .photo-scrolly > .photo-stage{display:none!important;}
  #ceb-atlantic-story .scrolly.wp-block-group{display:block!important;}
  #ceb-atlantic-story .photo-step .ceb-photo-source{display:block!important;}
}
/* Keep the native video editable in Gutenberg, but avoid taking up space
   alongside its scrolling text on the published page. */
#ceb-atlantic-story .photo-scrolly .photo-step .ceb-video-source{display:none!important;}
#ceb-atlantic-story.ceb-reading-mode .photo-scrolly .photo-step .ceb-video-source{display:block!important;}
/* Progressive enhancement: the original Gutenberg media and text remain
   readable if JavaScript is blocked, disabled, or fails before initialization. */
#ceb-atlantic-story:not(.ceb-js-ready) .scrolly.wp-block-group{
  display:block!important;max-width:960px!important;
  margin:0 auto!important;padding:0 clamp(20px,4vw,55px)!important;
}
#ceb-atlantic-story:not(.ceb-js-ready) .scrolly > .sticky-stage{display:none!important;}
#ceb-atlantic-story:not(.ceb-js-ready) .scrolly .scroll-steps.wp-block-group{padding:0!important;}
#ceb-atlantic-story:not(.ceb-js-ready) .scrolly :is(.map-step,.photo-step).wp-block-group{
  display:block!important;min-height:0!important;padding:25px 0 40px!important;
}
#ceb-atlantic-story:not(.ceb-js-ready) .scrolly :is(.story-card,.photo-text-panel){
  opacity:1!important;transform:none!important;
}
#ceb-atlantic-story:not(.ceb-js-ready) .scrolly .photo-step :is(.ceb-photo-source,.ceb-video-source){
  display:block!important;margin:0 0 22px!important;
}
#ceb-atlantic-story:not(.ceb-js-ready) .scrolly .photo-step :is(.ceb-photo-source img,.ceb-video-source video){
  display:block;width:100%;max-width:100%;height:auto;
}
#ceb-atlantic-story:not(.ceb-js-ready) .photo-scrolly .photo-step .photo-text-panel,
#ceb-atlantic-story:not(.ceb-js-ready) .map-scrolly .map-step .story-card{
  opacity:1!important;transform:none!important;
}

/* v1.5.1: size live Mapbox to the complete sticky Gutenberg map panel.
 * Paired with ResizeObserver in mapbox-tour.js for editor/theme changes. */
#ceb-atlantic-story .map-stage #ceb-live-map{
  display:block;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  overflow:hidden;
}
