/* ==========================================================================
   Internationale Gesellschaft für Mayr-Medizin — Header (eigenständig)
   Auszug aus igmm-design-system.css für Seiten mit altem Template (de/ …).
   Alle Tokens und Regeln sind auf .ds-header gescopet, damit das alte
   Template (Bootstrap/Polo) nicht beeinflusst wird.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Nunito:wght@300;400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
.ds-header {
  --font-ui: 'Roboto', sans-serif;
  --font-logo: 'Nunito', sans-serif;

  --text-xs: 14px;
  --text-micro: 11px;
  --tracking-caps: 0.16em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-10: 40px;

  --container-max: 1240px;
  --container-pad: 40px;
  --header-height: 78px;

  --radius-sm: 4px;
  --radius-md: 6px;

  --ease-out: cubic-bezier(0.2, 0.8, 0.3, 1);
  --duration-fast: 120ms;

  --color-surface-raised: #FFFFFF;
  --color-surface-active: #F1E8DC;
  --color-border-subtle: #E4D9CA;
  --color-border-strong: #DCCEBB;
  --color-text-primary: #1A1511;
  --color-text-secondary: #55483C;
  --color-text-muted: #6B5844;
  --color-accent: #D2814A;
  --color-accent-contrast: #FFFFFF;
  --overlay-header: rgba(251, 248, 244, 0.93);
}

/* --------------------------------------------------------------------------
   Basis innerhalb des Headers (überschreibt Bootstrap-Defaults)
   -------------------------------------------------------------------------- */
.ds-header,
.ds-header *,
.ds-header *::before,
.ds-header *::after { box-sizing: border-box; }

.ds-header {
  font-family: var(--font-ui);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
.ds-header a,
.ds-header a:hover,
.ds-header a:focus { text-decoration: none; }
.ds-header button { font: inherit; color: inherit; }
.ds-header img { max-width: none; }

.ds-header .ds-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-pad);
}

/* --------------------------------------------------------------------------
   Logo-Wortmarke
   -------------------------------------------------------------------------- */
.ds-header .ds-logotype { display: flex; flex-direction: column; line-height: 1.15; }
.ds-header .ds-logotype__sub {
  font-family: var(--font-logo);
  font-size: 14px;
  line-height: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.ds-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--overlay-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-strong);
}

/* style.css setzt "body #wrapper { overflow-x: hidden }" – das macht #wrapper
   zum Scroll-Container und hebelt position: sticky aus. "clip" schneidet
   ebenfalls horizontal ab, erzeugt aber keinen Scroll-Container. */
html body #wrapper { overflow-x: clip; }

.ds-header__inner { display: flex; align-items: center; gap: var(--space-10); height: 100%; }
.ds-header__brand { display: flex; align-items: center; gap: var(--space-3); cursor: pointer; flex-shrink: 0; }
.ds-header__logo { height: 46px; width: auto; display: block; }
.ds-header__actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
.ds-header__collapse { display: flex; align-items: center; gap: var(--space-10); }
.ds-header .ds-ml-auto { margin-left: auto; }

/* Mobile-Menü-Toggle (Hamburger) — auf Desktop ausgeblendet */
.ds-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.ds-nav__toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-text-primary);
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
}
.ds-nav__toggle[aria-expanded="true"] .ds-nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ds-nav__toggle[aria-expanded="true"] .ds-nav__toggle-bar:nth-child(2) { opacity: 0; }
.ds-nav__toggle[aria-expanded="true"] .ds-nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.ds-nav { display: flex; align-items: center; gap: var(--space-1); }

.ds-header .ds-nav__item {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
  cursor: pointer;
}
.ds-header .ds-nav__item:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-active);
}
.ds-header .ds-nav__item[aria-current] {
  color: var(--color-text-primary);
  background: var(--color-surface-active);
}

.ds-nav__dropdown { position: relative; }
.ds-nav__dropdown > .ds-nav__item::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  margin-bottom: 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.6;
  transform: rotate(45deg);
}
.ds-nav__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  margin-top: 6px;
  padding: var(--space-2);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px rgba(60, 42, 28, 0.14);
  z-index: 50;
}
/* Unsichtbare "Brücke" über den 6px-Abstand zwischen Menüpunkt und Dropdown,
   damit der :hover-Zustand beim Rüberfahren mit der Maus nicht abreißt. */
