/*
Theme Name: iWebple
Theme URI: https://iwebple.net
Author: iWebple
Description: 아이웹플 홈페이지 빌더 전용 경량 테마. 엘리멘터 없이 순정 워드프레스 + iw-builder 갤러리로 페이지를 제작합니다. 헤더/GNB/서브비주얼/푸터를 담당하고, 페이지 본문은 빌더가 렌더합니다.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: iwebple
*/

/* iw-core가 공통 토큰을 로드하므로 여기선 테마 껍데기(헤더/푸터/GNB)만 스타일링 */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--iw-font, 'Pretendard', 'Noto Sans KR', sans-serif);
  color: var(--iw-ink, #141a1f);
  background: #fff;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ===== 헤더 / GNB ===== */
.iw-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--iw-line, #e3e6e9);
}
.iw-header__inner {
  max-width: var(--iw-container, 1600px);
  margin: 0 auto;
  padding: 0 var(--iw-gutter, 30px);
  height: 76px;
  display: flex; align-items: center; gap: 32px;
}
.iw-logo { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.iw-logo img { max-height: 40px; width: auto; }

/* GNB 메뉴 (워드프레스 wp_nav_menu 출력) */
.iw-gnb { margin-left: auto; }
.iw-gnb ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.iw-gnb li { position: relative; }
.iw-gnb a {
  display: block; padding: 12px 18px;
  font-size: 15.5px; font-weight: 600; color: var(--iw-ink, #141a1f);
  border-radius: 6px;
}
.iw-gnb a:hover { background: var(--iw-bg-soft, #f4f6f8); color: var(--iw-brand, #1a5fb4); }
.iw-gnb .current-menu-item > a { color: var(--iw-brand, #1a5fb4); }

/* GNB 하위메뉴 (드롭다운) */
.iw-gnb ul ul {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 180px; flex-direction: column; gap: 0;
  background: #fff; border: 1px solid var(--iw-line, #e3e6e9);
  border-radius: 8px; padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.08);
}
.iw-gnb li:hover > ul { display: flex; }
.iw-gnb ul ul a { font-size: 14.5px; padding: 10px 14px; font-weight: 500; }

/* 모바일 토글 */
.iw-nav-toggle { display: none; margin-left: auto; background: none; border: 0; cursor: pointer; padding: 8px; }
.iw-nav-toggle span { display: block; width: 24px; height: 2px; background: var(--iw-ink, #141a1f); margin: 5px 0; transition: .2s; }

/* ===== 서브비주얼 + 서브네비 (부모-자식 페이지 기반, 대분류별) ===== */
.iw-subvisual {
  position: relative;
  background: var(--iw-bg-soft, #f4f6f8) center/cover no-repeat;
  color: #fff;
}
.iw-subvisual::before { content:""; position:absolute; inset:0; background: rgba(20,26,31,.42); }
.iw-subvisual__inner {
  position: relative;
  max-width: var(--iw-container, 1600px);
  margin: 0 auto; padding: 64px var(--iw-gutter, 30px);
}
.iw-subvisual h1 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.01em; }
.iw-subvisual p { margin: 8px 0 0; font-size: 16px; opacity: .92; }
.iw-subvisual--plain { background: var(--iw-bg-soft,#f4f6f8); color: var(--iw-ink,#141a1f); }
.iw-subvisual--plain::before { display: none; }

/* 서브네비 탭 (형제 페이지 = 같은 부모의 자식들) */
.iw-subnav { border-bottom: 1px solid var(--iw-line, #e3e6e9); background: #fff; }
.iw-subnav__inner {
  max-width: var(--iw-container, 1600px); margin: 0 auto;
  padding: 0 var(--iw-gutter, 30px);
  display: flex; gap: 4px; overflow-x: auto;
}
.iw-subnav a {
  padding: 16px 20px; font-size: 15px; font-weight: 600;
  color: var(--iw-body, #4c565e); border-bottom: 2px solid transparent; white-space: nowrap;
}
.iw-subnav a:hover { color: var(--iw-brand, #1a5fb4); }
.iw-subnav a.is-current { color: var(--iw-brand, #1a5fb4); border-bottom-color: var(--iw-brand, #1a5fb4); }

/* ===== 페이지 본문 (빌더 렌더 영역) ===== */
.iw-page-body { min-height: 40vh; }

/* ===== 푸터 ===== */
.iw-footer {
  background: var(--iw-ink, #141a1f); color: #b9c1c8;
  margin-top: 0;
}
.iw-footer__inner {
  max-width: var(--iw-container, 1600px); margin: 0 auto;
  padding: 48px var(--iw-gutter, 30px);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.iw-footer__brand { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.iw-footer__info { font-size: 13.5px; line-height: 1.8; }
.iw-footer__copy { font-size: 12.5px; color: #7c858d; }

/* ===== 반응형 ===== */
@media (max-width: 1024px) {
  .iw-header__inner { height: 66px; }
  .iw-subvisual h1 { font-size: 28px; }
}
@media (max-width: 768px) {
  .iw-nav-toggle { display: block; }
  .iw-gnb {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--iw-line, #e3e6e9);
  }
  .iw-gnb.is-open { display: block; }
  .iw-gnb ul { flex-direction: column; padding: 8px; }
  .iw-gnb ul ul { position: static; box-shadow: none; border: 0; padding-left: 12px; }
  .iw-gnb li:hover > ul { display: none; }
  .iw-gnb li.is-expanded > ul { display: flex; }
  .iw-footer__inner { flex-direction: column; }
}
