:root {
 --album: 256px;
 --album-grid: calc(var(--album)/1.75);
}

body {
 margin: 0;
 height: 100vh;
 width: 100vw;
 display: flex;
 flex-direction: row;
 overflow: hidden;
 image-rendering: unset;
}

main {
 height: 100vh;
 overflow-y: scroll;
}

aside {
 word-break: break-word;
 padding: 1rem;
 text-align: center;
 width: calc(var(--album) + mod(100vw - (var(--album) + 2rem), var(--album-grid)));
 flex-grow: 1;
 position: relative;
}

section {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(var(--album-grid), 1fr));
 grid-auto-rows: minmax(var(--album-grid), 1fr);
}

section img {
 width: 100%;
 aspect-ratio: 1 / 1;
 display: block;
 object-fit: cover;
}

aside img {
 width: var(--album);
 height: var(--album);
 margin-top: 0.5rem;
}

a { color: inherit; }

#display-artist, #display-album { font-size: 180%; }
#display-artist { font-weight: bold; }
#display-fav::before { content: "fav track: "}

button {
 display: block;
 position: absolute;
 top: 0.5rem; left: 0.5rem;
 background: var(--background);
 margin: 0;
 font-size: smaller;
}

main, nav, section { width: 100%; }
nav {
 display: flex;
 flex-direction: row;
}
input { flex-grow: 1; }
input, select {
 display: inline-block;
 margin: 0.5rem;
}

@media only screen and (max-width: 600px) {
 body:has(aside:not([style*="display: none"])) nav { flex-direction: column; }
}

@media only screen and (max-width: 400px) {
 nav { flex-direction: column; }
 body:has(aside:not([style*="display: none"])) main { display: none }
 :root {
  --album: 50vw;
  --album-grid: var(--album);
 }
 aside { --album: 75vw; }
}