.ds-nav__dropdown-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -6px;
  height: 6px;
}
.ds-nav__dropdown:hover > .ds-nav__dropdown-menu,
.ds-nav__dropdown:focus-within > .ds-nav__dropdown-menu {
  display: block;
}
.ds-header .ds-nav__dropdown-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.ds-header .ds-nav__dropdown-menu a:hover {
  color: var(--color-text-primary);
  background: var(--color-surface-active);
}

/* Untermenü-Toggle für Touch-Bedienung — auf Desktop ausgeblendet */
.ds-nav__dropdown-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.ds-nav__dropdown-toggle::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--duration-fast) var(--ease-out);
}
.ds-nav__dropdown-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }

/* Kleines Hinweis-Label im Menü (z. B. „NEU") */
.ds-header__badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  vertical-align: 1px;
}

/* --------------------------------------------------------------------------
   Sprachumschalter
   -------------------------------------------------------------------------- */
.ds-lang__flag { height: 16px; width: auto; display: inline-block; vertical-align: middle; border: 1px solid var(--color-border-subtle); }
.ds-lang .ds-nav__dropdown-menu { left: auto; right: 0; min-width: 160px; }
.ds-header .ds-lang .ds-nav__dropdown-menu a { display: flex; align-items: center; gap: var(--space-2); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
/* Breakpoint höher als im Design-System (900px), weil der de-Header vier
   Menüpunkte plus Sprachwahl trägt. Wert muss zum Script in de/_header_de.ascx passen. */
@media (max-width: 1080px) {
  .ds-nav__toggle { display: flex; margin-left: auto; }
  .ds-header__collapse {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background: var(--color-surface-raised);
    border-bottom: 1px solid var(--color-border-strong);
    box-shadow: 0 16px 32px rgba(60, 42, 28, 0.14);
    padding: var(--space-2) var(--container-pad) var(--space-6);
  }
  .ds-header__collapse.is-open { display: flex; }

  .ds-nav { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .ds-header .ds-nav__item { width: 100%; padding: 13px 4px; }

  .ds-nav__dropdown { display: flex; flex-wrap: wrap; align-items: center; }
  .ds-header .ds-nav__dropdown > .ds-nav__item { width: auto; flex: 1 1 auto; min-width: 0; }
  .ds-nav__dropdown > .ds-nav__item::after { display: none; }
  .ds-nav__dropdown-toggle { display: flex; }
  .ds-nav__dropdown-menu,
  .ds-lang .ds-nav__dropdown-menu {
    display: none;
    position: static;
    flex-basis: 100%;
    min-width: 0;
    margin-top: 0;
    padding: 0 0 var(--space-2) var(--space-4);
    background: transparent;
    border: none;
    box-shadow: none;
  }
  .ds-nav__dropdown-menu::before { display: none; }
  /* Auf Mobile steuert ausschließlich die is-open-Klasse (per JS) das Auf-/Zuklappen —
     :hover/:focus-within würde das Menü sonst beim Antippen offen "festhalten". */
  .ds-nav__dropdown:hover > .ds-nav__dropdown-menu,
  .ds-nav__dropdown:focus-within > .ds-nav__dropdown-menu {
    display: none;
  }
  .ds-nav__dropdown.is-open > .ds-nav__dropdown-menu { display: block; }

  .ds-header__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-subtle);
  }
}

/* Sehr schmale Viewports: Marke darf schrumpfen/umbrechen, damit der
   Hamburger-Button nicht über den rechten Seitenrand geschoben wird. */
@media (max-width: 400px) {
  .ds-header__inner { gap: var(--space-3); }
  .ds-header__brand { flex-shrink: 1; min-width: 0; }
  .ds-header__brand .ds-logotype { min-width: 0; }
  .ds-nav__toggle { flex-shrink: 0; }
}

@media (max-width: 640px) {
  .ds-header { --container-pad: 20px; }
}
