:root {
  --background: #b6bfc12b;
  --card-background: #b6bfc13b;
  --navigation-color: #2531229d;
  --navigation-active: #253122;
  --text: #253122;
  --focus: #253122;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--background);
  color: var(--text);
  font-family: "Google Sans Flex", system-ui, sans-serif;
  font-optical-sizing: auto;
  line-height: 1.5;
  font-weight: 400;
}

button {
  font: inherit;
}

code {
  font-family: inherit;
}

.app-layout {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 20px;
  row-gap: 0;
  width: 100%;
  padding: 0 20px 12px 0;
}

.sidebar {
  width: 96px;
  align-self: start;
  padding-top: 0;
}

.page-title {
  margin: 0;
  color: inherit;
  font-size: 1.75rem;
  font-weight: 400;
}

.view-navigation {
  display: flex;
  flex-direction: column;
  width: 96px;
  gap: 0;
  padding: 0;
  border: 2px solid var(--navigation-color);
}

.view-button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 56px;
  padding: 4px;
  border: 0;

  border-radius: 0;
  background: transparent;
  color: var(--navigation-color);
  font-size: 1.1rem;
  font-weight: 400;
  cursor: pointer;
}

.view-button + .view-button {
  border-top: 2px solid var(--navigation-color);
}
.view-button[aria-pressed="true"] {
  border-color: var(--navigation-active);
  color: var(--navigation-active);
}

.view-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.container {
  width: 100%;
  max-width: 1100px;
  min-width: 0;
  justify-self: center;
  padding-top: 0;
}

.page-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 20px;
  margin-right: -20px;
  padding-right: 20px;
}

.back-button {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  width: 44px;
  height: 44px;
  margin-left: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  line-height: 1;
  cursor: pointer;
}

.back-button svg {
  display: block;
  margin: auto;
}
.header-content {
  grid-column: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  width: 100%;
  max-width: 1100px;
  min-height: 66px;
  padding: 12px 0;
  justify-self: center;
}

.page-header.is-selected {
  background-color: var(--selected-color);
  color: var(--header-text);
}

.page-header.is-selected #back-button {
  color: inherit;
  border-color: currentColor;
}

.page-header.is-selected #back-button:focus-visible {
  outline-color: currentColor;
}

.palette-card h2 {
  font-weight: 400;
}

.page-header p {
  margin: 0;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.palette-card {
  min-width: 0;
  padding: 12px;
  background-color: var(--card-background);
  border: 0;
  border-radius: 0;
}

.palette-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.color-card h2 {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.palette-colors {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.palette-colors::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  border: 1px solid var(--text);
  border-radius: 0;
  pointer-events: none;
}

.color-swatch {
  container-type: inline-size;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.color-swatch__preview {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.color-swatch:first-child .color-swatch__preview {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.color-swatch:last-child .color-swatch__preview {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.color-swatch__preview:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: -6px;
  box-shadow: inset 0 0 0 3px var(--focus);
}

.color-swatch__copy {
  max-width: 100%;
  margin-top: 8px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: clamp(0.65rem, 1vw, 0.85rem);
  font-size: min(clamp(0.65rem, 1vw, 0.85rem), 23cqi);
  cursor: pointer;
}

.color-swatch__copy:hover {
  text-decoration: underline;
}

.color-swatch__copy:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.pagination:not([hidden]) {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.pagination button {
  padding: 6px 14px;
  border: 1px solid var(--navigation-color);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--focus);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: default;
}

.pagination button:focus-visible,
#back-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.status:empty {
  display: none;
}

.status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: 8px 12px;
  border-radius: 0;
  background-color: var(--text);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.catalog-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.875rem;
}

.catalog-footer p {
  margin: 0;
}
@media (max-width: 720px) {
  .app-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 12px;
  }

  .sidebar {
    padding-top: 0;
  }
  .page-header {
    grid-template-columns: minmax(0, 1fr);
    margin-right: 0;
    padding-right: 0;
  }

  .header-content {
    grid-column: 1;
  }
  .page-header.is-selected {
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 12px;
  }

  .page-header.is-selected .header-content {
    grid-column: 2;
  }

  .back-button {
    margin-left: 0;
  }
  .catalog-footer {
    position: static;
    padding: 12px;
  }
}

/* Collection filters share the navigation's outlined, square appearance. */
.collection-filters {
  min-width: 0;
  margin: 40px 0 0;
  padding: 0 10px;
  border: 0;
}
#collection-filters {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.collection-filter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: .85rem;
  cursor: pointer;
}
.collection-filter input {
  appearance: none;
  display: block;
  width: 32px;
  height: 32px;
  margin: 0;
  border: 2px solid var(--navigation-color);
  border-radius: 0;
  background: transparent;
  color: var(--navigation-active);
  cursor: pointer;
}
.collection-filter input:checked {
  border-color: currentColor;
  background:
    linear-gradient(45deg, transparent 46%, currentColor 47% 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, currentColor 47% 53%, transparent 54%);
}
.collection-filter input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
.collection-filter input:disabled { cursor: wait; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 720px) {
  .sidebar { width: 100%; }
  .collection-filters { margin-top: 20px; padding: 0; }
  #collection-filters { flex-direction: row; gap: 24px; }
}
