/*
  main.css
  `/` 메인 페이지 전용 스타일. tokens.css, header-footer.css 다음에 로드한다.
*/

/* ==========================================================================
   상황별 싱크대교체 안내 — 3열 정적 그리드(캐러셀 카드 재사용)
   ========================================================================== */
.situation-grid .carousel-card{ width: 100%; }

/* ==========================================================================
   고객 후기 — 자동 재생 마퀴 (요청에 따른 예외. .carousel과 별개 컴포넌트)
   ========================================================================== */
.review-carousel{ overflow: hidden; }
.review-carousel__track{
  display: flex;
  gap: 16px;
  width: max-content;
  animation: review-scroll 50s linear infinite;
}
@keyframes review-scroll{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce){
  .review-carousel__track{ animation: none; }
}
.review-card{
  flex: 0 0 260px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-2);
  border-radius: var(--r);
  padding: 20px;
}
.review-card__stars{ color: var(--clay); letter-spacing: 2px; margin-bottom: 10px; font-size: 14px; }
.review-card__text{ font-size: 15px; color: var(--ink-2); line-height: 1.6; margin: 0 0 12px; }
.review-card__who{ font-size: 13px; color: var(--ink-3); margin: 0; font-weight: 600; }

/* ==========================================================================
   히어로
   ========================================================================== */
.hero{
  position: relative;
  height: 0;
  padding-bottom: 133.333%;
  color: var(--white);
  overflow: hidden;
}
@media (min-width: 768px){
  .hero{ height: min(90vh, 760px); padding-bottom: 0; }
}
.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: hsl(24 30% 12% / 0);
}
.hero__body{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding-block: 48px 56px;
  width: 100%;
}
.hero__badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid hsl(0 0% 100% / .5);
  background: hsl(0 0% 100% / .12);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  margin-bottom: 18px;
}
.hero__badge .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--rose);
  flex: none;
}
.hero h1{ color: var(--white); margin-bottom: 16px; }
.hero__sub{
  display: grid;
  gap: 8px;
  margin: 0 0 28px;
  max-width: 560px;
  color: hsl(30 25% 94%);
  font-size: 17px;
  line-height: 1.7;
}
.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(--clay);
}
.hero__cta{ display: flex; flex-wrap: wrap; gap: 12px; }
.hero__cta .btn-ghost{
  background: hsl(0 0% 100% / .08);
  border-color: hsl(0 0% 100% / .6);
  color: var(--white);
}
.hero__cta .btn-ghost:active{ background: hsl(0 0% 100% / .18); }

/* ==========================================================================
   신뢰 배지 스트립
   ========================================================================== */
.badges{
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, 1fr);
  padding-block: 32px;
}
@media (min-width: 768px){
  .badges{ grid-template-columns: repeat(4, 1fr); padding-block: 40px; }
}
.badge-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline-end: 12px;
}
.badge-item svg{ flex: none; color: var(--clay); }
.badge-item span{ font-size: 15px; font-weight: 600; color: var(--ink-2); line-height: 1.5; }

/* ==========================================================================
   서비스 소개 카드 (홈 — 갤러리 상단)
   ========================================================================== */
