/* ==========================================================================
   Page Banner Component (H1)
   Dark blue background with white text
   Per Figma design - "H2" text style used for page titles
   ========================================================================== */

:root {
  --swoosh-height-mobile: 188px;
  --swoosh-height-desktop: 290px;
}

.page-banner {
  padding: 0;
  position: relative;
  min-height: 188px;
  overflow: visible;
  display: grid;
  /* align-items: center; */
  z-index: 1;
  background-repeat: no-repeat;
  background-size: 100% 165px;

  @media (min-width: 1024px) {
    min-height: 290px;
    background-size: 100% 236px;
  }
}

.page-banner__section {
  width: 100%;
  overflow: hidden;
  height: fit-content;
}

/* Decorative swoosh on banner */
.page-banner__background {
  grid-area: 1 / 1;
  height: 100%;
  width: 100%;
  pointer-events: none;

  picture {
    width: 100%;
    height: 100%;
    padding-right: var(--space-4);
    margin-top: calc(var(--space-3) * -1);

    @media (width >= 1024px) {
      padding: 0;
      margin: 0;
    }
  }

  img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: right bottom;
    pointer-events: none;

    @media (width > 528px) {
      object-fit: fill;
    }

    @media (width >= 1024px) {
      /* --clamp: clamp(32px, 34.375vw - 320px, 175px); */
      --clamp: clamp(32px, -14.836px + 12.488vw, 165px);

      width: calc(100% - (var(--clamp)/1440px * 100%));
      height: 290px;
      object-position: right center;
      object-fit: fill;
    }

    @media (width > 1440px) {
      width: calc(100% - 175px);
      object-fit: fill;
    }
  }
}

/* Dark banner */
.page-banner--dark {
  background-color: var(--color-white);
  background-image: linear-gradient(var(--color-blue-dark-alt), var(--color-blue-dark-alt));
  position: relative;
  margin-bottom: 40px;

  .page-banner__background {
    filter: drop-shadow(0 16.298px 48.893px rgba(0, 0, 0, 0.12));
  }

}

/* @media (max-width: 1023px) and (min-width: 768px) {
  .page-banner__nav {
    margin-bottom: 1.5rem;
  }
} */

/* @media (min-width: 1024px) {
  .page-banner--dark {
    margin-bottom: 80px;
  }
} */

.page-banner__link-item::marker {
  color: inherit;
  font-size: 0.6em;
}

.page-banner__container {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Left-align content */
  justify-content: center;
  gap: var(--space-5);
  margin: 0 auto;
  width: 100%;
  max-width: 1140px;
  height: 100%;
  /* max-height: 188px; */
  padding: 0 1rem;
  position: relative;
  z-index: 1;

  @media (min-width: 1024px) {
    max-height: 236px;
  }

  .page-banner--dark.page-banner--has-deep-links & {
    @media (min-width: 1024px) {
      margin-top: 62px;
    }
  }

  .page-banner--has-deep-links & {
    @media (min-width: 1024px) {
      margin-top: 50px;
      justify-content: flex-start;
    }
  }

}

/* H1 Title */
.page-banner__title {
  color: #FFFFFF;
  font-family: 'Outfit', sans-serif;
  font-size: 46px;
  font-style: normal;
  font-weight: 600;
  line-height: 120%;
  font-feature-settings: 'liga' off, 'clig' off;
  text-align: left;
  margin: 0;
  padding: 0;
  max-width: 930px;
}

@media (max-width: 1023px) {
  .page-banner__title {
    max-width: 660px;
    min-height: 188px;
    line-height: 1.1;
    display: flex;
    align-items: center;
    padding-right: 27%;
  }
}

.page-banner__title--large {
  font-size: clamp(27px, 5vw, 32px);

  @media (min-width: 1024px) {
    font-size: 46px;
  }
}

.page-banner__title--small {
  font-size: clamp(22px, 5vw, 30px);

  @media (min-width: 1024px) {
    font-size: 36px;
  }
}

/* Deep Links Navigation */
.page-banner__nav {
  width: 100%;

  @media (min-width: 1024px) {
    margin-bottom: var(--space-4);
  }
}

/* List Label (above deep links) */
.page-banner__list-label {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 120%; /* 21.6px */
  text-transform: uppercase;
  font-feature-settings: 'liga' off, 'clig' off;
  color: #FFFFFF;
  margin: 0 0 12px 0;

  @media (width < 1024px) {
    color: var(--color-blue-dark);
  }
}

