/* Custom Font Loading */
@font-face {
  font-family: 'New Rail Alphabet';
  src: url('../fonts/NewRailAlphabet-Black.woff2') format('woff2'),
       url('../fonts/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;
}

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 */
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #E6E6E6;
  padding: 1rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-info,
.header-links {
  flex: 1;
  min-width: 200px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 100%;
}

/* Language toggle */
.lang-toggle {
  display: inline-flex; /* flex for consistent spacing */
  gap: .3rem; /* adjust this to control DE/EN gap */
  margin-top: .25rem;
  text-align: right;
  font-weight: 700;
  align-items: baseline;
}
.lang-toggle.desktop-lang {
  position: absolute;
  top: 1rem; /* align to header padding top */
  right: 0;
  margin: 0;
}
.lang-toggle a {
  margin: 0; /* spacing controlled by flex gap */
  opacity: .4;
}
.lang-toggle a.active {
  opacity: 1;
}

.mobile-links {
  display: none;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4rem;
  margin-top: -1rem;
  line-height: 100%;
  /* padding-bottom: 1rem; */
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

section.services-section {
  padding-top: 4rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.service-category {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.category-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0;
  line-height: 100%;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.125rem 0;
  user-select: none;
  -webkit-user-select: none;
}

.checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-box {
  width: 20px;
  height: 20px;
  border: 2px solid #FF4500;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
  transform: translateY(-.5px);
}

/* Safari-specific adjustment - desktop Safari only
@media (min-width: 501px) {
  @supports (-webkit-hyphens: none) {
    .checkbox-box {
      transform: translateY(-.4px);
    }
  }
} */

/* Safari-specific adjustment - mobile Safari only */
/* @media (max-width: 500px) {
  @supports (-webkit-hyphens: none) {
    .checkbox-box {
      transform: translateY(-.5px);
    }
  }
} */

.checkbox-item input[type="checkbox"]:checked + .checkbox-box {
  background-color: #FF4500;
}

.checkbox-label {
  font-size: 1.5rem;
  font-weight: 700;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 1rem;
  font-weight: 700;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid #FF4500;
  border-radius: 4px;
  background: transparent;
  color: #FF4500;
  font-family: 'Neue Haas Grotesk Display Pro', -apple-system, Roboto, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  background-color: rgba(255, 69, 0, 0.05);
}

.selection-display {
  pointer-events: none;
  border-style: dashed;
  overflow: hidden;
  position: relative;
  contain: layout;
}

#yourSelectionText {
  display: inline-block;
  white-space: nowrap;
}

#yourSelectionText.scrolling {
  animation: scroll 12s linear infinite;
}

#yourSelectionText.scrolling::after {
  content: " • " attr(data-text);
}

@keyframes scroll {
  to {
    transform: translateX(-50%);
  }
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.submit-btn {
  width: 100%;
  padding: 0.5rem;
  border: 2px solid #FF4500;
  border-radius: 4px;
  background-color: #FF4500;
  color: #E6E6E6;
  font-family: 'New Rail Alphabet', -apple-system, Roboto, Helvetica, sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  opacity: 0.9;
}

.submit-btn:active {
  opacity: 0.8;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 4rem;
  padding-bottom: 1rem;
}

.footer-column {
  flex: 1;
  min-width: 250px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 110%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-column:last-child {
  justify-content: flex-end;
}

/* Footer layout helpers */
.footer-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.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;
}

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

/* Optional form hint */
.form-hint {
  font-size: 1rem;
  color: inherit;
}

/* 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) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .service-category:nth-child(1),
  .service-category:nth-child(2) {
    margin-bottom: .5rem;
  }
  .page-container {
    border-left: none;
    border-right: none;
  }
}

@media (max-width: 767px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  section.services-section {
    padding-top: 0rem;
  }

  .contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .header {
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #FF4500;
  }

  .header-links {
    display: none;
  }

  .mobile-links {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
    padding-top: 2rem;
  }

  .mobile-links .mobile-contact-links:first-child {
    flex: 1;
  }

  .mobile-contact-links p {
    line-height: 100%;
    margin: 0;
  }

  .mobile-lang.lang-toggle {
    text-align: right;
    margin-top: 0;
    gap: .6rem;
    flex-shrink: 0;
    align-self: flex-start;
    align-items: flex-start;
    line-height: 100%;
  }


  .services-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .service-category {
    margin-bottom: 1rem;
  }

  .category-title {
    font-size: 2rem;
  }

  .checkbox-box {
    width: 25px;
    height: 25px;
  }

  .checkbox-label {
    font-size: 2rem;
    line-height: 90%;
  }

  .submit-btn {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-column {
    min-width: 100%;
  }

  .footer {
    flex-direction: column;
  }

  /* Ensure footer columns order on mobile */
  .footer-left { order: 0; }
  .footer-right { order: 1; }

  /* Error page mobile styles - override desktop */
  .error-title {
    font-size: 2rem;
    line-height: 100%;
  }

  .error-home-link {
    font-size: 2rem;
    line-height: 100%;
  }
}

/* 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;
}

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

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

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

/* iOS: remove tap flash on taps */
html {
  -webkit-tap-highlight-color: transparent;
}