/* ---------- Page header (BigContentHeaderLayout, boxShadow: none) ---------- */
.publications-header {
    background: #e7effd;
    padding-top: calc(var(--spacing) * 5);
    padding-bottom: calc(var(--spacing) * 7);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.publications-header__titles {
    max-width: 600px;
    text-align: center;
}

.publications-header__title {
    font-size: 2rem;
    margin: 0;
}

.publications-header__subtitle {
    color: #606060;
    margin: calc(var(--spacing) * 2) 0;
}

/* ---------- Filters (progressive enhancement: revealed by publications.js) ---------- */
/* Gatsby capped only SearchInput at 800px; TagsAccordion was an unconstrained
   sibling, so the chips span the full content width. */
.publications-filters {
    width: 100%;
}

.publications-search {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.publications-search__input {
    width: 100%;
    display: block;
    color: inherit;
    padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
    margin: 0 auto;
    border: 1px solid #d0d9de;
    border-radius: 40px;
    outline: none;
    background: #fff;
}

.publications-search__icon {
    position: absolute;
    right: 20px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    color: var(--color-text);
    pointer-events: none;
}

.publications-tags {
    position: relative;
    margin-top: calc(var(--spacing) * 3);
}

.publications-tags__list {
    text-align: center;
    max-height: 230px;
    overflow-y: auto;
}

.publications-tags__list::-webkit-scrollbar {
    width: 6px;
    height: 5px;
}

.publications-tags__list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
}

.publications-tags__list::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 2px;
}

.publications-tags__list::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.publications-tags__empty {
    text-align: center;
}

/* The toggle hangs below the tag list, overlapping the header band's padding. */
.publications-tags__more {
    position: absolute;
    bottom: -55px;
    width: 100%;
    text-align: center;
}

/* ---------- Tag chip (Gatsby src/components/tag) ---------- */
.tag {
    display: inline-block;
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: var(--spacing) calc(var(--spacing) * 2);
    margin: 2.4px;
    border-radius: 20px;
    border: 1px solid #e5ebee;
    background-color: #fff;
}

.tag[hidden] {
    display: none;
}

.tag--clickable {
    cursor: pointer;
}

.tag--clickable:hover {
    background-color: #cde6ff;
}

.tag--clickable[aria-pressed='true'] {
    background-color: var(--color-primary);
    color: #fff;
}

/* ---------- "More Keywords" / "Read More" buttons ---------- */
.publications-more-button,
.publication__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing);
    border: none;
    outline: none;
    background-color: transparent;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.66;
    letter-spacing: 0.03333em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.publications-more-button {
    cursor: pointer;
    margin: calc(var(--spacing) * 2) auto;
}

.publications-more-button__icon,
.publication__toggle-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* angle-right, so down is +90deg and up is +270deg, as live rotates it. */
.publications-more-button__icon svg,
.publication__toggle-icon svg {
    transform: rotate(90deg);
}

.publications-more-button[aria-expanded='true'] .publications-more-button__icon svg,
.publication[open] .publication__toggle-icon svg {
    transform: rotate(270deg);
}

/* ---------- Accordion list ---------- */
.publications-body {
    padding-top: calc(var(--spacing) * 5);
    padding-bottom: calc(var(--spacing) * 4);
}

.publications-list__empty {
    text-align: center;
}

.publication {
    margin: 4px 0;
}

.publication__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing);
    padding: calc(var(--spacing) * 2);
    border-bottom: 2px solid #eee;
    cursor: pointer;
    list-style: none;
}

.publication__summary::-webkit-details-marker {
    display: none;
}

.publication[open] > .publication__summary {
    background-color: #f8faff;
}

.publication__summary:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.publication__main {
    display: flex;
    flex-direction: column;
    flex: 1 1 100%;
    min-width: 0;
}

.publication__title {
    color: #081f4d;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.6;
    letter-spacing: 0.0075em;
    text-decoration: none;
}

/* Explicit none: live's hover only recolours, but main.css underlines links on hover. */
.publication__title:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.publication__authors {
    font-size: 0.75rem;
    line-height: 1.66;
    letter-spacing: 0.4px;
    margin-top: var(--spacing);
}

.publication__side {
    display: flex;
    flex: 1 1 100%;
    align-items: center;
    justify-content: space-between;
}

.publication__date {
    font-size: 0.75rem;
    line-height: 1.66;
    letter-spacing: 0.4px;
    color: #767b87;
}

@media (min-width: 960px) {
    .publication__summary {
        flex-wrap: nowrap;
    }

    .publication__main {
        flex: 0 1 66.666%;
    }

    .publication__side {
        flex: 0 0 33.333%;
        justify-content: flex-end;
        gap: calc(var(--spacing) * 4);
    }
}

.publication__toggle-text::after {
    content: 'Read More';
}

.publication[open] .publication__toggle-text::after {
    content: 'Collapse';
}

/* ---------- Accordion panel ---------- */
.publication__content {
    padding: calc(var(--spacing) * 2);
    background-color: #f8faff;
    margin-top: 4px;
}

.publication__section-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.0075em;
    color: #3c4b68;
    margin: 0 0 var(--spacing);
}

.publication__tags {
    display: flex;
    overflow-x: auto;
    margin-bottom: calc(var(--spacing) * 2);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.publication__tags::-webkit-scrollbar {
    display: none;
}

.publication__abstract {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #606060;
    margin: 0;
}

.publication__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: calc(var(--spacing) * 2);
}
