/**
 * Apex Author Box - Frontend Styles
 * Built with theme-isolation scoping & responsive typography
 */

/* ==========================================================================
   Base CSS Custom Properties & CSS Reset
   ========================================================================== */
.aab-box {
    --aab-bg: #ffffff;
    --aab-text: #1e293b;
    --aab-text-muted: #64748b;
    --aab-accent: #6366f1;
    --aab-accent-hover: #4f46e5;
    --aab-border: #e2e8f0;
    --aab-radius: 12px;
    --aab-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Theme Reset & Isolation */
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 28px 0 !important;
    padding: 24px !important;
    background-color: var(--aab-bg) !important;
    color: var(--aab-text) !important;
    border: 1px solid var(--aab-border) !important;
    border-radius: var(--aab-radius) !important;
    font-family: var(--aab-font) !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
    clear: both !important;
    transition: all 0.25s ease !important;
}

.aab-box *,
.aab-box *::before,
.aab-box *::after {
    box-sizing: border-box !important;
}

/* Position specifics */
.aab-box.aab-pos-top {
    margin-top: 10px !important;
    margin-bottom: 24px !important;
}

.aab-box.aab-pos-bottom {
    margin-top: 32px !important;
    margin-bottom: 20px !important;
}

/* Shadows */
.aab-box.aab-shadow-none {
    box-shadow: none !important;
}

.aab-box.aab-shadow-subtle {
    box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02) !important;
}

.aab-box.aab-shadow-elevated {
    box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.03) !important;
}

/* Avatars */
.aab-avatar-wrap {
    flex-shrink: 0 !important;
    display: inline-block !important;
}

.aab-avatar-img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: cover !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.aab-avatar-circle .aab-avatar-img {
    border-radius: 50% !important;
}

.aab-avatar-rounded .aab-avatar-img {
    border-radius: 12px !important;
}

.aab-avatar-square .aab-avatar-img {
    border-radius: 4px !important;
}

