/**
 * Kompetencer Slider Widget Styles
 */

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

.kompetencer-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* 50% gray background on left side */
.kompetencer-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-color: var(--kompetencer-bg-color, #e8e8e8);
    z-index: 0;
}

.kompetencer-slider__inner {
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    padding: 60px 40px;
    z-index: 1;
}

.kompetencer-slider__slides {
    position: relative;
    width: 100%;
    height: 500px;
}

/* ==========================================================================
   SLIDE
   ========================================================================== */

.kompetencer-slider__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    gap: 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    display: flex;
    align-items: center;
}

.kompetencer-slider__slide--active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   CONTENT
   ========================================================================== */

.kompetencer-slider__content {
    flex: 0 0 45%;
    max-width: 45%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.kompetencer-slider__label {
    display: block;
    font-size: 16px;
    color: #333333;
    margin-bottom: 20px;
}

.kompetencer-slider__title {
    font-size: 42px;
    font-weight: 700;
    color: #6b9b37;
    line-height: 1.2;
    margin: 0 0 20px 0;
}

.kompetencer-slider__text {
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
}

.kompetencer-slider__text p {
    margin: 0 0 15px 0;
}

.kompetencer-slider__text p:last-child {
    margin-bottom: 0;
}

.kompetencer-slider__read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #6b9b37;
    text-decoration: none;
    margin-top: 20px;
    transition: color 0.3s ease;
}

.kompetencer-slider__read-more:hover {
    color: #5a8830;
}

.kompetencer-slider__read-more-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    line-height: 1;
    transition: transform 0.3s ease;
}

.kompetencer-slider__read-more-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.kompetencer-slider__read-more:hover .kompetencer-slider__read-more-icon {
    transform: translateX(4px);
}

/* ==========================================================================
   IMAGE
   ========================================================================== */

.kompetencer-slider__image-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.kompetencer-slider__image {
    width: 100%;
    height: 450px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.kompetencer-slider__navigation {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.kompetencer-slider__navigation--left {
    justify-content: flex-start;
}

.kompetencer-slider__navigation--center {
    justify-content: center;
}

.kompetencer-slider__navigation--right {
    justify-content: flex-end;
}

.kompetencer-slider__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: transparent;
    border: 1px solid #666666;
    border-radius: 50%;
    color: #666666;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.kompetencer-slider__arrow:hover {
    color: #6b9b37;
    border-color: #6b9b37;
}

.kompetencer-slider__arrow svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.kompetencer-slider__arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   RESPONSIVE - TABLET
   ========================================================================== */

@media (max-width: 1024px) {
    .kompetencer-slider__inner {
        padding: 50px 30px;
    }
    
    .kompetencer-slider__slide {
        gap: 30px;
    }
    
    .kompetencer-slider__content {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .kompetencer-slider__title {
        font-size: 32px;
    }
    
    .kompetencer-slider__image {
        height: 350px;
    }
    
    .kompetencer-slider::before {
        width: 55%;
    }
}

/* ==========================================================================
   RESPONSIVE - MOBILE
   ========================================================================== */

@media (max-width: 767px) {
    .kompetencer-slider::before {
        width: 100%;
    }
    
    .kompetencer-slider__inner {
        padding: 40px 20px;
    }
    
    .kompetencer-slider__slide {
        flex-direction: column;
        gap: 25px;
    }
    
    .kompetencer-slider__content {
        flex: 0 0 100%;
        max-width: 100%;
        order: 2;
    }
    
    .kompetencer-slider__image-wrapper {
        order: 1;
    }
    
    .kompetencer-slider__title {
        font-size: 28px;
    }
    
    .kompetencer-slider__image {
        height: 250px;
    }
    
    .kompetencer-slider__navigation {
        justify-content: center !important;
    }
}

/* ==========================================================================
   ELEMENTOR EDITOR FIXES
   ========================================================================== */

.elementor-editor-active .kompetencer-slider__slide {
    position: relative;
    opacity: 1;
    visibility: visible;
}

.elementor-editor-active .kompetencer-slider__slide:not(:first-child) {
    display: none;
}
