/**
 * Unified author box on built-in single post layouts.
 *
 * @package Ahura
 */

/* —— Classic layout (.authorbox) —— */
body.single-post .authorbox {
    width: 100%;
    max-width: 100%;
    margin: 2rem 0 0;
    padding: clamp(16px, 2.5vw, 22px);
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    gap: clamp(14px, 3vw, 20px);
    border-radius: 14px;
    border: 1px solid rgba(var(--ahura-theme-primary-rgb), 0.2);
    background: linear-gradient(
        160deg,
        var(--ahura-c-bg-primary),
        var(--ahura-theme-surface)
    );
    box-shadow:
        0 8px 32px rgba(var(--ahura-theme-primary-rgb), 0.1),
        0 0 0 1px rgba(var(--ahura-theme-primary-rgb), 0.06);
}

body.single-post .authorbox .authorimg {
    float: none;
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
}

body.single-post .authorbox .authorimg img,
body.single-post [class*="single-post-template-"] .post-author-wrap img,
body.single-post .post-author-wrap img {
    width: 72px;
    height: 72px;
    min-width: 72px;
    max-width: 72px;
    margin: 0;
    border-radius: 50%;
    object-fit: cover;
    box-shadow:
        0 0 0 3px rgba(var(--ahura-theme-primary-rgb), 0.2),
        0 8px 22px rgba(var(--ahura-theme-primary-rgb), 0.14);
}

body.single-post .authorbox .authorabout {
    padding: 0;
    flex: 1;
    min-width: 0;
}

body.single-post .authorbox-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 8px;
}

body.single-post .authorbox-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--ahura-c-text-primary);
}

body.single-post .authorbox-name .author-link {
    color: inherit;
    text-decoration: none;
}

body.single-post .authorbox-name .author-link:hover {
    color: var(--ahura-theme-primary);
}

body.single-post .authorbox .authorabout .authortxt {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--ahura-c-text-secondary);
}

/* —— Modern layouts (.post-author-wrap) —— */
body.single-post .post-author-wrap {
    display: flex;
    align-items: flex-start;
    gap: clamp(14px, 3vw, 20px);
}

body.single-post .author-avatar-wrap {
    flex-shrink: 0;
}

body.single-post .post-author-wrap .author-des-wrap {
    flex: 1;
    min-width: 0;
}

body.single-post .post-author-wrap .author-text {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
    color: var(--ahura-c-text-secondary);
}

/* Website pill — icon + label stay on one line */
body.single-post .authorbox-website {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border-radius: 999px;
    text-decoration: none;
    color: var(--ahura-theme-primary);
    background: rgba(var(--ahura-theme-primary-rgb), 0.1);
    border: 1px solid rgba(var(--ahura-theme-primary-rgb), 0.22);
    box-shadow: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body.single-post .authorbox-website:hover {
    color: var(--ahura-theme-primary);
    background: rgba(var(--ahura-theme-primary-rgb), 0.18);
    border-color: rgba(var(--ahura-theme-primary-rgb), 0.35);
}

body.single-post .authorbox-website__label {
    display: inline-block;
    line-height: 1.25;
}

body.single-post .authorbox-website .ah-theme-icon,
body.single-post .authorbox-website .ah-isax {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    min-width: 14px;
    max-width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    color: currentColor;
}

body.single-post .authorbox-website .ah-theme-icon img,
body.single-post .authorbox-website .ah-isax img,
body.single-post .authorbox-website .ah-theme-icon svg,
body.single-post .authorbox-website .ah-isax svg,
body.single-post .authorbox-website .ah-theme-icon .ah-theme-icon__svg,
body.single-post .authorbox-website .ah-isax .ah-theme-icon__svg {
    display: block;
    width: 14px !important;
    height: 14px !important;
    min-width: 14px;
    min-height: 14px;
    max-width: 14px;
    max-height: 14px;
    object-fit: contain;
    flex-shrink: 0;
    fill: currentColor;
}

/* Dark / black theme */
html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .authorbox,
html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .post-author-wrap {
    background: var(--ahura-c-bg-secondary);
    border-color: var(--ahura-c-border-primary);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .single-post-template-5 .post-author-wrap {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    border-top-color: var(--ahura-c-border-primary);
}

html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .authorbox-name,
html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .authorbox-meta {
    color: var(--ahura-c-text-primary);
}

html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .authorbox .authorabout .authortxt,
html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .post-author-wrap .author-text {
    color: var(--ahura-c-text-secondary);
}

html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .authorbox-website {
    color: var(--ahura-c-text-primary);
    background: rgba(var(--ahura-theme-primary-rgb), 0.14);
    border-color: rgba(var(--ahura-theme-primary-rgb), 0.28);
}

html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .authorbox-website:hover {
    color: var(--ahura-theme-primary);
    background: rgba(var(--ahura-theme-primary-rgb), 0.22);
    border-color: rgba(var(--ahura-theme-primary-rgb), 0.4);
}

html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .authorbox .authorimg img,
html:is(.ahura-dark-theme, .ahura-black-theme) body.single-post .post-author-wrap img {
    box-shadow:
        0 0 0 3px rgba(var(--ahura-theme-primary-rgb), 0.28),
        0 8px 22px rgba(0, 0, 0, 0.35);
}

@media (max-width: 576px) {
    body.single-post .authorbox,
    body.single-post .post-author-wrap {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    body.single-post .authorbox-meta {
        justify-content: center;
    }
}
