/* page-career — .tpl-page-career 아래로 작성
 *
 * 순서는 템플릿 섹션 순서와 같다:
 *   0 공통 → ① 배너 → ② Motto → ③ Values → ④ Culture → ⑤ Benefits → ⑥ Interview → ⑦ CTA(흐르는 문구) → 모션 줄이기
 * 섹션 안에서는 기본(모바일) → 넓은 화면(768 · 1024) → 상태(포커스 · 호버) → 예외(휴대폰 가로) 순
 */


/* ── 0 공통 ───────────────────────────────────────────────────────────── */
.tpl-page-career {
  overflow-x: clip;
}

/* 섹션 제목 */
.tpl-page-career h2 {
  margin-top: clamp(16px, calc(1.35 * var(--wp--custom--vwc)), 26px);
  margin-bottom: clamp(40px, calc(3.375 * var(--wp--custom--vwc)), 72px);
  font-size: clamp(22px, calc(3 * var(--wp--custom--vwc)), 40px);
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.tpl-page-career .career-culture__title,
.tpl-page-career .career-benefits__title,
.tpl-page-career .career-interview__title {
  text-wrap: balance;
  word-break: keep-all;
}

.tpl-page-career .career-motto {
  padding-block: clamp(60px, calc(6.1875 * var(--wp--custom--vwc)), 150px) clamp(40px, calc(4.5 * var(--wp--custom--vwc)), 90px);
}

.tpl-page-career .career-culture,
.tpl-page-career .career-benefits,
.tpl-page-career .career-interview {
  padding-block: clamp(72px, calc(6.75 * var(--wp--custom--vwc)), 150px);
}

.tpl-page-career .career-cta {
  padding-block: clamp(72px, calc(8.4375 * var(--wp--custom--vwc)), 170px);
}

.tpl-page-career .career-values-section {
  padding: clamp(72px, calc(8.8542 * var(--wp--custom--vwc)), 170px) 0 !important;
}


/* ── ① 배너 (.career-banner) — 화면 전체를 채운다 ───────────────────────── */
/* .tpl-page-career .career-banner {
  position: relative;
  height: calc(56.25 * var(--wp--custom--vwc));
  overflow: hidden;
} */

.tpl-page-career .career-banner__image {
  opacity: 1;
  transform: none;
  --cr-w: min(max(100vw, calc(100svh * 16 / 9)), calc((100vw - 2 * clamp(32px, calc(2.5 * min(1vw, calc(1920px / 100))), 64px)) * 1920 / 576));
  height: min(100svh, calc(var(--cr-w) * 9 / 16));
  position: relative;
  background: var(--wp--preset--color--ink);
  overflow: hidden;
  transition: opacity .8s cubic-bezier(0.32, 0.94, 0.6, 1), transform .8s cubic-bezier(0.32, 0.94, 0.6, 1);
  transition-delay: 0s;
}

.tpl-page-career .career-banner__image img {
  inset: auto;
  left: 50%;
  top: 50%;
  width: var(--cr-w);
  height: calc(var(--cr-w) * 9 / 16);
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: cover;
  position: absolute;
  filter: grayscale(1) contrast(1.02);
}


/* ── ② Motto 소개 (.career-motto) — 라벨 | 본문 두 단 ─────────────────────── */
.tpl-page-career .career-motto {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.tpl-page-career .career-motto__text {
  max-width: 38em;
  font-size: clamp(14px, calc(1.2 * var(--wp--custom--vwc)), 16px);
  line-height: 1.7;
  letter-spacing: -0.01em;
}

/* 앞 문장(p)과 h1을 한 문단처럼 이어 흐르게 한다 — h1 글자 크기는 본문(clamp)을 따른다 */
.tpl-page-career .career-motto__lead,
.tpl-page-career .career-motto__title {
  display: inline;
}

.tpl-page-career .career-motto__title {
  font-size: inherit;
}

@media (min-width: 768px) {
  .tpl-page-career .career-motto {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(30px, calc(5 * var(--wp--custom--vwc)), 80px);
  }

  .tpl-page-career .career-motto__label {
    padding-top: 6px;
    text-align: right;
  }
}


/* ── ③ Values (.career-values) — 사진 | 01·02·03 목록 ───────────────────────
 * 사진 3장은 한 틀에 겹쳐 두고, 켜진 것(.is-on)만 아래에서 올라온다. 목록은 켜진 항목(.is-active)만 Ink로 · 설명을 편다.
 * 꺼진 항목 색(Line)은 에디터에서 목록(__list) 글자색으로 준다.
 * 상태 클래스가 하나도 없으면(JS 전) 첫 번째가 켜진 것으로 본다.
 */
.tpl-page-career .career-values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: center;
  padding-top: var(--thesmc-header-height);
}

@media(max-width: 860px) {
  .tpl-page-career .career-values {
    grid-template-columns: 1fr;
  }

  .tpl-page-career .career-values__images:not(.block-editor-block-list__block) {
    max-width: none !important;
  }
}

/* 사진 크기는 비율이 아니라 격자 칸을 따른다.
 * 모바일 · 태블릿(위아래): 틀 높이를 화면에 맞추고(위아래 여유 80px씩) 목록이 차지하고 남은 줄을 사진이 채운다 — 목록은 늘 보인다.
 * 목록 높이는 설명 칸을 줄 수로 고정해(아래 「설명 칸 높이 고정」) 항목이 바뀌어도 그대로라 사진 높이도 흔들리지 않는다 */
.tpl-page-career .career-values:not(.block-editor-block-list__block) {
  height: calc(100svh - 160px);
  grid-template-rows: minmax(0, 1fr) auto;
}

.tpl-page-career .career-values__images:not(.block-editor-block-list__block) {
  position: relative;
  align-self: center;
  justify-self: end;
  width: 100%;
  height: 100%;
  overflow: hidden;
  max-width: 520px;
}

.tpl-page-career .career-values__image {
  margin: 0;
}

.tpl-page-career .career-values__image:not(.block-editor-block-list__block) {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
  transition: transform 0.9s var(--thesmc-ease);
  will-change: transform;
}

.tpl-page-career .career-values__image.is-on,
.tpl-page-career .career-values__images:not(:has(.is-on))>.career-values__image:first-child {
  transform: none;
}

.tpl-page-career .career-values__image img {
  display: block;
  width: calc(100% + 1px);
  height: calc(100% + 1px);
  object-fit: cover;
  filter: contrast(1.03);
}

/* 목록 — 번호는 counter로 붙인다 */
.tpl-page-career .career-values__list {
  display: flex;
  flex-direction: column;
  justify-content: start;
  gap: 14px;
  margin: 0;
  padding: 0;
  /* ol 기본 들여쓰기(40px) 제거 — 번호는 ::before가 그린다 */
  list-style: none;
  counter-reset: career-value;
  /* 펼친 설명 칸의 줄 수 — 세 설명 중 가장 긴 것이 들어가는 줄 수(폭별로 아래 미디어 쿼리에서 바꾼다). 문구를 고치면 다시 확인한다 */
  --values-desc-lines: 3;
}

@media (max-width: 300px) {
  .tpl-page-career .career-values__list {
    --values-desc-lines: 4;
  }
}

/* 휴대폰 가로(높이 500 이하)는 768px 넘어도 3줄이라 뺀다 */
@media (min-width: 768px) and (min-height: 501px) {
  .tpl-page-career .career-values__list {
    --values-desc-lines: 2;
  }
}

.tpl-page-career .career-values__item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: clamp(14px, calc(1.6 * var(--wp--custom--vwc)), 26px);
  counter-increment: career-value;
  font-size: clamp(28px, calc(9 * var(--wp--custom--vwc)), 52px);
}

