/* 조직도 — Responsive tree (HTML/CSS) */
.org {
  padding: 0;
}

/* 차트 래퍼 */
.org__chart {
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Head (대표 카드) */
.org__head {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background-color: var(--color-primary);
  box-shadow: 0 4px 18px rgba(27, 42, 74, 0.18);
  text-align: center;
}

.org__head-text {
  font-family: var(--font-primary);
  font-size: 1.375rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

/* 수직 연결선 (head → branches) */
.org__connector {
  width: 2px;
  height: 48px;
  background-image: linear-gradient(
    to bottom,
    var(--color-primary) 0,
    var(--color-primary) 6px,
    transparent 6px,
    transparent 12px
  );
  background-size: 2px 12px;
  background-repeat: repeat-y;
}

/* 본부 컨테이너 */
.org__branches {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 36px;
}

/* 본부 컨테이너 위의 가로선 */
.org__branches::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc((100% / 3) / 2);
  right: calc((100% / 3) / 2);
  height: 2px;
  background-image: linear-gradient(
    to right,
    var(--color-primary) 0,
    var(--color-primary) 6px,
    transparent 6px,
    transparent 12px
  );
  background-size: 12px 2px;
  background-repeat: repeat-x;
}

/* 본부 카드 */
.org__dept {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 1.25rem 1rem;
  background-color: #fff;
  border: 2px solid var(--color-primary);
  border-radius: 20px;
  text-align: center;
  box-sizing: border-box;
}

/* 본부 카드 위의 세로선 (가로선과 카드 연결) */
.org__dept::before {
  content: '';
  position: absolute;
  top: -36px;
  left: 50%;
  width: 2px;
  height: 36px;
  background-image: linear-gradient(
    to bottom,
    var(--color-primary) 0,
    var(--color-primary) 6px,
    transparent 6px,
    transparent 12px
  );
  background-size: 2px 12px;
  background-repeat: repeat-y;
  transform: translateX(-1px);
}

.org__dept-text {
  font-family: var(--font-primary);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

/* ===========================================================
   Mobile (<768px) — 세로 스택, 가로 스크롤 없음
   =========================================================== */
@media (max-width: 767px) {
  .org__chart {
    padding: 2rem 1rem;
  }

  .org__head {
    width: 140px;
    height: 140px;
  }

  .org__head-text {
    font-size: 1.125rem;
  }

  /* 브랜치를 세로 스택으로 전환 */
  .org__branches {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 0;
  }

  /* 가로 연결선 제거 (세로 레이아웃에서 불필요) */
  .org__branches::before {
    display: none;
  }

  /* 각 본부 위의 세로 연결선만 유지 */
  .org__dept {
    min-height: 72px;
    padding: 1rem;
  }

  .org__dept::before {
    top: -28px;
    height: 28px;
  }

  .org__dept-text {
    font-size: 1.0625rem;
  }
}
