/* =====================================================
   OrgChart Builder for Elementor — v2.0 Static CSS
   Pure CSS tree layout · no zoom · no wrapper border
===================================================== */

/* ── Reset ── */
.oc-widget, .oc-widget * { box-sizing: border-box; }
.oc-widget { font-family: inherit; }

/* ── Scroll wrapper (transparent, no border) ── */
.oc-scroll-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;   /* room for hover shadow */
}

/* ── Root row ── */
.oc-root {
    display: inline-flex;       /* shrink-wrap the tree */
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    min-width: 100%;
    gap: 0;                     /* individual gaps set inline */
}

/* ─────────────────────────────────────────────────────
   BRANCH
   Each .oc-branch = one node + its subtree.
   It stacks: [card] then [children row] vertically.
───────────────────────────────────────────────────── */
.oc-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* ─────────────────────────────────────────────────────
   CARD
───────────────────────────────────────────────────── */
.oc-card {
    display: block;
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: default;
    will-change: transform;
    flex-shrink: 0;
    /* width set per-widget by dynamic CSS */
}

a.oc-card { cursor: pointer; }

.oc-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    pointer-events: none;
}

.oc-card-inner {
    padding: 14px;
}

/* Vertical layout (default) */
.oc-card-inner.layout-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Horizontal layout */
.oc-card-inner.layout-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    text-align: left;
}
.oc-card-inner.layout-horizontal .oc-content { flex: 1; min-width: 0; }

