/* Shared component source. Distribute with tests/sync_site_ui.ps1. */
:root {
  --navigation-font: bold 24px/1.25 Arial, sans-serif;
  --navigation-row-height: 42px;
  --navigation-icon-size: 28px;
  --section-gap: 16px;
  --text-panel-padding: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.top-heading .heading a,
.heading .logo-link {
  -webkit-user-select: none;
  user-select: none;
}

.top-line,
.page-heading,
.section-heading {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  background: var(--grey1);
}

:is(.top-line, .page-heading, .section-heading) > :is(h1, h2) {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: Arial, sans-serif;
  font-weight: bold;
  line-height: 32px;
  text-align: center;
  overflow-wrap: anywhere;
}

:is(.top-line, .page-heading, .section-heading) > h1 {
  font-size: 28px;
}

:is(.top-line, .page-heading, .section-heading) > h2,
.section-heading > h1 {
  font-size: 24px;
}

#toc, #settings-panel {
  box-sizing: border-box;
  background: var(--black);
  border: 4px solid var(--grey1);
  padding: 0;
  text-align: left;
}

@media (min-width: 800px) {
  #toc, #settings-panel {
    /* Preserve the existing gap only when a status bar reserves space. */
    --sidebar-bottom-gap: clamp(0px, var(--sidebar-footer-height, 0px), 16px);
    height: calc(var(--visual-viewport-height, 100dvh) - 64px - var(--sidebar-footer-height, 0px) - var(--sidebar-bottom-gap));
    margin-bottom: var(--sidebar-bottom-gap);
  }
}

#toc :is(ul, li, h1) {
  list-style: none;
  margin: 0;
  padding: 0;
}

#toc .toc-column + .toc-column,
#toc .toc-controls + .toc-column,
#toc .toc-controls-item + li,
#toc .toc-section-start,
#toc li:not(.toc-brand) + .toc-brand,
#toc .toc-brand + li:not(.toc-brand) {
  margin-top: var(--section-gap);
}

#toc :is(li a:not(:where(.toc-controls *)), .toc-button), #settings-panel .toc-button {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: var(--navigation-row-height);
  margin: 0;
  padding: 4px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--white);
  font: var(--navigation-font);
  text-align: left;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
}

#toc :is(li a:not(:where(.toc-controls *)), .toc-button):hover, #settings-panel .toc-button:hover {
  background: var(--grey1);
}

#toc :is(a, button) {
  color: var(--white);
}

#toc :is(a, button)[aria-current="page"],
#toc .button-on, #settings-panel .button-on {
  color: var(--color1);
}

#toc .icons, #settings-panel .icons {
  flex: 0 0 var(--navigation-icon-size);
  width: var(--navigation-icon-size);
  height: var(--navigation-icon-size);
  margin: 0;
  fill: currentColor;
}

#toc .toc-controls {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  margin: 0;
  /* Aligns 28px icons in 32px square buttons with row icons. */
  padding: 8px;
  border: 0;
  background: var(--black);
}

#toc :is(a, button):focus-visible, #settings-panel button:focus-visible {
  outline: 1px solid var(--color1);
  outline-offset: -1px;
}

#toc button:disabled, #settings-panel button:disabled {
  color: var(--grey2);
  cursor: default;
}

#toc :is(.toc-close-wrap, .toc-close),
#settings-panel :is(.toc-close-wrap, .settings-panel-close) {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 48px;
  margin: var(--section-gap) 0 0;
  padding: 0;
  background: var(--black);
}

body {
  position: relative;
  isolation: isolate;
}

:where(.standard, .padded, .home-feature):not(:where(.module-body, .updates)) {
  background-color: var(--black);
}

.updates {
  background: transparent;
}

.updates-pagination,
#updates-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  margin: 0 0 16px;
  background: var(--grey1);
  color: var(--white);
}

.updates .updates-pagination > :is(a, button),
#updates-pagination > :is(a, button) {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.updates-pagination > span,
#updates-pagination > span {
  white-space: nowrap;
}

.site-background {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
}

html.site-background-enabled :is(.site-background, .background-bitmap).background-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.invert-colors body > .site-background {
  filter: none;
}

.invert-colors body > .site-background.bitmap {
  filter: invert(1) hue-rotate(180deg);
}

html:not(.site-background-enabled) .background-bitmap {
  visibility: hidden;
}

