/* Author panel — auto-loaded for the article-author-panel snippet
   (site/snippets/article-author-panel.php). Fills the article's right column on
   desktop; a full-width overlay under the menubar on mobile. */

/* Alpine cloak: hide the (server-rendered, all-authors) panels until Alpine has
   evaluated x-show, so only the selected one ever appears. Defined here because
   the global rule lives in landing.snippet.css, which the article page never loads. */
[x-cloak] {
    display: none !important;
}

.article-author-panel {
    position: sticky;
    top: var(--menubar-h);
    max-height: calc(100vh - var(--menubar-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-bg);
    border-left: var(--border);
    margin-left: -1px;
}

/* Slide in / out from the right (driven by Alpine x-transition). The host column
   clips the off-screen panel horizontally (see article-view.snippet.css), so no
   scrollbar flashes while it slides. */
.article-author-panel--anim {
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), opacity 300ms ease;
}
.article-author-panel--off {
    transform: translateX(100%);
    opacity: 0;
}
.article-author-panel--on {
    transform: translateX(0);
    opacity: 1;
}
/* When switching authors the two panels overlap in one grid cell — keep the
   entering panel above the leaving one so new content is never covered by old. */
.article-author-panel--enter {
    z-index: 2;
}
.article-author-panel--leave {
    z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
    .article-author-panel--anim {
        transition: none;
    }
    .article-author-panel--off {
        transform: none;
        opacity: 1;
    }
}

/* Header band: name + close, hairline below (Figma 312:12413). */
.article-author-panel__head {
    --fa-serif: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
    min-height: var(--menubar-h);
    padding: var(--space-2xs) var(--space-s);
    border-bottom: var(--border);
    position: sticky;
    top: 0;
    background-color: var(--color-bg);
}
.article-author-panel__name {
    font-size: var(--fs-subheading);
    line-height: var(--leading-tight);
}
.article-author-panel__close {
    flex: none;
    line-height: 0;
    color: var(--color-fg);
}
.article-author-panel__close .icon {
    width: 1.25rem;
    height: 1.25rem;
}
.article-author-panel__close:hover {
    color: var(--color-muted);
}

.article-author-panel__body {
    --fa-serif: 0;
    padding: var(--space-s);
}
.article-author-panel__bio {
    line-height: var(--leading-body);
}
.article-author-panel__bio > * + * {
    margin-top: var(--space-2xs);
}

/* Contact rows: uppercase label left, value right (Figma 311:11566–11569). */
.article-author-panel__contact {
    margin-top: var(--space-m);
}
.article-author-panel__contact-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-s);
    padding: var(--space-3xs) 0;
}
.article-author-panel__contact-row dt {
    --fa-weight: 100;
    --fa-serif: 0;
    text-transform: uppercase;
}
.article-author-panel__contact-row dd {
    margin: 0;
    text-align: right;
}
.article-author-panel__contact-row dd a {
    text-decoration: underline;
}
.article-author-panel__contact-row dd a:hover {
    text-decoration: none;
}

/* "Other articles by this author" band, full-bleed rules (Figma 312:12416). */
.article-author-panel__other {
    --fa-serif: 0;
    padding: var(--space-2xs) var(--space-s);
    border-top: var(--border-thin);
    border-bottom: var(--border);
    font-size: var(--fs-subheading);
    line-height: var(--leading-tight);
}

/* --- Mobile: full-width overlay under the menubar -------------------------- */
@media (max-width: 60rem) {
    .article-author-panel {
        position: fixed;
        inset: var(--menubar-h) 0 0 0;
        max-height: none;
        z-index: 150;
    }
}
