/**
 * Author bio popup
 *
 * File: css/author-bio-popup.css
 * Used on single posts and knowledge articles - see inc/author-bio-popup.php.
 */

/* ─── Trigger (the author name in the post meta) ─── */

.screen-author-trigger {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    line-height: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.screen-author-trigger:hover,
.screen-author-trigger:focus-visible {
    color: #005FAE;
    text-decoration-style: solid;
}

.screen-author-trigger:focus-visible {
    outline: 2px solid #4DB3FF;
    outline-offset: 3px;
}

/* ─── Modal shell ─── */

.screen-author-modal {
    position: fixed;
    inset: 0;
    z-index: 2000000000; /* above the site's sticky header and popup maker */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen-author-modal[hidden] {
    display: none;
}

.screen-author-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(40, 45, 58, 0.6);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.screen-author-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 30px 30px 26px;
    background: #FFFFFF;
    border-radius: 4px;
    box-shadow: 0 18px 50px rgba(40, 45, 58, 0.28);
    font-family: inherit;
    text-align: left;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.screen-author-modal.is-open .screen-author-modal__backdrop {
    opacity: 1;
}

.screen-author-modal.is-open .screen-author-modal__dialog {
    opacity: 1;
    transform: none;
}

.screen-author-modal__dialog:focus {
    outline: none;
}

/* ─── Close button ─── */

.screen-author-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #9E9E9E;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.screen-author-modal__close:hover,
.screen-author-modal__close:focus-visible {
    background: #F7F7F7;
    color: #282D3A;
}

/* ─── Head ─── */

.screen-author-modal__head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-right: 28px;
}

.screen-author-modal__avatar-wrap {
    flex: 0 0 auto;
    line-height: 0;
}

.screen-author-modal__avatar-wrap img {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.screen-author-modal__initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #282D3A;
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
}

.screen-author-modal__eyebrow {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #9E9E9E;
}

.screen-author-modal__name {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
    color: #282D3A;
}

/* ─── Accent line ─── */

.screen-author-modal__accent {
    width: 40px;
    height: 3px;
    margin: 18px 0;
    background: #FF8F08;
    border-radius: 2px;
}

/* ─── Bio ─── */

.screen-author-modal__bio {
    font-size: 15px;
    line-height: 1.65;
    color: #333333;
}

.screen-author-modal__bio p {
    margin: 0 0 12px;
}

.screen-author-modal__bio p:last-child {
    margin-bottom: 0;
}

.screen-author-modal__bio a {
    color: #005FAE;
}

/* ─── Actions ─── */

.screen-author-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #ECECEC;
}

.screen-author-modal__link {
    font-size: 13px;
    font-weight: 600;
    color: #005FAE;
    text-decoration: none;
}

.screen-author-modal__link:hover,
.screen-author-modal__link:focus-visible {
    color: #282D3A;
    text-decoration: underline;
}

/* ─── Scroll lock ─── */

body.screen-author-modal-open {
    overflow: hidden;
}

/* ─── Small screens ─── */

@media (max-width: 480px) {
    .screen-author-modal__dialog {
        padding: 26px 20px 22px;
    }

    .screen-author-modal__head {
        gap: 14px;
    }

    .screen-author-modal__avatar-wrap img {
        width: 52px;
        height: 52px;
    }

    .screen-author-modal__initials {
        width: 52px;
        height: 52px;
        font-size: 19px;
    }

    .screen-author-modal__name {
        font-size: 19px;
    }
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
    .screen-author-modal__backdrop,
    .screen-author-modal__dialog {
        transition: none;
    }
}
