/**
 * Hero Slider Styles
 *
 * New diagonal overlay design with animations
 * Desktop: Side-by-side with diagonal overlays
 * Mobile: Stacked layout (content top, image bottom)
 *
 * @package RO_Hero_Slider
 * @since   2.0.0
 */

/* ===================================
   CSS Custom Properties
   =================================== */

:root {
  /* Brand colors */
  --hero-accent-color: #c58d90;
  --hero-bg-default: #62a6e0;
  --hero-text-dark: #2d2d2d;
  --hero-cream: #f6e0c5;
  --hero-blue-dark: #446785;
  --hero-blue-medium: #6290b7;
}

/* ===================================
   Hero Slider Container (Swiper)
   =================================== */

.hero-slider-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.hero-swiper {
  width: 100%;
  height: auto;
}

.hero-slide {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* ===================================
   Slide Container - Main Layout
   =================================== */

.hero-slide__container {
  position: relative;
  width: 100%;
  min-height: 600px;
  display: flex;
  overflow: hidden;
}

/* ===================================
   Media Section (Video/Image)
   =================================== */

.hero-slide__media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-slide__video,
.hero-slide__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-slide__video {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.hero-slide__image {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Hide image when video is present (desktop) - image loads via JS on video error */
.has-video .hero-slide__image {
  display: none;
}

.has-video.video-failed .hero-slide__image {
  display: block;
}

/* ===================================
   Diagonal Overlays
   =================================== */

.hero-slide__overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 3;
}

/* Solid overlay - main background behind content */
.hero-slide__overlay--solid {
  width: 60%;
  clip-path: polygon(0 0, 100% 0, 65% 100%, 0 100%);
  z-index: 3;
  opacity: 0;
  transform: translateX(-100%);
  transition: none;
}

/* Transparent diagonal stripe */
.hero-slide__overlay--gradient {
  width: 75%;
  clip-path: polygon(0 0, 100% 0, 70% 100%, 0 100%);
  z-index: 2;
  opacity: 0;
  transform: translateX(-100%);
  transition: none;
}

/* Animate overlays when slide is active */
.swiper-slide-active .hero-slide__overlay--solid {
  opacity: 1;
  transform: translateX(0);
  transition: transform 0.8s ease-out, opacity 0.6s ease-out;
}

.swiper-slide-active .hero-slide__overlay--gradient {
  opacity: 1;
  transform: translateX(0);
  transition: transform 1s ease-out 0.15s, opacity 0.7s ease-out 0.15s;
}

/* ===================================
   Content Section
   =================================== */

.hero-slide__content {
  position: relative;
  z-index: 10;
  width: 50%;
  padding: 80px 100px;
  opacity: 0;
  transform: translateX(-50px);
  transition: none;
}

.hero-slide__content-inner {
  /* Adjust these for vertical alignment */
  padding-top: 3vh;
}

/* Animate content when slide is active */
.swiper-slide-active .hero-slide__content {
  opacity: 1;
  transform: translateX(0);
  transition: transform 0.7s ease-out 0.3s, opacity 0.6s ease-out 0.3s;
}

/* Angled text wrap to follow diagonal overlay */
.hero-slide__content::before {
  content: "";
  float: right;
  height: 100%;
  width: 30%;
  shape-outside: polygon(100% -14%, 100% 100%, 0 100%);
}

/* Title */
.hero-slide__title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 4vw, 4.5rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--title-line2-color, var(--hero-cream));
  margin: 0 0 1.5rem 0;
  max-width: 740px;
}

