/* 0301.css — 고객 / 산업별 레퍼런스
   수치는 design/0301_산업별 레퍼런스.svg(1920×2835) 좌표 실측 기준.
   히어로·헤더·푸터는 common.css 를 그대로 쓴다.

   세로 좌표
     히어로 밴드   64 ~ 520 (하단 1px #E8ECEF 구분선)
     필터/연도     584 ~ 636 (칩 높이 44 / 셀렉트 52)
     연도 패널     644 ~ 924 (열린 상태, 옵션 행 48)
     타임라인      첫 불릿 700, 행 간격 46, 그룹 간 +52
     푸터          2636

   타임라인 열 : 연도 384~600(216) / 고객사 600~807(207) / 사업내용 807~1536 */

/* 시안이 히어로 밴드를 64~520 으로 잡고 하단에 1px 구분선을 그린다.
   common.css 의 .hero 는 아래 여백 47 로 503 에서 끝나므로 63 + 선 1 로 520 을 맞춘다. */
.hero {
  padding-bottom: 63px;
  border-bottom: 1px solid var(--color-card-line);
}

.ref-section__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px var(--gutter-pc) 149px; /* 히어로 끝 520 → 필터 584 / 마지막 행 2487 → 푸터 2636 */
}

/* ── 상단 바 : 카테고리 칩(좌) + 연도 셀렉트(우) ── */
.ref-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* 칩 간격은 0302 와 같다 (잉크 간격 79 = 칩폭 62.5 + 17) */
.ref-filter {
  display: flex;
  gap: 17px; /* 칩 584~628 / 셀렉트 584~636 — 위쪽 기준으로 맞춘다 */
}

.ref-filter__btn {
  height: 44px;
  padding: 0 15.5px;
  border-radius: 20px;
  font-size: 18px;
  line-height: 1;
  color: var(--color-text-sub);
}

.ref-filter__btn--active {
  background: var(--color-tag-bg); /* #1740C4 10% */
  color: var(--color-primary);
}

/* ── 연도 셀렉트 : stroke rect 279×51 rx7.5 → 바깥 280×52, radius 8 ── */
.ref-select {
  position: relative;
  width: 280px;
}

.ref-select__btn {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-bg);
  font-size: 16px;
  line-height: 1;
  color: var(--color-muted);
}

.ref-select__btn--picked {
  color: var(--color-text);
}

.ref-select__arrow {
  transition: transform .2s ease;
}

.ref-select[data-open="true"] .ref-select__arrow {
  transform: rotate(180deg);
}

/* 패널 1256,644 280×280 rx8 : 셀렉트 하단 636 → 패널 상단 644 (8) */
.ref-select__panel {
  position: absolute;
  top: 60px;
  left: 0;
  width: 280px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0; /* 패널 644 → 첫 옵션 648 */
  border: 1px solid var(--color-card-line);
  border-radius: 8px;
  background: var(--color-bg);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.04); /* feOffset dy8 / blur σ6 / 0.04 */
  z-index: 20;
  display: none;
}

.ref-select[data-open="true"] .ref-select__panel {
  display: block;
}

.ref-select__option {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 16px;
  line-height: 1;
  text-align: left;
  color: var(--color-text-sub);
}

.ref-select__option:hover {
  background: #f7f8fd;
}

.ref-select__option--active {
  background: #f2f3fc;
  color: var(--color-primary);
}

/* ── 타임라인 ── */
.ref-timeline {
  margin-top: 38px; /* 셀렉트 하단 636 → 첫 행 박스 상단 674 */
}

.ref-panel {
  display: none;
}

.ref-panel--active {
  display: block;
}

.ref-year {
  position: relative;
  display: grid;
  grid-template-columns: 216px 1fr;
  animation: ref-year-in .45s ease;
}

@keyframes ref-year-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ref-year + .ref-year {
  margin-top: 52px; /* 그룹 간 : 불릿 간격 = 행수×46 + 52 */
}

