/*--------------------------------------------------------------
# Global Header
--------------------------------------------------------------*/
.header {
  --background-color: rgba(255, 255, 255, 0);
  --default-color: #ffffff;
  --heading-color: #ffffff;
  color: var(--default-color);
  background-color: var(--background-color);
  padding: 15px 0;
  transition: all 0.5s;
  z-index: 997;
}

.header .logo {
  line-height: 1;
}

.header .logo img {
  max-height: 32px;
  margin-right: 8px;
}

.header .logo h1 {
  font-size: 30px;
  margin: 0;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--heading-color);
}

/* Global Header on Scroll
------------------------------*/
.scrolled .header {
  --background-color: #3b94b5;
}


/*--------------------------------------------------------------
# Scroll Top Button
--------------------------------------------------------------*/
.scroll-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 99999;
  background-color: var(--accent-color);
  width: 40px;
  height: 40px;
  border-radius: 4px;
  transition: all 0.4s;
}

.scroll-top i {
  font-size: 24px;
  color: var(--contrast-color);
  line-height: 0;
}

.scroll-top:hover {
  background-color: color-mix(in srgb, var(--accent-color), transparent 20%);
  color: var(--contrast-color);
}

.scroll-top.active {
  visibility: visible;
  opacity: 1;
}

/*--------------------------------------------------------------
# Disable aos animation delay on mobile devices
--------------------------------------------------------------*/
@media screen and (max-width: 768px) {
  [data-aos-delay] {
    transition-delay: 0 !important;
  }
}

/*--------------------------------------------------------------
# Global Page Titles & Breadcrumbs
--------------------------------------------------------------*/
.page-title {
  color: var(--default-color);
  background-color: var(--background-color);
  padding: 160px 0 80px 0;
  text-align: center;
  position: relative;
}

.page-title:before {
  content: "";
  background-color: color-mix(in srgb, var(--background-color), transparent 50%);
  position: absolute;
  inset: 0;
}

.page-title h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 10px;
}

.page-title .breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  justify-content: center;
  padding: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 400;
}

.page-title .breadcrumbs ol li+li {
  padding-left: 10px;
}

.page-title .breadcrumbs ol li+li::before {
  content: "/";
  display: inline-block;
  padding-right: 10px;
  color: color-mix(in srgb, var(--default-color), transparent 50%);
}

/*--------------------------------------------------------------
# Global Sections
--------------------------------------------------------------*/
section,
.section {
  color: var(--default-color);
  background-color: var(--background-color);
  padding: 60px 0;
  scroll-margin-top: 90px;
  overflow: clip;
}

@media (max-width: 1199px) {

  section,
  .section {
    scroll-margin-top: 66px;
  }
}

/*--------------------------------------------------------------
# Global Section Titles
--------------------------------------------------------------*/
.section-title {
  text-align: center;
  padding-bottom: 40px;
  position: relative;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 20px;
  position: relative;
}

.section-title h2:after {
  content: "";
  position: absolute;
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent-color);
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}

.section-title p {
  margin-bottom: 0;
}

/*--------------------------------------------------------------
# Hero Section
--------------------------------------------------------------*/
.hero {
  position: relative;
  width: 100%;
  min-height: 80svh;
  overflow: hidden;
  background: linear-gradient(0deg, #99f8ff 0%, color-mix(in srgb, #3b94b5 90%, white 10%) 100%);
  display: block; /* don't use flex/end here */
  padding: 0;
}

/* Remove .container constraints if still present on the carousel */
.hero #hero-carousel.container {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
}

.hero h2 {
  margin-bottom: 30px;
  font-size: 48px;
  font-weight: 700;
}

.hero p {
  max-width: 80%;
  font-size: 20px;
  animation-delay: 0.4s;
  margin: 0 auto 30px auto;
}

/* Carousel must fill the hero */
.hero #hero-carousel,
.hero #hero-carousel .carousel-inner,
.hero #hero-carousel .carousel-item {
  position: relative;
  width: 100%;
  min-height: 80svh;
}

 .carousel.carousel-fade .carousel-item {
  position: absolute; /* stack all slides */
  inset: 0;
  display: block;
  opacity: 0;
  z-index: 0;

  /* "morph" feel: start slightly zoomed & soft */
  transform: scale(1.02);       /* tiny zoom */
  filter: blur(2px);
  will-change: opacity, transform, filter;
  transition:
    opacity 800ms ease,
    transform 1200ms cubic-bezier(.2,.6,.2,1),
    filter 800ms ease;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Incoming + current visible slide */
.carousel.carousel-fade .carousel-item.active,
.carousel.carousel-fade .carousel-item-next.carousel-item-start,
.carousel.carousel-fade .carousel-item-prev.carousel-item-end {
  opacity: 1;
  z-index: 1;
  transform: scale(1);
  filter: blur(0);
}

/* Outgoing slide during transition */
.carousel.carousel-fade .active.carousel-item-start,
.carousel.carousel-fade .active.carousel-item-end {
  opacity: 0;
  z-index: 0;
  transform: scale(1.02);
  filter: blur(2px);
}

/* Background image: cover the entire slide */
.hero .carousel-item img.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* fill without distortion */
  object-position: center;
  z-index: 0;
}

