/* ============================================================
 *  RURENT — Hero Carousel
 *  Pure CSS, no framework. Pakai BEM-style class: .rr-hcar-*
 *  Semua color & sizing pakai default yang bisa di-override
 *  lewat Elementor controls (selectors di PHP).
 * ============================================================ */

.rr-hcar {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #305057; /* fallback saat image belum load */
    --rr-hcar-trans: 600ms;
}

/* ── Track & slides ───────────────────────────────────────── */

.rr-hcar-track {
    position: relative;
    width: 100%;
}

.rr-hcar-slide {
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SLIDE mode — slides ditumpuk, geser pakai transform */
.rr-hcar--slide .rr-hcar-track {
    display: flex;
    will-change: transform;
    transition: transform var(--rr-hcar-trans) cubic-bezier(.22, .61, .36, 1);
}
.rr-hcar--slide .rr-hcar-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

/* FADE mode — slides absolute, opacity transition */
.rr-hcar--fade .rr-hcar-track {
    display: block;
}
.rr-hcar--fade .rr-hcar-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--rr-hcar-trans) ease, visibility 0s linear var(--rr-hcar-trans);
}
.rr-hcar--fade .rr-hcar-slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--rr-hcar-trans) ease, visibility 0s linear 0s;
    z-index: 1;
}
.rr-hcar--fade .rr-hcar-slide:first-child {
    position: relative; /* slide pertama "memegang" tinggi container */
}

/* ── Overlay ───────────────────────────────────────────────── */

.rr-hcar-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Inner content ─────────────────────────────────────────── */

.rr-hcar-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Alignment per slide */
.rr-hcar-slide--left   .rr-hcar-inner { align-items: flex-start; text-align: left; margin-left: 0; margin-right: auto; }
.rr-hcar-slide--center .rr-hcar-inner { align-items: center;     text-align: center; }
.rr-hcar-slide--right  .rr-hcar-inner { align-items: flex-end;   text-align: right; margin-left: auto; margin-right: 0; }

/* ── Title ─────────────────────────────────────────────────── */

.rr-hcar-title {
    margin: 0;
    font-family: var(--rr-font-display, 'Fraunces', Georgia, serif);
    font-size: clamp(32px, 5.5vw, 56px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rr-hcar-title span { display: block; }
.rr-hcar-title em   { font-style: italic; font-weight: inherit; }

/* ── Subtitle ──────────────────────────────────────────────── */

.rr-hcar-sub {
    margin: 0;
    font-size: clamp(14px, 2vw, 18px);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    max-width: 580px;
}
.rr-hcar-slide--center .rr-hcar-sub { margin-left: auto; margin-right: auto; }
.rr-hcar-slide--right  .rr-hcar-sub { margin-left: auto; margin-right: 0; }

/* ── Buttons ───────────────────────────────────────────────── */

.rr-hcar-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}
.rr-hcar-slide--center .rr-hcar-btn-group { justify-content: center; }
.rr-hcar-slide--right  .rr-hcar-btn-group { justify-content: flex-end; }

.rr-hcar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 8px;
    font-family: var(--rr-font, 'Inter', system-ui, sans-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: filter .2s ease, transform .2s ease, background .2s ease, color .2s ease;
    white-space: nowrap;
}
.rr-hcar-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    text-decoration: none;
}

.rr-hcar-btn--primary {
    background: #BF6616;
    color: #fff;
    border-color: #BF6616;
}

.rr-hcar-btn--secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}
.rr-hcar-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    filter: none;
}

/* ── Navigation arrows ─────────────────────────────────────── */

.rr-hcar-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.30);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.rr-hcar-arrow:hover {
    background: rgba(0, 0, 0, 0.55);
}
.rr-hcar-arrow:active {
    transform: translateY(-50%) scale(0.95);
}
.rr-hcar-arrow:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.rr-hcar-arrow svg {
    width: 50%;
    height: 50%;
    pointer-events: none;
}
.rr-hcar-arrow--prev { left: 16px; }
.rr-hcar-arrow--next { right: 16px; }

/* ── Dots ──────────────────────────────────────────────────── */

.rr-hcar-dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 980px;
    background: rgba(0, 0, 0, 0.20);
}
.rr-hcar-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, width .25s ease;
    -webkit-tap-highlight-color: transparent;
}
.rr-hcar-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}
.rr-hcar-dot.is-active {
    background: #fff;
    width: 28px;
    border-radius: 8px;
}
.rr-hcar-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* ── Empty / editor state ──────────────────────────────────── */

.rr-hcar-empty {
    padding: 40px 24px;
    text-align: center;
    color: #6b7280;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 768px) {
    .rr-hcar-inner {
        padding: 72px 20px 60px;
        gap: 16px;
    }
    .rr-hcar-arrow {
        width: 38px;
        height: 38px;
    }
    .rr-hcar-arrow--prev { left: 8px; }
    .rr-hcar-arrow--next { right: 8px; }
    .rr-hcar-dots { bottom: 16px; }
}

@media (max-width: 480px) {
    .rr-hcar-btn-group { width: 100%; flex-direction: column; }
    .rr-hcar-btn { width: 100%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .rr-hcar--slide .rr-hcar-track,
    .rr-hcar--fade  .rr-hcar-slide,
    .rr-hcar-btn,
    .rr-hcar-arrow,
    .rr-hcar-dot {
        transition: none !important;
    }
}

/* Saat di Elementor editor: matikan autoplay/animasi heavy untuk smooth editing */
.elementor-editor-active .rr-hcar--slide .rr-hcar-track {
    transition-duration: 0ms;
}
