// ==========================================================================
// Page Header Block
// Full-width header with background image and overlay
//
// OVERRIDE PATTERN:
// This block customizes child components via descendant selectors.
// Never create component modifiers for block-specific styling.
//
// ✓  .b-testimonials .c-card { ... }
// ✗  .c-card--testimonial { ... }
// ==========================================================================

.b-page-header {
  $self: &;

  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: $primary;

  &.t-blue {
    li,
    li::before,
    li::after,
    a,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      color: $white;
    }
  }

  // ==========================================================================
  // Height Variants
  // ==========================================================================

  &--small {
    min-height: 200px;

    @include media-breakpoint-up(md) {
      min-height: 250px;
    }

    @include media-breakpoint-up(lg) {
      min-height: 300px;
    }
  }

  &--medium {
    min-height: 300px;

    @include media-breakpoint-up(md) {
      min-height: 400px;
    }

    @include media-breakpoint-up(lg) {
      min-height: 450px;
    }
  }

  &--large {
    min-height: 400px;

    @include media-breakpoint-up(md) {
      min-height: 500px;
    }

    @include media-breakpoint-up(lg) {
      min-height: 600px;
    }
  }

  // ==========================================================================
  // Background Image
  // ==========================================================================

  &__background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
  }

  &__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  // ==========================================================================
  // Overlay Styles
  // ==========================================================================

  &__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
  }

  &--overlay-dark {
    #{$self}__overlay {
      background: linear-gradient(
        to bottom,
        rgba($hks-navy-dark, 0.7) 0%,
        rgba($hks-navy-dark, 0.85) 100%
      );
    }

    #{$self}__title,
    #{$self}__subtitle {
      color: $white;
    }
  }

  &--overlay-light {
    #{$self}__overlay {
      background: linear-gradient(
        to bottom,
        rgba($white, 0.85) 0%,
        rgba($white, 0.95) 100%
      );
    }

    #{$self}__title {
      color: $primary;
    }

    #{$self}__subtitle {
      color: $gray-700;
    }
  }

  &--overlay-none {
    #{$self}__overlay {
      display: none;
    }

    #{$self}__title,
    #{$self}__subtitle {
      color: $white;
      text-shadow: 0 2px 4px rgba($black, 0.3);
    }
  }

  // ==========================================================================
  // Content
  // ==========================================================================

  &__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: $spacer * 1.5 0;

    @include media-breakpoint-up(lg) {
      padding: $spacer * 2 0;
    }
  }
  .c-page-title {
    @include media-breakpoint-down(sm) {
      font-size: calc(1.375rem);
    }
  }
  &__title {
    font-size: $block-title-font-size-lg;
    font-weight: $font-weight-bold;
    margin: 0;
    line-height: 1.2;

    @include media-breakpoint-up(md) {
      font-size: $block-title-font-size-xl;
    }

    @include media-breakpoint-up(lg) {
      font-size: $block-title-font-size-xxl;
    }
  }

  &__subtitle {
    font-size: $font-size-base;
    margin-top: 1.5rem;
    margin-bottom: 0;
    @include media-breakpoint-up(md) {
      font-size: $font-size-lg;
    }

    @include media-breakpoint-up(lg) {
      font-size: $h4-font-size;
      font-weight: $font-weight-semibold;
    }
  }

  &__breadcrumbs {
    margin-top: 0.75rem;
    @include media-breakpoint-up(md) {
      margin-top: 1rem;
    }
    @include media-breakpoint-up(lg) {
      margin-top: 1.25rem;
    }
  }

  .c-report-meta {
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;

    margin-bottom: 0;
    margin-top: 1.5rem;
    @include media-breakpoint-up(md) {
      gap: 1rem;
      // font-size: 1.125rem;
      margin-top: 2rem;
    }
    @include media-breakpoint-up(lg) {
      gap: 1.5rem;
    }

    &__item {
      &::before {
        // color: $color-accent !important;
        @include media-breakpoint-up(md) {
          font-size: 1.25rem;
        }
      }
      @include media-breakpoint-up(md) {
        gap: 0.75rem;
        &--name {
          &::before {
            font-size: 1.375rem;
          }
        }
      }
    }
  }
  .c-copyright--overlay {
    display: none;
    z-index: 3;
  }

  &--caption-always .c-copyright--overlay {
    display: block;
  }

  &--caption-hover {
    &:hover .c-copyright--overlay,
    &:focus-within .c-copyright--overlay {
      display: block;
    }
  }

  @include media-breakpoint-down(sm) {
    &.l-section--m-top {
      padding-top: max(2rem, min(6vw, 5rem));
    }

    &.l-section--s-bottom {
      padding-bottom: max(1rem, min(4vw, 3rem));
    }
  }
}