.page-banner__links {
  display: flex;
  flex-wrap: wrap;
  /* align-items: start; */
  justify-content: flex-start;
  /* gap: var(--space-3) var(--space-4); 1rem 2rem; */
  gap: var(--space-5);
  list-style: disc; /* Show bullets */
  margin: 0;
  padding: 0;
  padding-left: 1rem; /* Space for bullets */

  @media (min-width: 1024px) {
    align-items: flex-start;
    gap: var(--space-10);
  }

  .page-banner--light & {

    @media (min-width: 1024px) {
      gap: var(--space-4);
    }
  }
}

.page-banner__link-item {
  margin: 0;
  padding: 0;
  color: #FFFFFF; /* For bullet color on dark theme */

  @media (width < 1024px) {
    color: var(--color-blue-dark);
    line-height: 1.1;
  }

  br {
    @media (width < 768px) {
      display: none;
    }
  }
}

.page-banner__link-item::marker {
  color: #FFFFFF;
  font-size: 0.6em; /* Smaller bullets - about 60% */

  @media (width < 1024px) {
    color: var(--color-blue-dark);
  }
}

.page-banner__link,
.page-banner__link:visited {
  color: #FFFFFF;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 120%; /* 19.2px */
  font-feature-settings: 'liga' off, 'clig' off;
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-skip-ink: auto;
  text-decoration-thickness: auto;
  text-underline-offset: 3px;
  text-underline-position: from-font;
  transition: opacity 150ms ease;

  @media (width < 1024px) {
    color: var(--color-blue-dark);
  }
}

.page-banner__link:hover {
  color: #FFFFFF;
  opacity: 0.8;

  @media (width < 1024px) {
    color: var(--color-blue-dark);
  }
}

.page-banner__link:focus-visible {
  color: #FFFFFF;
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;

  @media (width < 1024px) {
    color: var(--color-blue-dark);
    outline-color: var(--color-blue-dark);
  }
}

/* Responsive adjustments */
@media (max-width: 767px) {
  /* .page-banner {
    padding: 2rem 0;
  } */

  .page-banner__links {
    flex-direction: column;
    align-items: flex-start;
    /* gap: 0.75rem; */
  }
}

/* ==========================================================================
   Light Theme Variant
   Solid background with dark blue text
   Decorative swoosh on left, leaf image on right
   ========================================================================== */
