/* Organization Chart Component
================================================ */
.front-org__chart {
  background-color: #e4e7f1;
  border-radius: 10px;
  padding: min(calc(50 / 1366 * 100vw), 50px);
}

.front-org__chart-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: min(calc(5 / 1366 * 100vw), 5px);
}

.front-org__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: min(calc(20 / 1366 * 100vw), 20px);
  background-color: #fff;
  border-radius: 10px;
  padding: min(calc(30 / 1366 * 100vw), 30px);
  width: 100%;
}

.front-org__logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.front-org__logo-img {
  width: min(calc(170 / 1366 * 100vw), 170px);
  height: auto;
}

.front-org__service-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: min(calc(15 / 1366 * 100vw), 15px) min(calc(150 / 1366 * 100vw), 150px);
  border-radius: 10px;
}

.front-org__service-label span {
  font-size: min(calc(14 / 1366 * 100vw), 14px);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.front-org__connector {
  width: min(calc(452 / 1366 * 100vw), 452px);
  height: min(calc(50 / 1366 * 100vw), 50px);
}

.front-org__connector-svg {
  width: 100%;
  height: 100%;
}

.front-org__branches {
  display: flex;
  gap: min(calc(20 / 1366 * 100vw), 20px);
  width: 100%;
  padding: 0 min(calc(50 / 1366 * 100vw), 50px);
}

.front-org__branch {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: min(calc(5 / 1366 * 100vw), 5px);
}

.front-org__branch-header {
  display: flex;
  align-items: center;
  gap: min(calc(30 / 1366 * 100vw), 30px);
  padding: min(calc(10 / 1366 * 100vw), 10px);
  border-radius: 10px;
}

.front-org__branch-logo-wrap {
  background-color: #fff;
  border-radius: 7px;
  padding: min(calc(10 / 1366 * 100vw), 10px) min(calc(15 / 1366 * 100vw), 15px);
}

.front-org__branch-logo {
  width: min(calc(73 / 1366 * 100vw), 73px);
  height: min(calc(50 / 1366 * 100vw), 50px);
  object-fit: contain;
}

.front-org__branch-name {
  font-size: min(calc(18 / 1366 * 100vw), 18px);
  color: #fff;
  font-weight: 700;
  line-height: 40px;
  flex: 1;
  text-align: center;
}

.front-org__branch-items {
  display: flex;
  flex-direction: column;
  gap: min(calc(10 / 1366 * 100vw), 10px);
  padding-top: min(calc(20 / 1366 * 100vw), 20px);
  padding-left: min(calc(30 / 1366 * 100vw), 30px);
  position: relative;
}

/* Vertical connector line */
.front-org__branch-items::before {
  content: "";
  position: absolute;
  left: min(calc(10 / 1366 * 100vw), 10px);
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #152a6d;
}

/* Mask excess vertical line below last item center */
.front-org__branch-item:last-child::after {
  content: "";
  position: absolute;
  left: calc(-1 * min(calc(21 / 1366 * 100vw), 21px));
  top: calc(50% + 1px);
  bottom: 0;
  width: min(calc(4 / 1366 * 100vw), 4px);
  background-color: #e4e7f1;
}

.front-org__branch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fff;
  border-radius: 10px;
  padding: min(calc(20 / 1366 * 100vw), 20px) min(calc(15 / 1366 * 100vw), 15px);
  text-decoration: none;
  transition: opacity var(--transition-duration-base);
  position: relative;
}

/* Horizontal connector line */
.front-org__branch-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * min(calc(20 / 1366 * 100vw), 20px));
  top: 50%;
  width: min(calc(20 / 1366 * 100vw), 20px);
  height: 1px;
  background-color: #152a6d;
}

.front-org__branch-item > span {
  font-size: min(calc(14 / 1366 * 100vw), 14px);
  color: #000;
  font-weight: 700;
}