.tpl-page-career .career-values__item::before {
  content: counter(career-value, decimal-leading-zero);
  margin-top: 0.5em;
  font-size: clamp(14px, calc(1.1 * var(--wp--custom--vwc)), 17px);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

/* 설명(mark) — 이름의 큰 글자 · 좁은 행간(0.98) · 대문자를 물려받지 않게 따로 준다 */
.tpl-page-career .career-values__item mark {
  grid-column-start: 2;
  max-width: 30em;
  font-size: clamp(13px, calc(1 * var(--wp--custom--vwc)), 15.5px);
  line-height: 1.7;
  letter-spacing: 0;
  text-transform: none;
}

/* 설명 칸 높이 고정 — 내용 길이와 상관없이 「줄 수 × 행간」으로 편다. 접히는 설명과 펴지는 설명이 같은 시간 · 같은 곡선으로 움직여
 * 줄어드는 만큼 늘어나므로 목록 높이가 늘 같다 → 모바일 · 태블릿에서 「틀 − 목록」인 사진 높이도 흔들리지 않는다 */
.tpl-page-career .career-values__item:not(.block-editor-block-list__block) mark {
  height: 0;
  margin-top: 0;
  overflow: hidden;
  transition: height 0.4s var(--thesmc-ease), margin-top 0.4s var(--thesmc-ease);
}

/* 켜진 항목 */
.tpl-page-career .career-values__item.is-active,
.tpl-page-career .career-values__list:not(:has(.is-active))>.career-values__item:first-child {
  color: var(--wp--preset--color--ink) !important;
  transition: color 0.32s var(--thesmc-ease) 0.25s;
}

.tpl-page-career .career-values__item.is-active mark,
.tpl-page-career .career-values__list:not(:has(.is-active))>.career-values__item:first-child mark {
  height: calc(var(--values-desc-lines) * 1.7em);
  margin-top: 14px;
}

/* 태블릿 — 위아래 그대로(사진은 위 「사진 크기」처럼 남은 줄을 채운다). 간격 · 글자만 키운다 */
@media (min-width: 768px) {
  .tpl-page-career .career-values {
    gap: clamp(30px, calc(5 * var(--wp--custom--vwc)), 80px);
  }

  .tpl-page-career .career-values__list {
    gap: clamp(18px, calc(1.8 * var(--wp--custom--vwc)), 40px);
  }

  .tpl-page-career .career-values__item {
    font-size: clamp(28px, calc(4.5 * var(--wp--custom--vwc)), 70px);
  }
}

/* 데스크탑 — 사진 | 목록 5:5 */
@media (min-width: 1024px) {
  .tpl-page-career .career-values {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  /* 틀 높이 68svh — 사진은 왼쪽 칸을 꽉 채운다. 목록이 더 높으면(낮은 화면) 틀이 목록만큼 늘어난다 */
  .tpl-page-career .career-values:not(.block-editor-block-list__block) {
    height: auto;
    min-height: 68svh;
    grid-template-rows: none;
  }

  .tpl-page-career .career-values__list {
    min-height: clamp(420px, calc(25.875 * var(--wp--custom--vwc)), 480px);
  }
}

/* 휴대폰 가로(높이 500 이하) — 사진이 화면을 덮어 문구가 안 보이지 않게 사진을 줄이고 문구를 오른쪽에(시안 261005b).
 * 태블릿 구간(~1023px)이 위아래 배치라 큰 폰의 가로(932px 등)까지 여기에 넣는다 */
@media (max-width: 1023px) and (max-height: 500px) and (orientation: landscape) {
  .tpl-page-career .career-values {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 32px;
  }

  .tpl-page-career .career-values:not(.block-editor-block-list__block) {
    height: auto;
    grid-template-rows: none;
  }

  .tpl-page-career .career-values__images:not(.block-editor-block-list__block) {
    align-self: center;
    width: auto;
    height: calc(40.5 * var(--wp--custom--vwc));
    aspect-ratio: 1 / 1;
  }

  .tpl-page-career .career-values__list {
    gap: 10px;
    min-height: 0;
  }

  .tpl-page-career .career-values__item {
    font-size: clamp(26px, calc(3.9375 * var(--wp--custom--vwc)), 34px);
  }

  .tpl-page-career .career-values__item.is-active mark,
  .tpl-page-career .career-values__list:not(:has(.is-active))>.career-values__item:first-child mark {
    margin-top: 8px;
  }
}


/* ── ④ Culture (.career-culture) — 사진 | 캡션 · 이름 · 설명, 지그재그 ──────── */

.tpl-page-career .career-culture__list {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, calc(4.5 * var(--wp--custom--vwc)), 110px);
}

/* 항목 — 사진 | 글 두 단 */
.tpl-page-career .career-culture__item {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(28px, calc(5 * var(--wp--custom--vwc)), 80px);
  align-items: start;
}

.tpl-page-career .career-culture {
  container-type: inline-size;
}

.tpl-page-career .career-culture__image {
  --culture-bleed: clamp(0px, (var(--wp--style--global--wide-size) - 100cqw) / 2, var(--wp--preset--spacing--gutter));
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.tpl-page-career .career-culture__image:first-child {
  margin-left: calc(-1 * var(--culture-bleed));
}

.tpl-page-career .career-culture__image:last-child {
  margin-right: calc(-1 * var(--culture-bleed));
}

.tpl-page-career .career-culture__image a {
  display: block;
  height: 100%;
}

/* 틀을 꽉 채우고 가운데 기준으로 자른다(시안 image-slot의 width 111% · left/top 50%와 같은 결과) */
.tpl-page-career .career-culture__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transition: transform 0.6s var(--thesmc-ease);
}

.tpl-page-career .career-culture__caption {
  font-size: clamp(13px, calc(1.3 * var(--wp--custom--vwc)), 15px);
}

.tpl-page-career .career-culture__name {
  font-size: clamp(26px, calc(3.4 * var(--wp--custom--vwc)), 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.tpl-page-career .career-culture__desc {
  max-width: 34em;
  margin-top: clamp(16px, calc(1.2375 * var(--wp--custom--vwc)), 22px);
  font-size: clamp(15px, calc(1.5 * var(--wp--custom--vwc)), 18px);
  line-height: 1.75;
}

@media (hover: hover) and (pointer: fine) {
  .tpl-page-career .career-culture__item:hover .career-culture__image img {
    transform: scale(1.03);
  }
}


/* ── ⑤ Benefits (.career-benefits) — 카드 1 → 2 → 4열 ──────────────────────
 * 호버 · 포커스 시 흰 배경이 아래에서 올라오고 글자가 어두워진다
 */
.tpl-page-career .career-benefits__grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 1px;
}

.tpl-page-career .career-benefits__card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(28px, calc(3.2 * var(--wp--custom--vwc)), 40px) clamp(22px, calc(2.4 * var(--wp--custom--vwc)), 32px) clamp(34px, calc(2.25 * var(--wp--custom--vwc)), 48px);
  display: flex;
  flex-direction: column;
  min-height: clamp(220px, calc(14.5833 * var(--wp--custom--vwc)), 280px);
}

.tpl-page-career .career-benefits__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--wp--preset--color--white);
  transform: translateY(100%);
  transition: transform 0.5s var(--thesmc-ease);
  pointer-events: none;
}

