/* ==========================================================================
   정밀주조 (One Page) — 시안 sub.psd 1920px 기준
   공통 : page head = layout.css 토큰 · 섹션 타이틀 = .sec-title--ko
          상단 비주얼 · 소개 · 공정 카드 = sub.css (.sub-hero · .sub-intro · .img-card)
   ========================================================================== */

.casting [id] { scroll-margin-top: var(--header-h); }

/* 02 · 03 정밀 주조 라인 : 지그재그 공정 흐름 (카드 = .img-card) ---------------- */
.casting-line { padding-top: 70px; }
.casting-line + .casting-line { padding-top: 159px; }

.flow {
  --gap-x: 84px;
  --gap-y: 82px;
  --arrow-w: 52px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gap-x);
  row-gap: var(--gap-y);
  margin-top: 57px;
}
.flow__item {
  position: relative;
  grid-row: var(--r3);
  grid-column: var(--c3);
}
.flow__img img { aspect-ratio: 480 / 380; }
/* 번호 가독성용 상단 그림자 (시안 Layer 14 : 검정 → 투명) */
.flow__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .53) 0, rgba(0, 0, 0, .41) 10.3%, rgba(0, 0, 0, .31) 18.2%, rgba(0, 0, 0, .21) 26%, rgba(0, 0, 0, .13) 34%, rgba(0, 0, 0, .06) 41.8%, rgba(0, 0, 0, 0) 50.5%);
  pointer-events: none;
}
.flow__num {
  position: absolute;
  z-index: 1;
  left: 35px;
  top: 35px;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -.025em;
  color: #fff;
}
.flow__name { font-weight: 700; }

/* 화살표 : 다음 공정 방향 (right · left · down) — 라벨 높이는 .img-card 토큰 */
.flow__arrow {
  position: absolute;
  display: grid;
  place-items: center;
  color: var(--c-blue);
  pointer-events: none;
}
.flow__arrow svg { width: var(--arrow-w); height: auto; fill: currentColor; }
.flow__arrow[data-d3="right"],
.flow__arrow[data-d3="left"] {
  top: 0;
  bottom: calc(var(--card-label-h) + var(--card-label-gap));
  width: var(--gap-x);
}
.flow__arrow[data-d3="right"] { left: 100%; }
.flow__arrow[data-d3="left"] { right: 100%; }
.flow__arrow[data-d3="left"] svg { transform: rotate(180deg); }
.flow__arrow[data-d3="down"] { top: 100%; left: 0; right: 0; height: var(--gap-y); }
.flow__arrow[data-d3="down"] svg { transform: rotate(90deg); }

/* 04 주조설비 Table ---------------------------------------------------------- */
.casting-equip { padding: 148px 0 152px; }
.equip-table {
  margin-top: 36px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.equip-table table {
  width: 100%;
  border-top: 2px solid var(--c-text);
  border-bottom: 1px solid #cad4df;
  table-layout: fixed;
  letter-spacing: -.025em;
  text-align: center;
}
.equip-table__c1 { width: 11.6%; }
.equip-table__c2 { width: 36.65%; }
.equip-table__c3 { width: 26.25%; }
.equip-table thead th {
  height: 68px;
  border-bottom: 1px solid #cad4df;
  background: var(--c-bg-gray);
  font-weight: 700;
  font-size: 24px;
}
.equip-table thead th + th,
.equip-table tbody td { border-left: 1px solid #cad4df; }
.equip-table tbody + tbody { border-top: 1px solid #cad4df; }
.equip-table tbody th {
  font-weight: 700;
  font-size: 24px;
}
.equip-table td {
  height: 63.8px;
  padding: 6px 16px;
  font-size: 22px;
  line-height: 1.4;
  color: var(--c-text-sub);
}
.equip-table tbody tr + tr td { border-top: 1px solid #cad4df; }

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 1599px) {
  .flow { --gap-x: 64px; --gap-y: 72px; --arrow-w: 44px; }
}

@media (max-width: 1279px) {
  .casting-line { padding-top: 60px; }
  .casting-line + .casting-line, .casting-equip { padding-top: 120px; }
  .casting-equip { padding-bottom: 120px; }
  .flow { --gap-x: 48px; --gap-y: 64px; --arrow-w: 36px; margin-top: 44px; }
  .flow__num { left: 24px; top: 22px; font-size: 30px; }
  .equip-table thead th, .equip-table tbody th { font-size: 20px; }
  .equip-table td { height: 56px; font-size: 18px; }
  .equip-table thead th { height: 60px; }
}

/* 태블릿 : 2열 지그재그 */
@media (max-width: 1023px) {
  .casting-line + .casting-line, .casting-equip { padding-top: 96px; }
  .casting-equip { padding-bottom: 96px; }

  .flow { --gap-x: 56px; --gap-y: 64px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow__item { grid-row: var(--r2); grid-column: var(--c2); }
  .flow__arrow[data-d3] { top: auto; bottom: auto; left: auto; right: auto; width: auto; height: auto; }
  .flow__arrow[data-d3] svg { transform: none; }
  .flow__arrow[data-d2="right"],
  .flow__arrow[data-d2="left"] { top: 0; bottom: calc(var(--card-label-h) + var(--card-label-gap)); width: var(--gap-x); }
  .flow__arrow[data-d2="right"] { left: 100%; }
  .flow__arrow[data-d2="left"] { right: 100%; }
  .flow__arrow[data-d2="left"] svg { transform: rotate(180deg); }
  .flow__arrow[data-d2="down"] { top: 100%; left: 0; right: 0; height: var(--gap-y); }
  .flow__arrow[data-d2="down"] svg { transform: rotate(90deg); }

  /* 표 : 가로 스크롤 */
  .equip-table { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .equip-table table { min-width: 720px; }
  .equip-table td { padding: 6px 12px; white-space: nowrap; }
}

@media (max-width: 767px) {
  .casting-line { padding-top: 48px; }
  .casting-line + .casting-line, .casting-equip { padding-top: 72px; }
  .casting-equip { padding-bottom: 72px; }

  /* 모바일 : 1열 · 실제 공정 순서 · 화살표 모두 아래 방향 */
  .flow { --gap-y: 48px; --arrow-w: 30px; grid-template-columns: minmax(0, 1fr); margin-top: 28px; }
  .flow__item { grid-row: auto; grid-column: auto; }
  .flow__arrow[data-d2] { top: 100%; bottom: auto; left: 0; right: 0; width: auto; height: var(--gap-y); }
  .flow__arrow[data-d2] svg { transform: rotate(90deg); }
  .flow__num { left: 18px; top: 16px; font-size: 28px; }

  .equip-table { margin-top: 24px; }
  .equip-table table { min-width: 640px; }
  .equip-table thead th, .equip-table tbody th { font-size: 17px; }
  .equip-table thead th { height: 52px; }
  .equip-table td { height: 50px; font-size: 16px; }
}