.footer-socials .icons {
  fill: var(--white);
}

table:not(.table-cards) {
  --table-icon-size: 16px;
}

table:not(.table-cards) :is(.icons, .icons-small, .icon-small, .entry-metadata-icon, .external-link-icon) {
  flex: 0 0 var(--table-icon-size);
  width: var(--table-icon-size);
  height: var(--table-icon-size);
}

.overview-view-control {
  flex: none;
  margin: 0;
}

.overview-view-control button {
  color: var(--color1);
}

.overview-view-control .icons {
  fill: currentColor;
}

.overview-view-control button:focus-visible {
  outline: 4px solid var(--color1);
  outline-offset: 2px;
}

[data-overview] [data-overview-items][hidden],
[data-overview] [data-overview-table][hidden] {
  display: none;
}

[data-overview] [data-overview-content] {
  margin: 0;
  padding: 0;
  background: transparent;
}

[data-overview] .overview-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

[data-overview] .overview-items > li {
  min-width: 0;
  border: 4px solid var(--grey1);
  background: var(--black);
}

[data-overview] .overview-items > li:hover,
[data-overview] .overview-items > li:focus-within {
  background: var(--grey1);
}

[data-overview] .overview-items > li > :is(a, .overview-item-content) {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 16px;
  text-align: center;
}

[data-overview] .overview-item-label {
  min-width: 0;
  margin: 0;
  font-size: 22px;
  font-weight: normal;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

[data-overview] .overview-items .icons {
  flex: none;
  width: 96px;
  height: 96px;
  fill: var(--white);
}

[data-overview] .overview-logo {
  display: block;
  flex: none;
  width: min(100%, 180px);
  height: 96px;
  object-fit: contain;
}

[data-overview-view="list"] .overview-items {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px 32px;
  padding: var(--text-panel-padding);
  background: var(--black);
}

[data-overview-view="list"] .overview-items > li,
[data-overview-view="list"] .overview-items > li:hover,
[data-overview-view="list"] .overview-items > li:focus-within {
  border: 0;
  background: transparent;
}

[data-overview-view="list"] .overview-items > li > :is(a, .overview-item-content) {
  flex-direction: row;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  height: auto;
  padding: 0;
  text-align: left;
}

[data-overview-view="list"] .overview-items .icons {
  width: 32px;
  height: 32px;
}

[data-overview-view="list"] .overview-items .overview-logo {
  width: 96px;
  height: 32px;
}

[data-overview="artists"][data-overview-view="list"] .overview-items .icons {
  width: 96px;
}

[data-overview] .overview-table .overview-logo {
  width: auto;
  max-width: 100%;
  height: var(--table-icon-size);
}

[data-overview] .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

[data-overview] .table-scroll:has(> .overview-table) {
  border: 0 solid var(--grey1);
  border-left-width: 4px;
  border-right-width: 4px;
  padding: 0;
}

[data-overview] .table-scroll > .overview-table {
  border: 4px solid var(--grey1);
}

[data-overview] .table-scroll:has(> .overview-table) > .overview-table {
  border-left: 0;
  border-right: 0;
}

[data-overview] .overview-table :is(th, td) {
  border: 4px solid var(--grey1);
  padding: 6px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

[data-overview] .overview-table th[data-column-key="website"] {
  width: 40%;
}

[data-overview="software"] .overview-table th[data-column-key="website"],
[data-overview="hardware"] .overview-table th[data-column-key="website"] {
  width: 25%;
}

[data-overview] .overview-table th[data-column-key="vendor"] {
  width: 20%;
}

[data-overview] .overview-table th[data-column-key="use"] {
  width: 30%;
}

[data-overview="software"] .overview-table th[data-column-key="use"] {
  width: 25%;
}

[data-overview] .overview-table .overview-icon-column {
  width: 30px;
  text-align: center;
}

[data-overview="artists"] .overview-table .overview-icon-column {
  width: 100px;
}

[data-overview] .overview-icon-column .icons {
  margin: 0 auto;
  fill: var(--white);
}

[data-overview] .overview-icon-column .overview-logo {
  margin: 0 auto;
}

.external-link-tail {
  white-space: nowrap;
}

.external-link-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0;
  fill: currentColor;
  vertical-align: middle;
}

a:has(.external-link-icon):not(:has(img, svg:not(.external-link-icon))):hover {
  color: var(--black);
  background: var(--white);
}