.ref-year[hidden] + .ref-year {
  margin-top: 0;
}

.ref-year[hidden] {
  display: none;
}

/* 세로선 x391 w2 : 이 그룹 불릿에서 다음 그룹 불릿까지 잇는다 */
.ref-year::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 26px;
  bottom: -78px; /* 그룹 간격 52 + 다음 불릿까지 26 */
  width: 2px;
  background: var(--color-card-line);
}

.ref-year:last-child::before,
.ref-year--last::before {
  display: none;
}

/* 불릿 circle cx392 cy700 r7 + white stroke 2 → 안쪽 원 12 + 흰 테 2 = 바깥 16 */
.ref-year::after {
  content: "";
  position: absolute;
  left: 0; /* 384 + 8 = 중심 392 */
  top: 18px; /* 674 + 18 + 8 = 중심 700 */
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-bg);
  border-radius: 50%;
  background: var(--color-text);
}

.ref-year__label {
  padding: 9px 0 0 40px; /* 행 박스 상단 674 → 라인박스 683 / 좌 384 → 424 */
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--color-text);
}

/* 행 : 1줄이면 높이 46 (10 + 26 + 10), 사업내용이 길면 26 씩 늘어난다 */
.ref-row {
  display: grid;
  grid-template-columns: 207px 1fr;
  padding: 10px 0;
}

.ref-row__client {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 26px;
  color: var(--color-primary);
}

.ref-row__desc {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 26px;
  color: var(--color-text);
}

/* 고객사명만 나열된 연도(2007·2006·~2005) : 두 열을 합쳐 한 줄로 흘린다 */
.ref-row--plain .ref-row__desc {
  grid-column: 1 / -1;
}

.ref-empty {
  padding: 60px 0;
  font-size: 18px;
  line-height: 26px;
  color: var(--color-text-sub);
}

/* ── 반응형 : 모바일 시안이 없으므로 열을 접고 좌우 20 규칙을 따른다 ── */
@media (max-width: 1023px) {
  .ref-section__inner {
    padding: 64px var(--gutter-pc) 100px;
  }

  .ref-year {
    grid-template-columns: 140px 1fr;
  }

  .ref-year__label {
    padding-left: 28px;
    font-size: 28px;
  }

  .ref-row {
    grid-template-columns: 190px 1fr;
  }

  /* 열이 좁아지므로 본문도 한 단계 줄인다 (고객사명이 두 줄로 접히지 않게) */
  .ref-row__client,
  .ref-row__desc {
    font-size: 17px;
    line-height: 24px;
  }
}

@media (max-width: 767px) {
  /* common.css 의 모바일 히어로 여백(48)을 되돌린다. 구분선은 그대로 둔다 */
  .hero {
    padding-bottom: 48px;
  }

  .ref-section__inner {
    padding: 40px var(--gutter-mo) 60px;
  }

  .ref-bar {
    display: block;
  }

  .ref-filter {
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 0;
  }

  .ref-filter__btn {
    height: 38px;
    padding: 0 14px;
    font-size: 15px;
  }

  .ref-select {
    width: 100%;
    margin-top: 16px;
  }

  .ref-select__panel {
    width: 100%;
  }

  .ref-timeline {
    margin-top: 32px;
  }

  /* 연도 라벨을 위로 빼고 행은 1열로 흘린다 */
  .ref-year {
    display: block;
    padding-left: 28px;
  }

  .ref-year::after {
    top: 8px;
  }

  .ref-year::before {
    top: 16px; /* 불릿 중심 */
    bottom: -60px;
  }

  .ref-year + .ref-year {
    margin-top: 40px;
  }

  .ref-year__label {
    padding: 0;
    font-size: 24px;
  }

  .ref-row {
    display: block;
    padding: 10px 0;
  }

  .ref-row__client,
  .ref-row__desc {
    display: block;
    font-size: 15px;
    line-height: 22px;
  }

  .ref-row__desc {
    margin-top: 2px;
  }
}
