﻿/**
 * Hero Slider Component
 * Calculates height based on available viewport space minus header
 */

/* ==========================================================================
   Hero Slider Base Styles
   ========================================================================== */

/* Prevent any horizontal overflow from the entire page */
html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

.hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Height will be set by JavaScript to account for header */
  height: calc(100vh - var(--header-total-height, 100px));
  min-height: 500px; /* Minimum height for very short screens */
  background-color: var(--color-black);
}

.hero-slides {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
    overflow: hidden;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* ==========================================================================
   Hero Image - Mobile-responsive with center cropping
   ========================================================================== */

.hero-slide-image {
  position: absolute;
  top: 0;
  left: 50%; /* Center horizontally */
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cover entire area */
  object-position: center center; /* Keep center visible on crop */
  z-index: 0;
}

/* On very wide screens, ensure image fills width */
@media (min-width: 1920px) {
  .hero-slide-image {
    width: 100vw;
    max-width: none;
  }
}

/* On mobile, ensure center region stays visible */
@media (max-width: 768px) {
  .hero-slide-image {
    object-position: center center; /* Always center */
    min-width: 100%;
    min-height: 100%;
  }
}

/* ==========================================================================
   Hero Content Overlay
   ========================================================================== */

.hero-slide-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center; /* Vertically center content */
  z-index: 2;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

    .hero-content-inner {
        max-width: 600px;
        padding: var(--spacing-xl) 0;
    }
    /* Content alignment variations */
    .hero-slide.align-left .hero-content-inner {
        margin-left: 0;
        margin-right: auto;
        text-align: left;
    }

    .hero-slide.align-center .hero-content-inner {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .hero-slide.align-right .hero-content-inner {
        margin-left: auto;
        margin-right: 0;
        text-align: right;
    }
    /* ==========================================================================
   Hero Text Elements
   ========================================================================== */

    .hero-badge {
        display: inline-block;
        padding: 6px 16px;
        margin-bottom: var(--spacing-md);
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-semibold);
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--color-white);
        background-color: var(--color-accent);
        border-radius: var(--border-radius-sm);
    }

    .hero-title {
        margin: 0 0 var(--spacing-md);
        font-size: clamp(2.5rem, 5vw, 4rem); /* Responsive font size */
        font-weight: var(--font-weight-bold);
        line-height: 1.1;
        color: var(--color-white);
        text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    }

    .hero-subtitle {
        margin: 0 0 var(--spacing-lg);
        font-size: clamp(1rem, 2vw, 1.25rem); /* Responsive font size */
        font-weight: var(--font-weight-normal);
        line-height: var(--line-height-relaxed);
        color: var(--color-white);
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    }

    .hero-actions {
        display: flex;
        gap: var(--spacing-md);
        flex-wrap: wrap;
    }

    .hero-slide.align-center .hero-actions {
        justify-content: center;
    }

    .hero-slide.align-right .hero-actions {
        justify-content: flex-end;
    }
    /* ==========================================================================
   Hero Controls
   ========================================================================== */

    .hero-controls {
        position: absolute;
        bottom: var(--spacing-xl);
        left: 0;
        right: 0;
        z-index: 10;
        pointer-events: none; /* Allow clicks to pass through */
    }

    .hero-controls-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .hero-controls * {
        pointer-events: auto; /* Re-enable clicks on controls */
    }
    /* Dots */
    .hero-dots {
        display: flex;
        gap: var(--spacing-sm);
    }

    .hero-dot {
        width: 12px;
        height: 12px;
        padding: 0;
        border: 2px solid var(--color-white);
        border-radius: 50%;
        background-color: transparent;
        cursor: pointer;
        transition: all var(--transition-base);
    }

        .hero-dot:hover {
            background-color: rgba(255, 255, 255, 0.5);
            transform: scale(1.1);
        }

        .hero-dot.active {
            background-color: var(--color-white);
            width: 32px;
            border-radius: 6px;
        }
    /* Arrows */
    .hero-arrows {
        display: flex;
        gap: var(--spacing-sm);
    }

    .hero-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 2px solid var(--color-white);
        border-radius: 50%;
        background-color: rgba(0, 0, 0, 0.3);
        color: var(--color-white);
        font-size: var(--font-size-xl);
        cursor: pointer;
        transition: all var(--transition-base);
        backdrop-filter: blur(4px);
    }

        .hero-arrow:hover {
            background-color: var(--color-white);
            color: var(--color-black);
            transform: scale(1.05);
        }
    /* ==========================================================================
   Mobile Responsive
   ========================================================================== */

    @media (max-width: 992px) {
        .hero-slider {
            min-height: 400px;
            height: calc(100vh - var(--header-total-height, 100px));
        }

        .hero-title {
            font-size: clamp(2rem, 6vw, 3rem);
        }

        .hero-subtitle {
            font-size: clamp(0.9rem, 2.5vw, 1.1rem);
        }

        .hero-content-inner {
            max-width: 500px;
        }
    }

    @media (max-width: 768px) {
        .hero-slider {
            min-height: 500px; /* Ensure enough height on mobile */
            height: calc(100vh - var(--header-total-height, 95px));
        }

        .hero-slide-content {
            background: linear-gradient( to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100% );
        }
        /* Force all content to bottom center on mobile */
        .hero-slide-content {
            align-items: flex-end;
        }

        .hero-content-inner {
            max-width: 100%;
            text-align: center;
            padding-bottom: 100px; /* Space for controls */
        }

        .hero-slide.align-left .hero-content-inner,
        .hero-slide.align-right .hero-content-inner {
            margin-left: auto;
            margin-right: auto;
            text-align: center;
        }

        .hero-actions {
            justify-content: center;
        }

        .hero-title {
            font-size: clamp(1.75rem, 7vw, 2.5rem);
        }

        .hero-subtitle {
            font-size: clamp(0.875rem, 3vw, 1rem);
        }

        .hero-controls {
            bottom: var(--spacing-lg);
        }

        .hero-controls-inner {
            flex-direction: column;
            gap: var(--spacing-md);
        }

        .hero-arrow {
            width: 40px;
            height: 40px;
            font-size: var(--font-size-lg);
        }
    }

    @media (max-width: 576px) {
        .hero-slider {
            min-height: 450px;
            height: calc(100vh - var(--header-total-height, 85px));
        }

        .hero-content-inner {
            padding-bottom: 120px; /* More space for stacked controls */
        }

        .hero-badge {
            font-size: var(--font-size-xs);
            padding: 4px 12px;
        }

        .hero-actions {
            flex-direction: column;
            width: 100%;
        }

            .hero-actions .btn {
                width: 100%;
                justify-content: center;
            }

        .hero-dot {
            width: 10px;
            height: 10px;
        }

            .hero-dot.active {
                width: 24px;
            }

        .hero-arrow {
            width: 36px;
            height: 36px;
            font-size: var(--font-size-base);
        }
    }
    /* ==========================================================================
   Accessibility & Performance
   ========================================================================== */
    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        .hero-slide {
            transition: none;
        }
    }
    /* Ensure text is readable on all backgrounds */
    .hero-title,
    .hero-subtitle,
    .hero-badge {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }