/*
 * org-chart.v10.css  (plugin v1.2.8 / ZIP v12)
 * Additive layer on top of v4 → v5 → v6 → v7 → v8 → v9.
 * Do NOT modify v1–v9 CSS files.
 *
 * Fix: incoming connector alignment when a node has side-branch children.
 *
 * Problem (v1–v9)
 * ──────────────
 * When a node is rendered as org-branch-with-sides (because it has at least
 * one side-branch child), it is placed inside org-branch by the parent's
 * render_children_area().  org-branch::before draws the incoming connector
 * stub from the T-bar / org-connector-vert down to the child:
 *
 *   .org-branch::before { left: 50%; top: -24px; height: 24px; }
 *
 * org-branch's width equals org-branch-with-sides's width, which equals the
 * full org-card-row width: [side-col] + [32px gap] + [190px card-anchor].
 *
 * left:50% of org-branch therefore lands at the CENTRE of the full row,
 * not at the card centre.  For a 202px left side column the stub is ~117px
 * to the LEFT of the card centre — the connector arrives at an empty space
 * instead of the card.
 *
 * Fix
 * ───
 * PHP (render_node) adds class org-branch--over-sides to the wrapping
 * org-branch whenever the child renders as org-branch-with-sides.
 *
 * PHP (render_node) also emits <div class="org-card-incoming-stub"> inside
 * org-card-anchor (which holds only the card).  org-card-anchor is
 * position:relative, so:
 *
 *   .org-card-incoming-stub {
 *       position: absolute;
 *       top: -24px;          ← extends 24px above org-card-row top
 *       left: 50%;           ← 50% of org-card-anchor width = card centre ✓
 *   }
 *
 * With this stub active, the misaligned org-branch::before is suppressed.
 *
 * The stub is always emitted by PHP inside every org-card-anchor that is
 * part of an org-branch-with-sides.  However, it only becomes VISIBLE when
 * the org-branch parent has class org-branch--over-sides (the suppression
 * rule below makes it hidden otherwise, so it never interferes with the
 * normal org-branch::before path).
 *
 * Extended branches
 * ─────────────────
 * org-branch--extended uses padding-top:48px and ::before height:72px.
 * When combined with org-branch--over-sides the stub must also be 72px
 * tall.  A dedicated rule handles this case.
 *
 * Cascade strategy
 *   Same specificity as the rules being overridden → later load order wins.
 *   No !important used.
 */

/* ─────────────────────────────────────────────────────────────────────────────
 * 1.  Suppress the misaligned org-branch::before stub
 * ─────────────────────────────────────────────────────────────────────────── */

/*
 * Specificity (0,1,1) — same as v4's .org-branch::before (0,1,1).
 * v10 cascade wins. ✓
 */
.org-branch--over-sides::before {
	content: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 2.  Hide the stub div when org-branch::before is still active
 * ─────────────────────────────────────────────────────────────────────────── */

/*
 * org-card-incoming-stub is emitted by PHP inside every org-card-anchor that
 * is part of org-branch-with-sides.  Default: hidden so it does not
 * interfere with the normal connector path (where org-branch::before is fine).
 *
 * It is made visible only when the ancestor org-branch has --over-sides (rule 3).
 */
.org-card-incoming-stub {
	display: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 3.  The corrected stub — only active inside org-branch--over-sides
 * ─────────────────────────────────────────────────────────────────────────── */

/*
 * .org-branch--over-sides contains .org-branch-with-sides which contains
 * .org-card-row which contains .org-card-anchor which contains
 * .org-card-incoming-stub.
 *
 * org-card-anchor is position:relative + align-self:stretch (fills row height).
 *
 * position:absolute; top:-24px  → extends 24px above the row top, into the
 *   24px padding-top of org-children where org-branch::before would have been.
 *   Connects flush to the T-bar or org-connector-vert above. ✓
 *
 * left:50%; transform:translateX(-50%)  → horizontal centre of org-card-anchor
 *   = horizontal centre of the card (card fills the anchor's width).
 *   This is independent of the side columns' widths. ✓
 *
 * Specificity (0,2,0) — high enough to beat any inherited display:none. ✓
 */
.org-branch--over-sides .org-card-incoming-stub {
	display: block;
	position: absolute;
	top: -24px;
	left: 50%;
	transform: translateX(-50%);
	width: var(--org-line-weight, 1.5px);
	height: 24px;
	background: var(--org-line-color, rgba(100,116,139,0.55));
	pointer-events: none;
	z-index: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
 * 4.  Extended-branch variant  (org-branch--over-sides + org-branch--extended)
 * ─────────────────────────────────────────────────────────────────────────── */

/*
 * v7 defines:
 *   .org-branch--extended            { padding-top: 48px; }
 *   .org-branch--extended::before    { height: 72px; top: -72px; }
 *
 * When both modifiers are present on the same org-branch, ::before is
 * suppressed by rule 1 and the stub must also be 72px tall.
 *
 * Specificity (0,3,0) — beats rule 3's (0,2,0). ✓
 */
.org-branch--over-sides.org-branch--extended .org-card-incoming-stub {
	height: 72px;
	top: -72px;
}
