:root {
    color-scheme: light dark;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: Canvas;
    color: CanvasText;
}

a {
    color: LinkText;
}

.page-width {
    width: min(1500px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid color-mix(
        in srgb,
        CanvasText 20%,
        transparent
    );
}

.site-header h1 {
    margin: 0;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.header-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.header-stats {
    font-size: 1rem;
    font-weight: normal;
    color: #666;
    white-space: nowrap;
}

.site-subtitle {
    margin-top: 0.20rem;
    margin-left: 0.20rem;

    font-size: 1.05rem;
    color: #666;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-header h1 {
    margin: 0;
}

.site-header p {
    margin: 0.35rem 0 0;
}

main {
    padding-block: 1.5rem 3rem;
}

.search-panel {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid color-mix(
        in srgb,
        CanvasText 20%,
        transparent
    );
    border-radius: 0.5rem;
}

.search-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

input,
button,
.button {
    min-height: 2.6rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid color-mix(
        in srgb,
        CanvasText 30%,
        transparent
    );
    border-radius: 0.35rem;
    font: inherit;
}

input {
    width: 100%;
    background: Field;
    color: FieldText;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: ButtonFace;
    color: ButtonText;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.button:hover {
    filter: brightness(0.95);
}

.secondary {
    background: Canvas;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.results-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.results-count {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.9rem;
}

.sort-button {
    text-decoration: none;
    color: #0066cc;
    font-size: 0.95rem;
    font-weight: 600;
}

.sort-button:hover {
    text-decoration: underline;
}

.results-heading h2 {
    margin: 0;
}

.sort-button {
    text-decoration: none;
    color: #0066cc;
    font-size: 0.95rem;
    font-weight: 600;
}

.sort-button:hover {
    text-decoration: underline;
}

.table-container {
    margin-top: 0.75rem;
    overflow-x: auto;
    border: 1px solid color-mix(
        in srgb,
        CanvasText 20%,
        transparent
    );
    border-radius: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    padding: 0.7rem;
    border-bottom: 1px solid color-mix(
        in srgb,
        CanvasText 15%,
        transparent
    );
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: Canvas;
}

tbody tr:hover {
    background: color-mix(
        in srgb,
        CanvasText 5%,
        transparent
    );
}

td small {
    display: block;
    opacity: 0.7;
}

.empty-result {
    padding: 2rem;
    text-align: center;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* ---------- Show page navigation ---------- */

.show-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.show-navigation > div:last-child {
    text-align: right;
}

.disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* Stable column widths on the show playlist page */

.playlist-table {
    table-layout: fixed;
}

.playlist-table td:first-child {
    color: #777;
    font-weight: normal;
}

.playlist-table th:nth-child(1),
.playlist-table td:nth-child(1) {
    width: 2.5rem;
    text-align: left;
    padding-left: 0.75rem;
}

.playlist-table th:nth-child(2),
.playlist-table td:nth-child(2) {
    width: 35%;
}

.playlist-table th:nth-child(3),
.playlist-table td:nth-child(3) {
    width: auto;
}

.playlist-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {

    .page-width {
        width: min(100% - 1rem, 1500px);
    }

    .results-heading {
        display: block;
    }

    .show-navigation {
        grid-template-columns: 1fr 1fr;
    }

    .show-navigation > a {
        grid-column: 1 / -1;
        text-align: center;
    }
}

@media (max-width: 700px) {
    .page-width {
        width: min(100% - 1rem, 1500px);
    }

	.header-title-row {
		display: block;
	}

	.header-stats {
		margin-top: 0.35rem;
		white-space: normal;
	}
    .results-heading {
        display: block;
    }
}