/* Sort controls and responsive metadata columns */
.sort-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0;
    position: relative;
}

.sort-btns-group {
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
    width: 100%;
}

.sort-btn {
    background: none;
    border: none;
    font-family: var(--serif-font-family);
    font-style: italic;
    font-size: var(--font-size);
    font-weight: normal;
    cursor: pointer;
    color: var(--text-color);
    text-align: left;
    line-height: var(--line-height);
}

.extra-col,
:is(
    .sort-btn[data-sort="date"],
    .item-date,
    .sort-btn[data-sort="category"],
    .item-category
) {
    display: none;
}

body.show-date :is(.sort-btn[data-sort="date"], .item-date) {
    display: block;
    width: var(--w-date, 80px);
}

body.show-category :is(.sort-btn[data-sort="category"], .item-category) {
    display: block;
    width: var(--w-category, auto);
}

body.show-platform :is(.sort-btn[data-sort="platform"], .item-platform) {
    display: block;
    width: var(--w-platform, auto);
}

:is(.sort-btn[data-sort="date"], .item-date) {
    text-align: right;
    padding-right: 0;
}

/*
 * Keep the responsive reveal priority in DOM/JS order
 * (name -> date -> category -> client/platform), while placing date at the
 * visual end of every row.
 */
:is(.sort-btn[data-sort="name"], .item-name) {
    order: 1;
}

:is(.sort-btn[data-sort="category"], .item-category) {
    order: 2;
}

:is(.sort-btn[data-sort="platform"], .item-platform) {
    order: 3;
}

:is(.sort-btn[data-sort="date"], .item-date) {
    order: 4;
}

:is(.sort-btn[data-sort="name"], .item-name) {
    flex: 1 1 var(--w-name, 100px);
    width: auto;
    min-width: 0;
}

.sort-btn:is(
    [data-sort="date"],
    [data-sort="category"],
    [data-sort="platform"]
),
.item-meta {
    flex-shrink: 0;
}

/* Project list */
.list {
    overflow: hidden;
}

.projects-panel .list {
    flex: 0 0 auto;
}

.main-panel.left-collapsed .intro-panel {
    padding-right: 0;
}

.main-panel.left-collapsed .intro-panel > *,
.main-panel.right-collapsed .projects-panel > * {
    visibility: hidden;
}

.projects-panel > br {
    display: block;
    flex: 0 0 var(--line-space);
    height: var(--line-space);
    content: "";
}

.project-item {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    cursor: pointer;
    font-size: var(--font-size);
    border-bottom: 0;
    break-inside: avoid;
    line-height: var(--line-height);
    overflow: visible;
}

.project-item.revealed {
    display: flex;
}

@media (prefers-reduced-motion: reduce) {
    .project-item {
        display: flex;
    }
}

.projects-panel .footer-text {
    flex: 1 0 100px;
    min-height: 100px;
    margin-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-item:is(:hover, :focus-visible) {
    box-shadow: inset 0 -1px 0 var(--text-color);
}

.project-item.archived {
    text-decoration: line-through;
    opacity: 0.5;
    cursor: not-allowed;
}

body:not(.dark) .project-item.archived {
    opacity: 0.2;
}

:is(.item-name, .item-meta) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-name {
    display: flex;
    align-items: center;
    overflow: visible;
}

.item-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.experimental-label {
    display: inline-block;
    flex-shrink: 0;
    font-size: 0.6em;
    font-family: var(--font-family);
    font-weight: 500;
    font-style: italic;
    transform: rotate(-10deg);
    transform-origin: left center;
    margin-left: 4px;
    opacity: 0.8;
}

.project-item .experimental-label {
    overflow: visible;
    padding-right: 0.18em;
}
