/* ============================================================
   ORGANIZATION STRUCTURE — Page Styles
============================================================ */

.org-page {
  --org-hero-h: 320px;
  --org-node-radius: 18px;
  --org-connector: rgba(36, 55, 70, 0.45);
  --org-glow: rgba(162, 35, 142, 0.22);
}

/* ---- Shared ---- */
.org-section {
  position: relative;
  padding: 72px 0;
}

.org-section--alt {
  background-color: var(--clr-neutral-50, #f7f8fa);
}

.org-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(28, 38, 58, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 38, 58, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
}

.org-section > .container-max {
  position: relative;
  z-index: 1;
}

.org-section__header {
  max-width: 640px;
  margin-bottom: 36px;
}

.org-eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-display, var(--font-heading));
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clr-primary);
}

.org-title {
  margin: 0 0 12px;
  font-family: var(--font-display, var(--font-heading));
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--clr-neutral-900);
}

.org-lead {
  margin: 0;
  max-width: 640px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--clr-neutral-600);
}

/* ---- Hero ---- */
.org-hero {
  position: relative;
  height: var(--org-hero-h);
  min-height: var(--org-hero-h);
  max-height: var(--org-hero-h);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  background-color: var(--clr-primary);
  border-bottom: 1px solid rgba(137, 27, 120, 0.35);
}

.org-hero__pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: var(--clr-primary);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    repeating-linear-gradient(
      -32deg,
      transparent 0,
      transparent 11px,
      rgba(166, 206, 55, 0.12) 11px,
      rgba(166, 206, 55, 0.12) 12px
    ),
    radial-gradient(ellipse 65% 75% at 12% 18%, rgba(166, 206, 55, 0.22), transparent 58%),
    radial-gradient(ellipse 55% 65% at 90% 82%, rgba(166, 206, 55, 0.16), transparent 52%),
    radial-gradient(ellipse 80% 90% at 50% 120%, var(--clr-primary-hover, #891b78), transparent 55%);
  background-size:
    24px 24px,
    24px 24px,
    96px 96px,
    96px 96px,
    auto,
    auto,
    auto,
    auto;
}

.org-hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-width, 1280px);
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
}

.org-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  font-weight: 600;
}

.org-breadcrumb a {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}

.org-breadcrumb a:hover,
.org-breadcrumb a:focus-visible {
  color: #fff;
}

.org-breadcrumb__sep {
  color: rgba(255, 255, 255, 0.5);
}

.org-breadcrumb [aria-current="page"] {
  color: var(--clr-secondary);
}

.org-hero__eyebrow {
  margin: 0 0 10px;
  color: var(--clr-secondary);
}

.org-hero__title {
  margin: 0 0 12px;
  max-width: 820px;
  font-family: var(--font-display, var(--font-heading));
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  text-wrap: balance;
}

.org-hero__lead {
  margin: 0;
  max-width: 600px;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

/* ---- Toolbar ---- */
.org-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.org-search {
  position: relative;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.org-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-neutral-500);
  pointer-events: none;
}

.org-search__input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  border: 1px solid rgba(28, 38, 58, 0.12);
  border-radius: 12px;
  background: #fff;
  font-size: 0.95rem;
  color: var(--clr-neutral-900);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.org-search__input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(162, 35, 142, 0.15);
}

.org-search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--clr-neutral-500);
}

.org-search__clear:hover,
.org-search__clear:focus-visible {
  background: rgba(28, 38, 58, 0.06);
  color: var(--clr-neutral-900);
}

.org-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.org-filter {
  appearance: none;
  border: 1px solid rgba(28, 38, 58, 0.12);
  background: #fff;
  color: var(--clr-neutral-700);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.org-filter:hover,
.org-filter:focus-visible {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  outline: none;
}

.org-filter.is-active {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
}

/* ---- Chart layout ---- */
.org-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.org-chart-shell {
  position: relative;
  min-width: 0;
  padding: 20px 12px 28px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(28, 38, 58, 0.06);
  box-shadow: 0 12px 32px rgba(28, 38, 58, 0.05);
  overflow-x: auto;
  overflow-y: hidden;
}

.org-chart {
  min-width: max-content;
  margin: 0 auto;
}

.org-chart__empty {
  margin: 24px 0 0;
  text-align: center;
  color: var(--clr-neutral-500);
}

/* Tree — classic org-chart connectors */
.org-tree {
  --org-line: 2px;
  --org-gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: center;
}

.org-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: var(--org-gap);
  position: relative;
}

/* Vertical stub from parent node down into the children row */
.org-tree ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--org-line);
  height: var(--org-gap);
  background: var(--org-connector);
  transform: translateX(-50%);
}