/* Text-only */
.oc-card-inner.layout-text-only {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ── Avatar ── */
.oc-avatar-wrap { flex-shrink: 0; }
.oc-avatar {
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.oc-av-circle  { border-radius: 50%; }
.oc-av-rounded { border-radius: 8px; }
.oc-av-square  { border-radius: 2px; }

.oc-avatar img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.oc-initials {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; line-height: 1;
    letter-spacing: -.3px;
}

/* ── Content ── */
.oc-content { min-width: 0; }

.oc-badge {
    display: inline-block;
    padding: 2px 7px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: 20px;
    margin-bottom: 5px;
    line-height: 1.6;
}

.oc-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}

.oc-subtitle {
    margin: 3px 0 0;
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    word-break: break-word;
}

.oc-desc {
    margin: 5px 0 0;
    font-size: 10px;
    color: #94a3b8;
    line-height: 1.45;
}

/* ─────────────────────────────────────────────────────
   CONNECTORS  (pure CSS, pseudo-elements)

   .oc-children
     ├── ::before  = vertical stem going DOWN from parent
     └── .oc-branch
           ├── ::before  = horizontal bar across siblings
           └── ::after   = short vertical drop to each card

   Structure per branch (with children):
   
     [card]
       │  ← ::after on .oc-children (single vertical from card)
       │
   ┌───┼───┐  ← ::before on .oc-children (horizontal bar)
   │       │
   ▼       ▼  ← ::before on each .oc-branch inside (vertical drops)
  [c1]    [c2]
───────────────────────────────────────────────────── */

/* Vertical line coming DOWN from parent card */
.oc-children::before {
    content: '';
    display: block;
    width: var(--oc-lw, 2px);
    height: var(--oc-vc, 24px);
    background: var(--oc-lc, #cbd5e1);
    margin: 0 auto;
    flex-shrink: 0;
    /* Override with border-style for dashed/dotted */
}

/* Children row  */
.oc-children {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Inner row of sibling branches */
.oc-children-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    position: relative;
}

/* ─────────────────────────────────────────────────────
   We wrap child branches in a .oc-children-row so we can
   draw the horizontal bar and vertical drops accurately.
───────────────────────────────────────────────────── */

/* Horizontal bar spanning all siblings */
.oc-children-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: calc(var(--oc-cw, 85px) / 2);
    right: calc(var(--oc-cw, 85px) / 2);
    height: var(--oc-lw, 2px);
    background: var(--oc-lc, #cbd5e1);
    pointer-events: none;
}

/* Vertical drop from horizontal bar to each card */
.oc-children-row > .oc-branch::before {
    content: '';
    display: block;
    width: var(--oc-lw, 2px);
    height: var(--oc-vc, 24px);
    background: var(--oc-lc, #cbd5e1);
    margin: 0 auto;
    flex-shrink: 0;
}

/* Single child — no horizontal bar needed */
.oc-children-row:has(> .oc-branch:only-child)::before {
    display: none;
}

/* ── Dashed / Dotted lines ── */
.oc-ls-dashed .oc-children::before,
.oc-ls-dashed .oc-children-row::before,
.oc-ls-dashed .oc-children-row > .oc-branch::before {
    background: repeating-linear-gradient(
        to bottom,
        var(--oc-lc, #cbd5e1) 0, var(--oc-lc, #cbd5e1) 5px,
        transparent 5px, transparent 9px
    );
}

.oc-ls-dotted .oc-children::before,
.oc-ls-dotted .oc-children-row::before,
.oc-ls-dotted .oc-children-row > .oc-branch::before {
    background: repeating-linear-gradient(
        to bottom,
        var(--oc-lc, #cbd5e1) 0, var(--oc-lc, #cbd5e1) 2px,
        transparent 2px, transparent 6px
    );
}

/* ─────────────────────────────────────────────────────
   COLOUR SCHEMES
───────────────────────────────────────────────────── */

/* Corporate */
.oc-scheme-corporate .oc-card       { background:#f0f7ff; border-color:#bfdbfe; }
.oc-scheme-corporate .oc-title      { color:#1e3a8a; }
.oc-scheme-corporate .oc-subtitle   { color:#3b82f6; }
.oc-scheme-corporate .oc-badge      { background:#dbeafe; color:#1d4ed8; }

/* Modern */
.oc-scheme-modern .oc-card          { background:#faf5ff; border-color:#ddd6fe; }
.oc-scheme-modern .oc-title         { color:#4c1d95; }
.oc-scheme-modern .oc-subtitle      { color:#7c3aed; }
.oc-scheme-modern .oc-badge         { background:#ede9fe; color:#6d28d9; }

/* Nature */
.oc-scheme-nature .oc-card          { background:#f0fdf4; border-color:#bbf7d0; }
.oc-scheme-nature .oc-title         { color:#14532d; }
.oc-scheme-nature .oc-subtitle      { color:#16a34a; }
.oc-scheme-nature .oc-badge         { background:#dcfce7; color:#15803d; }

/* Sunset */
.oc-scheme-sunset .oc-card          { background:#fff7ed; border-color:#fed7aa; }
.oc-scheme-sunset .oc-title         { color:#7c2d12; }
.oc-scheme-sunset .oc-subtitle      { color:#ea580c; }
.oc-scheme-sunset .oc-badge         { background:#ffedd5; color:#c2410c; }

/* Dark */
.oc-scheme-dark .oc-card            { background:#1e293b; border-color:#334155; }
.oc-scheme-dark .oc-title           { color:#f1f5f9; }
.oc-scheme-dark .oc-subtitle        { color:#94a3b8; }
.oc-scheme-dark .oc-desc            { color:#64748b; }
.oc-scheme-dark .oc-badge           { background:#334155; color:#cbd5e1; }

/* Minimal */
.oc-scheme-minimal .oc-card         { background:#fff; border:2px solid #111; border-radius:3px; box-shadow:3px 3px 0 #111; }
.oc-scheme-minimal .oc-title        { color:#111; }
.oc-scheme-minimal .oc-subtitle     { color:#333; }

/* ─────────────────────────────────────────────────────
   HOVER EFFECTS  (set by dynamic CSS per widget)
   Base transition on all cards
───────────────────────────────────────────────────── */
.oc-card { transition: transform .22s ease, box-shadow .22s ease, border-color .18s ease; }

/* ─────────────────────────────────────────────────────
   FOCUS / ACCESSIBILITY
───────────────────────────────────────────────────── */
.oc-card:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────
   MOBILE
───────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .oc-mob-no-desc  .oc-desc  { display: none; }
    .oc-mob-no-badge .oc-badge { display: none; }

    /* Stack mode: linear top-down list */
    .oc-mobile-stack .oc-scroll-wrap { overflow: visible; }
    .oc-mobile-stack .oc-root        { flex-direction: column; align-items: center; }
    .oc-mobile-stack .oc-children-row { flex-direction: column; align-items: center; }
    .oc-mobile-stack .oc-children-row::before { display: none; }
    .oc-mobile-stack .oc-children-row > .oc-branch { width: 100%; }
    .oc-mobile-stack .oc-card { width: 90% !important; }

    /* Reduce card padding */
    .oc-card-inner { padding: 10px !important; }
    .oc-title    { font-size: 12px !important; }
    .oc-subtitle { font-size: 10px !important; }
}

@media (max-width: 1024px) and (min-width: 768px) {
    .oc-title    { font-size: 12px; }
    .oc-subtitle { font-size: 10px; }
}

/* ─────────────────────────────────────────────────────
   PRINT
───────────────────────────────────────────────────── */
@media print {
    .oc-scroll-wrap { overflow: visible; }
    .oc-card { box-shadow: none !important; transform: none !important; page-break-inside: avoid; }
}