.front-org__branch-icon {
  position: relative;
  width: min(calc(15 / 1366 * 100vw), 15px);
  height: min(calc(15 / 1366 * 100vw), 15px);
  background: #000;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.front-org__branch-arrow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.front-org__branch-arrow:nth-child(2) {
  transform: translateX(-100%);
}

.front-org__branch-item:hover .front-org__branch-arrow:first-child {
  transform: translateX(100%);
}

.front-org__branch-item:hover .front-org__branch-arrow:nth-child(2) {
  transform: translateX(0);
}

.front-org__branch-item:hover .front-org__branch-icon {
  transform: scale(1.3);
}

@media (width <= 750px) {
  .front-org__chart {
    padding: calc(10 / 375 * 100vw);
    border-radius: 5px;
  }

  .front-org__chart-inner {
    gap: calc(5 / 375 * 100vw);
  }

  .front-org__top {
    border-radius: 3px;
    padding: calc(10 / 375 * 100vw) calc(20 / 375 * 100vw);
    gap: calc(10 / 375 * 100vw);
  }

  .front-org__logo-img {
    width: calc(62 / 375 * 100vw);
  }

  .front-org__service-label {
    width: 100%;
    border-radius: 5px;
    padding: calc(10 / 375 * 100vw) calc(30 / 375 * 100vw);
  }

  .front-org__service-label span {
    font-size: calc(14 / 375 * 100vw);
  }

  .front-org__connector {
    width: 50%;
    height: calc(30 / 375 * 100vw);
  }

  .front-org__branches {
    flex-direction: row;
    gap: calc(5 / 375 * 100vw);
    padding: 0;
  }

  .front-org__branch {
    gap: calc(5 / 375 * 100vw);
  }

  .front-org__branch-header {
    flex-direction: column;
    align-items: center;
    gap: calc(10 / 375 * 100vw);
    padding: calc(10 / 375 * 100vw);
    border-radius: 5px;
    min-height: calc(108 / 375 * 100vw);
  }

  .front-org__branch-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    padding: calc(8 / 375 * 100vw) calc(10 / 375 * 100vw);
    width: 100%;
  }

  .front-org__branch-logo {
    width: calc(50 / 375 * 100vw);
    height: calc(35 / 375 * 100vw);
  }

  .front-org__branch-name {
    font-size: calc(14 / 375 * 100vw);
    line-height: calc(16 / 375 * 100vw);
    text-align: center;
  }

  .front-org__branch-items {
    padding-left: calc(15 / 375 * 100vw);
    padding-top: calc(5 / 375 * 100vw);
    gap: calc(10 / 375 * 100vw);
  }

  /* SP: Remove container-level vertical line */
  .front-org__branch-items::before {
    display: none;
  }

  .front-org__branch-item {
    border-radius: 5px;
    padding: calc(15 / 375 * 100vw);
  }

  .front-org__branch-item > span {
    font-size: calc(14 / 375 * 100vw);
  }

  .front-org__branch-icon {
    width: calc(14 / 375 * 100vw);
    height: calc(14 / 375 * 100vw);
  }

  /* SP: Horizontal connector */
  .front-org__branch-item::before {
    left: calc(-10 / 375 * 100vw);
    width: calc(10 / 375 * 100vw);
  }

  /* SP: Per-item vertical connector segment */
  .front-org__branch-item::after {
    content: "";
    position: absolute;
    left: calc(-10 / 375 * 100vw);
    top: calc(-5 / 375 * 100vw);
    bottom: calc(-5 / 375 * 100vw);
    width: 1px;
    background-color: #152a6d;
  }

  /* SP: First item extends into padding-top */
  .front-org__branch-item:first-child::after {
    top: calc(-5 / 375 * 100vw);
  }

  /* SP: Last item vertical stops at center (└ shape with horizontal ::before) */
  .front-org__branch-item:last-child::after {
    left: calc(-10 / 375 * 100vw);
    top: calc(-5 / 375 * 100vw);
    bottom: auto;
    height: calc(50% + 5 / 375 * 100vw);
    width: 1px;
    background-color: #152a6d;
  }
}
