.issue_tree_header {
    padding-top: 20px;
    border-top: 2px solid grey;

    padding-bottom: 10px;
    border-bottom: 1px solid grey;
}
.issue_tree_header > span:first-child {
    font-size: larger;
    font-weight: bold;
}
.issue_tree_header > span:last-child {
    float: right;
    font-size: small;
}

ul.issue_tree {
    margin: 0;
    padding: 0;
}

li.issue_tree_elem {
    list-style: none;
    display: block;
    user-select: none;
}
li.issue_tree_elem ul {
    padding: 0;
}

.branch_issue {
    padding: 10px 0;
    display: block;
    border-bottom: 1px solid grey;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.branch_issue > * {
    vertical-align: middle;
    margin-right: 25px;
    margin-left: 5px;
}
.branch_issue:hover,
.branch_issue:focus-visible {
    background-color: var(--gold) !important;
    color: white;
}

.arrow-img {
    transition: transform 0.2s ease-in-out;
    transform: rotate(0deg);
}
.arrow-img.expanded {
    transform: rotate(90deg);
}

.branch_list {
    --indent: 50px;
    max-height: 0;
    overflow: hidden;
    background-color: hsl(200, 100%, 95%);
    transition: max-height 0.2s ease-in-out;
}

.branch_list .branch_issue > span:first-child{
    margin-left: calc(var(--indent)*1);
}
.branch_list .branch_list .branch_issue > span:first-child {
    margin-left: calc(var(--indent)*2);
}
.branch_list .branch_list .branch_list .branch_issue > span:first-child {
    margin-left: calc(var(--indent)*3);
}
.branch_list .branch_list .branch_list .branch_list .branch_issue > span:first-child {
    margin-left: calc(var(--indent)*4);
}

.branch_list .branch_issue {
    background-color: hsl(35, 20%, 90%);
}
.branch_list .branch_list .branch_issue {
    background-color: hsl(35, 20%, 80%);
}
.branch_list .branch_list .branch_list .branch_issue {
    background-color: hsl(35, 20%, 70%);
}
.branch_list .branch_list .branch_list .branch_list .branch_issue {
    background-color: hsl(35, 20%, 60%);
}

.leaf_issue {
    display: flex;
    text-decoration: none;
    color: black;
    align-items: center;
}
.leaf_issue > :last-child {
    margin-left: auto;
}
.leaf_issue > :nth-child(2) {
    min-width: 8em;
}

/* Reflow (WCAG 1.4.10): shrink the per-level indent so deeply nested trees
   don't push the row width past a narrow viewport. */
@media (max-width: 640px) {
    /* The sort links float right on desktop; on a narrow screen that overlaps
       the "Dostępne roczniki" heading and the first tree row. Stack them below
       the heading instead, with comfortable tap spacing. */
    .issue_tree_header > span:last-child {
        float: none;
        display: block;
        margin-top: 10px;
    }
    .issue_tree_header > span:last-child > a {
        display: inline-block;
        padding: 6px 0;
    }
    .branch_list {
        --indent: 16px;
    }
    .branch_issue > * {
        margin-right: 10px;
    }
    /* Comfortable tap height for the expander/leaf rows, and let the article-count
       column shrink so a long issue title doesn't push the row past the screen. */
    .branch_issue,
    .leaf_issue {
        min-height: 44px;
    }
    .leaf_issue > :nth-child(2) {
        min-width: 0;
    }
}