.org-tree li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--org-gap) 10px 0;
}

/* Vertical line from horizontal bar down to this node */
.org-tree li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--org-line);
  height: var(--org-gap);
  background: var(--org-connector);
  transform: translateX(-50%);
}

/* Horizontal connector across siblings */
.org-tree li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--org-line);
  background: var(--org-connector);
}

.org-tree li:first-child::after {
  left: 50%;
  width: 50%;
}

.org-tree li:last-child::after {
  left: 0;
  width: 50%;
}

.org-tree li:only-child::after {
  display: none;
}

/* Root has no incoming connector */
.org-tree > li {
  padding-top: 0;
}

.org-tree > li::before,
.org-tree > li::after {
  display: none;
}

.org-tree ul.is-collapsed {
  display: none;
}

/* Nodes */
.org-node {
  position: relative;
  z-index: 1;
  width: 170px;
  padding: 12px 10px 14px;
  border-radius: var(--org-node-radius);
  background: #fff;
  border: 1px solid rgba(28, 38, 58, 0.1);
  box-shadow: 0 8px 22px rgba(28, 38, 58, 0.07);
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.org-node:hover,
.org-node:focus-visible {
  transform: translateY(-4px);
  border-color: var(--clr-primary);
  box-shadow: 0 12px 28px var(--org-glow);
  outline: none;
}

.org-node.is-selected {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(162, 35, 142, 0.18), 0 14px 30px var(--org-glow);
  transform: scale(1.02);
}

.org-node.is-match {
  border-color: var(--clr-secondary);
  box-shadow: 0 0 0 3px rgba(166, 206, 55, 0.28), 0 12px 28px rgba(166, 206, 55, 0.2);
}

.org-node.is-dimmed {
  opacity: 0.28;
  filter: grayscale(0.35);
}

.org-node__icon {
  width: 38px;
  height: 38px;
  margin: 0 auto 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(162, 35, 142, 0.08);
  color: var(--clr-primary);
  font-size: 1.05rem;
}

.org-node__role {
  margin: 0 0 4px;
  font-family: var(--font-display, var(--font-heading));
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--clr-neutral-900);
}

.org-node__name {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--clr-neutral-600);
}

.org-node__name--placeholder {
  color: var(--clr-neutral-500);
  font-style: italic;
}

.org-node__toggle {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(28, 38, 58, 0.14);
  background: #fff;
  color: var(--clr-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  z-index: 3;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(28, 38, 58, 0.12);
}

.org-node__toggle:hover,
.org-node__toggle:focus-visible {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
  outline: none;
}

.org-node.has-children {
  margin-bottom: 0;
}

/* Give the expand control room on the connector without breaking the line */
.org-tree li > .org-node.has-children + ul {
  margin-top: 0;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
  .org-page {
    --org-hero-h: 280px;
  }

  .org-section {
    padding: 60px 0;
  }

  /* Compact tree on tablet so it stays inside the viewport */
  .org-chart-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .org-tree {
    --org-gap: 28px;
  }

  .org-node {
    width: 148px;
    padding: 11px 8px 13px;
  }
}

@media (max-width: 767.98px) {
  .org-page {
    --org-hero-h: 240px;
  }

  .org-section {
    padding: 52px 0;
  }

  /* Accordion layout — no horizontal overflow */
  .org-chart-shell {
    overflow: visible;
    padding: 12px 8px 20px;
  }

  .org-chart {
    min-width: 0;
    width: 100%;
  }

  .org-tree {
    display: block;
    width: 100%;
    text-align: left;
  }

  .org-tree ul {
    display: block;
    width: 100%;
    padding: 8px 0 0 14px;
    margin-left: 18px;
    border-left: var(--org-line) solid var(--org-connector);
  }

  .org-tree ul::before,
  .org-tree li::before,
  .org-tree li::after {
    display: none !important;
  }

  .org-tree li {
    display: block;
    width: 100%;
    padding: 0 0 10px;
    align-items: stretch;
  }

  .org-tree > li {
    padding-top: 0;
  }

  .org-node {
    width: 100%;
    text-align: left;
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas:
      "icon role toggle"
      "icon name toggle";
    gap: 2px 12px;
    align-items: center;
    padding: 14px;
  }

  .org-node__icon {
    grid-area: icon;
    margin: 0;
  }

  .org-node__role {
    grid-area: role;
    margin: 0;
  }

  .org-node__name {
    grid-area: name;
  }

  .org-node__toggle {
    grid-area: toggle;
    position: static;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .org-node {
    transition: none;
  }

  .org-node:hover,
  .org-node.is-selected {
    transform: none;
  }
}
