/* Base + component layer.
 *
 * Component rules mirror the design system: square buttons (the only radius in
 * the system is 4px on form fields), 150ms ease-out motion limited to opacity
 * and a 4px translate, tabular numerals throughout.
 */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--eh-font);
  font-size: var(--eh-body);
  font-weight: 500;
  line-height: 1.7;
  color: var(--eh-slate);
  background: var(--eh-white);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}

/* Sticky action bar overlaps the footer on mobile without this. */
@media (max-width: 767px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  /* The bar is revealed on scroll, so the reserve is only owed while it is
     out. Left in place unconditionally when JS is absent — then it never hides. */
  .eh-js body:not(.eh-actionbar-on) { padding-bottom: 0; }
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--eh-navy);
  text-wrap: balance;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

/* Italic is reserved for the H1 and the CTA headline. Every other heading is
   upright — deliberate, so the italic marks the top of a page. */
h1 {
  font-style: italic;
  font-weight: 800;
  font-size: var(--eh-h1);
  line-height: 1.05;
  letter-spacing: -0.022em;
}

h2 { font-weight: 800; font-size: var(--eh-h2); }
h3 { font-weight: 800; font-size: var(--eh-h3); line-height: 1.3; }

/* German compounds are longer than any line this design has.
   "Maschinenraumautomatisierung" is one 28-character word, and at the mobile
   h1 size it measures roughly 470px against about 280px of usable width on a
   320px viewport — so it overflowed horizontally, with nothing to break it.

   `hyphens: auto` keys off the lang attribute, which every page already sets
   correctly (lang="de-DE" and so on), so German hyphenates at its own
   permitted points rather than anywhere. `overflow-wrap` is the fallback for
   a word the browser has no dictionary for.

   Deliberately NOT a per-language font-size override. That would fix today's
   longest word and leave the next one to be discovered in production, and it
   would give each locale a slightly different visual design for no reason.
   The measurements above were taken on German; Italian, checked at the same
   time, is within 6% of English on every page and shorter than it on the city
   pages. */
h1, h2, h3, h4 {
  overflow-wrap: break-word;
  hyphens: auto;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--eh-orange-deep); text-decoration: none; transition: color var(--eh-transition); }
a:hover { color: var(--eh-orange); }

img, svg { max-width: 100%; }
img { height: auto; }

ul, ol { margin: 0; padding: 0 0 0 1.1em; }

/* Visible focus everywhere — the designs only specify hover. */
:focus-visible {
  outline: var(--eh-focus);
  outline-offset: var(--eh-focus-offset);
}

.eh-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--eh-orange);
  color: var(--eh-white);
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 700;
}
.eh-skip:focus { left: 0; color: var(--eh-white); }

.eh-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */

.eh-shell { max-width: var(--eh-maxw); margin: 0 auto; }
.eh-pad   { padding-left: var(--eh-gutter); padding-right: var(--eh-gutter); }
.eh-section { padding-top: var(--eh-section-y); padding-bottom: var(--eh-section-y); }
.eh-mist  { background: var(--eh-mist); }
.eh-navy-bg { background: var(--eh-navy); color: var(--eh-on-dark-body); }
.eh-navy-bg h2, .eh-navy-bg h3 { color: var(--eh-white); }

/* ---------- Type helpers ---------- */

.eh-eyebrow {
  font-size: var(--eh-eyebrow);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--eh-orange);
  margin-bottom: 10px;
}
.eh-navy-bg .eh-eyebrow, .eh-on-dark .eh-eyebrow { color: var(--eh-on-dark-orange); }

.eh-lead { font-size: var(--eh-lead); font-weight: 500; line-height: 1.6; }
.eh-meta { font-size: var(--eh-meta); font-weight: 500; color: var(--eh-steel); }

/* ---------- Buttons ---------- */
/* Square, no radius, minimum 44px target. One orange button per screen. */

.eh-btn {
  display: inline-block;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 18px 28px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  text-align: center;
  transition: background-color var(--eh-transition), color var(--eh-transition),
              transform var(--eh-transition), opacity var(--eh-transition);
}
.eh-btn:active { transform: translateY(2px); }

.eh-btn--primary { background: var(--eh-orange); color: var(--eh-white); }
.eh-btn--primary:hover { background: var(--eh-orange-deep); color: var(--eh-white); }

.eh-btn--secondary { background: var(--eh-navy); color: var(--eh-white); }
.eh-btn--secondary:hover { background: var(--eh-ink); color: var(--eh-white); }

.eh-btn--tertiary {
  background: transparent;
  color: var(--eh-navy);
  border: 2px solid var(--eh-navy);
  padding: 16px 26px;
}
.eh-btn--tertiary:hover { background: var(--eh-navy); color: var(--eh-white); }

/* Tertiary on a dark surface */
.eh-btn--ghost {
  background: transparent;
  color: var(--eh-white);
  border: 2px solid var(--eh-on-dark-border-2);
  padding: 16px 26px;
}
.eh-btn--ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--eh-white); }

/* ---------- Chips ---------- */

.eh-chip {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 9px;
  background: var(--eh-navy);
  color: var(--eh-white);
}
.eh-chip--outline {
  background: transparent;
  color: var(--eh-navy);
  border: 1px solid var(--eh-line);
}
.eh-chip--on-dark {
  background: transparent;
  color: var(--eh-on-dark-chip);
  border: 1px solid var(--eh-on-dark-border-2);
  letter-spacing: 0.13em;
  padding: 7px 12px;
}

