/* SPDX-FileCopyrightText: © 2026 Christoph Görn <goern@b4mad.net> */
/* SPDX-License-Identifier: AGPL-3.0-or-later */

/* The stylesheet of the catalog and status pages (design D9, D12), the part that only
 * these pages need. Fonts, colours, the page frame (notice bar, header, footer, skip
 * link) and the dark theme come from /static/design.css, which is the bonn.biz tokens
 * plus design/theme.css. This file holds no colour literal and no font name: it reads
 * custom properties only. */

main {
  padding-bottom: var(--space-4);
}
.crumbs {
  margin: var(--space-5) 0 0;
  font: var(--text-small);
}
.crumbs + h1 {
  margin-top: var(--space-3);
}

.notice {
  background: var(--bg-info);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-left: 6px solid var(--status-notice);
  border-radius: var(--radius-md);
}

/* ---- Filter form ---- */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-4);
  background: var(--bg-section);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.filters h2 {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
  font: var(--text-h3);
  color: var(--text-heading);
}
.field label {
  display: block;
  font: var(--text-label);
  margin-bottom: var(--space-1);
}
.field select,
.field input {
  width: 100%;
  min-height: 44px;
  font: inherit;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--border-control);
  border-radius: var(--radius-md);
}
.actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}
button {
  font: var(--text-label);
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  background: var(--action-primary);
  color: var(--on-action);
  border: 2px solid var(--action-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
}
button:hover {
  box-shadow: var(--shadow-raised);
}

/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
  margin: var(--space-4) 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 44rem;
  background: var(--bg-card);
  font: var(--text-small);
  /* The page's `anywhere` would split short words like "unbekannt" in narrow columns. */
  overflow-wrap: break-word;
}
caption {
  text-align: left;
  font: var(--text-label);
  padding: var(--space-3) var(--space-3) var(--space-2);
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-3);
  border-bottom: 1px solid var(--line);
}
thead th {
  background: var(--bg-section);
  border-bottom: 2px solid var(--rule);
}
tbody th {
  font-weight: 400;
}
tbody tr:last-child > * {
  border-bottom: 0;
}

/* ---- Facts, chips, counts ---- */
.facts {
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) 1fr;
  gap: var(--space-3) var(--space-5);
}
.facts dt {
  font-weight: 700;
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 40rem) {
  .facts {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .facts dd {
    margin-bottom: var(--space-3);
  }
}

.chips,
.counts {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.chips li,
.counts li {
  background: var(--bg-info);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  font: var(--text-small);
}

/* ---- Pixel map of /status/ ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.pixelmap {
  position: relative;
  margin: var(--space-4) 0;
}
.pixels {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.px {
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid var(--px-edge);
  border-radius: 3px;
}
i.px {
  display: inline-block;
  vertical-align: -5px;
}
.px.ok {
  background: var(--px-ok);
}
.px.failing {
  background: var(--px-failing);
}
.px.warn {
  background: var(--px-warn);
}
.px.off {
  background: var(--px-off);
}
a.px:hover,
a.px:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
/* Detail text from the same string as the title attribute, kept inside the box so a phone does not scroll sideways. */
a.px:hover::after,
a.px:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 1;
  max-width: 100%;
  width: max-content;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-dark);
  color: var(--text-on-dark);
  box-shadow: var(--shadow-overlay);
  font: var(--text-small);
}
.legend {
  margin: var(--space-3) 0 0;
}
.legend .key {
  white-space: nowrap;
  margin-right: var(--space-3);
}
