/* v5.95 — 서비스: 작은 머리말(eyebrow) 아래 (01)(02)… 번호 + 큰 제목 목록. 참고: kommakomma.is "Where we can add value".
   선택된 항목(처음엔 첫 항목)만 Ink로 진하고 아래에 label·설명이 펼쳐지며, 나머지는 Dusty blue로 접혀 있다.
   PC(≥1024px)는 목록 오른쪽에 세로 2:3 사진 한 장이 선택된 제목의 높이를 따라 위아래로 움직인다(v5.96, kommakomma와 같은 방식 — services[].image, 없으면 사진 칸 없이 목록만).
   모바일·태블릿은 번호+제목 아코디언이고 사진은 펼친 항목 안에 들어간다.
   동작: public/scripts/services-list.js. 마크업: src/pages/index.astro(SSR)·public/scripts/content.js(런타임).
   색은 팔레트(Ink·Dusty·Cream·Paper)만, 그림자·그레이디언트·검정/흰색은 쓰지 않는다.
   이전 디자인(파노라마 + 3칸 목록)은 design-archive/services-2026-10/ 에 보관. */

.services-section {
  --svc-idle: rgba(108, 134, 156, 0.5); /* Dusty blue 50% */
  --svc-num-w: clamp(2.6rem, 4.2vw, 4.6rem);
  --svc-gap: clamp(0.9rem, 1.8vw, 1.75rem);
  --svc-photo-w: clamp(14.5rem, 20vw, 21rem);
  padding: clamp(6rem, 11vw, 11rem) 0 clamp(7rem, 12vw, 12rem);
}

.services-section__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 100rem);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

/* ── 머리말 ── */
.services-section__intro {
  max-width: 36rem;
  margin-bottom: clamp(2.75rem, 6vw, 5.5rem);
}

.services-section__intro .section-label {
  margin-bottom: 1.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.services-section__intro h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.1vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-transform: uppercase;
  text-wrap: balance;
  word-break: keep-all;
}

.services-section__intro h2 em {
  font-style: normal;
  font-weight: inherit;
}

.services-section__intro p {
  max-width: 46ch;
  margin: 1.5rem 0 0;
  color: var(--color-dusty);
  font-size: 0.8125rem;
  letter-spacing: 0.015em;
  line-height: 1.7;
  text-wrap: pretty;
  word-break: keep-all;
}

/* ── 번호 + 제목 목록 ── */
.services-section__list {
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-item__heading {
  margin: 0;
  font: inherit;
}

.service-item__head {
  display: grid;
  grid-template-columns: var(--svc-num-w) minmax(0, 1fr);
  gap: var(--svc-gap);
  align-items: start;
  width: 100%;
  margin: 0;
  padding: clamp(0.3rem, 0.8vw, 0.65rem) 0;
  border: 0;
  background: transparent;
  color: var(--svc-idle);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: color 500ms cubic-bezier(0.625, 0.05, 0, 1);
}

.service-item.is-active .service-item__head {
  color: var(--color-ink);
}

.service-item__head:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 4px;
}

.service-item__num {
  padding-top: clamp(0.7rem, 1.7vw, 1.8rem);
  font-family: var(--font-pretendard);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1;
}

.service-item__title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 14vw, 4.75rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.9;
  text-transform: uppercase;
  text-wrap: balance;
  word-break: keep-all;
}

@media (hover: hover) {
  .service-item:not(.is-active) .service-item__head:hover {
    color: color-mix(in srgb, var(--color-ink) 55%, transparent);
  }
}

/* ── 펼침 패널 ── */
.service-item__panel {
  display: grid;
  grid-template-rows: 1fr;
  padding-left: calc(var(--svc-num-w) + var(--svc-gap));
}

.js .service-item:not(.is-active) .service-item__panel {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 600ms cubic-bezier(0.625, 0.05, 0, 1), opacity 300ms ease, visibility 0s linear 600ms;
}

.js .service-item.is-active .service-item__panel {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition: grid-template-rows 600ms cubic-bezier(0.625, 0.05, 0, 1), opacity 500ms ease 150ms, visibility 0s;
}

.service-item__panel-inner {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  max-width: 40rem;
  min-height: 0;
  padding: 0.5rem 0 clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
}

.service-item__label {
  color: var(--color-dusty);
  font-family: var(--font-pretendard);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.service-item__description {
  max-width: 44ch;
  margin: 0;
  color: var(--color-ink);
  font-size: 0.875rem;
  letter-spacing: 0.012em;
  line-height: 1.7;
  text-wrap: pretty;
  word-break: keep-all;
}

/* 모바일·태블릿: 펼친 항목 안의 사진(세로 2:3) */
.service-item__figure {
  display: block;
  width: min(64%, 17rem);
  margin-top: 0.75rem;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--color-cream);
}

.service-item__figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.services-section__visual {
  display: none;
}

/* ── PC(≥1024px): 왼쪽 목록 + 오른쪽 사진 ──
   v5.96 kommakomma 방식: 사진 칸(visual)은 목록과 같은 줄에 붙고, 그 안의 2:3 사진 틀(frame)이 선택된 제목의 가운데 높이로 옮겨 간다.
   위치(--svc-photo-y)는 services-list.js가 정한다. 틀은 목록 위·아래로 조금 넘칠 수 있다(머리말 오른쪽 빈 칸·섹션 아래 여백 안). */
@media (min-width: 1024px) {
  .services-section__inner:has([data-service-visual]) {
    grid-template-columns: minmax(0, 1fr) var(--svc-photo-w);
    grid-template-areas:
      "intro ."
      "list visual";
    column-gap: clamp(3rem, 7vw, 8rem);
  }

  .services-section__inner:has([data-service-visual]) .services-section__intro {
    grid-area: intro;
  }

  .services-section__inner:has([data-service-visual]) .services-section__list {
    grid-area: list;
  }

  .service-item__title {
    font-size: clamp(3.4rem, 7.4vw, 8.5rem);
  }

  /* 사진은 오른쪽 틀 하나만 — 항목 안 사진은 쓰지 않는다 */
  .service-item__figure {
    display: none;
  }

  .services-section__visual {
    position: relative;
    grid-area: visual;
    display: block;
    align-self: stretch;
    pointer-events: none;
  }

  .services-section__frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: var(--color-cream);
    opacity: 0;
    transform: translate3d(0, var(--svc-photo-y, 0px), 0);
    transition: opacity 500ms ease;
    will-change: transform;
  }

  /* 선택된 항목에 사진이 없으면 틀을 비운다 */
  .services-section__frame:has(.is-active) {
    opacity: 1;
  }

  .services-section__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 300ms ease;
  }

  .services-section__photo.is-active {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-item__head,
  .js .service-item .service-item__panel,
  .services-section__frame,
  .services-section__photo {
    transition: none !important;
  }
}