/* Typography Resets */
.aab-box a {
    color: var(--aab-accent) !important;
    text-decoration: none !important;
    transition: color 0.15s ease, opacity 0.15s ease !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.aab-box a:hover {
    color: var(--aab-accent-hover) !important;
    text-decoration: underline !important;
}

.aab-author-name {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: var(--aab-text) !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.aab-author-name a {
    color: inherit !important;
    text-decoration: none !important;
}

.aab-author-name a:hover {
    color: var(--aab-accent) !important;
    text-decoration: none !important;
}

.aab-job-title {
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: var(--aab-text-muted) !important;
    line-height: 1.4 !important;
}

.aab-bio-text {
    margin: 12px 0 0 0 !important;
    padding: 0 !important;
    font-size: 14.5px !important;
    line-height: 1.65 !important;
    color: var(--aab-text) !important;
}

.aab-bio-text p {
    margin: 0 0 8px 0 !important;
    line-height: inherit !important;
}

.aab-bio-text p:last-child {
    margin-bottom: 0 !important;
}

.aab-full-bio-link {
    font-weight: 600 !important;
    margin-left: 6px !important;
    display: inline-block !important;
}

/* Verified Badge */
.aab-verified-badge {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
}

/* ==========================================================================
   Social Icons Bar
   ========================================================================== */
.aab-social-icons {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 12px !important;
}

.aab-social-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    border: none !important;
    line-height: 1 !important;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease !important;
}

.aab-social-link:hover {
    transform: translateY(-2px) !important;
    text-decoration: none !important;
}

.aab-social-style-monochrome .aab-social-link {
    color: #475569 !important;
}

.aab-social-style-monochrome .aab-social-link:hover {
    color: #0f172a !important;
}

.aab-social-style-colored .aab-social-link {
    color: #64748b !important;
}

.aab-social-style-colored .aab-social-link:hover {
    color: var(--aab-brand-color, var(--aab-accent)) !important;
}

.aab-social-style-filled .aab-social-link {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.aab-social-style-filled .aab-social-link:hover {
    background: var(--aab-accent) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   PRESET 1: CNET TECH JOURNAL (Matches Image 5)
   ========================================================================== */
.aab-style-cnet {
    padding: 22px 26px !important;
    border-radius: 10px !important;
}

.aab-style-cnet .aab-cnet-header {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.aab-style-cnet .aab-avatar-wrap .aab-avatar-img {
    width: 68px !important;
    height: 68px !important;
}

.aab-style-cnet .aab-cnet-meta {
    display: flex !important;
    flex-direction: column !important;
}

.aab-style-cnet .aab-cnet-divider {
    height: 32px !important;
    width: 1px !important;
    border-left: 1px dotted #cbd5e1 !important;
    margin: 0 4px !important;
}

.aab-style-cnet .aab-cnet-socials .aab-social-icons {
    gap: 14px !important;
}

.aab-style-cnet .aab-cnet-socials .aab-svg-icon {
    width: 18px !important;
    height: 18px !important;
}

.aab-style-cnet .aab-cnet-body {
    margin-top: 14px !important;
}

.aab-style-cnet .aab-bio-text {
    margin-top: 0 !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
    color: #1e293b !important;
}

.aab-style-cnet .aab-full-bio-link {
    color: #7c3aed !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

.aab-style-cnet .aab-full-bio-link:hover {
    text-decoration: underline !important;
}

/* ==========================================================================
   PRESET 2: ELLA BENNETT CLEAN CARD (Matches Image 2)
   ========================================================================== */
.aab-style-ella {
    background-color: #f8fafc !important;
    border-color: #f1f5f9 !important;
    border-radius: 8px !important;
    padding: 24px 28px !important;
}

.aab-style-ella .aab-ella-container {
    display: flex !important;
    align-items: center !important;
    gap: 22px !important;
}

.aab-style-ella .aab-avatar-wrap .aab-avatar-img {
    width: 72px !important;
    height: 72px !important;
}

.aab-style-ella .aab-ella-content {
    flex: 1 !important;
}

.aab-style-ella .aab-author-name {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-bottom: 6px !important;
}

.aab-style-ella .aab-ella-job-pill {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #4b5563 !important;
    background: #e5e7eb !important;
    padding: 2px 8px !important;
    border-radius: 12px !important;
    margin-left: 8px !important;
}

.aab-style-ella .aab-bio-text {
    margin-top: 0 !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: #374151 !important;
}

.aab-style-ella .aab-social-icons {
    margin-top: 10px !important;
}

/* ==========================================================================
   PRESET 3: FORBES EDITORIAL BYLINE (Matches Image 3)
   ========================================================================== */
.aab-style-forbes {
    border-top: 1px solid #e5e7eb !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 16px 0 !important;
    box-shadow: none !important;
}

.aab-style-forbes .aab-forbes-top-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
}

.aab-style-forbes .aab-forbes-avatar .aab-avatar-img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
}

.aab-style-forbes .aab-forbes-byline-text {
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: #1f2937 !important;
    flex: 1 !important;
}

.aab-style-forbes .aab-by-prefix {
    font-weight: 400 !important;
    color: #4b5563 !important;
}

.aab-style-forbes .aab-forbes-author-link {
    font-weight: 700 !important;
    color: #111827 !important;
    text-decoration: underline !important;
}

.aab-style-forbes .aab-forbes-staff {
    color: #4b5563 !important;
    font-weight: 500 !important;
}

.aab-style-forbes .aab-forbes-toggle-btn {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 2px 4px !important;
    color: #0284c7 !important;
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    transition: transform 0.2s ease !important;
}

.aab-style-forbes .aab-forbes-toggle-btn.aab-open .aab-chevron-icon {
    transform: rotate(180deg) !important;
}

.aab-style-forbes .aab-forbes-pub-link {
    margin-top: 2px !important;
    font-size: 13.5px !important;
    color: #6b7280 !important;
}

.aab-style-forbes .aab-forbes-pub-link a {
    font-weight: 700 !important;
    color: #111827 !important;
    text-decoration: underline !important;
}

.aab-style-forbes .aab-forbes-bio-drawer {
    margin-top: 10px !important;
    padding-left: 56px !important;
    font-size: 14.5px !important;
    color: #374151 !important;
}

.aab-style-forbes .aab-forbes-timestamps {
    margin-top: 8px !important;
    padding-left: 56px !important;
    font-size: 13px !important;
    color: #6b7280 !important;
}

.aab-style-forbes .aab-time-separator {
    margin: 0 6px !important;
}

/* ==========================================================================
   PRESET 4: VERIFIED AUTHORITY (E-E-A-T Reviewer & Author)
   ========================================================================== */
.aab-style-healthline {
    border: 1px solid #d1fae5 !important;
    background: #f0fdfa !important;
    border-radius: 12px !important;
    padding: 18px 20px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.aab-style-healthline .aab-healthline-byline-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px !important;
    width: 100% !important;
}

.aab-style-healthline .aab-healthline-avatar-wrap {
    flex-shrink: 0 !important;
}

.aab-style-healthline .aab-healthline-avatar-wrap .aab-avatar-img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.aab-style-healthline .aab-healthline-text-wrap {
    flex: 1 !important;
    min-width: 0 !important;
}

.aab-style-healthline .aab-healthline-credits {
    font-size: 14.5px !important;
    line-height: 1.55 !important;
    color: #1e293b !important;
    word-break: break-word !important;
}

.aab-style-healthline .aab-hl-reviewed-phrase {
    color: #0f766e !important;
    font-weight: 600 !important;
}

.aab-style-healthline .aab-hl-reviewer-name {
    font-weight: 700 !important;
    color: #0f766e !important;
    text-decoration: underline !important;
}

.aab-style-healthline .aab-hl-credentials {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    background: #ccfbf1 !important;
    color: #0f766e !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    margin-left: 4px !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.aab-style-healthline .aab-hl-dash {
    margin: 0 6px !important;
    color: #94a3b8 !important;
}

.aab-style-healthline .aab-hl-written-phrase {
    color: #475569 !important;
}

.aab-style-healthline .aab-hl-author-name {
    font-weight: 700 !important;
    color: #0284c7 !important;
    text-decoration: underline !important;
}

.aab-style-healthline .aab-hl-job-title,
.aab-style-healthline .aab-hl-company {
    color: #475569 !important;
    font-size: 13.5px !important;
}

.aab-style-healthline .aab-hl-bullet {
    margin: 0 6px !important;
    color: #94a3b8 !important;
}

.aab-style-healthline .aab-hl-date {
    color: #64748b !important;
    font-size: 13.5px !important;
}

.aab-style-healthline .aab-healthline-bio {
    margin-top: 12px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(15, 118, 110, 0.12) !important;
}

.aab-style-healthline .aab-healthline-bio .aab-bio-text {
    margin: 0 !important;
    font-size: 14.5px !important;
    line-height: 1.6 !important;
    color: #334155 !important;
}

.aab-style-healthline .aab-social-icons {
    margin-top: 10px !important;
}

/* ==========================================================================
   PRESET 5: MODERN GLASSMORPHIC
   ========================================================================== */
.aab-style-modern {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9)) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-left: 4px solid var(--aab-accent) !important;
    border-radius: 12px !important;
    padding: 22px 24px !important;
}

.aab-style-modern .aab-modern-top {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.aab-style-modern .aab-avatar-wrap .aab-avatar-img {
    width: 64px !important;
    height: 64px !important;
}

.aab-style-modern .aab-modern-badge {
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--aab-accent) !important;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
}

.aab-style-modern .aab-modern-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: 14px !important;
    padding-top: 12px !important;
    border-top: 1px solid #f1f5f9 !important;
}

