/* 메인 서비스 요약 카드 · 서비스 페이지 머리 — scripts/webflow-import/service-pages.mjs */

.ea-svc-sum__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.ea-svc-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 17rem;
  padding: 2rem;
  border-radius: var(--radius--card);
  background: var(--color-palette--white, #fff);
  color: var(--color-palette--black, #151515);
  text-decoration: none;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.ea-svc-card h3 {
  margin: 0;
}
.ea-svc-card p {
  margin: 0;
  color: var(--color-palette--gray-dark, #6b6b6b);
  word-break: keep-all;
  transition: color 0.2s;
}
.ea-svc-card__no {
  font-family: var(--font--font-mono);
  color: var(--color-palette--gray-dark, #6b6b6b);
  font-size: 0.9rem;
}
.ea-svc-card__more {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
  font-weight: 500;
}
.ea-svc-card__more .symbol {
  color: var(--color-palette--green-brand, #0cdc83);
}
.ea-svc-card:hover {
  background: var(--color-palette--black, #151515);
  color: var(--color-palette--white, #fff);
}
.ea-svc-card:hover p,
.ea-svc-card:hover .ea-svc-card__no {
  color: #a8a8a8;
}

/* 서비스 페이지 — 머리 아래 섹션 사이를 메인보다 조금 좁게, 위치 이동 시 메뉴 바 아래에서 멈춤 */
[data-ea-home="service"] ~ section[id] {
  scroll-margin-top: 6rem;
}

/* 메인 포트폴리오 '전체 프로젝트 보기' — 검은 큰 버튼 + 초록 화살표로 강조 */
#portfolio .section-header > .button-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 3.25rem;
  padding: 0 1.25rem 0 1.75rem;
  border-color: var(--color-palette--black, #151515);
  background: var(--color-palette--black, #151515);
  color: var(--color-palette--white, #fff);
  font-size: 17px;
  transition:
    background-color 0.2s,
    gap 0.2s;
}
#portfolio .section-header > .button-secondary::after {
  content: "arrow_forward";
  font-family: "Material Symbols Outlined", sans-serif;
  font-size: 22px;
  line-height: 1;
  color: var(--color-palette--green-brand, #0cdc83);
}
#portfolio .section-header > .button-secondary:hover {
  background: #333;
  color: var(--color-palette--white, #fff);
  gap: 0.875rem;
}

/* 서비스 페이지 섹션 제목 끝 심볼 — 글자 높이 · 아래 맞춤 */
.ea-symbol {
  display: inline-block;
  height: 1em;
  width: auto;
  margin: 0 0.25ch;
  vertical-align: text-bottom;
}
/* 머리 바로 아래 첫 섹션 — 머리와의 사이를 좁게 */
[data-ea-home="service"] + .section {
  padding-top: 0;
}
[data-ea-home="service"] + .section > .container {
  padding-top: 4rem;
}
[data-ea-home="service"] + .section .section-header {
  margin-top: 0;
}

@media screen and (max-width: 991px) {
  .ea-svc-sum__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media screen and (max-width: 479px) {
  .ea-svc-sum__grid {
    grid-template-columns: 1fr;
  }
  .ea-svc-card {
    min-height: 0;
    padding: 1.5rem;
  }
}

/* 서비스 탭 카드 — 카드가 3장보다 적으면(관리자에서 숨긴 서비스가 있을 때) 가운데로 모은다. 카드 폭은 3칸 기준 그대로 */
@media screen and (min-width: 992px) {
  .service-tabs .card-grid:not(.target):not(.feature) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  .service-tabs .card-grid:not(.target):not(.feature) > .card {
    flex: 0 1 calc((100% - 3rem) / 3);
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
  }
}

/* 주요 클라이언트 로고 — 넓은 화면에서 한 줄에 5개(태블릿 4개 · 휴대폰 2개는 그대로) */
@media screen and (min-width: 992px) {
  .logo-collection-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: auto;
  }
}

/* 서비스 페이지 콘텐츠 폭 — 맨 위 서비스 카드 두 장을 합친 폭(세 칸 중 두 칸 + 사이, 탭 안쪽 여백 10px 빼고)에
   아래 섹션(타겟 고객 카드 · 주요 클라이언트 · 강점 카드 · 고객 평가)을 모두 맞춘다(넓은 화면) */
@media screen and (min-width: 992px) {
  [data-ea-home="service"] ~ section[id]:not(#service):not(#footer):not(#hero) {
    --ea-svc-w: calc(
      2 * (100% - 2 * var(--_responsive---space--regular-width) - 20px - 3rem) /
        3 + 1.5rem
    );
  }
  [data-ea-home="service"]
    ~ section[id]:not(#service):not(#footer):not(#hero)
    > .container {
    padding-left: calc((100% - var(--ea-svc-w)) / 2);
    padding-right: calc((100% - var(--ea-svc-w)) / 2);
  }
  /* 타겟 고객 카드는 안쪽 여백(10px)이 한 겹 더 있어 그만큼 넓힌다 — 서비스 카드 안쪽 여백과 같은 이유 */
  [data-ea-home="service"]
    ~ section#target:not(#service):not(#footer):not(#hero)
    > .container {
    padding-left: calc((100% - var(--ea-svc-w)) / 2 - 10px);
    padding-right: calc((100% - var(--ea-svc-w)) / 2 - 10px);
  }
  /* 로고는 칸 가운데에 */
  .logo-collection-list {
    justify-items: center;
  }
}

/* 주요 클라이언트 로고 · 강점 카드 — 넓은 화면, 위 카드 두 장 폭 안에서 */
@media screen and (min-width: 992px) {
  /* 로고: 칸 사이를 줄이고 높이를 키운다(가로로 긴 로고는 칸 폭까지만) */
  /* 로고 칸을 위 카드 두 장 폭 전체로 펴고, 줄마다 가운데 정렬(마지막 줄도 가운데) */
  [data-ea-home="service"] ~ section#target .logo-grid,
  [data-ea-home="service"] ~ section#target .logo-collection-list-wrapper {
    width: 100%;
  }
  .logo-collection-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 2.5rem;
    row-gap: 3rem;
  }
  .logo-collection-list > * {
    flex: 0 0 calc((100% - 4 * 2.5rem) / 5);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .logo-collection-list .logo-image {
    height: 3.25rem;
    width: auto;
    max-width: 100%;
  }
  /* 강점 카드: 글이 짧아 높이를 줄인다 */
  [data-ea-home="service"] ~ section#feature .feature-stack-card {
    height: min(420px, 60vh);
  }
}
