/* Custom Font Loading */
@font-face {
  font-family: 'New Rail Alphabet';
  src: url('../fonts/subset-NewRailAlphabet-Black.woff2') format('woff2'),
       url('../fonts/subset-NewRailAlphabet-Black.woff') format('woff');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'New Rail Alphabet', -apple-system, Roboto, Helvetica, sans-serif;
  background-color: #E6E6E6;
  color: #FF4500;
  line-height: 100%;
}

.page-container {
  min-height: 100vh; /* fallback for older browsers */
  min-height: 100dvh; /* dynamic viewport height - adjusts with UI bars */
  display: flex;
  justify-content: center;
  max-width: 948px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content-wrapper {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  min-height: 100%; /* avoid double viewport height */
}

/* Error page styles */
.error-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.error-header {
  padding: 1rem 0rem 0rem 0rem;
}

.error-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 100%;
  margin: 0;
}

.error-home-link {
  font-size: 1rem;
  font-weight: 700;
  line-height: 100%;
  display: inline-block;
  margin-top: 0.25rem;
  color: inherit;
  text-decoration: none;
}

.error-home-link:hover {
  color: inherit;
  text-decoration: none;
}

.error-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 4rem; /* standard gap */
  padding-bottom: 1rem; /* match footer spacing */
}

.motto-box {
  display: flex;
  padding: 4px 6px;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  flex: 1 0 0;
  align-self: stretch;
  border-radius: 4px;
  border: 2px solid #FF4500;
  font-weight: 700;
}

.error-main .motto-box {
  flex: 1; /* expand to fill available space */
}

.motto-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.motto-row span {
  font-size: 1rem;
  font-weight: 700;
  line-height: 100%;
}

/* Link styling */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: inherit;
  text-decoration: none;
}

@media (min-width: 948px) {
  .page-container {
    border-left: 2px solid #FF4500;
    border-right: 2px solid #FF4500;
  }
}

@media (max-width: 947px) {
  .page-container {
    border-left: none;
    border-right: none;
  }
}

@media (max-width: 500px) {
  .page-container {
    padding: 0 1rem;
  }

  /* Error page mobile overrides (late to win) */
  .error-title,
  .error-home-link {
    font-size: 2rem;
    line-height: 100%;
  }
}