/* First line color controlled by CSS variable */
.hero-slide__title::first-line {
  color: var(--title-line1-color, #fff);
}

/* Blurb/Description */
.hero-slide__blurb {
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(1rem, 1.5vw, 1.375rem);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 1.5rem 0;
  max-width: 540px;
}

/* Button */
.hero-slide__button {
  --btn-bg: #f9d6fa;
  --btn-color: #465460;
  --btn-bg-hover: #446785;
  --btn-color-hover: #fff;
  margin: 0;
  outline: 0;
  vertical-align: baseline;
  box-sizing: border-box;
  display: inline-block;
  line-height: 1;
  padding: 12px 24px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: none;
  text-decoration: none;
  width: auto;
  font-size: 18px;
  color: var(--btn-color);
  border-radius: 0;
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  background-color: var(--btn-bg);
}

.hero-slide__button:hover {
  background-color: var(--btn-bg-hover);
  color: var(--btn-color-hover);
}

/* ===================================
   Animations (reserved for future use)
   =================================== */

/* ===================================
   Swiper Navigation
   =================================== */

.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  transition: all 0.3s ease;
  top: auto;
  bottom: 60px;
  transform: none;
}

.hero-swiper .swiper-button-prev:hover,
.hero-swiper .swiper-button-next:hover {
  background: rgba(255, 255, 255, 0.4);
}

.hero-swiper .swiper-button-prev::after,
.hero-swiper .swiper-button-next::after {
  font-size: 18px;
  font-weight: bold;
}

.hero-swiper .swiper-button-prev {
  left: 20px;
}

.hero-swiper .swiper-button-next {
  right: 20px;
}

/* ===================================
   Swiper Pagination
   =================================== */

.hero-swiper .swiper-pagination {
  bottom: 20px;
}

.hero-swiper .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: #fff;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.hero-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  width: 24px;
  border-radius: 5px;
}

/* ===================================
   Responsive - Large Tablet
   =================================== */

@media (max-width: 1200px) {
  .hero-slide__content::before {
    width: 35%;
    shape-outside: polygon(100% -10%, 100% 100%, 0 100%);
  }
}

/* ===================================
   Responsive - Tablet
   =================================== */

@media (max-width: 1024px) {
  .hero-slide__container {
    min-height: 500px;
  }

  .hero-slide__content {
    width: 55%;
    padding: 60px 80px;
  }

  .hero-slide__overlay--solid {
    width: 75%;
  }

  .hero-slide__overlay--gradient {
    width: 90%;
  }
}

/* ===================================
   Responsive - Mobile (Stacked Layout)
   =================================== */

@media (max-width: 768px) {
  .hero-slide__container {
    flex-direction: column;
    min-height: auto;
  }

  /* Content on top with background color from CSS variable */
  .hero-slide__content {
    position: relative;
    width: 100%;
    padding: 60px 30px;
    box-sizing: border-box;
    background-color: var(--slide-bg-color, var(--hero-bg-default));
    z-index: 10;
  }

  /* Remove angled text wrap on mobile */
  .hero-slide__content::before {
    display: none;
  }

  /* Hide diagonal overlays on mobile */
  .hero-slide__overlay {
    display: none;
  }

  /* Media below content */
  .hero-slide__media {
    position: relative;
    width: 100%;
    height: 300px;
    z-index: 1;
  }

  /* Hide video on mobile */
  .hero-slide__video {
    display: none !important;
  }

  /* Show image on mobile (even with video) since video is hidden */
  .has-video .hero-slide__image {
    display: block;
  }

  /* Left align content on mobile */
  .hero-slide__title,
  .hero-slide__blurb {
    text-align: left;
    max-width: 100%;
  }

  /* Hide navigation arrows on mobile */
  .hero-swiper .swiper-button-prev,
  .hero-swiper .swiper-button-next {
    display: none;
  }
}

/* ===================================
   Accessibility & Motion Preferences
   =================================== */

@media (prefers-reduced-motion: reduce) {
  /* Elementor handles button animations */
}

/* High contrast mode */
@media (prefers-contrast: high) {
  /* Elementor handles button contrast */
}

/* Print styles */
@media print {
  .hero-swiper .swiper-button-prev,
  .hero-swiper .swiper-button-next,
  .hero-swiper .swiper-pagination {
    display: none;
  }

  .hero-slide__overlay {
    display: none;
  }

  .hero-slide__content {
    background: #f0f0f0;
    color: #000;
  }
}
