/**
 * Elegant Home Hero Carousel Styles
 * Version: 3.0.0
 * Author: Darko Ivanec
 * Company: Digitalni Svemir
 *
 * Features:
 * - GPU-accelerated animations (will-change, transform3d)
 * - Full cross-browser support (vendor prefixes, IE11+ fallbacks)
 * - Accessibility (reduced-motion, touch-action, ARIA, semantic HTML)
 * - RTL language support
 * - Responsive design with mobile-first approach
 */

/* =============================================================================
   CAROUSEL CONTAINER
   ============================================================================= */
.elegant-home-hero-carousel {
    position: relative;
    width: 100%;
    height: 870px;
    overflow: hidden;
    /* Prevent default touch behaviors for better swipe control */
    touch-action: pan-y pinch-zoom;
    -ms-touch-action: pan-y pinch-zoom;
}

@media (min-width: 1000px) {
    .elegant-home-hero-carousel {
        height: 800px;
    }
}

/* =============================================================================
   SLIDES - CodePen pristup (display: none/block + fade animation)
   ============================================================================= */
.elegant-hero-slide {
    display: none; /* Sakriveni po defaultu */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* GPU acceleration for smooth animations */
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.elegant-hero-slide.active {
    display: block; /* Vidljivi kada su aktivni */
}

/* Fade-in animacija - brža tranzicija */
.elegant-hero-slide.fade-in {
    -webkit-animation-name: elegantFadeIn;
    animation-name: elegantFadeIn;
    -webkit-animation-duration: 0.5s;
    animation-duration: 0.5s;
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
}

@-webkit-keyframes elegantFadeIn {
    from {
        opacity: 0.4;
    }
    to {
        opacity: 1;
    }
}

@keyframes elegantFadeIn {
    from {
        opacity: 0.4;
    }
    to {
        opacity: 1;
    }
}

/* =============================================================================
   BACKGROUND IMAGES
   ============================================================================= */
.elegant-hero-slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.elegant-hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Mobile Background - Show on mobile */
.elegant-hero-bg-image.mobile-bg {
    display: block;
}

/* Desktop Background - Hide on mobile */
.elegant-hero-bg-image.desktop-bg {
    display: none;
}

/* Show desktop background on larger screens */
@media (min-width: 1000px) {
    .elegant-hero-bg-image.mobile-bg {
        display: none;
    }

    .elegant-hero-bg-image.desktop-bg {
        display: block;
    }
}

/* =============================================================================
   GRADIENT OVERLAY - RADIAL GRADIENT (kao Figma)
   ============================================================================= */
.elegant-hero-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        /* Gornji linear gradient za vrh */
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0.3) 15%,
            rgba(0, 0, 0, 0) 30%
        ),
        /* Radial gradient za donji dio - kao Figma */
        radial-gradient(
            ellipse 220% 41% at 53% 32%,
            rgba(0, 0, 0, 0) 31%,
            rgba(0, 0, 0, 1) 100%
        );
    background-blend-mode: normal, multiply;
    z-index: 2;
}

/* =============================================================================
   CONTENT
   ============================================================================= */
.elegant-hero-slide-content {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: end;
    -ms-flex-align: end;
    align-items: flex-end;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0 20px 80px 20px; /* Mobile - manji bottom padding */
}

@media (min-width: 1000px) {
    .elegant-hero-slide-content {
        /* Desktop - sadržaj pozicioniran od dna */
        -webkit-box-align: end;
        -ms-flex-align: end;
        align-items: flex-end;
        padding: 0 7% 8% 7%; /* 8% bottom padding - prostor za pagination */
    }
}

.elegant-hero-content-inner {
    width: 100%;
    text-align: center;
    margin: 0 auto;
    padding-bottom: 25px; /* Mobile - prostor za pagination */
}

@media (min-width: 1000px) {
    .elegant-hero-content-inner {
        padding-bottom: 0; /* No padding - pagination positioned by JavaScript */
    }
}