/* add a fixed overlay on each slide (constant during fade) */
.hero .carousel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1;
  pointer-events: none;
}

.carousel-item {
  opacity: 0;
  transition: opacity .6s ease-in-out;
}
.carousel-item.active,
.carousel-item-next.carousel-item-start,
.carousel-item-prev.carousel-item-end {
  opacity: 1;
}

/* Center overlay text; keep it above the image and above waves */
.hero .carousel-container {
  position: relative;
  z-index: 2;
  min-height: calc(100svh - 60px); /* account for wave overlay height */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px 100px;
}

@media (min-width: 1024px) {
  .hero p {
    max-width: 60%;
    font-size: 17px;
  }

  .hero .carousel-control-prev,
  .hero .carousel-control-next {
    width: 5%;
  }
}

@media (max-width: 768px) {
  .hero .carousel-container {
    min-height: 90vh;
  }

  .hero h2 {
    font-size: 28px;
  }

  .hero p {
    max-width: 60%;
    font-size: 12px;
  }
}

.hero .btn-get-started {
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 1px;
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  transition: 0.5s;
  line-height: 1;
  margin: 10px;
  animation-delay: 0.8s;
  color: var(--default-color);
  border: 2px solid #fff;
}

.hero .btn-get-started:hover {
  background: #94d4be;
  color: #fff;
  text-decoration: none;
}

/* Waves must NOT consume layout height — pin to bottom */
.hero .hero-waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  width: 100%;
  z-index: 3;
  pointer-events: none;
}

.hero .wave1 use {
  animation: move-forever1 10s linear infinite;
  animation-delay: -2s;
  fill: var(--default-color);
  opacity: 0.6;
}

.hero .wave2 use {
  animation: move-forever2 8s linear infinite;
  animation-delay: -2s;
  fill: var(--default-color);
  opacity: 0.4;
}

.hero .wave3 use {
  animation: move-forever3 6s linear infinite;
  animation-delay: -2s;
  fill: var(--default-color);
}

@keyframes move-forever1 {
  0% {
    transform: translate(85px, 0%);
  }

  100% {
    transform: translate(-90px, 0%);
  }
}

@keyframes move-forever2 {
  0% {
    transform: translate(-90px, 0%);
  }

  100% {
    transform: translate(85px, 0%);
  }
}

@keyframes move-forever3 {
  0% {
    transform: translate(-90px, 0%);
  }

  100% {
    transform: translate(85px, 0%);
  }
}


/*--------------------------------------------------------------
# Gallery Section
--------------------------------------------------------------*/
#island-filters-storymap a, #island-filters-eia a {
  cursor: pointer;
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-weight: 400;
  color: var(--default-color);
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 70%);
  transition: all 0.3s ease;
}
#island-filters-storymap a:hover,
#island-filters-storymap a.active,
#island-filters-eia a:hover,
#island-filters-eia a.active {
  background: var(--accent-color);
  color: var(--contrast-color);
  border-color: var(--accent-color);
}


/* Base Gallery Layout */
.storymap .storymap-item, .eia .eia-item {
  position: relative;
  overflow: hidden;
  border-right: 3px solid var(--background-color);
  border-bottom: 3px solid var(--background-color);
  height: 250px;

  will-change: opacity, transform;
  contain: layout paint size;           /* isolate each tile */
  transition: opacity .22s ease, transform .22s ease;
}

/* Image fill */
.storymap .storymap-item img, .eia .eia-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease-in-out;
}

/* Zoom on hover */
.storymap .storymap-item:hover img, .eia .eia-item:hover img {
  transform: scale(1.1);
}

/* Caption overlay */
.storymap .storymap-caption, .eia .eia-caption {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.328);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 15px;
  text-align: left;
  opacity: 1;
  transition: background 0.3s ease, opacity 0.3s ease;
}
.storymap .storymap-caption h4, .eia .eia-caption h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: #fff;
}

/* Hover reveal */
.storymap .storymap-item:hover .storymap-caption, .eia .eia-item:hover .eia-caption {
  background: rgba(0, 0, 0, 0.7);
}

/* Filter transition */
.storymap .grid-item, .eia .grid-item {
  transition: opacity .25s ease, transform .25s ease;
}
.storymap .grid-item.is-hiding, .eia .grid-item.is-hiding {
  opacity: 0;
  transform: scale(.98);
}
.storymap .grid-item.is-hidden, .eia .grid-item.is-hidden {
  display: none !important;
}

/* Disable expensive hovers while filtering */
.storymap .filtering .gallery-item:hover img, .eia .filtering .gallery-item:hover img { 
  transform: none; 
}

/* Also mute pointer events during filtering to avoid layout thrash */
.storymap .filtering, .eia .filtering{ pointer-events: none; }

/* Optional: ease filter buttons to feel snappier */
#island-filters-storymap a,#island-filters-eia a { transition: background .2s ease, color .2s ease, border-color .2s ease; }