/* Coss color roles and control treatment, with native links and the catalog's type pairing. */
:root {
  --primary: #262626;
  --primary-foreground: #fafafa;
  --secondary: #f5f5f5;
  --secondary-foreground: #404040;
  --accent: #f5f5f5;
  --favorite: oklch(0.66482 0.12966 3.585);
  --favorite-muted: oklch(0.97847 0.01102 3.488);
  --favorite-border: oklch(0.90280 0.03060 357.133);
  --browse-foreground: oklch(0.57639 0.03062 156.817);
  --browse-muted: oklch(0.96628 0.00580 153.775);
  --browse-border: oklch(0.91235 0.01423 155.569);
  --ring: #a3a3a3;
  --radius-md: 8px;
  --radius-lg: 12px;
}
.site-header {
  display: block;
  height: auto;
  min-height: 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.site-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  min-height: 96px;
}
.site-header .wordmark {
  justify-self: start;
  align-self: center;
  gap: 11px;
  font-size: 25px;
  letter-spacing: -.6px;
  font-weight: 500;
  min-height: 44px;
}
.site-header .brand-mark {
  width: 35px;
  height: 35px;
  border-radius: var(--radius-md);
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--input);
  box-shadow: var(--shadow);
}
.site-header .primary-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}
.site-header .primary-nav a {
  justify-content: center;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s ease;
}
.site-header .primary-nav a::after { display: none; }
.site-header .primary-nav a:hover { color: var(--foreground); }
.site-header .primary-nav a.active {
  color: var(--foreground);
  background: transparent;
  box-shadow: none;
}
.site-header .primary-nav a.active::after {
  display: block;
  bottom: 2px;
  height: 1px;
  background: currentColor;
}
.site-header .header-favorites {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 8px;
  padding: 8px 13px;
  margin: 0;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 500;
}
.site-header .header-favorites:hover,
.site-header .header-favorites.active { background: var(--favorite-muted); border-color: var(--favorite-border); }
.site-header .header-favorites > svg { color: var(--favorite); fill: none; }
.site-header .header-favorites:has(.nav-favorites-count:not([hidden])) > svg { fill: currentColor; }
.site-header .nav-favorites-count { color: var(--secondary-foreground); background: var(--favorite-muted); border-color: var(--favorite-border); font-size: 10px; min-width: 20px; height: 20px; }
.site-header a:focus-visible, .site-footer a:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
.site-footer {
  display: block;
  padding: 0;
  min-height: 0;
  color: var(--foreground);
  background: var(--background);
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.footer-directory {
  display: grid;
  grid-template-columns: 1.2fr .8fr 1.2fr .9fr;
  gap: 60px;
  padding-block: 56px 48px;
}
.footer-wordmark {
  display: inline-block;
  font-family: var(--font-catalog);
  font-size: 42px;
  font-weight: 450;
  line-height: .98;
  letter-spacing: -.6px;
}
.footer-identity p { color: var(--muted-foreground); font-size: 12px; margin-top: 21px; }
.footer-directory h2 { font: 600 12px/1.5 var(--font-ui); margin: 1px 0 16px; }
.footer-directory ul { list-style: none; margin: 0; padding: 0; }
.footer-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px;
  color: var(--muted-foreground);
  line-height: 1.5;
  width: fit-content;
  max-width: 100%;
}
.footer-links a:hover { color: var(--foreground); text-decoration: underline; text-underline-offset: 4px; }
.footer-collections a { width: 100%; }
.footer-count { font-size: 10px; font-variant-numeric: tabular-nums; color: var(--muted-foreground); flex-shrink: 0; }
.footer-years ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 200px; }
.footer-years a {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--background);
  box-shadow: var(--shadow);
  color: var(--secondary-foreground);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.footer-years a:hover,
.footer-years a[aria-current] { background: var(--browse-muted); border-color: var(--browse-border); color: var(--secondary-foreground); }
.footer-years a[aria-current] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; font-weight: 600; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-block: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 11px;
}
.back-to-top { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.back-to-top svg { transform: rotate(-90deg); }
@media (max-width: 1100px) {
  .site-header-inner { gap: 20px; }
  .site-header .wordmark { font-size: 23px; }
  .site-header .primary-nav { gap: 24px; }
  .footer-directory { gap: 36px; grid-template-columns: 1fr .8fr 1.2fr .85fr; }
}
@media (max-width: 800px) {
  .site-header-inner { grid-template-columns: 1fr auto; gap: 14px 20px; padding-block: 20px 16px; }
  .site-header .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-self: start; width: auto; order: initial; }
  .site-header .header-favorites { grid-column: 2; grid-row: 1; }
  .footer-directory { grid-template-columns: 1fr 1fr; gap: 36px 48px; padding-block: 40px; }
  .footer-identity { grid-column: 1; }
  .footer-collections { grid-column: 1; grid-row: 2; }
  .footer-years { grid-column: 2; grid-row: 2; }
  .footer-wordmark { font-size: 38px; }
}
@media (max-width: 480px) {
  .site-header-inner { padding-top: 16px; gap: 15px 10px; }
  .site-header .wordmark { font-size: 22px; gap: 8px; }
  .site-header .brand-mark { display: none; }
  .site-header .primary-nav { justify-self: start; gap: 28px; }
  .site-header .primary-nav a { flex: none; padding-inline: 0; }
  .site-header .header-favorites { padding-inline: 10px; gap: 6px; font-size: 11px; }
  .footer-directory { gap: 30px 28px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .footer-wordmark { font-size: 34px; }
  .footer-identity p { font-size: 11px; max-width: 16ch; line-height: 1.6; margin-top: 15px; }
  .footer-links a { font-size: 12px; }
  .footer-directory h2 { font-size: 11px; margin-bottom: 12px; }
  .footer-count { display: none; }
  .footer-years ul { gap: 8px; }
  .footer-years a { padding-inline: 8px; }
  .footer-bottom { gap: 12px; font-size: 10px; padding-block: 13px; }
}

/* Color describes an action or a selected state; shape and labels carry the same meaning. */
.favorite-button { color: var(--favorite); }
.favorite-detail > svg { color: var(--favorite); }
.favorite-button:hover,
.favorite-button[aria-pressed="true"] {
  color: var(--favorite);
  background: var(--favorite-muted);
  border-color: var(--favorite-border);
}
.favorite-detail:hover,
.favorite-detail[aria-pressed="true"] {
  color: var(--secondary-foreground);
  background: var(--favorite-muted);
  border-color: var(--favorite-border);
}
.active-filters .tag {
  color: var(--secondary-foreground);
  background: var(--browse-muted);
  border-color: var(--browse-border);
}
.view-switch a.selected, .text-link { color: var(--browse-foreground); }
.search-field:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }

@media print { .site-header, .site-footer { display: none; } }
