.shahr-author-box-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: inherit;
    direction: rtl;
    text-align: right;
}

.card-layout-w {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.shahr-author-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background-color: #ffffff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.shahr-author-box-avatar img {
    border-radius: 50%;
    object-fit: cover;
}

.shahr-author-box-desc {
    flex: 1;
}

.shahr-author-box-desc .written-by {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: inline-block;
}

.shahr-author-box-desc .written-by.bilingual::after {
    content: " / Author";
    font-size: inherit;
    color: inherit;
}

.shahr-author-box-desc .author-name {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
}

.shahr-author-box-desc .author-name a {
    color: #002773;
    text-decoration: none;
}

.shahr-author-box-desc .author-name a:hover {
    color: #003087;
}

.shahr-author-box-desc .author-bio {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 12px;
    line-height: 1.6;
}

.author-social-links,
.shahr-author-box-share-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.author-social-links a,
.shahr-author-box-share-links a {
    color: #002773;
    text-decoration: none;
    transition: all 0.3s ease;
}

.author-social-links a:hover,
.shahr-author-box-share-links a:hover {
    color: #003087;
}

.shahr-author-box-desc .follow-button {
    display: inline-block;
    padding: 6px 12px;
    background-color: #002773;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.shahr-author-box-desc .follow-button.bilingual::after {
    content: " / Follow";
    font-size: inherit;
    color: inherit;
}

.shahr-author-box-desc .follow-button:hover {
    background-color: #003087;
}

.shahr-author-box-related-posts {
    position: relative;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 16px;
    padding: 16px;
}

.shahr-author-box-related-posts .related-posts-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.shahr-author-box-related-posts .related-posts-title .title-text {
    flex: 1;
}

.shahr-author-box-related-posts .related-posts-title .title-text.bilingual::after {
    content: " / Other Posts by This Author";
    font-size: inherit;
    color: inherit;
}

.shahr-author-box-related-posts .related-posts-title .toggle-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.shahr-author-box-related-posts .related-posts-title .toggle-icon i,
.shahr-author-box-related-posts .related-posts-title .toggle-icon svg {
    transition: opacity 0.3s ease;
}

.shahr-author-box-related-posts .related-posts-title .toggle-icon.toggled {
    transform: rotate(180deg);
}

.shahr-author-box-related-posts .related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.shahr-author-box-related-posts .related-posts-list.active {
    max-height: 500px;
    opacity: 1;
}

.shahr-author-box-related-posts ul li {
    margin-bottom: 6px;
}

.shahr-author-box-related-posts ul li a {
    font-size: 13px;
    color: #002773;
    text-decoration: none;
    transition: all 0.3s ease;
}

.shahr-author-box-related-posts ul li a:hover {
    color: #003087;
}

.shahr-author-box-all-posts {
    margin-top: 16px;
    text-align: center;
}

.shahr-author-box-all-posts-button {
    display: inline-block;
    padding: 6px 12px;
    background-color: #002773;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.shahr-author-box-all-posts-button.bilingual::after {
    content: " / All Posts";
    font-size: inherit;
    color: inherit;
}

.shahr-author-box-all-posts-button:hover {
    background-color: #003087;
}

/* Dark Mode */
html[scheme="dark"] .shahr-author-box,
html[scheme="dark"] .shahr-author-box-related-posts {
    background-color: #1a252fbd;
}

html[scheme="dark"] .shahr-author-box-desc .written-by {
    color: #9ca3af;
}

html[scheme="dark"] .shahr-author-box-desc .author-name a {
    color: #60a5fa;
}

html[scheme="dark"] .shahr-author-box-desc .author-name a:hover {
    color: #93c5fd;
}

html[scheme="dark"] .shahr-author-box-desc .author-bio {
    color: #d1d5db;
}

html[scheme="dark"] .shahr-author-box-desc .author-social-links a,
html[scheme="dark"] .shahr-author-box-desc .shahr-author-box-share-links a {
    color: #60a5fa;
}

html[scheme="dark"] .shahr-author-box-desc .author-social-links a:hover,
html[scheme="dark"] .shahr-author-box-desc .shahr-author-box-share-links a:hover {
    color: #93c5fd;
}

html[scheme="dark"] .shahr-author-box-desc .follow-button {
    background-color: #002773;
    color: #ffffff;
}

html[scheme="dark"] .shahr-author-box-desc .follow-button:hover {
    background-color: #003087;
}

html[scheme="dark"] .shahr-author-box-related-posts ul li a {
    color: #60a5fa;
}

html[scheme="dark"] .shahr-author-box-related-posts ul li a:hover {
    color: #93c5fd;
}

html[scheme="dark"] .shahr-author-box-all-posts-button {
    background-color: #002773;
    color: #ffffff;
}

html[scheme="dark"] .shahr-author-box-all-posts-button:hover {
    background-color: #003087;
}

/* LTR-Specific Styles */
[dir="ltr"] .shahr-author-box-container {
    direction: ltr;
    text-align: left;
}

[dir="ltr"] .shahr-author-box {
    flex-direction: row;
}

[dir="ltr"] .shahr-author-box-desc {
    text-align: left;
}

[dir="ltr"] .author-social-links a i,
[dir="ltr"] .shahr-author-box-share-links a i,
[dir="ltr"] .author-social-links a svg,
[dir="ltr"] .shahr-author-box-share-links a svg {
    margin-inline-end: 0;
    margin-inline-start: 4px;
}

[dir="ltr"] .shahr-author-box-related-posts .related-posts-title {
    flex-direction: row;
}

[dir="ltr"] .shahr-author-box-related-posts .related-posts-title .title-text {
    order: 0;
}

[dir="ltr"] .shahr-author-box-related-posts .related-posts-title .toggle-icon {
    order: 1;
}

[dir="ltr"] .shahr-author-box-related-posts ul li {
    text-align: left;
}

[dir="ltr"] .shahr-author-box-all-posts {
    text-align: center;
}

/* Mobile-Specific Styles */
@media (max-width: 767px) {
    .shahr-author-box {
        padding: 12px;
        gap: 12px;
    }

    .shahr-author-box-avatar img {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px;
        max-width: 60px;
        object-fit: cover;
        border-radius: 50%;
    }

    .shahr-author-box-desc .written-by {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .shahr-author-box-desc .author-name {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .shahr-author-box-desc .author-bio {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 8px;
    }

    .author-social-links,
    .shahr-author-box-share-links {
        gap: 0;
        margin-bottom: 8px;
    }

    .shahr-author-box-desc .author-social-links {
        gap: 0;
    }

    .shahr-author-box-desc .follow-button {
        font-size: 13px;
        padding: 4px 10px;
    }

    .shahr-author-box-related-posts {
        padding: 12px;
        margin-top: 12px;
    }

    .shahr-author-box-related-posts .related-posts-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .shahr-author-box-related-posts .related-posts-title .toggle-icon {
        width: 20px;
        height: 20px;
    }

    .shahr-author-box-related-posts ul li a {
        font-size: 12px;
    }

    .shahr-author-box-all-posts {
        margin-top: 12px;
    }

    .shahr-author-box-all-posts-button {
        font-size: 13px;
        padding: 4px 10px;
    }

    /* Dark Mode Mobile Adjustments */
    html[scheme="dark"] .shahr-author-box,
    html[scheme="dark"] .shahr-author-box-related-posts {
        background-color: #1a252fbd;
    }
}