/* ===== Organigramm v6 (A11y-Update) ===== */

.org-page {
  font-family: inherit;
}

/* Root-Titel */
.org-root-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 0.8rem 0;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid #d4a437;
}

/* Boxes (jetzt <button>) */
.org-box {
  background: #1e3a5f;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 5px 8px;
  text-align: center;
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  word-wrap: break-word;
  hyphens: auto;
  display: inline-block;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.org-box:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.org-box:focus-visible {
  outline: 3px solid #d4a437;
  outline-offset: 2px;
  filter: brightness(1.15);
  box-shadow: 0 0 0 5px rgba(212,164,55,0.25);
}
.org-box-lead {
  min-width: 130px;
  max-width: 180px;
  font-size: 0.75rem;
}

.org-box-name {
  display: block;
}
.org-box-sub {
  display: block;
  margin-top: 3px;
}
.org-box-sub-line {
  display: block;
  font-size: 0.55rem;
  font-weight: 400;
  line-height: 1.3;
  opacity: 0.85;
}
.org-box-sub-line-divider {
  border-top: 1px solid rgba(255,255,255,0.3);
  padding-top: 1px;
  margin-top: 1px;
}
.org-box-note {
  display: block;
  font-size: 0.5rem;
  font-weight: 400;
  font-style: italic;
  opacity: 0.7;
  margin-top: 2px;
}

/* Rubrik-Container */
.org-rubrik {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 160px;
  max-width: 200px;
  min-width: 140px;
}
.org-rubrik-header {
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  border-radius: 6px 6px 0 0;
  line-height: 1.2;
  word-wrap: break-word;
  hyphens: auto;
}
.org-rubrik-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  align-items: center;
}

/* Node-Wrapper (Lead + Rubriken) */
.org-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.org-node-leaf {
  display: flex;
  justify-content: center;
}
.org-rubriken {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

/* ===== Detail Panel (Dialog) ===== */
.org-detail-panel {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 320px;
  max-width: calc(100vw - 2rem);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  padding: 1.25rem 1rem 1rem;
  z-index: 200;
  border: 1px solid #ddd;
}
.org-detail-panel.open {
  display: block;
}
.org-detail-num {
  font-size: 0.75rem;
  color: #999;
  font-weight: 400;
  margin-bottom: 2px;
}
.org-detail-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 8px 0;
  text-align: center;
  line-height: 1.3;
}
.org-detail-sub {
  font-size: 0.78rem;
  color: #555;
  line-height: 1.4;
  margin-bottom: 2px;
}
.org-detail-note {
  font-size: 0.7rem;
  color: #888;
  margin-top: 6px;
  font-style: italic;
}
.org-detail-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.org-detail-close:hover {
  background: #f0f0f0;
  color: #1e3a5f;
}
.org-detail-close:focus-visible {
  outline: 2px solid #d4a437;
  outline-offset: 2px;
  background: #f0f0f0;
}

/* ===== Carousel ===== */
.org-carousel {
  text-align: center;
  margin-bottom: 4px;
  position: relative;
}
.org-carousel-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #d4a437;
  background: #eee;
  display: block;
  margin: 0 auto;
}
.org-carousel-img.photo-zoom { cursor: zoom-in; }

.org-person-info {
  text-align: center;
  margin-top: 6px;
}
.org-person-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}
.org-person-location {
  font-size: 0.7rem;
  color: #888;
  margin-top: 1px;
}
.org-contact {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #eee;
  font-size: 0.75rem;
  color: #555;
}
.org-contact-row {
  margin-bottom: 3px;
}
.org-contact-row a {
  color: #2980b9;
  text-decoration: none;
  word-break: break-all;
}
.org-contact-row a:hover,
.org-contact-row a:focus-visible {
  text-decoration: underline;
}

.org-carousel-nav {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.org-carousel-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(30, 58, 95, 0.08);
  color: #1e3a5f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  position: relative;
  padding: 0;
  font: inherit;
}
.org-carousel-btn::before {
  content: attr(data-arrow);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  display: block;
}
.org-carousel-btn:hover {
  background: rgba(30, 58, 95, 0.18);
  transform: scale(1.08);
}
.org-carousel-btn:active {
  transform: scale(0.95);
}
.org-carousel-btn:focus-visible {
  outline: 2px solid #d4a437;
  outline-offset: 2px;
}
.org-carousel-counter {
  font-size: 0.7rem;
  color: #999;
  min-width: 30px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ===== Legende unten ===== */
.org-legend-bottom {
  text-align: center;
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #ddd;
  font-size: 0.75rem;
  color: #555;
}
.org-legend-bottom .org-stand {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.org-legend-bottom .org-legend-abbr {
  display: block;
  font-weight: 400;
}

/* Live-Region (visually hidden, fuer Screenreader) */
.org-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Mobile: Panel zentriert, nicht mehr bottom-right */
@media (max-width: 768px) {
  .org-detail-panel {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    width: auto;
  }
}

/* Reduced-Motion: keine Hover-Transitions, keine Animationen */
@media (prefers-reduced-motion: reduce) {
  .org-box,
  .org-box:hover,
  .org-box:focus-visible,
  .org-carousel-btn,
  .org-carousel-btn:hover,
  .org-detail-close {
    transition: none !important;
    transform: none !important;
  }
  .org-box:focus-visible,
  .org-carousel-btn:focus-visible,
  .org-detail-close:focus-visible {
    animation: none !important;
  }
}
