/* ============================================================
   Author Popup — Optiveum Theme
   ============================================================ */

/* --- Trigger wrapper in article meta row --- */
.article-author {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Transparent bridge that fills the 12px gap between trigger and popup,
   so the mouse doesn't leave the hover zone while moving toward the popup. */
.js-author-trigger:hover::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.article-author__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.article-author__avatar--placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--grey-primary);
}

.article-author__label {
    font-family: var(--font-family-primary);
    font-size: 14px;
    font-weight: 500;
    color: var(--breadcrumbs-text);
}

.article-author__name {
    font-family: var(--font-family-primary);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-violet-dark);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
}

.article-author__name:hover,
.article-author__name:focus-visible {
    opacity: 0.7;
    outline: 2px solid var(--primary-violet-light);
    outline-offset: 2px;
    border-radius: 2px;
}

/* --- Popup container --- */
.author-popup {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 100;
    width: 320px;
    background: var(--white-primary);
    border: 1px solid var(--grey-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

/* Arrow */
.author-popup::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 24px;
    width: 12px;
    height: 12px;
    background: var(--white-primary);
    border-left: 1px solid var(--grey-primary);
    border-top: 1px solid var(--grey-primary);
    transform: rotate(45deg);
}

/* Open state */
.author-popup.is-open,
.js-author-trigger:hover .author-popup,
.js-author-trigger:focus-within .author-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.author-popup__inner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Header: photo + name */
.author-popup__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-popup__photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-popup__photo--placeholder {
    background-color: var(--grey-primary);
}

.author-popup__identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-popup__name {
    font-family: var(--font-family-primary);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-violet-dark);
    line-height: 1.2;
}

.author-popup__job {
    font-family: var(--font-family-primary);
    font-size: 13px;
    font-weight: 500;
    color: var(--breadcrumbs-text);
    line-height: 1.3;
}

/* Expertise */
.author-popup__expertise {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.author-popup__expertise-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--breadcrumbs-text);
}

.author-popup__expertise-title {
    font-family: var(--font-family-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--breadcrumbs-text);
}

.author-popup__expertise-value {
    font-family: var(--font-family-primary);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-violet-dark);
}

/* Bio */
.author-popup__bio {
    font-family: var(--font-family-primary);
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-violet-dark);
    line-height: 1.5;
    margin: 0;
}

/* Footer */
.author-popup__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--grey-primary);
}

.author-popup__bio-link {
    font-family: var(--font-family-primary);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-violet-dark);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.author-popup__bio-link:hover {
    opacity: 0.7;
}

.author-popup__social {
    display: flex;
    gap: 8px;
}

.author-popup__social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--grey-primary);
    border-radius: var(--border-radius-sm);
    color: var(--primary-violet-dark);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.author-popup__social-btn:hover {
    background-color: var(--primary-violet-dark);
    color: var(--white-primary);
    border-color: var(--primary-violet-dark);
}

.author-popup__linkedin-icon--white {
    display: none;
}

.author-popup__social-btn:hover .author-popup__linkedin-icon--default {
    display: none;
}

.author-popup__social-btn:hover .author-popup__linkedin-icon--white {
    display: block;
}

/* Mobile: bottom sheet */
@media (max-width: 767px) {
    .author-popup {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
        transform: translateY(20px);
        max-height: 80vh;
        overflow-y: auto;
    }

    .author-popup::before {
        display: none;
    }

    .author-popup.is-open {
        transform: translateY(0);
    }
}