.svc-promo-grid{
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
}
@media (min-width: 640px){
  .svc-promo-grid{ gap: 20px; }
}
.svc-promo-card{
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.svc-promo-card img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.svc-promo-card__body{
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: linear-gradient(to top, hsl(0 0% 0% / .72), hsl(0 0% 0% / 0) 85%);
}
.svc-promo-card h3{ font-size: 12px; line-height: 1.35; margin: 0; color: var(--white); }
.svc-promo-card .btn-secondary{
  min-height: 32px;
  padding: 0 6px;
  font-size: 11px;
  background: var(--white);
  color: var(--wood-deep);
  border: 1px solid var(--white);
}
.svc-promo-card .btn-secondary:active{ background: var(--wood); color: var(--white); }
@media (min-width: 640px){
  .svc-promo-card__body{ padding: 16px; gap: 12px; }
  .svc-promo-card h3{ font-size: 17px; }
  .svc-promo-card .btn-secondary{ min-height: 48px; padding: 0 20px; font-size: 16px; }
}
.svc-promo-more{ margin-top: 24px; text-align: center; }

/* ==========================================================================
   전후 시공 갤러리 (§6 규칙: 전/후는 항상 같은 행)
   ========================================================================== */
.gallery-grid{
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px){
  .gallery-grid{ gap: 20px; }
}
.gallery-grid .card{ padding: 0; overflow: hidden; }

.ba-slider{
  --pos: 50%;
  position: relative;
  height: 0;
  padding-bottom: 100%;
  overflow: hidden;
  touch-action: pan-y;
  cursor: ew-resize;
}
.ba-slider__img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.ba-slider__img--before{ clip-path: inset(0 calc(100% - var(--pos)) 0 0); }

.ba-slider .ba-cap{
  position: absolute;
  bottom: 10px;
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: hsl(24 30% 12% / .6);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  pointer-events: none;
}
.ba-slider .ba-cap--before{ left: 10px; }
.ba-slider .ba-cap--after{ right: 10px; }

.ba-slider__handle{
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 3px;
  background: var(--white);
  border: none;
  padding: 0;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px hsl(24 30% 12% / .18);
  cursor: ew-resize;
  touch-action: pan-y;
}
.ba-slider__handle svg{
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  padding: 9px;
  border-radius: 999px;
  background: var(--white);
  color: var(--clay);
  box-shadow: var(--sh-2);
  transform: translate(-50%, -50%);
}
.ba-slider__handle:focus-visible{ outline: none; }
.ba-slider__handle:focus-visible svg{ outline: 2px solid var(--clay); outline-offset: 2px; }

/* ==========================================================================
   소개
   ========================================================================== */
.intro p{ max-width: 680px; }

/* ==========================================================================
   서비스 특징 카드
   ========================================================================== */
.features-grid{
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px){ .features-grid{ grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1024px){ .features-grid{ grid-template-columns: repeat(4, 1fr); } }
.feature-card svg{ color: var(--clay); margin-bottom: 14px; }
.feature-card h3{ margin-bottom: 8px; }
.feature-card p{ font-size: 15px; color: var(--ink-2); margin: 0; }

/* ==========================================================================
   대형 전후 비교
   ========================================================================== */
.compare-list{ display: grid; gap: 40px; }
.compare-list .card{ padding: 0; overflow: hidden; }
.compare-list .ba-pair > div{ min-width: 0; }
.compare-list .ba-frame{ position: relative; height: 0; padding-bottom: 100%; overflow: hidden; }
.compare-list .ba-frame img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.compare-list .ba-cap{ font-size: 13px; }
@media (min-width: 768px){
  .compare-list .ba-frame{ padding-bottom: 133.333%; }
}

/* ==========================================================================
   진행 절차
   ========================================================================== */
.steps{
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  counter-reset: step;
}
@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: 0 20px; border-top: 3px solid var(--line-2); padding-top: 24px; }
  .step + .step{ border-left: 1px solid var(--line); }
}
.step__num{
  display: block;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .08em;
  color: var(--clay);
  margin-bottom: 10px;
}
.step h3{ margin-bottom: 8px; }
.step p{ font-size: 15px; color: var(--ink-2); margin: 0; max-width: none; }

/* ==========================================================================
   비용 안내 표
   ========================================================================== */
.cost-table{ width: 100%; border-collapse: collapse; }
.cost-table th, .cost-table td{
  text-align: left;
  padding: 16px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.cost-table thead th{ border-top: none; font-size: 13px; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.cost-table td:first-child, .cost-table th:first-child{ width: 34%; font-weight: 700; color: var(--ink); }
.cost-table td{ font-size: 15px; color: var(--ink-2); }
.cost-note{ margin-top: 16px; font-size: 15px; color: var(--ink-2); }

/* ==========================================================================
   시공서비스 / 서비스상세 링크
   ========================================================================== */
.link-grid{ display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 768px){ .link-grid{ grid-template-columns: repeat(2, 1fr); gap: 20px; } }
.link-card{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  text-decoration: none;
  color: var(--ink);
}
.link-card span{ font-weight: 700; font-size: 17px; }
.link-card::after{
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--clay);
  border-right: 2px solid var(--clay);
  transform: rotate(45deg);
}

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list{ display: grid; gap: 10px; }
.faq-item{
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px 20px;
}
.faq-item summary{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker{ display: none; }
.faq-item summary::after{
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: -4px;
  border-bottom: 2px solid var(--clay);
  border-right: 2px solid var(--clay);
  transform: rotate(45deg);
  transition: transform .18s ease-out;
}
.faq-item[open] summary::after{ transform: rotate(225deg); margin-top: 4px; }
.faq-item p{ margin: 0 0 20px; color: var(--ink-2); max-width: 640px; }

/* ==========================================================================
   CTA 밴드
   ========================================================================== */
.cta-band{ background: var(--wood-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; }

@media (prefers-reduced-motion: reduce){
  .faq-item summary::after{ transition: none !important; }
}
