/* ==========================================================================
   03-layout.css — 헤더 · 푸터 · 페이지 컨테이너
   GeneratePress 대응: header → site-header 요소, footer → site-footer 요소
   ========================================================================== */

/* ------------------------------------------------------------------
   페이지 컨테이너
   ------------------------------------------------------------------ */
.page-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px var(--gutter-page) 160px;
  gap: var(--gutter-section);}

.container {
  width: 100%;
  max-width: var(--container-main);}

/* 목록(좌) + 사이드바(우) 2단 영역 */
.layout-with-sidebar {
  display: flex;
  align-items: flex-start;
  gap: 72px;
  width: 100%;}
.layout-with-sidebar--offset { padding-top: 24px;}
.layout-with-sidebar > .content-area { flex: 1 0; min-width: 0;}
.layout-with-sidebar > .sidebar { width: var(--sidebar-width); flex-shrink: 0;}

/* ------------------------------------------------------------------
   헤더 (sticky)
   ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  width: 100%;
  height: var(--header-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 40px;
  /* 배경색은 GP 색상 > 헤더 패널이 담당한다 (기본 var(--base-3)) */
  border-bottom: 1px solid transparent;
  transition: border-bottom var(--transition-fast);}
.site-header.is-scrolled { border-bottom-color: rgba(2, 32, 71, 0.05);}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--container-main);
  margin: 0 auto;}

.header-logo { display: block; flex-shrink: 0; padding: 0 0 4px;}
.header-logo img { width: 110px; height: 20px;}

.header-nav { display: flex; align-items: center; gap: 6px;}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-header-text);
     white-space: nowrap;
  transition: background-color var(--transition-fast);}
.nav-link:hover { background-color: var(--color-header-hover-bg);}
.nav-link.is-active { color: var(--color-primary);}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;}

/* 아이콘 버튼 (검색/햄버거) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);}
.icon-btn:hover { background-color: var(--bg-subtle);}
.icon-btn img, .icon-btn svg { width: 24px; height: 24px;}

.icon-btn--mobile { display: none;}

/* --- 모바일 드롭다운 메뉴 --- */
.mobile-menu {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  z-index: 499;
  display: none;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 8px 14px 24px;
  background-color: var(--bg-default);
  box-shadow: 0 12px 20px rgba(2, 32, 71, 0.06);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;}
.mobile-menu.is-open { max-height: 500px; opacity: 1;}

/* ------------------------------------------------------------------
   푸터
   ------------------------------------------------------------------ */
.site-footer {
  padding: 50px 0 100px;
  /* 배경색은 글로벌 컬러 Base 2(var(--base-2))와 연결된 토큰 사용 —
     GP 푸터 패널은 .site-info(저작권 바) 전용이라 커스텀 푸터엔 없음 */
  background-color: var(--bg-subtle);}

.footer-inner {
  max-width: var(--container-footer);
  margin: 0 auto;
  padding: 0 67px;}

.footer-nav { display: flex; padding-bottom: 50px;}

.footer-col {
  width: 170px;
  padding-right: 20px;}
.footer-col:last-of-type { flex: 1; padding-right: 0;}

.footer-col__title {
  padding-bottom: 5px;
  color: var(--text-strong);}

.footer-col a {
  display: block;
  color: var(--text-secondary);}
.footer-col a:hover { text-decoration: underline;}

/* 사업자 정보 */
.footer-info {
  color: var(--text-tertiary);
   font-style: normal;
   white-space: pre-wrap;}
.footer-info__company {
  display: block;
  padding-bottom: 16px;
  color: var(--text-strong);}
.footer-info a { color: inherit;}
.footer-info a:hover { text-decoration: underline;}

/* 약관 링크 */
.footer-legal {
  display: inline-grid;
  grid-template-columns: repeat(4, auto);
  gap: 4px 34px;
  padding: 24px 0 30px;}
.footer-legal a {
  color: var(--text-secondary);}
.footer-legal strong { color: var(--text-strong);}
.footer-legal strong:hover { text-decoration: underline; cursor: pointer;}

/* SNS 아이콘 */
.footer-sns { display: flex;}
.footer-sns li { margin-right: 8px;}
.footer-sns li:last-of-type { margin-right: 0;}
.footer-sns a {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  opacity: 0.7;
  transition: opacity var(--transition-fast);}
.footer-sns a:hover { opacity: 1;}
.footer-sns img { width: 100%; height: 100%;}

/* ------------------------------------------------------------------
   반응형
   ------------------------------------------------------------------ */
@media (max-width: 1024px) {
  :root { --gutter-page: 40px;}

  .page-wrap { padding: 20px var(--gutter-page) 120px; gap: 56px;}

  .layout-with-sidebar { gap: 32px;}
  .layout-with-sidebar > .sidebar { display: none;}

  .site-header { padding: 10px var(--gutter-page);}
}

@media (max-width: 768px) {
  :root { --gutter-page: 24px;}

  .page-wrap { padding: 12px var(--gutter-page) 120px; gap: 40px;}

  .site-header { padding: 10px 14px;}

  /* 모바일: GNB/액션 숨기고 로고+아이콘만 */
  .header-nav, .header-actions { display: none;}
  .icon-btn--mobile { display: inline-flex;}
  .mobile-menu { display: flex;}

  .mobile-menu .nav-link { width: 100%;}

  .footer-inner { padding: 0 24px;}
  .footer-nav { flex-direction: column; padding-bottom: 0;}
  .footer-col { width: 100%; padding-bottom: 40px;}
  .footer-legal { grid-template-columns: auto; row-gap: 6px;}
}