.tpl-page-career .career-benefits__card p {
  transition: color 0.45s var(--thesmc-ease);
}

.tpl-page-career .career-benefits__body {
  padding-top: clamp(28px, calc(2.8125 * var(--wp--custom--vwc)), 44px);
}

.tpl-page-career .career-benefits__num {
  font-weight: 500;
}

.tpl-page-career .career-benefits__name {
  font-size: clamp(18px, calc(1.9 * var(--wp--custom--vwc)), 23px);
}

.tpl-page-career .career-benefits__desc {
  margin-top: 12px;
  font-size: clamp(13px, calc(1.3 * var(--wp--custom--vwc)), 15px);
}

@media (max-width: 900px) {
  .tpl-page-career .career-benefits__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width: 520px) {
  .tpl-page-career .career-benefits__grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* 키보드 포커스 */
.tpl-page-career .career-benefits__card:focus-within::before {
  transform: none;
}

.tpl-page-career .career-benefits__card:focus-within .career-benefits__num,
.tpl-page-career .career-benefits__card:focus-within .career-benefits__desc {
  color: var(--wp--preset--color--graphite) !important;
}

.tpl-page-career .career-benefits__card:focus-within .career-benefits__name {
  color: var(--wp--preset--color--ink) !important;
}

@media (hover: hover) and (pointer: fine) {
  .tpl-page-career .career-benefits__card:hover::before {
    transform: none;
  }

  .tpl-page-career .career-benefits__card:hover .career-benefits__num,
  .tpl-page-career .career-benefits__card:hover .career-benefits__desc {
    color: var(--wp--preset--color--graphite) !important;
  }

  .tpl-page-career .career-benefits__card:hover .career-benefits__name {
    color: var(--wp--preset--color--ink) !important;
  }
}


/* ── ⑥ Interview (.career-interview) — 인터뷰 링크 목록 ──────────────────────
 * 호버 · 포커스 시 검은 배경이 아래에서 차오르고 글자가 Ivory로. 넓은 화면에서는 오른쪽 절반에 놓는다
 */
.tpl-page-career .career-interview__list {
  margin-block: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--wp--preset--color--line);
}

