/* Font-URLs sind root-absolut (/assets/fonts/…), nicht relativ (../fonts/…).
   Aufgelöst werden sie gegen die Herkunft DIESER Datei — im Deployment also
   gegen den Asset-Host, der die style.css ausliefert (siehe src/lib/asset.ts).
   Ein fester Host darf hier nicht stehen: dieselbe CSS wird von Seiten auf
   verschiedenen Asset-Hosts genutzt. */
@font-face {
  font-family: DBHead;
  font-style: normal;
  font-weight: 200;
  src:
    url(/assets/fonts/dbhea02-webfont.woff) format("woff"),
    url(/assets/fonts/dbhea02-webfont.ttf) format("truetype");
  font-display: swap;
}
@font-face {
  font-family: DBHead;
  font-style: normal;
  font-weight: 300;
  src:
    url(/assets/fonts/dbhea03-webfont.woff) format("woff"),
    url(/assets/fonts/dbhea03-webfont.ttf) format("truetype");
  font-display: swap;
}
@font-face {
  font-family: DBHead;
  font-style: normal;
  font-weight: 700;
  src:
    url(/assets/fonts/dbhea07-webfont.woff) format("woff"),
    url(/assets/fonts/dbhea07-webfont.ttf) format("truetype");
  font-display: swap;
}

:root {
  --db-red: #ec0016;
  --db-red-hover: #c50014;
  --db-grey: #646973;
  --db-grey-lighter: #91949a;
  --db-text: #131821;
  --db-border: #e5e7eb;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--db-text);
  background: #fff;
  font-family:
    DBHead,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-weight: 300;
  line-height: 1.5;
  text-align: left;
}
a {
  color: var(--db-red);
}
a:hover,
a:focus {
  color: var(--db-red-hover);
}

/* ---- Maintenance (home) ---- */
.maintenance {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem 4rem;
}
/* Maße kommen pro Variante aus dem Content (logo.width / logo.headerHeight);
   [variant].astro setzt sie als Inline-Custom-Properties auf <body>. Die Werte
   hier sind die Defaults, falls eine Variante nichts angibt. */
.maintenance__logo {
  width: 100%;
  height: auto;
  max-width: var(--logo-width, 650px);
  margin-bottom: 3rem;
}
.maintenance__inner {
  max-width: 640px;
}
.maintenance__headline {
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 1.25rem;
}
.maintenance__pulse {
  display: block;
  width: 64px;
  height: 4px;
  background: var(--db-red);
  margin: 1.5rem auto 0;
  border-radius: 2px;
}
.maintenance__copy {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--db-grey);
  margin: 1.75rem auto 2.5rem;
  max-width: 520px;
}
.maintenance__contact-label {
  font-size: 0.95rem;
  color: var(--db-grey);
  margin: 0 0 0.5rem;
}
.contact-link {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--db-red);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.contact-link:hover,
.contact-link:focus {
  color: var(--db-red-hover);
}

/* ---- Content pages (imprint / privacy) ---- */
.site-header {
  border-bottom: 1px solid var(--db-border);
  padding: 1.25rem 1.5rem;
}
.site-header__center {
  max-width: 880px;
  margin: 0 auto;
}
.site-header__logo {
  display: inline-block;
}
.site-header__logo img {
  height: var(--logo-header-height, 44px);
  width: auto;
  max-width: 100%;
  display: block;
}

.content {
  flex: 1 0 auto;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  overflow-wrap: break-word;
}
.content h1 {
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 1.5rem;
}
.content h2 {
  font-weight: 700;
  font-size: 1.35rem;
  margin: 2.25rem 0 0.75rem;
}
.content h3 {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 1.75rem 0 0.5rem;
}
.content p {
  margin: 0 0 1rem;
}
.content ul {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}
.content li {
  margin: 0 0 0.4rem;
}
.content .lead {
  font-size: 1.15rem;
  color: var(--db-grey);
}
.content address {
  font-style: normal;
  margin: 0 0 1rem;
}
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  text-decoration: none;
}
.back-link::before {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.4em;
  vertical-align: -0.12em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5'/%3E%3Cpath d='M12 19l-7-7 7-7'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5'/%3E%3Cpath d='M12 19l-7-7 7-7'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

/* ---- Footer (shared) ---- */
.footer {
  flex-shrink: 0;
  border-top: 1px solid var(--db-border);
  padding: 1.75rem 1.5rem;
}
.footer__center {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer__menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.footer__menu a {
  color: var(--db-text);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer__menu a:hover,
.footer__menu a:focus {
  color: var(--db-red);
}
.footer__copyright {
  color: var(--db-grey);
  font-size: 0.9rem;
}
@media (max-width: 37.5rem) {
  .footer__center {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Logo über die Breite steuern, damit es auf schmalen Viewports nicht über
     den Rand ragt (breite Logos wie DB E&C sind bei fixer Höhe ~400px breit). */
  .site-header__logo {
    display: block;
  }
  .site-header__logo img {
    width: auto;
    height: auto;
    max-width: 13.75rem;
    max-height: var(--logo-header-height, 44px);
  }
}

/* ---- i18n (language toggle) ---- */
[hidden] {
  display: none !important;
}
[data-lang="de"] {
  display: none;
}
html.lang-de [data-lang="de"] {
  display: revert;
}
html.lang-de [data-lang="en"] {
  display: none;
}

/* Sprachauswahl liegt im normalen Fluss (kein fixed/sticky) — als Zeile über dem
   Logo. Sie scrollt einfach mit der Seite. */
.lang-switch {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 1rem 1.5rem 0;
  font-size: 0.85rem;
}
.lang-switch button {
  background: none;
  border: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--db-grey);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  line-height: 1;
}
.lang-switch button:hover {
  color: var(--db-text);
}
.lang-switch button[aria-pressed="true"] {
  color: var(--db-red);
  font-weight: 700;
}
.lang-switch span {
  color: #d1d5db;
}

[data-view="imprint"],
[data-view="privacy"] {
  display: none;
}
.site-header {
  display: none;
}

html.view-imprint [data-view="imprint"],
html.view-privacy [data-view="privacy"] {
  display: block;
}
html.view-imprint [data-view="home"],
html.view-privacy [data-view="home"] {
  display: none;
}
html.view-imprint .site-header,
html.view-privacy .site-header {
  display: block;
}

[data-view="imprint"]:target,
[data-view="privacy"]:target {
  display: block;
}

.content:focus {
  outline: none;
}