.page-banner--light {
  /* Solid background color matching dark variant pattern */
  background-color: var(--color-white, #fff);
  background-image: linear-gradient(#ECF8FF, #ECF8FF);
  position: relative;
  overflow: visible;
  padding: 0;
  margin-bottom: 60px;
}

/* Decorative leaf image (default, hidden when custom image is provided) */
.page-banner--light::after {
  content: '';
  position: absolute;
  right: 0;
  top: 28px;
  width: 100%;
  height: 290px;
  background-image: url('/themes/custom/livmarli/images/leaves.png');
  background-size: auto 290px;
  background-repeat: no-repeat;
  background-position: right top;
  pointer-events: none;
}

/* Hide default leaves when a custom banner image is uploaded */
.page-banner--has-image.page-banner--light::after {
  display: none;
}

/* Custom banner image wrapper */
.page-banner__image-wrapper {
  grid-area: 1 / 1;
  justify-self: end;
  align-self: stretch;
  position: relative;
  height: 100%;
  max-height: var(--swoosh-height-desktop);
  /* right: -12px; */
  z-index: 0;
  display: grid;
  place-content: end;
  pointer-events: none;

  @media (max-width: 1023.98px) {
    max-width: 203px;
    max-height: var(--swoosh-height-mobile);
    align-items: flex-start;
    /* top is set by JS to align with the title's vertical center */
    align-self: flex-start;
    /* min-height: 201px; */
  }

  @media (min-width: 1024px) {
    top: 42px;
  }
}

/* Picture element within image wrapper */
/* .page-banner__image-wrapper picture {
  display: contents;
} */

/* Custom banner image (replaces leaves) */
.page-banner__image {
  height: 100%;
  max-height: 320px;
  width: auto;
  object-fit: contain;
  object-position: right top;
  pointer-events: none;
  z-index: 0;
  position: relative;

  @media (max-width: 1023.98px) {
    bottom: -6px;
  }
}

.page-banner--light .page-banner__container {
  /* Content inherits base container styles, z-index to stay above decorative elements */
  z-index: 1;
}

.page-banner--light .page-banner__title {
  color: var(--color-blue-dark);

  @media (max-width: 1023.98px) {
    max-width: 660px;
    min-height: 188px;
    line-height: 1.1;
    display: flex;
    align-items: center;
    padding-right: 26.1%;
  }
}

.page-banner--light .page-banner__list-label {
  color: var(--color-blue-dark);
}

.page-banner--light .page-banner__links {
  list-style: none;
  padding-left: 0;
}

.page-banner--light .page-banner__link-item {
  display: flex;
  align-items: start;
  gap: 0.5rem;
}

/* Leaf icon for light theme bullets */
.page-banner--light .page-banner__link-item::before {
  content: '';
  display: inline-block;
  width: 19px;
  height: 18px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19' height='18' viewBox='0 0 19 18' fill='none'%3E%3Cg clip-path='url(%23clip0_2783_61315)'%3E%3Cpath d='M9.06846 17.9999C9.06846 17.9999 8.62562 8.8698 0.506861 5.03125C0.506861 5.03125 -3.12022 15.1373 9.06846 17.9999Z' fill='%23003A70'/%3E%3Cpath d='M10.5511 16.7988C11.3328 16.3165 20.2297 12.2826 16.1509 0.547846C16.1916 0.558983 16.223 0.522656 16.2026 0.517087C15.8767 0.427993 6.09544 3.00776 10.5511 16.7988Z' fill='%23003A70'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2783_61315'%3E%3Crect width='19' height='18' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.page-banner--light .page-banner__link,
.page-banner--light .page-banner__link:visited {
  color: #003A70; /* --Branded-Blue-dark */
}

.page-banner--light .page-banner__link:hover {
  color: #003A70;
  opacity: 0.8;
}

.page-banner--light .page-banner__link:focus-visible {
  color: #003A70;
  outline-color: #003A70;
}

/* Page specific styles */
.page--explore-livmarli {
  .page-banner__title {
    @media (max-width: 576px) {
      padding-right: 45%;
    }
  }

  .page-banner__image-wrapper {
    @media (max-width: 1023.98px) {
      max-width: 210px;
    }

    @media (min-width: 1024px) {
      top: 8px;
      right: -24px;
    }

    .page-banner__image {
      @media (max-width: 1023.98px) {
        bottom: -13px;
      }

      @media (min-width: 1024px) {
        max-height: 278px;
      }
    }
  }
}

.path--algs[class*="page--improvements"] {
  .page-banner__container {
    @media (min-width: 1024px) {
      margin-top: 40px;
    }
  }

  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      right: 0;
    }

    .page-banner__image {
      @media (max-width: 1023.98px) {
        bottom: -20px;
        right: -4px;
      }
    }
  }
}

.page--results-with-livmarli {
  .page-banner__container {
    @media (min-width: 1024px) {
      margin-top: 40px;
    }
  }

  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      right: 0;
    }

    .page-banner__image {
      @media (max-width: 1023.98px) {
        bottom: -20px;
        right: -4px;
      }
    }
  }
}

.page--real-people-taking-LIVMARLI {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 478px;
      top: 26px;
      right: 0;
    }
  }
}

.page--tea-dr-bass-video {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      right: -12px;
    }
  }
}

.page--finley-video {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 405px;
      top: 30px;
      right: -10px;
    }
  }
}

.page--tea-video {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 422px;
      top: 32px;
      right: 0;
    }
  }
}

.page--tyler-video {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      top: 32px;
      right: 0;
    }
  }
}

.page--emma-abby-video {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      top: 56px;
      right: 0;
    }
  }
}

.page--caregivers-perspectives-video {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      top: 56px;
      right: 0;
    }
  }
}

.page--taking-livmarli {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
    }
  }
}

.page--access-and-support {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      right: -4px;
    }
  }
}

.page--resources {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      right: 0;
    }

    .page-banner__image {
      @media (max-width: 1023.98px) {
        bottom: -6px;
        right: -4px;
      }
    }
  }
}

.page--accessibility {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      top: 50px;
      right: 0;
    }
  }
}

.page--do-not-sell {
  .page-banner__title {
    @media (max-width: 576px) {
      padding-right: 55%;
    }
  }

  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 475px;
      right: 0;
    }
  }
}

.page--site-map {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      top: 50px;
      right: 0;
    }
  }
}

.page--36 {
  .page-banner__image-wrapper {
    @media (min-width: 1024px) {
      max-width: 460px;
      top: 55px;
      right: 0;
    }
  }
}