/* 시공사례 홈페이지 공통 스타일 — 모바일 먼저, 넓은 화면은 칸만 늘린다.
   고객별로 바뀌는 건 --accent 하나 (site.json "accent"). */
:root {
  --paper: #F6F7F4;
  --sheet: #FFFFFF;
  --ink: #1B2A3A;
  --muted: #5E6B78;
  --rule: #D5DAD8;
  --accent: #C8362B;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  word-break: keep-all; overflow-wrap: anywhere;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
section { padding-block: 56px; }
.sec-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; max-width: 640px; }
.sec-head h2 { font-size: clamp(24px, 4.4vw, 36px); font-weight: 800; }
.sec-head p { color: var(--muted); }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 8px; border: 2px solid var(--ink);
  font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
}
.btn-main { background: var(--ink); color: var(--paper); }
.btn-sub { background: transparent; color: var(--ink); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* 헤더 */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); }
.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 36px; width: auto; }
.brand b { font-size: 20px; font-weight: 800; display: block; line-height: 1.2; }
.brand small { font-size: 12px; color: var(--muted); }
.top-tel { display: none; font-weight: 700; font-size: 18px; text-decoration: none; font-variant-numeric: tabular-nums; }

/* 히어로 */
.hero { padding-block: 32px 48px; }
.hero .wrap { display: grid; gap: 28px; }
.hero h1 { font-size: clamp(32px, 7.5vw, 56px); font-weight: 800; white-space: pre-line; }
.hero .lead { font-size: 17px; color: var(--muted); max-width: 32em; }
.hero-copy { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.feature { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: var(--rule); }
.feature img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.feature figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px 14px;
  background: linear-gradient(transparent, rgba(15, 22, 30, .78)); color: #fff; font-size: 14px;
}
.feature figcaption b { display: block; font-size: 16px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { font-size: 15px; color: var(--muted); }
.facts li + li::before { content: "/"; margin-right: 8px; color: var(--rule); }

/* 시공사례 */
.cases { display: grid; grid-template-columns: 1fr; gap: 20px; }
.case-card { text-decoration: none; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.case-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--rule); }
.case-card h3 { font-size: 18px; }
.meta { font-size: 14px; color: var(--muted); }
.empty { padding: 28px; border: 2px dashed var(--rule); border-radius: 10px; color: var(--muted); }

/* 목록형 섹션 */
.rows { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.rows li { padding: 16px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; }
.rows li b { font-size: 17px; }
.rows li span { color: var(--muted); font-size: 15px; }
.two > * + * { margin-top: 48px; }
.steps { counter-reset: s; }
.steps li { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; }
.steps li::before { counter-increment: s; content: counter(s); grid-row: span 2; font-weight: 800; font-size: 22px; line-height: 1.4; color: var(--accent); }
.promise { background: var(--ink); color: var(--paper); }
.promise .sec-head p, .promise .rows li span { color: #C9D2DA; }
.promise .rows { border-top-color: var(--paper); }
.promise .rows li { border-bottom-color: rgba(246, 247, 244, .2); }

/* FAQ */
details { border-bottom: 1px solid var(--rule); padding: 16px 0; }
details:first-of-type { border-top: 2px solid var(--ink); }
summary { cursor: pointer; font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); }
details[open] summary::after { content: "−"; }
details p { margin-top: 8px; color: var(--muted); }

/* 마감 */
.closing { border-top: 2px solid var(--ink); }
.closing .wrap { display: flex; flex-direction: column; gap: 20px; }
.closing h2 { font-size: clamp(24px, 4.4vw, 36px); font-weight: 800; }
.areas { color: var(--muted); }
footer { padding-block: 24px 32px; font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; flex-direction: column; gap: 2px; }
.notice { background: #FFF6D6; color: #5B4500; font-size: 13px; text-align: center; padding: 6px 16px; }

/* 사례 상세 */
.back { display: inline-block; margin-bottom: 16px; font-size: 15px; color: var(--muted); }
.case-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.case-head h1 { font-size: clamp(26px, 5.6vw, 40px); font-weight: 800; }
.desc { white-space: pre-line; max-width: 62ch; margin-bottom: 28px; }
.ba { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 28px; }
.ba figure, .gallery figure { margin: 0; }
.ba img, .gallery img { width: 100%; border-radius: 8px; background: var(--rule); }
.ba figcaption { font-weight: 700; padding-top: 8px; }
.gallery { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 36px; }

/* 전후 비교 슬라이더 (ba_mode: slider) */
.cmp { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: var(--rule); user-select: none; }
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-before img { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-tag {
  position: absolute; top: 12px; padding: 4px 10px; border-radius: 4px; pointer-events: none;
  background: rgba(15, 22, 30, .72); color: #fff; font-size: 13px; font-weight: 700;
}
.cmp-l { left: 12px; }
.cmp-r { right: 12px; background: var(--accent); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; pointer-events: none; box-shadow: 0 0 6px rgba(0, 0, 0, .35); }
.cmp-line i {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.cmp-line i::before { content: "◀ ▶"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-style: normal; color: var(--ink); letter-spacing: 2px; }
.cmp input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
  -webkit-appearance: none; appearance: none; background: transparent;
}
.cmp input::-webkit-slider-thumb { -webkit-appearance: none; width: 56px; height: 600px; }
.cmp input::-moz-range-thumb { width: 56px; height: 600px; border: 0; }
.cmp:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.feature-cmp { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.feature-cmp figcaption { font-size: 14px; color: var(--muted); }
.feature-cmp figcaption a { text-decoration: none; }
.feature-cmp figcaption b { color: var(--ink); }
.ba-one { max-width: 880px; margin-bottom: 20px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border-radius: 8px; overflow: hidden; }
.split figure { margin: 0; position: relative; }
.split img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--rule); border-radius: 0; }
.split figcaption {
  position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 4px;
  background: rgba(15, 22, 30, .72); color: #fff; font-size: 12px; font-weight: 700;
}
.split figure + figure figcaption { background: var(--accent); }

/* 모바일 하단 연락 바 */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--sheet); border-top: 1px solid var(--rule);
}
.mbar .btn { flex: 1; min-height: 50px; padding: 0 8px; }

@media (min-width: 640px) {
  .cases { grid-template-columns: 1fr 1fr; }
  .ba { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .mbar { display: none; }
  .top-tel { display: inline; }
  section { padding-block: 80px; }
  .hero { padding-block: 48px 80px; }
  .hero .wrap { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
  .cases { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
  .two > * + * { margin-top: 0; }
  .closing .wrap { flex-direction: row; justify-content: space-between; align-items: center; }
}
