:root {
    --abp-primary-color: #598aff;
    --abp-text-color: #333;
    --abp-bg-color: #f8f9fa;
    --abp-border-radius: 8px;
    --abp-spacing: 20px;
    --abp-border-color: #e0e0e0;
    --abp-muted-color: #555;
    --abp-white: #fff;
    --abp-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --abp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
    --abp-shadow-img: 0 2px 8px rgba(0, 0, 0, 0.10);
    --abp-shadow-play: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    --abp-transition: 0.2s ease;
}

/* Base */
.abp-author-box {
    direction: rtl;
    background: var(--abp-bg-color);
    border: 1px solid var(--abp-border-color);
    border-radius: var(--abp-border-radius);
    padding: var(--abp-spacing);
    margin: var(--abp-spacing) 0;
    box-shadow: var(--abp-shadow-sm);
    box-sizing: border-box;
}

.abp-author-box *,
.abp-author-box *::before,
.abp-author-box *::after {
    box-sizing: border-box;
}

.abp-author-header {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

.abp-author-avatar {
    flex-shrink: 0;
    margin: 0;
}

.abp-author-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--abp-primary-color);
    box-shadow: var(--abp-shadow-img);
    display: block;
}

.abp-author-info {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.abp-author-name {
    margin: 0 0 10px 0;
    color: var(--abp-text-color);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.35;
}

.abp-author-description {
    color: var(--abp-muted-color);
    line-height: 1.8;
    font-size: 0.95rem;
    margin: 15px 0 0;
    text-align: justify;
}

.abp-author-description > *:first-child {
    margin-top: 0;
}

.abp-author-description > *:last-child {
    margin-bottom: 0;
}

/* Video */
.abp-video-container {
    position: relative;
    max-width: 200px;
    border-radius: var(--abp-border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.abp-video-cover {
    position: relative;
    cursor: pointer;
    line-height: 0;
    display: inline-block;
    outline: none;
}

.abp-video-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.abp-video-cover:focus-visible {
    box-shadow: 0 0 0 3px rgba(89, 138, 255, 0.35);
    border-radius: var(--abp-border-radius);
}

.abp-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform var(--abp-transition);
    z-index: 2;
    line-height: 0;
}

.abp-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.08);
}

.abp-play-btn svg {
    filter: var(--abp-shadow-play);
}

/* Primary profile link */
.abp-author-link {
    margin-top: 15px;
}

.abp-author-link a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--abp-primary-color);
    color: var(--abp-white);
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--abp-transition), transform var(--abp-transition);
}

.abp-author-link a:hover,
.abp-author-link a:focus-visible {
    opacity: 0.92;
    text-decoration: none;
}

.abp-author-link a:focus-visible {
    outline: 2px solid rgba(89, 138, 255, 0.35);
    outline-offset: 2px;
}

/* Social Links + Custom Links */
.abp-author-social-links,
.abp-author-custom-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.abp-author-social-link,
.abp-author-custom-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--abp-border-color);
    border-radius: 999px;
    background: var(--abp-white);
    color: var(--abp-text-color);
    text-decoration: none;
    font-size: 0.92rem;
    line-height: 1.2;
    vertical-align: middle;
    transition:
        background-color var(--abp-transition),
        border-color var(--abp-transition),
        color var(--abp-transition),
        box-shadow var(--abp-transition),
        transform var(--abp-transition);
}

.abp-author-social-link:hover,
.abp-author-custom-link:hover {
    text-decoration: none;
    border-color: var(--abp-primary-color);
    color: var(--abp-primary-color);
    box-shadow: 0 3px 10px rgba(89, 138, 255, 0.10);
    transform: translateY(-1px);
}

.abp-author-social-link:focus-visible,
.abp-author-custom-link:focus-visible {
    outline: none;
    border-color: var(--abp-primary-color);
    box-shadow: 0 0 0 3px rgba(89, 138, 255, 0.20);
}

.abp-author-social-link img,
.abp-author-custom-link img {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.abp-author-social-link span,
.abp-author-custom-link span {
    display: inline-block;
    vertical-align: middle;
    word-break: break-word;
}

/* Video Modal */
.abp-video-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.abp-video-modal[aria-hidden="false"] {
    display: flex;
}

.abp-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.abp-modal-content {
    position: relative;
    z-index: 2;
    width: min(90%, 960px);
    max-height: 90vh;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.abp-modal-content video {
    width: 100%;
    max-width: 100%;
    max-height: 80vh;
    display: block;
    background: #000;
}

.abp-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    z-index: 3;
}

.abp-modal-close:focus-visible {
    outline: 2px solid rgba(255,255,255,0.6);
    outline-offset: 2px;
}

/* Author Posts Widget / Shortcode */
.abp-author-posts {
    margin: 20px 0;
}

.abp-section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--abp-primary-color);
    color: var(--abp-text-color);
    line-height: 1.4;
}

.abp-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.abp-post-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--abp-border-radius);
    overflow: hidden;
    transition: transform var(--abp-transition), box-shadow var(--abp-transition);
}

.abp-post-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--abp-shadow-md);
}

.abp-post-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.abp-post-thumbnail {
    margin: 0;
    line-height: 0;
    overflow: hidden;
}

.abp-post-thumbnail img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.abp-post-item:hover .abp-post-thumbnail img {
    transform: scale(1.05);
}

.abp-post-title {
    margin: 0;
    padding: 15px;
    font-size: 1rem;
    color: var(--abp-text-color);
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    .abp-author-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .abp-author-info {
        text-align: center;
    }

    .abp-author-description {
        text-align: center;
    }

    .abp-author-social-links,
    .abp-author-custom-links {
        justify-content: center;
    }

    .abp-video-container {
        max-width: 100%;
    }

    .abp-posts-grid {
        grid-template-columns: 1fr;
    }

    .abp-modal-content {
        width: calc(100vw - 24px);
    }
}
