/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #F8FAFC;
  --bg-sub1: #E2E8F0;
  --bg-sub2: #F1F5F9;
  --accent: #1E40AF;
  --text: #0F172A;
  --radius: 12px;
  --gap-img-text: 16px;
  --side-pad: 24px;
  --section-gap: 48px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 { font-weight: 700; margin: 0; color: var(--text); }
h1 { font-size: 29px; line-height: 1.4; }
h2 { font-size: 22px; line-height: 1.4; }
h3 { font-size: 18px; line-height: 1.4; }
h4 { font-size: 18px; line-height: 1.4; }
p { margin: 0; }
.section-subtitle { font-weight: 400; color: #475569; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-pad);
}
.section { padding: var(--section-gap) 0; }
.section-head { margin-bottom: 32px; }
.section-head h2 { margin-bottom: 8px; }

/* ==========================================================================
   Buttons / Icons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-outline { background: #fff; color: var(--accent); border-color: var(--accent); }
.cta-group { display: flex; flex-wrap: wrap; gap: 12px; }

.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent);
  fill: currentColor;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--bg-sub1);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand .logo-mark { width: 32px; height: 32px; }
.brand .logo-text { font-size: 18px; font-weight: 700; }

/* nav-desktop / hamburger는 wp_is_mobile()로 서버에서 양자택일 렌더링되므로
   CSS 너비 기준 display 토글을 두지 않는다 (기기 기준 분기 규칙 유지) */
.nav-desktop { display: flex; align-items: center; gap: 28px; }
.nav-desktop ul { display: flex; align-items: center; gap: 28px; }
.nav-desktop a.nav-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.nav-desktop .icon { width: 18px; height: 18px; }

.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: none; border: none;
}
.hamburger-btn span { display: block; width: 22px; height: 2px; background: var(--text); position: relative; }
.hamburger-btn span::before, .hamburger-btn span::after {
  content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: var(--text); transition: transform .3s;
}
.hamburger-btn span::before { top: -7px; }
.hamburger-btn span::after { top: 7px; }

