/* =====================================================
   Master Lawyer - Page not found styles
   Page: 404.html
   Namespace: .error-*
   Typography uses the role tokens from style.css (--font-display, --font-label,
   --font-body, --font-caption and their -weight / -stretch / -scale), so every
   font option in the customizer applies here too. Sizes are design sizes
   multiplied by the role scale and --screen-type.
   ===================================================== */

.error {
  --error-gold: var(--gold);
  --error-gold-text: #8a6420;
  --error-ink: #262626;
  --error-text: #5f5f5f;
  --error-muted: #706d67;
  --error-line: #e6e0d4;
  --error-soft: #f7f5f1;
  --error-ease: cubic-bezier(0.22, 1, 0.36, 1);

  padding: 80px 0 100px;
  background: #fff;
  font-family: var(--font-body);
  color: var(--error-text);
}

/* ---------- Message ---------- */

.error-main {
  max-width: 660px;
  margin: 0 auto 64px;
  text-align: center;
}

.error-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.12em;
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-stretch: var(--font-display-stretch);
  font-size: min(calc(240px * var(--font-display-scale) * var(--screen-type)), 40vw);
  line-height: 1;
  text-transform: var(--font-display-case);
  color: var(--error-ink);
  animation: error-rise 0.8s var(--error-ease) both;
}

.error-code__digit {
  display: block;
}

.error-code__mark {
  display: block;
  width: auto;
  height: 0.72em;
  animation: error-swing 1.1s 0.25s var(--error-ease) both;
}

.error-eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-label);
  font-weight: var(--font-label-weight);
  font-stretch: var(--font-label-stretch);
  font-size: calc(13px * var(--font-label-scale) * var(--screen-type));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--error-gold-text);
}

.error-title {
  margin: 0 0 14px;
  padding: 0;
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  font-stretch: var(--font-display-stretch);
  font-size: min(calc(50px * var(--font-display-scale) * var(--screen-type)), 10vw);
  line-height: 1.08;
  text-transform: var(--font-display-case);
  color: var(--error-ink);
}

.error-lead {
  margin: 0 0 34px;
  font-size: calc(17px * var(--font-body-scale) * var(--screen-type));
  line-height: 1.65;
}

@keyframes error-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes error-swing {
  from {
    opacity: 0;
    transform: rotate(-8deg) scale(0.92);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Search ---------- */

.error-search {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.error-search__label {
  display: block;
  margin: 0 0 10px;
  font-family: var(--font-label);
  font-weight: var(--font-label-weight);
  font-stretch: var(--font-label-stretch);
  font-size: calc(14px * var(--font-label-scale) * var(--screen-type));
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--error-ink);
}

.error-search__field {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid #cfc8ba;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.3s var(--error-ease), box-shadow 0.3s var(--error-ease);
}

.error-search__field:focus-within {
  border-color: var(--error-gold);
  box-shadow: 0 0 0 4px rgb(var(--gold-rgb) / 20%);
}

.error-search__icon {
  position: absolute;
  top: 50%;
  left: 18px;
  font-size: 20px;
  color: var(--error-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.error-search__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 56px;
  padding: 0 14px 0 50px;
  border: 0;
  border-radius: 10px 0 0 10px;
  background: transparent;
  font-family: var(--font-body);
  font-size: calc(16px * var(--font-body-scale) * var(--screen-type));
  color: var(--error-ink);
}

.error-search__input::placeholder {
  color: #767676;
}

.error-search__input:focus,
.error-search__input:focus-visible {
  outline: none;
}

.error-search__submit {
  flex: none;
  margin: 5px;
  padding: 0 26px;
  border: 0;
  border-radius: 7px;
  background: var(--error-gold);
  font-family: var(--font-label);
  font-weight: var(--font-label-weight);
  font-stretch: var(--font-label-stretch);
  font-size: calc(15px * var(--font-label-scale) * var(--screen-type));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  cursor: pointer;
  transition: background-color 0.3s var(--error-ease), color 0.3s var(--error-ease);
}

.error-search__submit:hover {
  background: #000;
  color: #fff;
}

.error-search__submit:focus-visible {
  outline: 2px solid var(--error-ink);
  outline-offset: 2px;
  border-radius: 7px;
}

/* ---------- Popular pages ---------- */

.error-links {
  max-width: 1000px;
  margin: 0 auto;
}

.error-links__title {
  margin: 0 0 18px;
  padding: 0;
  font-family: var(--font-label);
  font-weight: var(--font-label-weight);
  font-stretch: var(--font-label-stretch);
  font-size: calc(14px * var(--font-label-scale) * var(--screen-type));
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  color: var(--error-muted);
}

.error-links ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.error-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 24px 24px;
  border: 1px solid var(--error-line);
  border-radius: 10px;
  background: #fff;
  color: var(--error-text);
  text-decoration: none;
  transition: transform 0.45s var(--error-ease), border-color 0.45s var(--error-ease), background-color 0.45s var(--error-ease);
}

.error-link .ico {
  margin-bottom: 16px;
  font-size: 30px;
  line-height: 1;
  color: var(--error-gold);
  transition: transform 0.45s var(--error-ease);
}

.error-link__name {
  margin-bottom: 4px;
  font-family: var(--font-label);
  font-weight: var(--font-label-weight);
  font-stretch: var(--font-label-stretch);
  font-size: calc(19px * var(--font-label-scale) * var(--screen-type));
  line-height: 1.25;
  color: var(--error-ink);
}

.error-link__text {
  font-size: calc(14px * var(--font-body-scale) * var(--screen-type));
  line-height: 1.5;
}

.error-link:hover {
  border-color: var(--error-gold);
  background: var(--error-soft);
  transform: translateY(-4px);
}

.error-link:hover .ico {
  transform: translateY(-2px);
}

.error-link:focus-visible {
  border-radius: 10px;
}

.error-help {
  margin: 40px 0 0;
  font-size: calc(15px * var(--font-body-scale) * var(--screen-type));
  text-align: center;
}

.error-help a {
  color: var(--error-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--error-gold);
  text-underline-offset: 3px;
  transition: color 0.3s var(--error-ease);
}

.error-help a:hover {
  color: var(--error-gold-text);
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
  .error-links ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575px) {
  .error {
    padding: 48px 0 70px;
  }

  .error-main {
    margin-bottom: 48px;
  }

  .error-search__submit {
    padding: 0 16px;
  }

  .error-links ul {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .error-link {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 16px;
    align-items: center;
    padding: 18px 20px;
  }

  .error-link .ico {
    grid-row: span 2;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .error-code,
  .error-code__mark {
    animation: none;
  }

  .error-search__field,
  .error-search__submit,
  .error-link,
  .error-link .ico {
    transition: none;
  }

  .error-link:hover,
  .error-link:hover .ico {
    transform: none;
  }
}