/* Category Badge - IZ FIGME */
.elegant-hero-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 30px 8px 30px; /* Exact iz Figme */
    margin-bottom: 30px;
    font-family: "Reddit Sans", sans-serif; /* Google font iz Figme */
    font-size: 17px; /* Iz Figme */
    font-weight: 800; /* ExtraBold iz Figme */
    line-height: 15px; /* Iz Figme */
    letter-spacing: 3.4px; /* Iz Figme */
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

@media (hover: hover) {
    .elegant-hero-category:hover {
        opacity: 0.85;
        color: #ffffff !important;
    }
}

/* Desktop: Increased size and margin */
@media (min-width: 1000px) {
    .elegant-hero-category {
        font-size: 25px;
        font-weight: 800;
        line-height: 30px;
        letter-spacing: 5px;
        margin-bottom: 50px;
        min-width: 233px;
        height: 46px;
    }
}

/* Category with Custom Icon */
.elegant-hero-category-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

/* Desktop: Increased margin and icon size */
@media (min-width: 1000px) {
    .elegant-hero-category-wrapper {
        margin-bottom: 70px;
    }

    .elegant-hero-category-icon {
        margin-bottom: 30px !important;
    }

    .elegant-hero-category-icon img {
        width: 59px !important;
        height: 72px !important;
        flex-shrink: 0;
        aspect-ratio: 59 / 72;
    }
}

.elegant-hero-category-icon {
    margin-bottom: 25px !important;
}

.elegant-hero-category-icon img {
    width: auto;
    height: 40px;
    min-height: 40px;
    display: block;
}

.elegant-hero-category-no-bg {
    background: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

/* Title */
.elegant-hero-slide-title {
    margin: 0;
    padding: 0;
    color: #FFF !important;
    text-align: center !important;
    font-family: "EB Garamond", Georgia, serif !important;
    font-size: 44px !important;
    font-style: italic !important;
    text-transform: uppercase;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;

    /* Word breaking - prelama duge riječi samo ako ne stanu u kontejner, BEZ crtice */
    overflow-wrap: break-word;
    word-wrap: break-word; /* Fallback za IE/Edge */
    max-width: 100%;

    /* VAŽNO: Hyphenation ISKLJUČEN - riječi se ne smiju lomiti sa crticom */
    hyphens: none;
    -webkit-hyphens: none;
    -ms-hyphens: none;
}

/* DESKTOP TITLE STYLES */
@media (min-width: 1000px) {
    .elegant-hero-slide-title {
        /* Font iz Figme */
        font-family: 'EB Garamond', serif;
        letter-spacing: -2px; /* Negativan spacing iz Figme */
        text-align: center;

        /* Max širina iz Figme: 1494px (1920px - 213px lijevo - 213px desno) */
        max-width: 1494px;
        margin: 0 auto;

        /* Font size, line-height i weight se postavljaju preko WP Bakery inline stilova */
    }
}

.elegant-hero-slide-title a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

@media (hover: hover) {
    .elegant-hero-slide-title a:hover {
        opacity: 0.9;
    }
}

/* =============================================================================
   PAGINATION DOTS - IZVAN SLIDES (kao CodePen)
   ============================================================================= */
.elegant-carousel-pagination {
    position: absolute; /* Absolute positioning kao CodePen */
    bottom: 50px; /* Mobile - blizu naslova */
    left: 0;
    right: 0;
    z-index: 10; /* Iznad slide content */
    text-align: center; /* Centrira dots */
    pointer-events: none; /* Ne blokira klikove na content */
}

@media (min-width: 1000px) {
    .elegant-carousel-pagination {
        /* Desktop - fixed position at bottom */
        bottom: 5%; /* 5% od donjeg ruba - uvijek vidljivo */
    }
}

.elegant-carousel-dots {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex; /* inline-flex za centriranje */
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 20px;
    padding: 0;
    margin: 0;
    pointer-events: auto; /* Omogući klikove na dots */
}

@media (min-width: 1000px) {
    .elegant-carousel-dots {
        gap: 25px; /* Iz Figme */
    }
}

.elegant-carousel-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    border: none;
    background-color: #FFFFFF; /* Bijela */
    opacity: 0.5; /* Vidljivija bijela */
    cursor: pointer;
    /* Mobile: jednostavan transition BEZ delay-a */
    -webkit-transition: opacity 0.3s ease, background-color 0.3s ease;
    -o-transition: opacity 0.3s ease, background-color 0.3s ease;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    /* GPU acceleration */
    will-change: opacity, background-color;
}

