/* ============================================================================
   Premium How It Works Section
   
   Blue gradient container, 3 steps with entrance animation, connector arrows,
   optional orange CTA.
   ============================================================================ */

.bobex-hiw-section {
    margin: 2.5rem 0;
}

.bobex-hiw-container {
    background: linear-gradient(to right, var(--bobex-color-primary), var(--bobex-color-primary-dark));
    border-radius: var(--bobex-radius-md);
    box-shadow: var(--bobex-shadow-card);
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .bobex-hiw-container {
        padding: 2rem;
    }
}

/* ─── Title ────────────────────────────────────────────────────────────────── */

.bobex-hiw-title {
    text-align: center;
    margin: 0 0 1.5rem 0 !important;
}

/* ─── Steps List ───────────────────────────────────────────────────────────── */

.bobex-hiw-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .bobex-hiw-steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* ─── Individual Step ──────────────────────────────────────────────────────── */

.bobex-hiw-step {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--bobex-radius-sm);
    padding: 1rem;
    text-align: center;
    /* Animation setup - will be controlled by JS */
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 768px) {
    .bobex-hiw-step {
        padding: 1.25rem;
    }
}

/* Animation will be applied via inline styles in JS for better control */
.bobex-hiw-section:not(.bobex-animation-ready) .bobex-hiw-step {
    opacity: 0;
    transform: translateY(40px);
}

.bobex-hiw-section.bobex-animation-ready .bobex-hiw-step {
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Disable animation when prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .bobex-hiw-section:not(.bobex-animation-ready) .bobex-hiw-step {
        opacity: 1;
        transform: translateY(0);
    }
    
    .bobex-hiw-section.bobex-animation-ready .bobex-hiw-step {
        transition: none;
    }
}

/* ─── Step Number Circle ───────────────────────────────────────────────────── */

.bobex-hiw-step-number {
    width: 3rem;
    height: 3rem;
    border-radius: var(--bobex-radius-full);
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    color: #fff;
}

/* ─── Step Title ───────────────────────────────────────────────────────────── */

.bobex-hiw-step-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1.3;
    color: #fff;
    margin: 0 0 0.25rem 0;
}

@media (min-width: 768px) {
    .bobex-hiw-step-title {
        font-size: 0.9375rem;
    }
}

.bobex-hiw-step-title,
.bobex-hiw-step-title .rich-text,
.bobex-hiw-step-title span,
.bobex-hiw-step-title strong {
    color: #fff;
}

/* ─── Step Description ─────────────────────────────────────────────────────── */

.bobex-hiw-step-desc {
    font-family: 'Roboto', sans-serif;
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

@media (min-width: 768px) {
    .bobex-hiw-step-desc {
        font-size: 0.875rem;
    }
}

.bobex-hiw-step-desc,
.bobex-hiw-step-desc .rich-text,
.bobex-hiw-step-desc span,
.bobex-hiw-step-desc p,
.bobex-hiw-step-desc strong {
    color: rgba(255, 255, 255, 0.9);
}

.bobex-hiw-step-desc p,
.bobex-hiw-step-desc p strong,
.bobex-hiw-step-desc p a,
.bobex-hiw-step-desc a {
    color: rgba(255, 255, 255, 0.9);
}

#content .bobex-hiw-step .bobex-hiw-step-title,
#content .bobex-hiw-step .bobex-hiw-step-title strong,
#content .bobex-hiw-step .bobex-hiw-step-desc,
#content .bobex-hiw-step .bobex-hiw-step-desc p,
#content .bobex-hiw-step .bobex-hiw-step-desc strong,
#content .bobex-hiw-step .bobex-hiw-step-desc a {
    color: rgba(255, 255, 255, 0.9) !important;
}

#content .bobex-hiw-step .bobex-hiw-step-title {
    color: #fff !important;
}

/* ─── Connector Arrow ──────────────────────────────────────────────────────── */

.bobex-hiw-arrow {
    position: absolute;
    right: -1.25rem; /* Centered in the gap between cards */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 1.5rem;
    height: 1.5rem;
    background: #fff;
    border-radius: var(--bobex-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .bobex-hiw-arrow {
        top: calc(50% + 0.5rem); /* Adjust for visual balance with number circle at top */
    }
}

.bobex-hiw-arrow svg {
    width: 0.75rem;
    height: 0.75rem;
    color: var(--bobex-color-primary);
}

/* ─── CTA ──────────────────────────────────────────────────────────────────── */

.bobex-hiw-cta-wrapper {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

/* ─── Editor Styles ────────────────────────────────────────────────────────── */

/* Placeholder for when no steps exist (shouldn't happen since we prefill) */
.bobex-hiw-step:empty::before {
    content: '';
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
}
