/*
  main.css — 공통 컴포넌트(히어로/카드/캐러셀/단계/CTA). tokens.css, header-footer.css 다음에 로드.
*/

/* ===== 히어로 — 좌측 텍스트 / 우측 사진 절반 분할(형제사이트의 풀블리드 사진+오버레이 텍스트와 구분) =====
   모바일은 사진(위)+텍스트(아래) 세로 스택, 텍스트는 항상 불투명 배경 위에 놓여 스크림/텍스트섀도우가 필요 없다. */
.hero{ position: relative; overflow: hidden; color: var(--ink); display: flex; flex-direction: column; background: var(--paper); }
.hero__media{ position: relative; order: 1; height: 66vh; min-height: 320px; max-height: 560px; }
.hero__media img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.hero__scrim{ display: none; }
.hero__body{ position: relative; order: 2; width: 100%; padding: 22px 20px 40px; }
@media (min-width: 768px){ .container.hero__body{ padding: 0 6vw; } }

@media (min-width: 768px){
  .hero{ display: grid; grid-template-columns: 1fr 1fr; min-height: 520px; }
  .hero__media{ order: 2; aspect-ratio: auto; height: 100%; }
  .container.hero__body{ order: 1; max-width: none; margin-inline: 0; display: flex; flex-direction: column; justify-content: center; }
}

.hero__badge{ display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--r-chip); border: 1px solid var(--line-2); background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 18px; }
.hero__badge .dot{ width: 8px; height: 8px; border-radius: 999px; background: var(--accent2); flex: none; }
.hero h1{ color: var(--ink); margin-bottom: 14px; text-shadow: none; }
.hero h2{ color: var(--ink-2); font-weight: 500; font-size: clamp(16px, 2.4vw, 20px); letter-spacing: -0.01em; margin-bottom: 28px; text-shadow: none; }
.hero__answer{ max-width: 520px; font-size: clamp(16px, 2.2vw, 18.5px); line-height: 1.7; color: var(--ink-2); margin-bottom: 24px; text-shadow: none; }
.hero__sub{ display: grid; gap: 8px; margin: 0 0 28px; max-width: 520px; color: var(--ink-3); font-size: 15.5px; }
.hero__sub li{ list-style: none; padding-left: 22px; position: relative; }
.hero__sub li::before{ content: ""; position: absolute; left: 0; top: 10px; width: 12px; height: 2px; background: var(--accent); }
.hero__cta{ display: flex; flex-wrap: wrap; gap: 12px; }