.nav-mobile {
  max-height: 0;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--bg-sub1);
  transition: max-height .35s ease;
}
.nav-mobile.is-open { max-height: 320px; }
.nav-mobile ul { padding: 8px var(--side-pad) 16px; }
.nav-mobile a { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.nav-mobile .icon { width: 20px; height: 20px; }

body { padding-top: 64px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  color: #fff;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-inner { position: relative; padding: 64px var(--side-pad) var(--section-gap); z-index: 2; }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,.15) 0%, rgba(15,23,42,.65) 100%);
  z-index: 1;
}
.hero h1 { color: #fff; margin-bottom: 16px; }
.hero .hero-copy { color: #E2E8F0; margin-bottom: 24px; font-size: 16px; }
@media (max-width: 767px) {
  .hero::before { content: none; }
  .hero-inner { background: linear-gradient(180deg, rgba(15,23,42,0) 0%, rgba(15,23,42,.88) 55%); padding-top: 220px; }
}

/* ==========================================================================
   Swipe slider (mobile) / grid (desktop)
   ========================================================================== */
.slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 16px;
  margin: 0 calc(var(--side-pad) * -1);
  padding: 0 var(--side-pad) 8px;
}
.slider::-webkit-scrollbar { display: none; }
.slider .slide { flex: 0 0 100%; scroll-snap-align: start; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-sub1); }
.dot.is-active { background: var(--accent); }

@media (min-width: 768px) {
  .slider { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); overflow: visible; margin: 0; padding: 0; }
  .slider .slide { flex: none; }
  .dots { display: none; }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  height: 100%;
}
.card h3 { margin-bottom: 4px; }
.card p { color: #475569; font-size: 15px; }
/* 아이콘이 있는 카드는 시공사례 카드처럼 가로형 비율 박스로, 텍스트는 3줄로 잘라 형태를 고정 */
.card:has(> .icon) {
  aspect-ratio: 4 / 3;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: var(--gap-img-text);
  overflow: hidden;
}
.card:has(> .icon) .icon { grid-row: 1 / 3; align-self: center; margin-bottom: 0; }
.card:has(> .icon) h3 { grid-column: 2; }
.card:has(> .icon) p {
  grid-column: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Checklist */
.checklist .slider { --cols: 4; }
.checklist .card { background: var(--bg-sub2); }

/* Why us */
.whyus .slider { --cols: 4; }
.whyus .card { background: var(--bg-sub2); }

/* About */
.about .slider { --cols: 3; }
.about .card { background: #fff; border: 1px solid var(--bg-sub1); }

/* ==========================================================================
   Services grid
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
/* 시공사례 카드와 동일하게 카드 전체를 가로 비율(4:3)로 고정, 사진 위에 텍스트 오버레이 */
.service-card {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.service-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.service-card .service-card-body {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(15,23,42,.9) 0%, rgba(15,23,42,.35) 55%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px;
}
.service-card h3 { font-size: 16px; margin-bottom: 4px; color: #fff; }
.service-card p {
  color: #E2E8F0; font-size: 13px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden;
}
.service-card .link-indicator {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; color: #fff; margin-top: 6px;
}
.service-card .link-indicator svg { width: 14px; height: 14px; fill: currentColor; }
@media (hover: hover) {
  .service-card:hover img { transform: scale(1.06); }
}

/* ==========================================================================
   Case study grid (main page, no links)
   ========================================================================== */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .cases-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
.case-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.case-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.case-card .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(15,23,42,.88) 0%, rgba(15,23,42,.15) 65%, transparent 100%);
  display: flex; align-items: flex-end; padding: 16px;
  opacity: 0; transition: opacity .3s ease;
}
.case-card .overlay h3 { color: #fff; font-size: 16px; }
@media (hover: hover) {
  .case-card:hover .overlay { opacity: 1; }
  .case-card:hover img { transform: scale(1.06); }
}
@media (max-width: 767px) {
  .case-card .overlay { opacity: 1; background: linear-gradient(0deg, rgba(15,23,42,.85) 0%, transparent 70%); }
}
.cases-more { text-align: center; margin-top: 32px; }

/* ==========================================================================
   FAQ accordion
   ========================================================================== */
.faq-item { border-bottom: 1px solid var(--bg-sub1); }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 16px 0;
  background: none; border: none; text-align: left;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.faq-q .plus { width: 20px; height: 20px; flex-shrink: 0; position: relative; }
.faq-q .plus::before, .faq-q .plus::after {
  content: ""; position: absolute; background: var(--accent); border-radius: 2px;
}
.faq-q .plus::before { left: 0; top: 9px; width: 20px; height: 2px; }
.faq-q .plus::after { left: 9px; top: 0; width: 2px; height: 20px; transition: transform .25s ease; }
.faq-item.is-open .faq-q .plus::after { transform: rotate(90deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding: 0 0 20px; color: #475569; }
.faq-item.is-open .faq-a { max-height: 400px; }

/* ==========================================================================
   Consult CTA section
   ========================================================================== */
.consult-cta { background: var(--text); color: #fff; text-align: center; }
.consult-cta h2 { color: #fff; }
.consult-cta .section-subtitle { color: #CBD5E1; margin-bottom: 24px; }
.consult-cta .cta-group { justify-content: center; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--bg-sub2); border-top: 1px solid var(--bg-sub1); padding: var(--section-gap) 0 32px; }
.site-footer .footer-nav ul { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; }
.site-footer .footer-nav a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; min-height: 44px; }
.site-footer .footer-nav .icon { width: 18px; height: 18px; }
.site-footer .biz-info { color: #475569; font-size: 14px; line-height: 1.8; }
.site-footer .biz-info strong { color: var(--text); }

/* ==========================================================================
   Fade in on scroll
   ========================================================================== */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Sub page hero / generic content
   ========================================================================== */
.page-hero { background: var(--bg-sub2); padding: 48px 0 40px; }
.page-hero h1 { margin-bottom: 8px; }
.page-hero .section-subtitle { margin-bottom: 24px; }
.article-body { }
.article-body h2 { margin-top: var(--section-gap); margin-bottom: 12px; }
.article-body h3 { margin-top: 28px; margin-bottom: 8px; }
.article-body p { margin-bottom: 16px; color: #334155; }
.article-body figure { margin: 24px 0; }
.article-body figure img { border-radius: var(--radius); width: 100%; height: auto; }
.article-body figcaption { margin-top: 8px; font-size: 14px; color: #64748B; }
.article-body ul.check-list li { display: flex; gap: 10px; padding: 6px 0; color: #334155; }
.article-body ul.check-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 9px; flex-shrink: 0; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.badge { background: var(--bg-sub1); color: var(--text); font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 999px; }

.info-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .info-grid { grid-template-columns: repeat(2, 1fr); } }
.info-grid .card h3 { display: flex; align-items: center; gap: 8px; }

.stat-strip { display: flex; flex-wrap: wrap; gap: 16px; background: var(--bg-sub2); border-radius: var(--radius); padding: 20px; margin: 24px 0; }
.stat-strip div { flex: 1 1 140px; }
.stat-strip strong { display: block; font-size: 18px; }
.stat-strip span { font-size: 13px; color: #64748B; }

.timeline { border-left: 2px solid var(--bg-sub1); padding-left: 20px; margin: 24px 0; }
.timeline li { position: relative; padding-bottom: 20px; color: #334155; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.quote-block { border-left: 4px solid var(--accent); background: var(--bg-sub2); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin: 24px 0; color: #334155; }

/* Contact page */
.contact-card { background: #fff; border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.contact-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.contact-pc-btn { font-size: 16px; }

/* Sitemap page */
.sitemap-group { margin-bottom: var(--section-gap); }
.sitemap-group h2 { margin-bottom: 12px; }
.sitemap-list li { border-bottom: 1px solid var(--bg-sub1); }
.sitemap-list a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 0; font-weight: 700; }