.aab-style-modern .aab-modern-archive-btn {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: var(--aab-accent) !important;
}

/* ==========================================================================
   PRESET 6: INTERACTIVE TABBED
   ========================================================================== */
.aab-style-tabbed {
    padding: 0 !important;
    overflow: hidden !important;
}

.aab-style-tabbed .aab-tab-nav {
    display: flex !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.aab-style-tabbed .aab-tab-btn {
    background: none !important;
    border: none !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border-bottom: 2px solid transparent !important;
}

.aab-style-tabbed .aab-tab-btn.aab-tab-active {
    color: var(--aab-accent) !important;
    border-bottom-color: var(--aab-accent) !important;
    background: #ffffff !important;
}

.aab-style-tabbed .aab-tab-content {
    padding: 22px 24px !important;
}

.aab-style-tabbed .aab-tabbed-bio-layout {
    display: flex !important;
    align-items: flex-start !important;
    gap: 18px !important;
}

.aab-style-tabbed .aab-avatar-wrap .aab-avatar-img {
    width: 68px !important;
    height: 68px !important;
}

.aab-style-tabbed .aab-recent-posts-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.aab-style-tabbed .aab-recent-post-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 9px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    font-size: 14px !important;
}

.aab-style-tabbed .aab-recent-post-item:last-child {
    border-bottom: none !important;
}