/* ---------- Data rows ---------- */
/* Label/value pairs rather than prose wherever a fact can be tabulated. */

.eh-rows { border-top: 2px solid var(--eh-navy); }
.eh-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--eh-line);
}
.eh-row__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--eh-steel);
  padding-top: 2px;
}
.eh-row__value { font-size: var(--eh-data-value); font-weight: 600; color: var(--eh-navy); }
.eh-row__value--prose { font-weight: 500; color: var(--eh-slate); line-height: 1.65; }

@media (max-width: 767px) {
  .eh-row { grid-template-columns: 1fr; gap: 6px; padding: 13px 0; }
}

/* ---------- Tables ---------- */

.eh-table { width: 100%; border-collapse: collapse; font-size: var(--eh-data-value); }
.eh-table th {
  background: var(--eh-navy);
  color: var(--eh-white);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-align: left;
  padding: 11px 14px;
}
.eh-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--eh-line);
  vertical-align: top;
}
.eh-table tbody tr:nth-child(even) { background: var(--eh-mist); }

.eh-table-scroll { overflow-x: auto; }

/* ---------- Photography slots ---------- */
/* Temporary. The image component falls back to this until photography lands. */

.eh-photo {
  position: relative;
  background: var(--eh-placeholder);
  border: 1px solid var(--eh-line);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  overflow: hidden;
  min-height: 200px;
}
.eh-photo__id {
  position: absolute;
  top: 18px;
  left: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--eh-steel);
}
.eh-photo__note {
  background: rgba(1, 32, 78, 0.92);
  padding: 18px 20px;
  max-width: 440px;
}
.eh-photo__note-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--eh-on-dark-orange);
  margin-bottom: 6px;
}
.eh-photo__note-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--eh-on-dark-chip);
}
.eh-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* min-height gives an *empty* slot presence. On a filled slot carrying an
   inline aspect-ratio it becomes the box's controlling dimension and derives
   the width from it — a 21/9 slot at min-height 200px demands 467px and
   overflows any narrower column. Drop it with the rest of the placeholder
   chrome. */
.eh-photo--filled { padding: 0; border: 0; min-height: 0; }

@media (max-width: 767px) {
  /* :not() is load-bearing. --filled clears the padding above, but this block
     comes later at equal specificity, so an unscoped .eh-photo re-applied the
     placeholder's mat to real photographs — on mobile only. */
  .eh-photo:not(.eh-photo--filled) { padding: 16px; min-height: 150px; }
  .eh-photo__note { padding: 12px 14px; }
  .eh-photo__note-text { font-size: 11.5px; }
}

/* ---------- Cards ---------- */

.eh-card {
  border: 1px solid var(--eh-line);
  background: var(--eh-white);
  display: flex;
  flex-direction: column;
  transition: transform var(--eh-transition), opacity var(--eh-transition);
}
.eh-card__body { padding: 28px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.eh-card__title { font-size: var(--eh-card-title); font-weight: 800; color: var(--eh-navy); line-height: 1.25; }
a.eh-card:hover { transform: translateY(-4px); }

@media (max-width: 767px) {
  .eh-card__body { padding: 17px; }
}

/* ---------- Breadcrumbs ---------- */

.eh-crumbs {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--eh-steel);
  padding: 14px 0;
}
.eh-crumbs a { color: var(--eh-steel); }
.eh-crumbs a:hover { color: var(--eh-orange-deep); }
.eh-crumbs__sep { padding: 0 8px; color: var(--eh-line); }

/* ---------- Forms ---------- */
/* 4px radius is the only radius in the system. */

.eh-field { display: flex; flex-direction: column; gap: 6px; }
.eh-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--eh-steel);
}
.eh-input, .eh-textarea, .eh-select {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--eh-navy);
  background: var(--eh-white);
  border: 1px solid var(--eh-line);
  border-radius: 4px;
  padding: 13px 14px;
  width: 100%;
  transition: border-color var(--eh-transition), box-shadow var(--eh-transition);
}
.eh-input:focus, .eh-textarea:focus, .eh-select:focus {
  outline: none;
  border: 2px solid var(--eh-orange);
  padding: 12px 13px; /* keep the box from shifting when the border thickens */
}
.eh-textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.eh-field--error .eh-input,
.eh-field--error .eh-textarea,
.eh-field--error .eh-select { border: 2px solid var(--eh-orange-deep); padding: 12px 13px; }
.eh-field__error { font-size: 11.5px; font-weight: 600; color: var(--eh-orange-deep); }

.eh-required { color: var(--eh-orange-deep); }

/* The honeypot. Hidden from people, reachable by bots. */
.eh-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; opacity: 0;
}

/* ---------- Utilities ---------- */

.eh-grid { display: grid; gap: 24px; }
.eh-grid--2 { grid-template-columns: repeat(2, 1fr); }
.eh-grid--3 { grid-template-columns: repeat(3, 1fr); }
.eh-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 979px) {
  .eh-grid--3, .eh-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .eh-grid { gap: 16px; }
  .eh-grid--2, .eh-grid--3, .eh-grid--4 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
