/* ============================================
   ECX 30 - Menue-Panel (Mobil)
   Der Entwurf der Grafikerin hat fuer Mobil nur
   Bruchstuecke, deshalb ist das hier eigene
   Arbeit auf ihren Tokens.
   Sichtbar nur unter 900px.
   Alle Bedienelemente sind mindestens 44px hoch -
   das wird im Klinikalltag oft in Eile bedient,
   die Desktop-Masse sind fuer die Maus gedacht.
   ============================================ */

/* Burger: drei Balken, die sich zum X drehen. */
.ecx-burger {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 12px;
  flex: none;
}
.ecx-burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), top var(--dur) var(--ease);
}
.ecx-burger span:nth-child(1) { top: 0; }
.ecx-burger span:nth-child(2) { top: 5px; }
.ecx-burger span:nth-child(3) { top: 10px; }

.ecx-topbar__burger[aria-expanded="true"] .ecx-burger span:nth-child(1) {
  top: 5px;
  transform: rotate(45deg);
}
.ecx-topbar__burger[aria-expanded="true"] .ecx-burger span:nth-child(2) { opacity: 0; }
.ecx-topbar__burger[aria-expanded="true"] .ecx-burger span:nth-child(3) {
  top: 5px;
  transform: rotate(-45deg);
}

/* ============ Overlay ============ */
.ecx-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(14, 34, 55, .55);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.ecx-panel-overlay[hidden] { display: none; }
.ecx-panel-is-open .ecx-panel-overlay { opacity: 1; }

/* ============ Panel ============ */
.ecx-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  background: var(--ec-blue);
  color: #fff;
  box-shadow: var(--shadow-3);
  transform: translateX(100%);
  transition: transform var(--dur) var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ecx-panel[hidden] { display: none; }
.ecx-panel-is-open .ecx-panel { transform: translateX(0); }

/* Bis 480px nimmt das Panel die volle Breite ein. */
@media (max-width: 480px) {
  .ecx-panel { max-width: none; }
}

/* Die Adminleiste liegt fest oben, das Panel darf nicht darunter
   verschwinden. Unter 783px ist sie 46px hoch statt 32px. */
body.admin-bar .ecx-panel { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .ecx-panel { top: 46px; }
}

/* ============ Kopf ============ */
.ecx-panel__head {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
  border-bottom: 1px solid var(--dark-line);
  flex: none;
}
.ecx-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--r-md);
  color: #fff;
  background-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  transition: background var(--dur) var(--ease);
}
.ecx-panel__close:hover { background-color: rgba(255,255,255,.12); }

/* ============ Navigation ============ */
.ecx-panel__nav { flex: 1 1 auto; padding: 8px 0; }

.ecx-panel__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ecx-panel__item { border-bottom: 1px solid var(--dark-line-2); }

/* Punkte der obersten Ebene: Link und Aufklapp-Punkt gleich hoch. */
.ecx-panel__link,
.ecx-panel__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  color: #fff;
  background-color: transparent;
  border: 0;
  -webkit-appearance: none;
  appearance: none;
  text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
/* color: #fff wiederholt, sonst gewinnt das fremde a:hover - 10-base.css. */
.ecx-panel__link:hover,
.ecx-panel__trigger:hover { background-color: rgba(255,255,255,.06); color: #fff; }

.ecx-panel__link.ecx-is-active,
.ecx-panel__trigger.ecx-is-active { color: var(--ec-red); }

.ecx-panel__chevron {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform var(--dur) var(--ease);
}
.ecx-panel__trigger[aria-expanded="true"] .ecx-panel__chevron { transform: rotate(180deg); }

/* ============ Akkordeon-Inhalt ============ */
.ecx-panel__sub {
  padding: 4px 0 10px;
  background: rgba(0, 0, 0, .12);
}
.ecx-panel__sub[hidden] { display: none; }

/* Kind-Eintraege: gleiche Bausteine wie am Desktop, aber groessere
   Flaeche. 44px waere das Minimum, hier sind es 52px, weil zwei
   Textzeilen darin stehen. */
.ecx-panel__child {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 20px 10px 24px;
  color: #fff;
  text-decoration: none;
  transition: background var(--dur) var(--ease);
}
.ecx-panel__child:hover { background-color: rgba(255,255,255,.06); color: #fff; }
.ecx-panel__child > div { display: flex; flex-direction: column; }
.ecx-panel__child .ecx-ico {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--ec-red);
}
.ecx-panel__child span { font-size: 15px; font-weight: 500; line-height: 1.3; }
.ecx-panel__child .ecx-sub {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,.65);
  margin-top: 2px;
}
.ecx-panel__child.ecx-is-active > div > span:first-child { color: var(--ec-red); }

/* ============ Fuss ============ */
.ecx-panel__foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-top: 1px solid var(--dark-line);
}

.ecx-panel__lang {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.ecx-panel__lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: #fff;
  opacity: .65;
  text-decoration: none;
}
.ecx-panel__lang a.ecx-is-active { opacity: 1; }
.ecx-panel__lang span { opacity: .35; }

.ecx-panel__socials { display: flex; gap: 4px; }
.ecx-panel__socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  color: #fff;
  opacity: .85;
  transition: background var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.ecx-panel__socials a:hover { background: var(--ec-red); opacity: 1; }
.ecx-panel__socials a svg { width: 18px; height: 18px; }

/* Ab 900px gibt es das Panel nicht. Falls es beim Vergroessern des
   Fensters offen war, bleibt nichts stehen. */
@media (min-width: 900px) {
  .ecx-panel,
  .ecx-panel-overlay { display: none !important; }
}

/* Wer Bewegung reduziert haben moechte, bekommt keine. */
@media (prefers-reduced-motion: reduce) {
  .ecx-panel,
  .ecx-panel-overlay,
  .ecx-burger span,
  .ecx-panel__chevron,
  .ecx-panel__link,
  .ecx-panel__trigger,
  .ecx-panel__child {
    transition-duration: 0s;
  }
}
