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

.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;
    scrollbar-width: none; /* Firefox — matches the footnote sidebar */
}
.article-author-panel::-webkit-scrollbar {
    display: none; /* WebKit / Chromium */
}

/* Shown and slid by the article view (panel(), article-view.snippet.js):
   `is-shown` puts it on the page, `is-open` slides it into place. Opened by a
   click it is shown first and then opened, so it slides in from the right;
   closed, it slides out and is hidden once the slide has run. A history step
   (Back, Forward) or a page loaded with the panel's address sets both at once,
   in the same frame as the route: no slide, and never a frame with the panel
   in its old state. On narrow screens it moves a short way, not its whole
   width, fading as it comes — as the site menu and the article info drawer
   do; on wide screens its whole width, the fade on its own ease. The host
   column clips the panel horizontally (see article/article-view.snippet.css),
   so no scrollbar flashes while it slides. When switching authors the two
   panels overlap in one grid cell: the open one is above the leaving one. */
.article-author-panel {
    --panel-layer: 1;
    display: none;
    transform: translateX(var(--slide-nudge));
    opacity: 0;
    z-index: var(--panel-layer);
    transition:
        transform var(--slide-duration) var(--ease-panel),
        opacity var(--slide-duration) var(--ease-panel);
}
.article-author-panel.is-shown {
    display: block;
}
.article-author-panel.is-open {
    transform: none;
    opacity: 1;
    z-index: calc(var(--panel-layer) + 1);
}
@media (min-width: 60rem) {
    .article-author-panel {
        transform: translateX(100%);
        transition:
            transform var(--slide-duration) var(--ease-panel),
            opacity var(--slide-duration) ease;
    }
}
@media (prefers-reduced-motion: reduce) {
    .article-author-panel {
        transition: none;
    }
}

/* Header band: name + close, a list item (ui/list-item) with its rule below
   (Figma 312:12413). The row's vertical spacing and size are the list item's. */
.article-author-panel__head {
    --fa-serif: 0;
    padding-inline: var(--space-s);
    line-height: var(--leading-tight);
    position: sticky;
    z-index: 2;
    top: 0;
    background-color: var(--color-bg);
}
/* The band is as tall as the menubar; the row's centring needs the name and
   the close control in the middle of it, not on its first line. */
.article-author-panel .article-author-panel__head {
    align-items: center;
    gap: var(--space-s);
    min-height: var(--menubar-h);
}
.article-author-panel__close {
    flex: none;
    line-height: 0;
    color: var(--color-fg);
}
.article-author-panel__close .icon {
    width: var(--close-size);
    height: var(--close-size);
}
.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, a list item (ui/list-item) with a
   thin rule above as well (Figma 312:12416). */
.article-author-panel__other {
    --fa-serif: 0;
    padding-inline: var(--space-s);
    border-top: var(--border-thin);
    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;
        --panel-layer: var(--z-panel); /* the open one a level above: still under the menubar */
    }
}
