/* Block Styles Foundation */

/* Modern Clean Card (matches final demo) */
.wp-block-group.is-style-retro-card,
.wp-block-columns.is-style-retro-card {
    background-color: #ffffff !important;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    padding: 32px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.wp-block-group.is-style-retro-card:hover,
.wp-block-columns.is-style-retro-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

@media (max-width: 768px) {
    .wp-block-group.is-style-retro-card,
    .wp-block-columns.is-style-retro-card {
        padding: 24px 20px !important;
        text-align: left !important;
        align-items: flex-start !important;
    }
}

/* Card Icon Badge (Squircle) */
.card-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(22, 136, 248, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}
.card-icon-badge--red {
    background: rgba(239, 68, 68, 0.08);
}
.card-icon-badge--purple {
    background: rgba(168, 85, 247, 0.08);
}

/* Step Number Badge */
.step-number-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ffd600;
    border: 2px solid #081b31;
    box-shadow: 2.5px 2.5px 0 #081b31;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 20px;
    color: #081b31;
    font-family: 'Space Mono', monospace;
    flex-shrink: 0;
}
.step-number-badge--circle {
    border-radius: 50%;
}
.step-number-badge--blue {
    background: #1688f8;
    color: #ffffff;
}
.step-number-badge--red {
    background: #ef4444;
    color: #ffffff;
}

