/**
 * RNN Slider — Frontend Styles
 * Lightweight, performant, no external dependencies.
 */

/* -----------------------------------------------
   Critical: Prevent FOUC
   ----------------------------------------------- */
.rnn-slider:not(.rnn-slider--ready) .rnn-slider__track {
    overflow: hidden;
}

.rnn-slider:not(.rnn-slider--ready) .rnn-slider__slide {
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
}

.rnn-slider:not(.rnn-slider--ready) .rnn-slider__slide:first-child {
    visibility: visible;
    position: relative;
}

/* -----------------------------------------------
   Container
   ----------------------------------------------- */
.rnn-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    -webkit-user-select: none;
    user-select: none;
    direction: ltr;
}

.rnn-slider:not(.rnn-slider--ready) {
    min-height: 100px;
}

/* -----------------------------------------------
   Track
   ----------------------------------------------- */
.rnn-slider__track {
    display: flex;
    will-change: transform;
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* -----------------------------------------------
   Slide
   ----------------------------------------------- */
.rnn-slider__slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.rnn-slider--ready .rnn-slider__slide {
    display: flex;
    flex-direction: column;
}

/* -----------------------------------------------
   Fade: CSS Grid stacking for consistent height
   ----------------------------------------------- */
.rnn-slider--fade .rnn-slider__track {
    display: grid;
    position: relative;
}

.rnn-slider--fade .rnn-slider__slide {
    grid-row: 1;
    grid-column: 1;
    opacity: 0;
    transition-property: opacity;
    pointer-events: none;
    z-index: 0;
}

.rnn-slider--fade .rnn-slider__slide--active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* -----------------------------------------------
   Picture & Image
   ----------------------------------------------- */
.rnn-slider__picture {
    display: block;
    width: 100%;
    line-height: 0;
}

.rnn-slider--ready .rnn-slider__picture {
    flex: 1 1 0%;
    min-height: 0;
}

.rnn-slider__image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.rnn-slider--ready .rnn-slider__image {
    height: 100%;
}

/* -----------------------------------------------
   Content Overlay
   ----------------------------------------------- */
.rnn-slider__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 40px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    color: #fff;
    z-index: 2;
}

.rnn-slider__title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.rnn-slider__desc {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.rnn-slider__btn {
    display: inline-block;
    padding: 10px 24px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    border: none;
    cursor: pointer;
}

.rnn-slider__btn:hover {
    background: #f0f0f0;
    color: #111;
}

/* -----------------------------------------------
   Arrows — perfectly round on all devices
   ----------------------------------------------- */
.rnn-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s, opacity 0.2s;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    opacity: 0;
    line-height: 1;
    overflow: hidden;
}

.rnn-slider:hover .rnn-slider__arrow,
.rnn-slider:focus-within .rnn-slider__arrow {
    opacity: 1;
}

.rnn-slider__arrow:hover {
    background: #fff;
}

.rnn-slider__arrow:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    opacity: 1;
}

.rnn-slider__arrow--prev {
    left: 16px;
}

.rnn-slider__arrow--next {
    right: 16px;
}

.rnn-slider__arrow svg {
    display: block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    flex-shrink: 0;
    fill: none;
    stroke: #333;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* -----------------------------------------------
   Dots — perfectly round
   ----------------------------------------------- */
.rnn-slider__dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.rnn-slider__dot {
    display: block;
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    max-width: 10px;
    max-height: 10px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.2s, transform 0.2s;
}

.rnn-slider__dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.rnn-slider__dot--active {
    background: #fff;
    transform: scale(1.25);
}

.rnn-slider__dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* -----------------------------------------------
   Grabbing cursor
   ----------------------------------------------- */
.rnn-slider--draggable {
    cursor: grab;
}

.rnn-slider--dragging {
    cursor: grabbing;
}

.rnn-slider--dragging .rnn-slider__track {
    transition: none !important;
}

/* -----------------------------------------------
   Tablet (768px – 1024px)
   ----------------------------------------------- */
@media (max-width: 1024px) and (min-width: 769px) {
    .rnn-slider__content {
        padding: 24px 28px;
    }

    .rnn-slider__title {
        font-size: 20px;
    }

    .rnn-slider__arrow {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
        opacity: 1;
    }

    .rnn-slider__arrow--prev {
        left: 12px;
    }

    .rnn-slider__arrow--next {
        right: 12px;
    }

    .rnn-slider__arrow svg {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
    }
}

/* -----------------------------------------------
   Mobile (<768px)
   ----------------------------------------------- */
@media (max-width: 768px) {
    .rnn-slider__content {
        padding: 20px 20px;
    }

    .rnn-slider__title {
        font-size: 18px;
    }

    .rnn-slider__desc {
        font-size: 13px;
    }

    .rnn-slider__btn {
        padding: 8px 18px;
        font-size: 13px;
    }

    .rnn-slider__arrow {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        max-width: 36px;
        max-height: 36px;
        opacity: 1;
    }

    .rnn-slider__arrow--prev {
        left: 10px;
    }

    .rnn-slider__arrow--next {
        right: 10px;
    }

    .rnn-slider__arrow svg {
        width: 16px;
        height: 16px;
        min-width: 16px;
        min-height: 16px;
    }

    .rnn-slider__dot {
        width: 8px;
        height: 8px;
        min-width: 8px;
        min-height: 8px;
        max-width: 8px;
        max-height: 8px;
    }
}
