/**
 * CODEX-6 — Author archive + author box styles.
 *
 * Only includes the author-specific sidebar blocks. The main article
 * listing reuses the site's native `.page-content > .content > .posts >
 * article.post` structure, styled by custom1/2/3.css.
 *
 * Brand violet: #5757ff (site token).
 */

/* ====== Author sidebar (author.php) ====== */

.codexa-author-sidebar {
    font-size: 1.05rem;
    line-height: 1.5;
}

.codexa-author-sidebar .sidebar-item {
    margin-bottom: 1.75em;
}

.codexa-author-sidebar .sidebar-item:last-child {
    margin-bottom: 0;
}

.codexa-author-sidebar__identity {
    text-align: center;
}

.codexa-author-sidebar__photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    box-shadow: 0 2px 12px rgba(87, 87, 255, 0.15);
    background: #eceaf9;
}

.codexa-author-sidebar__bio {
    font-size: 1.1em;
    line-height: 1.5;
    color: #3a3a4a;
}

.codexa-author-sidebar__bio p {
    margin: 0 0 0.4em;
    line-height: 1.4;
}

.codexa-author-sidebar__bio p:last-child {
    margin-bottom: 0;
}

.codexa-author-sidebar__cta {
    display: inline-block;
    background: #5757ff;
    color: #fff !important;
    border-radius: 24px;
    padding: 12px 28px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1.05em;
    transition: background 0.15s ease;
}

.codexa-author-sidebar__cta:hover {
    background: #2c22c0;
}

.codexa-author-sidebar__socials {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.65em;
    flex-wrap: wrap;
}

.codexa-author-sidebar__socials a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #5757ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5757ff;
    background: #f5f5fa;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.codexa-author-sidebar__socials a:hover {
    background: #5757ff;
    color: #fff;
}

.codexa-author-sidebar__chips {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.codexa-author-sidebar__chip {
    background: #5757ff;
    color: #fff;
    padding: 4px 14px;
    border-radius: 18px;
    font-size: 0.85em;
    font-weight: 600;
}

.codexa-author-sidebar__formations {
    list-style: none;
    padding: 0;
    margin: 0;
}

.codexa-author-sidebar__formation {
    background: #eceaf9;
    color: #1a1a2e;
    border-radius: 6px;
    padding: 6px 12px;
    margin-bottom: 0.5em;
    font-size: 0.9em;
    line-height: 1.4;
}

.codexa-author-posts__empty {
    color: #6a6a7a;
    font-style: italic;
}

/* ====== Author box (bottom of single post) ====== */

.single-post .page-content aside.codexa-author-box,
aside.codexa-author-box {
    display: flex;
    gap: 1.5em;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin: 3em 0 2em;
    padding: 1.75em 2em;
    background: #f5f5fa;
    border-left: 4px solid #5757ff;
    border-radius: 6px;
    float: none;
}

.codexa-author-box__photo {
    flex: 0 0 auto;
}

.codexa-author-box__photo img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.codexa-author-box__body {
    flex: 1 1 auto;
    min-width: 0;
}

.codexa-author-box__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em 0.75em;
    align-items: baseline;
    margin-bottom: 0.5em;
}

.codexa-author-box__label {
    font-size: 0.85em;
    color: #6a6a7a;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.codexa-author-box__name {
    font-size: 1.15em;
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.codexa-author-box__name:hover {
    color: #5757ff;
}

.codexa-author-box__role {
    font-size: 0.9em;
    color: #5757ff;
    font-weight: 500;
}

.codexa-author-box__bio {
    margin: 0 0 0.75em;
    max-width: 100%;
    font-size: 0.95em;
    line-height: 1.55;
    color: #3a3a4a;
}

.codexa-author-box__cta {
    display: inline-block;
    font-size: 0.9em;
    font-weight: 600;
    color: #5757ff;
    text-decoration: none !important;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.codexa-author-box__cta:hover {
    border-bottom-color: #5757ff;
}

/* ====== Responsive mobile ======
 * On author archive, make the sidebar appear BEFORE the articles list
 * (so visitors see who the author is before scrolling through posts).
 * The theme normally stacks content above aside on mobile — we override.
 */

@media (max-width: 900px) {
    .author .page-content {
        display: flex;
        flex-direction: column;
        gap: 1.5em;           /* override theme's desktop gap (80px) */
        row-gap: 1.5em;
    }
    .author .page-content .codexa-author-sidebar {
        order: 1;
        width: 100%;
        max-width: none;
        margin-bottom: 0;      /* gap handled by flex gap */
    }
    .author .page-content .content {
        order: 2;
        width: 100%;
    }

    /* Compact identity block on mobile: centered layout */
    .codexa-author-sidebar__identity {
        text-align: center;
    }
}

@media (max-width: 680px) {
    .codexa-author-sidebar__photo {
        width: 110px;
        height: 110px;
    }
    .codexa-author-sidebar__cta {
        display: block;
        text-align: center;
        padding: 12px 20px;
    }
    .codexa-author-sidebar__socials,
    .codexa-author-sidebar__chips {
        justify-content: flex-start;
    }
    .codexa-author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5em 1.25em;
    }
    .codexa-author-box__meta {
        justify-content: center;
    }
}

/* ====== Post header meta (auteur + dates) ====== */

.post-meta {
    color: #6a6a7a;
    font-size: 0.9em;
    margin: 0 0 1.5em;
    line-height: 1.5;
}

.post-meta a[rel="author"] {
    color: #5757ff;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.post-meta a[rel="author"]:hover {
    border-bottom-color: #5757ff;
}

.post-meta__dates {
    color: #8a8a96;
}