.tpl-page-career .career-interview__list {
  width: 50%;
  min-width: 300px;
  max-width: none;
  margin-right: 0 !important;
  margin-left: auto !important;
}

.tpl-page-career .career-interview__item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--wp--preset--color--line);
  font-size: clamp(24px, calc(3.6 * var(--wp--custom--vwc)), 54px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.tpl-page-career .career-interview__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--wp--preset--color--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.42s var(--thesmc-ease);
}

.tpl-page-career .career-interview__item a {
  position: relative;
  z-index: 1;
  display: block;
  padding: clamp(20px, calc(1.9125 * var(--wp--custom--vwc)), 36px) 6px clamp(20px, calc(1.9125 * var(--wp--custom--vwc)), 36px) clamp(22px, calc(2.2 * var(--wp--custom--vwc)), 40px);
  transition: color 0.42s var(--thesmc-ease);
}

.tpl-page-career .career-interview__item a::after {
  content: "↗";
  font-size: clamp(22px, calc(2.6 * var(--wp--custom--vwc)), 40px);
  font-weight: 400;
  line-height: 1;
  margin-left: 0.4em;
  position: relative;
  top: -0.12em;
}

/* 키보드 포커스 */
.tpl-page-career .career-interview__item:focus-within::before {
  transform: scaleY(1);
}