/* ===== 요약 박스 (AI 빠른 추출용) ===== */
.overview-box{ background: var(--accent-soft); border: 1px solid #E3C88C; border-radius: var(--r-lg); padding: 20px 22px; }
.overview-box h2{ font-size: 15px; color: var(--accent-deep); margin-bottom: 10px; }
.overview-box ul{ margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; line-height: 1.8; }

/* ===== 핵심요약 카드 ===== */
.summary-grid{ display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 768px){ .summary-grid{ grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (min-width: 1024px){ .summary-grid--4{ grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px){ .summary-grid--3{ grid-template-columns: repeat(3, 1fr); } }
.summary-card .num{ display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r); background: var(--ink); color: var(--white); font-weight: 800; font-size: 14px; font-family: var(--font-serif); margin-bottom: 12px; }
.summary-card h3{ margin-bottom: 8px; }
.summary-card p{ font-size: 14.5px; color: var(--ink-2); margin: 0; }

/* ===== 전후사진 그리드 ===== */
.gallery-grid{ display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px){ .gallery-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px){ .gallery-grid--3{ grid-template-columns: repeat(3, 1fr); } }
.gallery-set{ background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--sh-1); }

/* ===== 대표 키워드 캐러셀 =====
   모바일(640px 미만): 가로 스와이프 대신 6장을 세로로 한 줄씩 쌓아 스크롤만으로 전부 보이게 함.
   640px 이상: 스크롤스냅 가로 캐러셀(자동재생/스와이프). */
.carousel{ position: relative; }
.carousel__track{
  display: flex; flex-direction: column; gap: 16px;
  padding: 4px; margin: 0;
}
@media (min-width: 640px){
  .carousel__track{
    flex-direction: row; gap: 20px; overflow-x: auto; scroll-snap-type: x proximity;
    padding: 4px 4px 16px; margin: 0 -4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  }
  .carousel__track::-webkit-scrollbar{ height: 6px; }
  .carousel__track::-webkit-scrollbar-thumb{ background: var(--line-2); border-radius: 999px; }
}
.carousel__item{ flex: 0 0 auto; width: 100%; scroll-snap-align: start; }
@media (min-width: 640px){ .carousel__item{ width: 44vw; max-width: 320px; } }
@media (min-width: 1024px){ .carousel__item{ width: calc((100% - 5 * 20px) / 6); max-width: none; } }
.carousel__nav{ display: none; }
@media (min-width: 1024px){
  .carousel__nav{ display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 14px; }
  .carousel__nav button{ width: 40px; height: 40px; border-radius: var(--r); border: 1.5px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
  .carousel__nav button:hover{ border-color: var(--amber); color: var(--amber-deep); }
}

/* ===== 키워드 캐러셀 카드 (1:1) ===== */
.kw-grid{ display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px){ .kw-grid{ grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.kw-card{ display: flex; flex-direction: column; padding: 0; overflow: hidden; height: 100%; text-decoration: none; color: var(--ink); transition: transform .18s ease, box-shadow .18s ease; }
.kw-card:hover{ transform: translateY(-3px); box-shadow: var(--sh-3); }
.kw-card .thumb{ border-radius: var(--r-lg) var(--r-lg) 0 0; aspect-ratio: 1/1; }
.kw-card__body{ padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kw-card h3{ font-size: 16px; }
.kw-card p{ font-size: 13.5px; color: var(--ink-2); margin: 0; flex: 1; }
.kw-card .btn-secondary{ align-self: flex-start; margin-top: 4px; }

/* ===== 서비스/지역 카드 ===== */
.svc-grid, .region-grid{ display: grid; gap: 16px; grid-template-columns: 1fr; list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px){ .svc-grid, .region-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px){ .svc-grid, .region-grid{ grid-template-columns: repeat(4, 1fr); } }
.svc-card, .region-card{ display: flex; flex-direction: column; padding: 0; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .18s ease, box-shadow .18s ease; }
.svc-card a, .region-card a{ display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.svc-card:hover, .region-card:hover{ transform: translateY(-3px); box-shadow: var(--sh-3); }
.svc-card .thumb, .region-card .thumb{ border-radius: var(--r-lg) var(--r-lg) 0 0; }
.svc-card__body, .region-card__body{ padding: 16px; }
.svc-card h3, .region-card h3{ font-size: 16px; margin-bottom: 6px; }
.svc-card p, .region-card p{ font-size: 13.5px; color: var(--ink-2); margin: 0; }

/* ===== 관련페이지 카드(1:1, 상세/지역페이지 공용) ===== */
.related-grid{ display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px){ .related-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px){ .related-grid{ grid-template-columns: repeat(6, 1fr); } }
.related-card{ display: flex; flex-direction: column; padding: 0; overflow: hidden; text-decoration: none; color: var(--ink); height: 100%; transition: transform .18s ease, box-shadow .18s ease; }
.related-card:hover{ transform: translateY(-2px); box-shadow: var(--sh-2); }
.related-card .thumb{ border-radius: var(--r-lg) var(--r-lg) 0 0; aspect-ratio: 1/1; }
.related-card__body{ padding: 12px; }
.related-card h3{ font-size: 14px; margin-bottom: 4px; }
.related-card p{ font-size: 12px; color: var(--accent); margin: 0; font-weight: 700; }

/* ===== 진행 절차 ===== */
.steps{ display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 768px){ .steps{ grid-template-columns: repeat(4, 1fr); gap: 0; } }
.step{ position: relative; padding: 20px 0; }
@media (min-width: 768px){ .step{ padding: 24px 20px 0; border-top: 3px solid var(--amber); } .step + .step{ border-left: 1px solid var(--line); } }
.step__num{ display: block; font-weight: 800; font-size: 14px; letter-spacing: .08em; color: var(--amber-deep); margin-bottom: 10px; }
.step h3{ margin-bottom: 8px; }
.step p{ font-size: 14.5px; color: var(--ink-2); margin: 0; }

/* ===== CTA 밴드 ===== */
.cta-band{ background: var(--amber-soft); }
.cta-band__inner{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-band h2{ margin-bottom: 8px; }
.cta-band p{ margin: 0; color: var(--ink-2); }
.cta-band__actions{ display: flex; flex-wrap: wrap; gap: 12px; flex: none; }

/* ===== 링크 그리드 ===== */
.link-grid{ display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 768px){ .link-grid{ grid-template-columns: repeat(2, 1fr); gap: 18px; } }
.link-card{ display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; text-decoration: none; color: var(--ink); }
.link-card span{ font-weight: 700; font-size: 16px; }
.link-card::after{ content: ""; flex: none; width: 9px; height: 9px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg); }

.section-head{ margin-bottom: 28px; max-width: 720px; }
.section-head .eyebrow{ margin-bottom: 10px; }
.section-head h2{ position: relative; padding-bottom: 16px; }
.section-head h2::after{ content: ""; position: absolute; left: 0; bottom: 0; width: 52px; height: 4px; background: var(--accent); }
.section-head h2::before{ content: ""; position: absolute; left: 60px; bottom: 0; width: 14px; height: 4px; background: var(--accent2); }
.section-head p{ color: var(--ink-2); margin: 14px 0 0; }

/* ===== 상담 준비 카드 / 참고자료 카드 (허브·상담 공용) ===== */
.prep-grid{ display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px){ .prep-grid{ grid-template-columns: repeat(3, 1fr); } }
.prep-card{ text-align: center; }
.prep-card .prep-num{ display: block; font-family: var(--font-serif); font-weight: 900; font-size: 26px; color: var(--accent-deep); letter-spacing: 0; margin-bottom: 10px; }
.prep-card h3{ font-size: 16px; margin-bottom: 4px; }

.ref-grid{ display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px){ .ref-grid{ grid-template-columns: repeat(3, 1fr); } }
.ref-card{ display: flex; align-items: center; gap: 12px; }
.ref-card .ref-icon{ flex: none; width: 40px; height: 40px; border-radius: var(--r); background: var(--accent2-soft); color: var(--accent2-deep); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-family: var(--font-serif); }
.ref-card p{ margin: 0; font-size: 14.5px; font-weight: 600; }

/* ===== 지역 허브 공용 ===== */
.hero--area{ min-height: 44vh; }
@media (min-width: 768px){ .hero--area{ min-height: 50vh; } }
.district-chips{ display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.district-chips .chip{ pointer-events: none; }

/* ===== 서비스 허브 공용 ===== */
.hero--service{ min-height: 44vh; }
@media (min-width: 768px){ .hero--service{ min-height: 50vh; } }
.hub-lead{ max-width: 720px; }
