/* ==========================================================================
   NxGen Addons — Authority Builder
   ========================================================================== */

.ab {
    --ab-font: 'Inter', system-ui, -apple-system, sans-serif;
    --ab-bg: #ffffff;
    --ab-color: #5a6272;
    --ab-heading-color: #1e293b;
    --ab-accent: #3b82f6;
    --ab-accent-hover: #2563eb;
    --ab-subhead-bg: #f1f5f9;
    --ab-subhead-color: #334155;
    --ab-bullet-icon: var(--ab-accent);
    --ab-btn-bg: var(--ab-accent);
    --ab-btn-color: #ffffff;
    --ab-btn-hover-bg: var(--ab-accent-hover);
    --ab-btn-hover-color: #ffffff;
    --ab-btn-s-bg: transparent;
    --ab-btn-s-color: var(--ab-heading-color);
    --ab-btn-s-border: #d1d5db;
    --ab-btn-s-hover-bg: #f9fafb;
    --ab-btn-s-hover-color: var(--ab-heading-color);
    --ab-stat-value-color: var(--ab-heading-color);
    --ab-stat-label-color: var(--ab-color);
    --ab-bar-bg: #e5e7eb;
    --ab-bar-fill: var(--ab-accent);
    --ab-ibox-bg: var(--ab-subhead-bg);
    --ab-ibox-border: #e5e7eb;
    --ab-ibox-radius: 12px;
    --ab-ibox-icon-color: var(--ab-accent);
    --ab-ibox-title-color: var(--ab-heading-color);
    --ab-ibox-desc-color: var(--ab-color);

    font-family: var(--ab-font);
    color: var(--ab-color);
    background-color: var(--ab-bg);
    border-radius: 16px;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

/* ---------- Preset: Bold ---------- */
.ab--bold {
    --ab-font: 'Montserrat', system-ui, sans-serif;
    --ab-bg: #0f1b8c;
    --ab-color: #c7caed;
    --ab-heading-color: #ffffff;
    --ab-accent: #c8ff00;
    --ab-accent-hover: #b8ef00;
    --ab-subhead-bg: rgba(200,255,0,0.12);
    --ab-subhead-color: #c8ff00;
    --ab-btn-color: #111827;
    --ab-btn-s-color: #ffffff;
    --ab-btn-s-border: rgba(255,255,255,0.25);
    --ab-btn-s-hover-bg: rgba(255,255,255,0.08);
    --ab-btn-s-hover-color: #ffffff;
    --ab-stat-value-color: #ffffff;
    --ab-stat-label-color: #a5a9d4;
    --ab-bar-bg: rgba(255,255,255,0.12);
    --ab-ibox-bg: rgba(200,255,0,0.12);
    --ab-ibox-border: rgba(255,255,255,0.1);
    --ab-ibox-title-color: #ffffff;
    --ab-ibox-desc-color: #a5a9d4;
}

/* ---------- Preset: Dark ---------- */
.ab--dark {
    --ab-font: 'Inter', system-ui, sans-serif;
    --ab-bg: #1a1b2e;
    --ab-color: #9ca3af;
    --ab-heading-color: #f1f5f9;
    --ab-accent: #f5a623;
    --ab-accent-hover: #e09000;
    --ab-subhead-bg: rgba(245,166,35,0.12);
    --ab-subhead-color: #f5a623;
    --ab-btn-s-color: #f1f5f9;
    --ab-btn-s-border: rgba(255,255,255,0.2);
    --ab-btn-s-hover-bg: rgba(255,255,255,0.06);
    --ab-btn-s-hover-color: #f1f5f9;
    --ab-stat-value-color: #f1f5f9;
    --ab-stat-label-color: #9ca3af;
    --ab-bar-bg: rgba(255,255,255,0.1);
    --ab-ibox-bg: rgba(245,166,35,0.12);
    --ab-ibox-border: rgba(255,255,255,0.08);
    --ab-ibox-title-color: #f1f5f9;
    --ab-ibox-desc-color: #9ca3af;
}

/* ---------- Preset: Pastel ---------- */
.ab--pastel {
    --ab-font: 'Poppins', system-ui, sans-serif;
    --ab-bg: #fde8e0;
    --ab-color: #6b5e57;
    --ab-heading-color: #3d2e26;
    --ab-accent: #e8845c;
    --ab-accent-hover: #d5703e;
    --ab-subhead-bg: rgba(232,132,92,0.15);
    --ab-subhead-color: #c96a3e;
    --ab-btn-s-color: #3d2e26;
    --ab-btn-s-border: rgba(61,46,38,0.2);
    --ab-btn-s-hover-bg: rgba(232,132,92,0.08);
    --ab-btn-s-hover-color: #3d2e26;
    --ab-stat-value-color: #3d2e26;
    --ab-stat-label-color: #6b5e57;
    --ab-bar-bg: rgba(232,132,92,0.2);
    --ab-ibox-bg: rgba(232,132,92,0.15);
    --ab-ibox-border: rgba(232,132,92,0.2);
    --ab-ibox-title-color: #3d2e26;
    --ab-ibox-desc-color: #6b5e57;
}

/* ---------- Hero (header + image) — Flexbox layout ---------- */
.ab__hero {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
    margin-bottom: 48px;
}

.ab__hero:not(.ab__hero--has-image) .ab__content {
    flex-basis: 100%;
    max-width: 100%;
    margin-left: var(--ab-margin-l);
    margin-right: var(--ab-margin-r);
}

.ab__hero--has-image .ab__content {
    flex-basis: 50%;
    max-width: 50%;
    min-width: 0;
}

.ab__hero--has-image .ab__image {
    flex: 1 1 0%;
    min-width: 0;
}

.ab__hero--content-right .ab__content {
    order: 2;
}

.ab__hero--content-right .ab__image {
    order: 1;
}

/* ---------- Content Alignment (no image — driven by CSS vars from Elementor selector) ---------- */
.ab__content {
    --ab-btn-justify: flex-start;
    --ab-bullet-justify: start;
    --ab-margin-l: 0;
    --ab-margin-r: auto;
}

.ab__hero:not(.ab__hero--has-image) .ab__content .ab__subhead,
.ab__hero:not(.ab__hero--has-image) .ab__content .ab__desc {
    margin-left: var(--ab-margin-l);
    margin-right: var(--ab-margin-r);
}

.ab__content .ab__buttons {
    justify-content: var(--ab-btn-justify);
}

.ab__content .ab__bullets {
    justify-items: var(--ab-bullet-justify);
}

/* ---------- Subhead ---------- */
.ab__subhead {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ab-subhead-color);
    background: var(--ab-subhead-bg);
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: 16px;
}

