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

/* ===== 히어로 ===== */
.hero{ position: relative; overflow: hidden; color: var(--white); display: flex; align-items: center; min-height: 60vh; }
@media (min-width: 768px){ .hero{ min-height: 72vh; } }
@media (min-width: 1200px){ .hero{ min-height: 78vh; } }
.hero__media{ position: absolute; inset: 0; z-index: 0; }
.hero__media img{ width: 100%; height: 100%; object-fit: cover; }
.hero__scrim{ position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(28,25,23,.05) 0%, rgba(28,25,23,0) 45%, rgba(28,25,23,.32) 100%); }
.hero__body{ position: relative; z-index: 2; width: 100%; padding-block: 84px 72px; }
@media (min-width: 768px){ .hero__body{ padding-block: 124px 104px; } }
.hero__badge{ display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12); color: var(--white); font-weight: 700; font-size: 13px; letter-spacing: .04em; margin-bottom: 18px; }
.hero__badge .dot{ width: 8px; height: 8px; border-radius: 999px; background: var(--amber); flex: none; }
.hero h1{ color: var(--white); margin-bottom: 14px; text-shadow: 0 2px 16px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.5); }
.hero h2{ color: #E7E5E4; font-weight: 500; font-size: clamp(16px, 2.4vw, 20px); letter-spacing: -0.01em; margin-bottom: 28px; text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.hero__answer{ max-width: 640px; font-size: clamp(16px, 2.4vw, 19px); line-height: 1.7; color: #E7E5E4; margin-bottom: 24px; text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.hero__sub{ display: grid; gap: 8px; margin: 0 0 28px; max-width: 560px; color: #D6D3D1; 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(--amber); }
.hero__cta{ display: flex; flex-wrap: wrap; gap: 12px; }
.hero__cta .btn-ghost{ background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.6); color: var(--white); }
.hero__cta .btn-ghost:hover{ background: rgba(255,255,255,.18); }

/* ===== 모바일: H1을 사진 위 오버레이에서 분리해 상단에 먼저 배치 =====
   site.js가 H1을 .hero 최상단 직속 자식으로 옮긴다(데스크톱에서는 .hero__body 안으로 되돌림).
   display:contents 방식은 일부 브라우저에서 order와 함께 쓸 때 렌더링이 깨져 이 방식으로 교체함. */
@media (max-width: 767.98px){
  .hero{ display: flex; flex-direction: column; align-items: stretch; min-height: 62vh; }
  .hero > h1{
    position: relative; z-index: 3;
    color: var(--ink);
    text-shadow: none;
    background: var(--paper);
    padding: 28px 20px 18px;
    margin: 0;
  }
}

/* ===== 요약 박스 (AI 빠른 추출용) ===== */
.overview-box{ background: var(--accent-soft); border: 1px solid #A7F3D0; 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: 50%; background: var(--amber); color: var(--navy); font-weight: 800; font-size: 14px; 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); } }
.gallery-set{ background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--sh-1); }

/* ===== 대표 키워드 캐러셀 (스크롤스냅, 자동재생, 스와이프) ===== */
.carousel{ position: relative; }
.carousel__track{
  display: flex; 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: 50%; border: 1.5px solid var(--line-2); background: var(--white); color: var(--navy); 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; }
@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: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: 44px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); }
.section-head p{ color: var(--ink-2); margin: 14px 0 0; }
.section-foot{ margin-top: 28px; text-align: center; }