/* Info Callout */
.wp-block-group.is-style-callout-info {
    background-color: var(--wp--preset--color--slate-50, #f8fafc);
    border-left: 4px solid var(--wp--preset--color--primary, #1688f8);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

/* Button Styling */
.wp-block-button.is-style-retro-button .wp-block-button__link {
    background-color: var(--wp--preset--color--primary, #1688f8);
    color: #ffffff !important;
    border-radius: 12px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 12px 24px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(22, 136, 248, 0.2);
    border: 1px solid transparent;
}
.wp-block-button.is-style-retro-button .wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22, 136, 248, 0.3);
}

/* Terminal */
.wp-block-code.is-style-terminal {
    background-color: var(--wp--preset--color--surface-dark);
    color: var(--wp--preset--color--slate-200);
    border-radius: 8px;
    padding: 32px 20px 20px;
    position: relative;
    border: 1px solid var(--wp--preset--color--slate-900);
    font-family: var(--wp--preset--font-family--mono);
    overflow-x: auto;
}
.wp-block-code.is-style-terminal::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ff5f56;
    box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27c93f;
}

/* ==========================================================================
   Gradient Text Utilities
   ========================================================================== */
.gradient-text-purple {
    color: #8b5cf6;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}
.gradient-text-blue {
    color: #1688f8;
    background: linear-gradient(135deg, #1688f8 0%, #38bdf8 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}
.gradient-text-sky {
    color: #0284c7;
    background: linear-gradient(135deg, #38bdf8 0%, #1688f8 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}
.gradient-text-red {
    color: #ef4444;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}
.gradient-text-teal {
    color: #1688f8;
    background: linear-gradient(135deg, #1688f8 0%, #34d399 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}
.gradient-text-managed {
    color: #1688f8;
    background: linear-gradient(135deg, #1688f8 0%, #a855f7 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
}

/* ==========================================================================
   Card Icon Badges & Step Numbers
   ========================================================================== */
.card-icon-badge,
.icon-badge-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(22, 136, 248, 0.08) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}
.card-icon-badge--red,
.icon-badge-box--red {
    background: rgba(239, 68, 68, 0.08) !important;
}
.card-icon-badge--purple,
.icon-badge-box--purple {
    background: rgba(168, 85, 247, 0.08) !important;
}
.step-number-badge,
.step-number-box {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ffd600 !important;
    border: 2px solid #081b31 !important;
    box-shadow: 2.5px 2.5px 0 #081b31 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 20px;
    color: #081b31 !important;
    font-family: 'Space Mono', monospace;
    flex-shrink: 0;
}

/* ==========================================================================
   Testimonial Slider & Buttons
   ========================================================================== */
.nav-slider-btn {
    position: absolute;
    top: auto;
    bottom: -12px;
    z-index: 10;
    -webkit-appearance: none;
    appearance: none;
    background: #ffffff !important;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-slider-btn:hover {
    transform: scale(1.05);
    color: #1688f8;
    border-color: #1688f8;
}
.nav-slider-btn.prev {
    left: calc(50% - 44px);
    transform: none;
}
.nav-slider-btn.next {
    right: calc(50% - 44px);
    transform: none;
}
@media (min-width: 992px) {
    .nav-slider-btn {
        width: 48px;
        height: 48px;
        top: 50%;
        bottom: auto;
        background: #ffffff !important;
        border: 1px solid var(--color-border);
    }
    [data-theme="dark"] .nav-slider-btn {
        background: #ffffff !important;
    }
    .nav-slider-btn.prev {
        left: -24px;
        transform: translateY(-50%);
    }
    .nav-slider-btn.next {
        right: -24px;
        transform: translateY(-50%);
    }
    .nav-slider-btn:hover {
        transform: translateY(-50%) scale(1.1);
    }
}
.testimonials-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 8px 8px 24px 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.testimonials-scroll::-webkit-scrollbar {
    display: none;
}
.testimonials-scroll > div {
    flex: 0 0 min(100%, 350px);
    scroll-snap-align: start;
}
@media (min-width: 992px) {
    .testimonials-scroll > div {
        flex: 0 0 calc(33.333% - 16px);
    }
}

/* ==========================================================================
   Header Navigation Active States & Highlights
   ========================================================================== */
.main-nav__menu a.is-active,
.nav-dropdown__toggle.is-active {
    color: #1688f8 !important;
    font-weight: 800 !important;
    position: relative;
}
.main-nav__menu > li > a.is-active::after,
.nav-dropdown > .nav-dropdown__toggle.is-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #1688f8;
    border-radius: 4px;
}
.main-nav__menu > li > a,
.nav-dropdown > .nav-dropdown__toggle {
    position: relative;
}

/* Dropdown active item */
.nav-dropdown__item.is-active {
    background-color: rgba(22, 136, 248, 0.08) !important;
    border-radius: 10px;
    box-shadow: inset 4px 0 0 #1688f8;
}
.nav-dropdown__item.is-active .nav-dropdown__text strong {
    color: #1688f8 !important;
}
.nav-dropdown__item.is-active .nav-dropdown__icon {
    background-color: #1688f8 !important;
}
.nav-dropdown__item.is-active .nav-dropdown__icon svg {
    stroke: #ffffff !important;
}

/* Mobile drawer active item */
.mobile-drawer__links a.is-active {
    color: #1688f8 !important;
    font-weight: 800 !important;
    background-color: rgba(22, 136, 248, 0.08) !important;
    border-radius: 8px;
    position: relative;
    display: block;
}
.mobile-drawer__links a.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background-color: #1688f8;
    border-radius: 0 4px 4px 0;
}

/* Desktop Dropdown Hover */
@media (min-width: 992px) {
    .nav-dropdown:hover .nav-dropdown__menu,
    .nav-dropdown.is-open .nav-dropdown__menu {
        opacity: 1 !important;
        transform: translateY(0) !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

/* Prevent Gutenberg layout constrained from breaking custom grid and flex layouts */
.wp-block-group.is-layout-constrained > div,
.wp-block-group.is-layout-constrained > section,
.subpage-main .is-layout-constrained > * {
    max-width: 100% !important;
}

/* ==========================================================================
   Pricing Table Grid Fix (Ensures 3-columns side-by-side on desktop)
   ========================================================================== */
.product-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 28px !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 1140px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Guard against rogue wpautop empty paragraphs or br tags breaking CSS grid cells */
.product-grid > p,
.product-grid > br {
    display: none !important;
}

.product-grid > div {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

/* Single Pricing Card Center Support (e.g. Jasa Optimasi Website) */
.product-grid:has(> div:only-of-type),
.product-grid:has(> .features-card:only-child),
.product-grid:has(> .pricing-card:only-child) {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

@media (min-width: 992px) {
    .product-grid:has(> div:only-of-type),
    .product-grid:has(> .features-card:only-child),
    .product-grid:has(> .pricing-card:only-child) {
        display: flex !important;
        justify-content: center !important;
    }
}

.product-grid > div:only-of-type,
.product-grid > .features-card:only-child,
.product-grid > .pricing-card:only-child {
    grid-column: 1 / -1 !important;
    max-width: 480px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}


/* ==========================================================================
   Clickable Category Badges (blog cards, single article header, archive hero)
   ========================================================================== */
a.feed-card__category-badge,
a.article-header__badge {
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

a.feed-card__category-badge:hover,
a.feed-card__category-badge:focus-visible {
    background: rgba(22, 136, 248, 0.92) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

a.article-header__badge:hover,
a.article-header__badge:focus-visible {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
}

a.feed-card__category-badge:focus-visible,
a.article-header__badge:focus-visible,
.blog-archive-hero__back:focus-visible {
    outline: 2px solid #1688f8;
    outline-offset: 2px;
}

.blog-archive-hero__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1688f8;
    text-decoration: none;
}

.blog-archive-hero__back:hover {
    text-decoration: underline;
}