/* ---------- Headline ---------- */
.ab__headline {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ab-heading-color);
    margin: 0 0 16px 0;
}

/* ---------- Description ---------- */
.ab__desc {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--ab-color);
    margin: 0 0 24px 0;
}

.ab__hero--has-image:not(.ab__hero--bleed) .ab__desc {
    max-width: 540px;
}

.ab__desc p {
    margin: 0 0 12px 0;
}

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

.ab__desc a {
    color: var(--ab-accent);
    text-decoration: underline;
}

.ab__desc a:hover {
    color: var(--ab-accent-hover);
}

/* ---------- Buttons ---------- */
.ab__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.ab__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
    text-decoration: none;
    line-height: 1.4;
    border: 2px solid transparent;
}

.ab__btn:focus,
.ab__btn:focus-visible {
    outline: 2px solid var(--ab-accent);
    outline-offset: 2px;
}

.ab__btn:active {
    outline: none;
}

.ab__btn--primary {
    background: var(--ab-btn-bg);
    color: var(--ab-btn-color);
}

.elementor-widget-nxgen_authority_builder .ab a.ab__btn--primary {
    color: var(--ab-btn-color);
    text-decoration: none;
}

.ab__btn--primary:hover {
    background: var(--ab-btn-hover-bg);
    color: var(--ab-btn-hover-color);
    transform: translateY(-1px);
}

.elementor-widget-nxgen_authority_builder .ab a.ab__btn--primary:hover {
    color: var(--ab-btn-hover-color);
}