.aab-style-tabbed .aab-recent-post-title {
    font-weight: 600 !important;
    color: #1e293b !important;
}

.aab-style-tabbed .aab-recent-post-date {
    font-size: 12px !important;
    color: #94a3b8 !important;
    flex-shrink: 0 !important;
    margin-left: 12px !important;
}

/* ==========================================================================
   Mobile & Tablet Responsiveness
   ========================================================================== */
@media (max-width: 640px) {
    .aab-box {
        padding: 16px 14px !important;
        margin: 20px 0 !important;
    }

    /* Tech Journal Mobile */
    .aab-style-cnet .aab-cnet-header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .aab-style-cnet .aab-avatar-wrap .aab-avatar-img {
        width: 54px !important;
        height: 54px !important;
    }

    .aab-style-cnet .aab-cnet-divider {
        display: none !important;
    }

    .aab-style-cnet .aab-cnet-socials {
        width: 100% !important;
        margin-top: 4px !important;
    }

    /* Clean Minimalist Mobile */
    .aab-style-ella .aab-ella-container {
        display: flex !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }

    .aab-style-ella .aab-avatar-wrap .aab-avatar-img {
        width: 56px !important;
        height: 56px !important;
    }

    /* Newsroom Byline Mobile */
    .aab-style-forbes .aab-forbes-top-row {
        gap: 10px !important;
    }

    .aab-style-forbes .aab-forbes-avatar .aab-avatar-img {
        width: 38px !important;
        height: 38px !important;
    }

    .aab-style-forbes .aab-forbes-bio-drawer,
    .aab-style-forbes .aab-forbes-timestamps {
        padding-left: 0 !important;
    }

    /* Verified Authority Mobile: Never break into an awkward column */
    .aab-style-healthline .aab-healthline-byline-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .aab-style-healthline .aab-healthline-avatar-wrap .aab-avatar-img {
        width: 46px !important;
        height: 46px !important;
    }

    .aab-style-healthline .aab-healthline-credits {
        font-size: 13.5px !important;
        line-height: 1.5 !important;
    }

    /* Modern Luxe Mobile */
    .aab-style-modern .aab-modern-footer {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    /* Interactive Portfolio Mobile */
    .aab-style-tabbed .aab-tabbed-bio-layout {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }

    .aab-style-tabbed .aab-avatar-wrap .aab-avatar-img {
        width: 52px !important;
        height: 52px !important;
    }
}
