@charset "UTF-8";

/* Leadership chart: a tree starting at the Ortsbeauftragter, styled after the THW timeline (thw.de Zeitstrahl).
   The line runs on the left; each level is indented further; the line ends at the last dot. */
.org { container-type: inline-size; font-family: Calibri, "Droid Sans", Arial, sans-serif; color: #202020; }
.org-line { list-style: none; margin: 0; padding: 0; }
.org-line > li { position: relative; }
.org-line > li::before { /* line segment, drawn per entry so it can stop at the last dot */
  content: ""; position: absolute; top: 0; bottom: 0; left: 14px; width: 2px; background: #039; }
.org-line > li:last-child::before { bottom: auto; height: 48px; }

/* Group markers on the line (like the year labels) */
.org-label { padding-top: 22px; }
.org-label span { display: inline-block; position: relative; background: #039; color: #fff;
  font-weight: bold; font-size: 20px; line-height: 1.2; padding: 6px 18px; }
.org-label.is-sub span { background: #fff; color: #039; border: 2px solid #039; font-size: 15px; padding: 3px 12px; }

/* Entries: dot on the line, a stub to the card; deeper levels are indented further */
.org-item { margin-left: 16px; padding: 12px 0 0 24px;
  background: linear-gradient(#039, #039) no-repeat 0 47px / 9px 2px; }
.org-item.is-depth-2 { padding-left: 48px; background-size: 33px 2px; }
.org-item.is-depth-3 { padding-left: 72px; background-size: 57px 2px; }
.org-line > .org-item::before { left: -2px; }
.org-item::after { /* dot */
  content: ""; position: absolute; top: 40px; left: -9px; width: 16px; height: 16px; border-radius: 50%; background: #039; }

/* The Ortsbeauftragter is the root: no dot, no stub, the line starts below the card */
.org-item.is-top { margin-left: 0; padding: 0; background: none; }
.org-line > .org-item.is-top::before { left: 14px; }
.org-item.is-top::after { content: none; }

/* Cards like the timeline teasers, with a pointer towards the line */
.org-card { position: relative; box-sizing: border-box; max-width: 460px; min-height: 72px; display: grid;
  grid-template-columns: auto 1fr; gap: 12px; align-items: center; background: #fff; border: 2px solid #039; padding: 12px 14px; }
.org-card.no-badge { grid-template-columns: 1fr; }
.org-card::before, .org-card::after { content: ""; position: absolute; clip-path: polygon(100% 0, 100% 100%, 0 50%); }
.org-card::before { left: -15px; top: 21px; width: 15px; height: 30px; background: #039; }
.org-card::after { left: -12px; top: 22px; width: 14px; height: 28px; background: #fff; }

/* All cards have the blue border; the Ortsbeauftragter gets a thicker top edge */
.is-top .org-card { border-top-width: 5px; }
.is-top .org-card::before, .is-top .org-card::after { content: none; }
.org-card.vacant { border-style: dashed; background: #f5f6f8; }
.org-card.vacant .org-name { color: #53616b; font-weight: normal; font-style: italic; }

/* Badge as high as the two text lines (role 12px x 1.3 + 3px gap + name 16px x 1.3 = 39.4px); width follows the SVG viewBox 261 x 81 (= 127px) */
.org-badge { display: block; height: calc(12px * 1.3 + 3px + 16px * 1.3); width: auto; aspect-ratio: 261 / 81; }
.org-text { min-width: 0; }
.org-role { font-size: 12px; line-height: 1.3; text-transform: uppercase; letter-spacing: 1px; color: #53616b; overflow-wrap: anywhere; }
.org-name { font-size: 16px; line-height: 1.3; font-weight: bold; margin-top: 3px; overflow-wrap: anywhere; }

/* Narrow (phone): smaller badge so long function names keep room */
@container (max-width: 420px) {
  .org-card { grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 12px; }
  .org-card.no-badge { grid-template-columns: 1fr; }
  .org-badge { width: 64px; height: auto; } /* 64 x 20 px */
  .org-role { letter-spacing: 0.5px; }
}