.elegant-carousel-dot.active {
    width: 5px;
    height: 5px;
    background-color: #FFFFFF; /* Bijela puna */
    opacity: 1; /* Potpuno opaque */
}

/* =============================================================================
   DESKTOP PAGINATION - Dva stila (Progress Bar ili Classic Dots)
   ============================================================================= */
@media (min-width: 1000px) {
    /* PROGRESS BAR STYLE - CodePen animacija sa razvlačenjem */
    .pagination-progress .elegant-carousel-dot {
        width: 7px;
        height: 7px;
        display: inline-block;
        /* background-color se postavlja preko inline style (inactive_dot_color_desktop) */
        opacity: 1; /* Potpuno vidljivi sa svojom bojom */
        border-radius: 20px; /* Zaobljeni rubovi */
        cursor: pointer;
        /* Samo background i width transition - bez opacity! */
        -webkit-transition: background-color 1s, width 1s;
        -o-transition: background-color 1s, width 1s;
        transition: background-color 1s, width 1s;
        -webkit-transition-delay: 1s, 0s;
        -o-transition-delay: 1s, 0s;
        transition-delay: 1s, 0s;
        /* GPU acceleration for width animation */
        will-change: width, background-color;
    }

    .pagination-progress .elegant-carousel-dot.active {
        opacity: 1; /* Potpuno opaque */
        width: 113px; /* Širi se na 113px */
        /* SVE se animira INSTANT (0s delay) */
        -webkit-transition-delay: 0s;
        -o-transition-delay: 0s;
        transition-delay: 0s;
    }

    /* CLASSIC DOTS STYLE - Stara verzija bez width transition-a */
    .pagination-dots .elegant-carousel-dot {
        width: 7px !important; /* Fiksna širina */
        height: 7px !important;
        display: inline-block;
        /* background-color se postavlja preko inline style */
        opacity: 0.5; /* Vidljivija */
        border-radius: 50%; /* Kružne */
        cursor: pointer;
        /* Samo opacity transition, BEZ width! */
        -webkit-transition: opacity 0.3s ease, background-color 0.3s ease;
        -o-transition: opacity 0.3s ease, background-color 0.3s ease;
        transition: opacity 0.3s ease, background-color 0.3s ease;
    }

    .pagination-dots .elegant-carousel-dot.active {
        opacity: 1; /* Potpuno opaque */
        width: 7px !important; /* Ista širina kao neaktivni */
    }
}

/* =============================================================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    .elegant-hero-slide.fade-in {
        -webkit-animation: none;
        animation: none;
    }

    .elegant-carousel-dot {
        -webkit-transition: none;
        -o-transition: none;
        transition: none;
    }

    .pagination-progress .elegant-carousel-dot,
    .pagination-dots .elegant-carousel-dot {
        -webkit-transition: none !important;
        -o-transition: none !important;
        transition: none !important;
    }
}

/* =============================================================================
   RTL (Right-to-Left) SUPPORT
   ============================================================================= */
[dir="rtl"] .elegant-home-hero-carousel,
.rtl .elegant-home-hero-carousel {
    direction: rtl;
}

[dir="rtl"] .elegant-hero-slide-title,
.rtl .elegant-hero-slide-title {
    text-align: right;
}

[dir="rtl"] .elegant-carousel-dots,
.rtl .elegant-carousel-dots {
    direction: rtl;
}

/* =============================================================================
   LOADING STATE
   ============================================================================= */
.elegant-hero-carousel-no-posts {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* Hide slides before JS initializes - CodePen pristup */
.elegant-home-hero-carousel:not(.carousel-initialized) .elegant-hero-slide {
    display: none;
}

.elegant-home-hero-carousel:not(.carousel-initialized) .elegant-hero-slide:first-child {
    display: block;
}
