@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap");

:root {
  --background: #fff;
  --ink: #111;
  --muted: color-mix(in srgb, var(--ink) 65%, transparent);
  --line: rgba(0, 0, 0, 0.12);
  --accent: #0072f5;
  --hover: color-mix(in srgb, var(--accent) 8%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #000;
    --ink: #ededed;
    --line: rgba(255, 255, 255, 0.145);
    --accent: #2488fa;
    --hover: color-mix(in srgb, var(--accent) 12%, transparent);
  }
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 10px 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font:
    14px/1.4 Inter,
    sans-serif;
}

main {
  width: calc(100% - 20px);
  max-width: 900px;
}

h1 {
  margin: 0 0 10px;
  font:
    500 16px/1.5 Inter,
    sans-serif;
  text-align: center;
}

#catalogue {
  position: relative;
  max-height: 95vh;
  overflow-y: scroll;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--background);
}

#search {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
  background: var(--background);
}

#search svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font:
    14px/1.4 Inter,
    sans-serif;
}

#search:focus-within {
  box-shadow: inset 0 0 0 1px var(--accent);
}

#search button {
  display: none;
  padding: 0;
  border: 0;
  background: transparent;
}

#search.has-value button {
  display: block;
}

#sentinel {
  height: 1px;
}

.dataset {
  border-bottom: 1px solid var(--line);
}

.dataset:last-child {
  border-bottom: 0;
}

.dataset a {
  display: flex;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  flex-direction: column;
  gap: 3px;
}

.dataset a:hover {
  background: var(--hover);
  color: color-mix(in srgb, var(--accent) 65%, transparent);
}

.dataset a:hover .name,
.dataset a:hover .page {
  color: var(--accent);
}

.dataset a:hover .meta, .dataset a:hover .format {
  color: color-mix(in srgb, var(--accent) 65%, transparent);
  stroke: color-mix(in srgb, var(--accent) 65%, transparent);
}

.top,
.meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.name {
  font:
    500 14px/1.4 Inter,
    sans-serif;
}

.page {
  font:
    14px/1.4 Inter,
    sans-serif;
}

.meta {
  color: var(--muted);
  font-size: 12px;
}

.format {
  width: 14px;
  height: 14px;
  stroke: var(--muted);
  stroke-width: 1.5;
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.availability {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}

.availability.available {
  background: color-mix(in srgb, var(--accent) 65%, transparent);
}