.ab__btn--secondary {
    background: var(--ab-btn-s-bg);
    color: var(--ab-btn-s-color);
    border-color: var(--ab-btn-s-border);
}

.elementor-widget-nxgen_authority_builder .ab a.ab__btn--secondary {
    color: var(--ab-btn-s-color);
    text-decoration: none;
}

.ab__btn--secondary:hover {
    background: var(--ab-btn-s-hover-bg);
    color: var(--ab-btn-s-hover-color);
    transform: translateY(-1px);
}

.elementor-widget-nxgen_authority_builder .ab a.ab__btn--secondary:hover {
    color: var(--ab-btn-s-hover-color);
}

.ab__btn-icon {
    display: inline-flex;
    font-size: 0.875em;
}

.ab__btn--primary .ab__btn-icon {
    color: inherit;
}

.ab__btn--secondary .ab__btn-icon {
    color: inherit;
}

/* ---------- Bullet List ---------- */
.ab__bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    display: grid;
    gap: 10px 24px;
}


.ab__bullet {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ab__bullet-icon {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--ab-bullet-icon);
    fill: var(--ab-bullet-icon);
}

.ab__bullet-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.ab__bullet-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ab-color);
}

/* ---------- Feature Image ---------- */
.ab__image {
    position: relative;
    overflow: hidden;
}

.ab__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

/* ---------- Image Edge Bleed ---------- */
.ab__hero--bleed {
    overflow: visible;
    position: relative;
    margin-bottom: 0;
}

.ab__hero--bleed .ab__content {
    position: relative;
    z-index: 1;
}

.ab__image--bleed {
    position: absolute;
    top: 0;
    bottom: 0;
    right: -40px;
    left: calc(var(--ab-content-width, 50%) + var(--ab-bleed-gap, 24px));
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    overflow: hidden;
}

.ab__image--bleed img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: cover;
    object-position: top left;
    border-radius: 12px 0 0 0;
}

.ab__hero--content-right.ab__hero--bleed .ab__content {
    margin-left: auto;
}

.ab__hero--content-right .ab__image--bleed {
    left: -40px;
    right: calc(var(--ab-content-width, 50%) + var(--ab-bleed-gap, 24px));
    justify-content: flex-start;
}

.ab__hero--content-right .ab__image--bleed img {
    object-position: top right;
    border-radius: 0 12px 0 0;
}

/* ---------- Stats ---------- */
.ab__stats {
    display: grid;
    gap: 32px;
    padding: 32px 0;
    border-top: 1px solid var(--ab-ibox-border);
    margin-bottom: 48px;
}


.ab__stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ab__stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ab-stat-value-color);
}

.ab__stat-label {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--ab-stat-label-color);
}

.ab__stat-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--ab-bar-bg);
    overflow: hidden;
    margin-top: 8px;
}

.ab__stat-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ab-bar-fill);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ---------- Feature Boxes ---------- */
.ab__iboxes {
    display: grid;
    gap: 24px;
}


.ab__ibox {
    position: relative;
    background: var(--ab-ibox-bg);
    border: 1px solid var(--ab-ibox-border);
    border-radius: var(--ab-ibox-radius);
    padding: 28px 24px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ab__ibox:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.ab__ibox--has-bg {
    background-size: cover;
    background-position: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #ffffff;
}

.ab__ibox-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 100%);
    border-radius: inherit;
}

.ab__ibox--has-bg .ab__ibox-icon,
.ab__ibox--has-bg .ab__ibox-title,
.ab__ibox--has-bg .ab__ibox-desc,
.ab__ibox--has-overlay .ab__ibox-icon,
.ab__ibox--has-overlay .ab__ibox-title,
.ab__ibox--has-overlay .ab__ibox-desc {
    position: relative;
    z-index: 1;
    color: #ffffff;
}

.ab__ibox-body {
    position: relative;
    z-index: 1;
}