.tpl-page-career .career-interview__item:focus-within a {
  color: var(--wp--preset--color--ivory);
}

@media (max-width: 360px) {
  .tpl-page-career .career-interview__list {
    min-width: auto;
    width: 100%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .tpl-page-career .career-interview__item:hover::before {
    transform: scaleY(1);
  }

  .tpl-page-career .career-interview__item:hover a {
    color: var(--wp--preset--color--ivory);
  }
}


/* ── ⑦ CTA (.career-cta) — 흐르는 문구 링크 ───────────────────────────────
 * 호버 · 포커스 시 Ivory 배경이 아래에서 올라오고 문구가 Ink로
 */
.tpl-page-career .career-cta {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
}

.tpl-page-career .career-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--wp--preset--color--ivory);
  transform: translateY(101%);
  transition: transform 0.55s var(--thesmc-ease);
}

/* 흐르는 문구 — 같은 문단 4개를 이어 붙이고 절반(-50%)만큼 밀어 끊김 없이 반복 */
.tpl-page-career .amarq-track {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  font-size: clamp(44px, calc(8 * var(--wp--custom--vwc)), 132px);
  line-height: 0.9;
  letter-spacing: -0.025em;
  transition: color 0.55s var(--thesmc-ease);
  animation: amarqScroll 26s linear infinite;
  will-change: transform;
}

.tpl-page-career .amarq-track>p {
  flex-shrink: 0;
  margin: 0;
  padding: 0 clamp(30px, calc(3.5 * var(--wp--custom--vwc)), 72px);
  white-space: nowrap;
}

/* 키보드 포커스 */
.tpl-page-career .career-cta:focus-visible::before {
  transform: translateY(0);
}

.tpl-page-career .career-cta:focus-visible .amarq-track {
  color: var(--wp--preset--color--ink) !important;
}

@media (hover: hover) and (pointer: fine) {
  .tpl-page-career .career-cta:hover::before {
    transform: translateY(0);
  }

  .tpl-page-career .career-cta:hover .amarq-track {
    color: var(--wp--preset--color--ink) !important;
  }
}

@keyframes amarqScroll {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(-50%, 0, 0);
  }
}


/* ── 모션 줄이기 ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tpl-page-career .amarq-track {
    animation: none;
  }

  .tpl-page-career .career-values__image:not(.block-editor-block-list__block) {
    opacity: 0;
    transform: none;
    transition: none;
  }

  .tpl-page-career .career-values__image.is-on,
  .tpl-page-career .career-values__images:not(:has(.is-on))>.career-values__image:first-child {
    opacity: 1;
  }

  /* 고정 스크롤이 없으니 세 항목을 모두 펼쳐 보여 준다 */
  .tpl-page-career .career-values__item {
    color: var(--wp--preset--color--ink) !important;
  }

  .tpl-page-career .career-values__item:not(.block-editor-block-list__block) mark {
    max-height: none;
    margin-top: 14px;
  }

  .tpl-page-career .career-values__item,
  .tpl-page-career .career-values__item mark,
  .tpl-page-career .career-culture__image img,
  .tpl-page-career .career-benefits__card::before,
  .tpl-page-career .career-benefits__card p,
  .tpl-page-career .career-interview__item::before,
  .tpl-page-career .career-interview__item a,
  .tpl-page-career .career-cta::before,
  .tpl-page-career .amarq-track {
    transition: none;
  }
}