/* Additions for the pages this project maintains: About, Suggestions, Status.
 *
 * A separate file rather than an edit to css/style.css: that directory is
 * owned by www-data and not writable here. Loaded after style.css, so it
 * inherits every variable defined there. The CSP forbids inline <style>. */

/* The base stylesheet contains no media queries and sizes the site title at a
 * fixed 1.8rem, which is 37px wider than a 375px phone - so every page on the
 * site scrolls sideways on a handset. It matters most here, because the status
 * page exists to be read on one. css/style.css is owned by www-data and not
 * writable from the deploying account, so this is an override rather than a
 * fix at source; it applies to every page that loads pages.css, which is all
 * four of the pages this project maintains. */
@media (max-width: 480px) {
  .site-header {
    padding: 28px 0 22px;
  }

  .site-header h1 {
    font-size: 1.3rem;
    letter-spacing: 0;
    /* Belt and braces: on a 320px screen even 1.3rem is tight, and a title
     * that wraps is better than a document that scrolls sideways. */
    overflow-wrap: anywhere;
  }
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
}

.nav-btn {
  display: inline-block;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: border-color 0.15s, color 0.15s;
}

.nav-btn:hover,
.nav-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* Every page carries the same nav in the same order; the page you are on is
   marked rather than missing. A nav that reshuffles itself on every page makes
   the reader re-find their place each click. */
.nav-btn[aria-current="page"] {
  border-color: var(--accent-dim);
  color: var(--accent);
  pointer-events: none;
}

/* Hardware list on the About page. A <dl> in a grid: the label column sizes
 * to its content on wide screens and stacks on narrow ones. */
.spec-list {
  margin: 0;
  border-top: 1px solid var(--border);
}

.spec-list .spec {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.spec-list dt {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.spec-list dd {
  margin: 0;
  color: var(--text);
}

@media (max-width: 560px) {
  .spec-list .spec {
    grid-template-columns: 1fr;
  }
}

/* Body copy links, which the base stylesheet only styles inside .saves-list. */
main p a {
  color: var(--accent-dim);
}

main p a:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------- status
 * Built to be read on a phone held one-handed: one column, generous rows,
 * nothing that needs a horizontal scroll or a precise tap. */

.status-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.status-meta {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.summary {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.stale-warning {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--warn);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.5;
}

.status-list,
.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.status-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.status-item:first-child {
  border-top: 1px solid var(--border);
}

.status-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-name {
  font-weight: 600;
  /* A long server name wraps rather than pushing the state off the screen. */
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-state {
  margin-left: auto;
  flex: none;
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.is-offline .status-state {
  color: var(--text-dim);
}

.status-facts {
  margin-top: 5px;
  /* Lines up under the name, past the dot and its gap. */
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.event-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.event-when {
  flex: none;
  width: 68px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.event-what {
  min-width: 0;
  overflow-wrap: anywhere;
}

.event-item.sev-warn .event-what,
.event-item.sev-error .event-what {
  color: var(--warn);
}

.status-note {
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.6;
}

@media (max-width: 420px) {
  .event-item {
    flex-direction: column;
    gap: 2px;
  }

  .event-when {
    width: auto;
  }
}

/* The status page carries each server's address and collapsed saves now.
   The folds reuse .join-mods from the shared sheet; these only space them
   inside a status item. */
.status-item .addr-row { margin: 8px 0 0 20px; }
.status-item details.join-mods { margin: 8px 0 0 20px; }
.status-item .status-facts + .status-facts { margin-top: 2px; }
