div.article_list_headers {
    border-bottom: 2px solid var(--beige3);
    display: flex;
    font-size: small;
    margin-bottom: 5px;
    color: var(--gold);
    font-weight: bold;
}
div.article_list_headers > span {
    margin-bottom: 5px;
}

ul.article_list {
    padding: 0;
    margin: 0;
    list-style-type: none;
}
ul.article_list > li {
    padding: 15px 0;
    border-bottom: 1px solid var(--gray4);
}

div.article_title_cell > span,
div.article_title_cell > a.article_title {
    display: block;
    margin-right: 15px;
    margin-bottom: 5px;
}
div.article_title_cell > span:not(:first-child) {
    font-size: 0.9em;
}
div.article_title_cell > span:not(:first-child) > a {
    color: var(--black3);
    text-decoration: none;
}
div.article_title_cell > span:not(:first-child) > a:focus-visible {
    color: var(--beige4);
}

.article_title {
    font-size: larger;
    font-weight: bolder;
}
/* The title links the PDF when there is one (same target as "Pełny tekst"). */
a.article_title {
    color: inherit;
    text-decoration: none;
}
a.article_title:focus-visible {
    text-decoration: underline;
}
span.article_pages {
    font-size: smaller;
}

/* Compact-layout inline labels: shown ≤960px where the column header row is
   hidden, so a bare year/pages value keeps its meaning. */
.cell_label {
    display: none;
}

div.article_actions_cell > button, div.article_actions_cell > a {
    display: flex;
    align-items: center;
    color: var(--black3);
    border: none;
    background: none;
    text-decoration: none;
    padding: 5px 0;
    cursor: pointer;
    /* ≥24px tap height for the share/cite/PDF actions (WCAG 2.2 SC 2.5.8); the
       960px block turns these into ≥44px pill buttons on the compact layout. */
    min-height: var(--touch-target-min);
}

div.article_authors_cell > a {
    display: block;
    color: var(--black3);
    text-decoration: none;
    margin-right: 15px;
}
div.article_authors_cell > a:focus-visible {
    color: var(--beige4);
}

div.citations {
    background-color: var(--beige1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s, margin-top 0.5s;
    position: relative;
}
div.citations.expanded {
    margin-top: 20px;
    max-height: 60em; /* a long BibTeX record + the plain citation; the compact layout drops the cap */
}
div.citations > div {
    padding: 20px 75px;
    overflow: hidden;
}
.citation_status {
    min-height: 1.5em;
    padding: 20px 75px 0;
    color: var(--black3);
}
.citations button {
    border: none;
    background-color: var(--beige2);
    border-radius: 1000px;
    padding: 8px 16px;
    float: right;
    margin: 0 10px;
    color: var(--black3);
}
.citations button:disabled {
    cursor: wait;
    opacity: 0.6;
}
.text_citation {
    border-top: 1px solid var(--gold);
}
.bibtex_citation {
    border-top: 1px solid var(--black3);
}
.bibtex_citation > p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.text_citation > p {
    overflow-wrap: anywhere;
}
.citation_header {
    color: var(--gold);
}
.citations_x {
    position: absolute;
    right: 15px;
    top: 5px;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    float: none;
    cursor: pointer;
    /* ≥24×24 hit box (WCAG 2.2 SC 2.5.8); wraps a 24px icon, pinned so it can't
       collapse below the minimum. */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
}
.citations_x > img {
    display: block;
}

/* Hover colours only where a pointer can hover (see style.css). */
@media (hover: hover) {
    div.article_title_cell > span:not(:first-child) > a:hover {
        color: var(--beige4);
    }
    a.article_title:hover {
        text-decoration: underline;
    }
    div.article_actions_cell > button:hover,
    div.article_actions_cell > a:hover {
        color: var(--beige4);
    }
    div.article_authors_cell > a:hover {
        color: var(--beige4);
    }
    .citations button:hover {
        background-color: var(--beige3);
    }
}

/* Compact layout (WCAG 1.4.10): the .four_col_split rule in style.css stacks
   the article rows; here trim the wide citation padding, give the expanded
   panel unbounded room once it is full-width and turn the actions into pills. */
@media (max-width: 960px) {
    /* Column headers don't align to the now-stacked rows — drop them and surface
       the per-value labels instead. */
    div.article_list_headers {
        display: none;
    }
    .cell_label {
        display: inline;
        color: var(--gold);
        font-weight: bold;
        font-size: small;
    }
    div.article_title_cell {
        margin-bottom: 6px;
    }
    /* Actions become a row of tappable pill buttons (≥44px) rather than a stack
       of thin text links; they share the row evenly and wrap as pairs. */
    div.article_actions_cell {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
    }
    div.article_actions_cell > button,
    div.article_actions_cell > a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 auto;
        min-height: 44px;
        padding: 8px 16px;
        background-color: var(--beige2);
        border-radius: 1000px;
    }
    div.citations > div {
        padding: 16px;
    }
    /* The status line keeps clear of the absolute 44px close button. */
    .citation_status {
        padding: 16px 56px 0 16px;
    }
    /* No cap: a fixed max-height silently clipped long BibTeX records. */
    div.citations.expanded {
        max-height: none;
    }
    .citations button {
        float: none;
        margin: 8px 0 0;
        min-height: 44px;
    }
    .citations_x {
        padding: 10px;
        top: 0;
        right: 4px;
    }

    /* The desktop 15px right gutter on titles/authors is dead space on a
       stacked card; author links (block, stacked with no spacing) get an 8px
       tap padding. */
    div.article_title_cell > span,
    div.article_title_cell > a.article_title {
        margin-right: 0;
    }
    div.article_authors_cell > a {
        margin-right: 0;
        padding: 8px 0;
    }
}

/* Phone portrait: secondary lines at body size (0.9em was 14.4px). */
@media (max-width: 640px) {
    div.article_title_cell > span:not(:first-child) {
        font-size: 1em;
    }
    span.article_pages {
        font-size: 1em;
    }
    .cell_label {
        font-size: 0.875em;
    }
}
