/* ==========================================================================
   Legal Center
   ========================================================================== */

/* --- Hero ---------------------------------------------------------------- */
.lg-hero { position: relative; background: transparent; }
.lg-hero__inner {
  position: relative;
  z-index: 1;
  padding-block: 80px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.lg-hero__title { display: flex; flex-direction: column; align-items: flex-start; }
.lg-hero__glow {
  left: 82%;
  top: 60px;
  width: 620px;
  height: 700px;
  --glow-rot: -18deg;
  --glow-dur: 33s;
  --glow-delay: -24s;
  opacity: .8;
}
.lg-hero__note {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* --- Dokumente ----------------------------------------------------------- */
.lg-docs { position: relative; background: transparent; }
.lg-docs__inner { position: relative; z-index: 1; padding-block: 24px 80px; }

/* Betriebsmodell-Umschalter. Fährt auf der `[data-tabs]`-Mechanik aus app.js,
   die die Panels über das `hidden`-Attribut schaltet. */
.lg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
  padding-bottom: 2px;
}
.lg-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 18px;
  color: rgba(0, 0, 0, .55);
  transition: color .15s ease;
}
.lg-tab img { width: 20px; height: 20px; object-fit: contain; opacity: .55; transition: opacity .15s ease; }
.lg-tab:hover { color: var(--black); }
.lg-tab:hover img { opacity: .8; }
.lg-tab.is-active { color: var(--blue-main); font-weight: 600; }
.lg-tab.is-active img { opacity: 1; }
/* Der Indikator sitzt auf der Trennlinie der Leiste, nicht darüber. */
.lg-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 4px;
  background: var(--blue-main);
  border-radius: 2px;
}

/* Ohne geöffnetes Dokument ist die Liste auf die Breite der übrigen
   Rechtsseiten begrenzt — über die volle 1440er-Spalte gezogen stünden
   Dokumentname und Aktionsicons zu weit auseinander, um noch als eine Zeile
   gelesen zu werden. Sobald rechts gelesen wird, rückt sie auf 380px zusammen. */
.lg-layout { display: flex; align-items: flex-start; gap: 24px; }
.lg-side { width: 900px; max-width: 100%; transition: width .3s ease; }
.lg-layout.is-reading .lg-side { width: 380px; flex: none; }
.lg-layout.is-reading .lg-doc__name { font-size: 14px; }

.lg-panel { display: flex; flex-direction: column; gap: 40px; margin-top: 40px; }

/* --- Leseansicht --------------------------------------------------------- */
.lg-viewer {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  margin-top: 40px;
  border: 1px solid #e6edf8;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 0 13px rgba(0, 0, 0, .09);
  overflow: hidden;
}
.lg-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid #e6edf8;
  background: #f8fafd;
}
.lg-viewer__title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--blue-dark-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lg-viewer__acts { display: flex; align-items: center; gap: 2px; flex: none; }
.lg-viewer__body { position: relative; }
.lg-viewer__body iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 260px);
  min-height: 520px;
  border: 0;
  background: var(--white);
}
/* Ohne Dokument im iframe braucht der Viewer keine volle Lesehöhe. */
.lg-viewer.is-protected .lg-viewer__body iframe { height: 260px; min-height: 0; }

/* Liegt über dem iframe, der bei geschützten Dokumenten leer bleibt. */
.lg-viewer__note {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  justify-content: center;
  padding: 32px;
  background: var(--white);
}
.lg-viewer__note p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
  max-width: 42ch;
}
.lg-viewer__note-title { font-weight: 600 !important; color: var(--black) !important; }
.lg-viewer__note .btn { margin-top: 8px; }
.lg-group { display: flex; flex-direction: column; gap: 12px; }
.lg-group__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  color: var(--blue-dark-2);
  padding-inline: 4px;
}
.lg-list {
  background: var(--white);
  border: 1px solid #e6edf8;
  border-radius: 12px;
  box-shadow: 0 0 13px rgba(0, 0, 0, .09);
  overflow: hidden;
}

.lg-doc__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  scroll-margin-top: calc(var(--nav-h) + 24px);
  cursor: pointer;
  transition: background-color .15s ease;
}
.lg-doc__row:hover { background: rgba(44, 123, 255, .02); }
.lg-doc__row:focus-visible { outline: 2px solid var(--blue-main); outline-offset: -2px; }
.lg-doc__row.is-selected {
  background: rgba(44, 123, 255, .08);
  box-shadow: inset 2px 0 0 var(--blue-main);
}
.lg-doc__row.is-selected .lg-doc__name { color: var(--blue-main); font-weight: 400; }
.lg-list > .lg-doc__row:last-child,
.lg-list > .lg-sub:last-child { border-bottom: 0; }
.lg-doc__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-body);
}
.lg-lock { width: 15px; height: 15px; flex: none; color: var(--text-muted); opacity: .6; }

.lg-doc__acts { display: flex; align-items: center; gap: 2px; flex: none; }
.lg-act {
  display: inline-flex;
  padding: 7px;
  border-radius: 6px;
  color: rgba(0, 0, 0, .35);
  transition: color .15s ease, background-color .15s ease;
}
.lg-act svg { width: 16px; height: 16px; display: block; }
.lg-act:hover { color: var(--blue-main); background: rgba(44, 123, 255, .08); }

/* Die AVV-Anlagen hängen unter dem Gesamtdokument; <details> spart dafür
   eigenes JavaScript und bleibt ohne Skript bedienbar. */
.lg-sub { border-bottom: 1px solid rgba(0, 0, 0, .05); }
.lg-sub > summary {
  padding: 6px 20px 12px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--blue-main);
  cursor: pointer;
  list-style: none;
  transition: color .15s ease;
}
.lg-sub > summary::-webkit-details-marker { display: none; }
.lg-sub > summary::before { content: "▸ "; }
.lg-sub[open] > summary::before { content: "▾ "; }
/* Beide Beschriftungen stehen im Markup, `[open]` blendet die passende ein —
   so wechselt der Text ohne JavaScript mit dem Zustand. */
.lg-sub[open] > summary .lg-sub__more,
.lg-sub:not([open]) > summary .lg-sub__less { display: none; }
.lg-sub > summary:hover { color: #1866e8; }
.lg-sub__list { margin-left: 24px; border-left: 2px solid rgba(44, 123, 255, .2); }
.lg-doc__row--sub { padding-block: 11px; }
.lg-sub__list .lg-doc__row:last-child { border-bottom: 0; }
.lg-doc__row--sub .lg-doc__name { font-size: 14px; }

/* Nebeneinander lohnt sich erst ab genug Breite für beide Spalten; darunter
   rutscht die Leseansicht unter die Liste. */
@media (max-width: 1100px) {
  .lg-layout { flex-direction: column; }
  .lg-layout.is-reading .lg-side { width: 100%; }
  .lg-layout.is-reading .lg-doc__name { font-size: 15px; }
  .lg-viewer { position: static; width: 100%; margin-top: 24px; }
  .lg-viewer__body iframe { height: 70vh; min-height: 420px; }
}

@media (max-width: 700px) {
  .lg-hero__inner { padding-block: 56px 32px; }
  .lg-tab { padding: 10px 12px; font-size: 16px; }
  .lg-doc__row { padding-inline: 14px; align-items: flex-start; }
  .lg-doc__name { font-size: 14px; }
  .lg-sub__list { margin-left: 12px; }
}

/* --- On-Premise: Dokumente nur auf Anfrage ------------------------------- */
.lg-empty {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-body);
  max-width: 560px;
}
.lg-empty__cta { margin-top: 16px; align-self: flex-start; justify-self: start; }
