/* ==========================================================================
   Error page (404 / 500 / anything else)
   Requires theme.css first.
   ========================================================================== */

.er-page {
  padding: 110px 0 var(--ims-section);
  background: var(--ims-paper);
}

/* ---- Head ---------------------------------------------------------------
   The status code is set large but low-contrast: it is the least useful
   thing on the page to a visitor, so it should not shout over the sentence
   that actually tells them what happened.
   ------------------------------------------------------------------------ */

.er-head {
  max-width: 620px;
  margin: 0 0 56px;
}

.er-code {
  margin: 0 0 10px;
  font-size: 92px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ims-surface-2);
}

.er-title {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--ims-ink);
}

.er-body {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ims-ink-soft);
}

.er-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

/* ---- Routes out ---------------------------------------------------------- */

.er-routes {
  padding-top: 34px;
  border-top: 1px solid var(--ims-rule);
}

.er-routes__title {
  margin: 0 0 24px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ims-ink);
}

.er-routes__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  list-style: none;
  background: var(--ims-rule);
}

.er-routes__cell {
  display: flex;
  margin: 0;
}

.er-route {
  display: flex;
  gap: 16px;
  width: 100%;
  padding: 22px 20px 24px;
  background: var(--ims-paper);
  text-decoration: none;
  transition: background 180ms ease;
}

.er-route:hover,
.er-route:focus {
  background: var(--ims-surface);
  text-decoration: none;
}

.er-route:focus-visible {
  outline: 2px solid var(--ims-brand);
  outline-offset: -2px;
}

.er-route__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 16px;
  color: var(--ims-brand);
  border: 1px solid var(--ims-rule);
}

.er-route__name {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ims-ink);
}

.er-route__body {
  display: block;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ims-ink-soft);
}

/* ---- Help line ---------------------------------------------------------- */

.er-help {
  margin: 34px 0 0;
  font-size: 15px;
  color: var(--ims-ink-soft);
}

/* ---- Breakpoints -------------------------------------------------------- */

@media (max-width: 767px) {
  .er-page { padding: 80px 0 var(--ims-section-sm); }

  .er-code  { font-size: 64px; }
  .er-title { font-size: 26px; }
  .er-body  { font-size: 15px; }

  .er-actions .ims-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .er-route { transition: none; }
}
