.split-banner.split-banner {
  display: block;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  background-color: transparent;
}

[dir="rtl"] .split-banner {
  left: auto;
  right: 50%;
  margin-right: -50vw !important;
  margin-left: -50vw !important;
}

.split-banner-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
  width: 100%;
}

.split-banner .container-full {
  height: 100%;
}

.container-full .section-body {
  height: inherit !important;
}

.split-banner-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-banner--fullscreen {
  height: calc(
    100vh -
      (
        var(--header-height, 70px) + var(--announcement-height, 0px) +
          var(--subheader-height, 0px)
      )
  );
  min-height: 500px;
}

.split-banner--fullscreen .split-banner-item {
  height: 100%;
  aspect-ratio: auto;
}

@media (max-width: 768px) {
  .split-banner-inner {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    height: auto; /* Allow height to be determined by content/aspect-ratio */
  }

  .split-banner-item {
    aspect-ratio: 4 / 3; /* Better height for mobile stacking */
  }

  .split-banner--fullscreen {
    height: auto;
    min-height: auto;
  }

  .split-banner--fullscreen .split-banner-item {
    height: 60vh; /* Controlled height on mobile instead of full 100vh per item */
  }

  .split-banner-overlay {
    padding: var(--spacing-2xl);
  }

  .split-banner-title {
    font-size: 2rem;
  }

  /* Keep comfortable spacing on mobile, but respect selected position */
  .split-banner-overlay {
    padding: var(--spacing-2xl) !important;
    padding-bottom: 2rem !important;
  }
}

.split-banner-item img,
.split-banner-video,
.split-banner-item iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  will-change: transform;
  transition: transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  filter: brightness(0.85);
}

.split-banner-item:hover img,
.split-banner-item:hover .split-banner-video,
.split-banner-item:hover iframe {
  transform: scale(1.1);
  filter: brightness(1);
}

.split-banner-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-2xl);
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.4) 100%
  );
  transition: all 0.5s ease;
}

/* Content Position Variants */
.split-banner-overlay--center {
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
}

.split-banner-overlay--center-bottom {
  justify-content: flex-end !important;
  align-items: center !important;
  text-align: center !important;
  padding-bottom: 3rem !important;
}

.split-banner-overlay--bottom-left {
  justify-content: flex-end !important;
  align-items: flex-start !important;
  text-align: left !important;
  padding-bottom: 3rem !important;
  padding-left: 3rem !important;
}

.split-banner-overlay--bottom-right {
  justify-content: flex-end !important;
  align-items: flex-end !important;
  text-align: right !important;
  padding-bottom: 3rem !important;
  padding-right: 3rem !important;
}

.split-banner-item:hover .split-banner-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

.split-banner-title {
  color: var(--color-white);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.1;
}

.split-banner-subtitle {
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  margin-bottom: var(--spacing-lg);
  opacity: 0.9;
  letter-spacing: 0.05em;
  max-width: 80%;
}

.split-banner-btn {
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-banner-btn:hover {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.3);
}

/* Oblique Layout Styles - Using Clip-Path for perfect 50/50 diagonal split */
@media (min-width: 769px) {
  .split-banner-inner--oblique {
    position: relative;
    display: block; /* Override grid for absolute stacking */
    height: 100%;
    width: 100%;
    aspect-ratio: 21 / 9;
    min-height: 480px;
  }

  .split-banner--fullscreen .split-banner-inner--oblique {
    aspect-ratio: auto;
  }

  .split-banner-inner--oblique .split-banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  /* Left item clips from the right */
  .split-banner-inner--oblique .split-banner-item:first-child {
    z-index: 2;
    clip-path: polygon(0 0, 55% 0, 45% 100%, 0 100%);
  }

  /* Right item clips from the left */
  .split-banner-inner--oblique .split-banner-item:last-child {
    z-index: 1;
    clip-path: polygon(55% 0, 100% 0, 100% 100%, 45% 100%);
  }

  /* Add a stylish glowing divider line */
  .split-banner-inner--oblique::after {
    content: "";
    position: absolute;
    top: 0;
    left: 45%;
    height: 100%;
    width: 10%;
    background: linear-gradient(
      to right,
      transparent 49.5%,
      rgba(255, 255, 255, 0.4) 50%,
      transparent 50.5%
    );
    clip-path: polygon(100% 0, 100.5% 0, 0.5% 100%, 0% 100%);
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
  }

  /* RTL Adjustments for Oblique - INSIDE Media Query */
  [dir="rtl"] .split-banner-inner--oblique .split-banner-item:first-child {
    clip-path: polygon(45% 0, 100% 0, 100% 100%, 55% 100%);
  }

  [dir="rtl"] .split-banner-inner--oblique .split-banner-item:last-child {
    clip-path: polygon(0 0, 45% 0, 55% 100%, 0 100%);
  }

  [dir="rtl"] .split-banner-inner--oblique::after {
    left: auto;
    right: 45%;
    clip-path: polygon(0% 0, 0.5% 0, 100.5% 100%, 100% 100%);
  }
}

.split-banner-item-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 10;
}

/* Position content away from the diagonal line in oblique layout */
@media (min-width: 769px) {
  .split-banner-inner--oblique .split-banner-item:first-child .split-banner-overlay {
    padding-right: 50%;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .split-banner-inner--oblique .split-banner-item:last-child .split-banner-overlay {
    padding-left: 50%;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  /* Specific padding adjustments for corner positions if selected */
  .split-banner-inner--oblique .split-banner-item:first-child .split-banner-overlay--center-bottom {
    padding-right: 50%;
    padding-bottom: 3rem;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
  }

  .split-banner-inner--oblique .split-banner-item:last-child .split-banner-overlay--center-bottom {
    padding-left: 50%;
    padding-bottom: 3rem;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
  }

  .split-banner-inner--oblique .split-banner-item:first-child .split-banner-overlay--bottom-left {
    padding-left: 3rem;
    padding-bottom: 3rem;
    align-items: flex-start;
    justify-content: flex-end;
  }

  .split-banner-inner--oblique .split-banner-item:last-child .split-banner-overlay--bottom-right {
    padding-right: 3rem;
    padding-bottom: 3rem;
    align-items: flex-end;
    justify-content: flex-end;
  }

  /* RTL Support for Oblique Content Positioning */
  [dir="rtl"] .split-banner-inner--oblique .split-banner-item:first-child .split-banner-overlay {
    padding-right: var(--spacing-2xl);
    padding-left: 50%;
    align-items: center;
    text-align: center;
  }

  [dir="rtl"] .split-banner-inner--oblique .split-banner-item:last-child .split-banner-overlay {
    padding-left: var(--spacing-2xl);
    padding-right: 50%;
    align-items: center;
    text-align: center;
  }
}

/* Loading States & Fallbacks */
.split-banner-video {
  opacity: 0;
  transition: opacity 1s ease;
}

.split-banner-video[src],
.split-banner-video:not(iframe) {
  opacity: 1;
}