.ab__ibox-icon {
    font-size: 28px;
    color: var(--ab-ibox-icon-color);
    fill: var(--ab-ibox-icon-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ab__ibox--icon-above .ab__ibox-icon {
    margin-bottom: 16px;
}

.ab__ibox-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.ab__ibox-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ab__ibox-icon-wrap .ab__ibox-icon {
    margin: 0;
    line-height: 1;
}

.ab__ibox-icon-wrap--circle {
    border-radius: 50%;
    background-color: var(--ab-subhead-bg);
}

.ab__ibox-icon-wrap--square {
    border-radius: 0;
    background-color: var(--ab-subhead-bg);
}

.ab__ibox-icon-wrap--rounded-square {
    border-radius: 12px;
    background-color: var(--ab-subhead-bg);
}

.ab__ibox--icon-above .ab__ibox-icon-wrap {
    margin-bottom: 16px;
}

.ab__ibox-heading-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ab__ibox-heading-row .ab__ibox-title {
    margin: 0;
}

.ab__ibox-heading-row .ab__ibox-icon-wrap {
    flex-shrink: 0;
}

.ab__ibox--icon-top-left,
.ab__ibox--icon-top-right,
.ab__ibox--icon-bottom-left,
.ab__ibox--icon-bottom-right {
    position: relative;
}

.ab__ibox--icon-top-left > .ab__ibox-icon-wrap,
.ab__ibox--icon-top-right > .ab__ibox-icon-wrap,
.ab__ibox--icon-bottom-left > .ab__ibox-icon-wrap,
.ab__ibox--icon-bottom-right > .ab__ibox-icon-wrap {
    position: absolute;
    z-index: 2;
}

.ab__ibox--icon-top-left > .ab__ibox-icon-wrap {
    top: 16px;
    left: 16px;
}

.ab__ibox--icon-top-right > .ab__ibox-icon-wrap {
    top: 16px;
    right: 16px;
}

.ab__ibox--icon-bottom-left > .ab__ibox-icon-wrap {
    bottom: 16px;
    left: 16px;
}

.ab__ibox--icon-bottom-right > .ab__ibox-icon-wrap {
    bottom: 16px;
    right: 16px;
}

.ab__ibox--icon-bottom-left .ab__ibox-body,
.ab__ibox--icon-bottom-right .ab__ibox-body {
    padding-bottom: 48px;
}

.ab__ibox-fimg {
    margin: -28px -24px 20px -24px;
    overflow: hidden;
}

.ab__ibox-fimg img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.ab__ibox--has-fimg.ab__ibox--icon-top-left > .ab__ibox-icon-wrap,
.ab__ibox--has-fimg.ab__ibox--icon-top-right > .ab__ibox-icon-wrap {
    z-index: 3;
}

.ab__ibox-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ab-ibox-title-color);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.ab__ibox-desc {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--ab-ibox-desc-color);
    margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .ab {
        padding: 40px 24px;
    }
    .ab__hero--has-image:not(.ab__hero--bleed) .ab__content {
        flex-basis: 100% !important;
        max-width: 100% !important;
    }
    .ab__hero--has-image:not(.ab__hero--bleed) .ab__image {
        flex-basis: 100%;
    }
    .ab__hero--content-right .ab__content { order: 1; }
    .ab__hero--content-right .ab__image { order: 2; }
    .ab__image:not(.ab__image--bleed) img {
        max-height: 400px;
    }
    .ab__image--bleed {
        right: -24px;
        bottom: 0;
    }
    .ab__hero--content-right .ab__image--bleed {
        left: -24px;
        right: calc(var(--ab-content-width, 50%) + var(--ab-bleed-gap, 24px));
    }
    .ab__hero--bleed .ab__content {
        max-width: 50% !important;
        flex-basis: 50% !important;
    }
}

@media (max-width: 767px) {
    .ab__hero--bleed .ab__content {
        max-width: 100% !important;
        flex-basis: 100% !important;
    }
    .ab__image--bleed {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto !important;
        right: auto !important;
        width: calc(100% + 32px);
        margin: 0 -16px;
        display: block;
    }
    .ab__image--bleed img {
        border-radius: 0;
        max-height: 300px;
        width: 100%;
    }
    .ab {
        padding: 32px 16px;
    }
    .ab__headline {
        font-size: 1.5rem;
    }
    .ab__stat-value {
        font-size: 1.75rem;
    }
    .ab__buttons {
        flex-direction: column;
    }
    .ab__btn {
        justify-content: center;
    }
}
