/* =============================================
   common.css | 공통 레이아웃 & 헤더/내비
   ============================================= */
@import url('./variables.css');
@import url('./reset.css');

/* ── 레이아웃 */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 48px 0; }

/* ── 헤더 */
.site-header {
  background: var(--white);
  position: sticky;
  top: 0; z-index: 100;
  box-shadow: var(--shadow);
  height: var(--header-h);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.logo-img {
  height: 48px;
  display: flex; align-items: center; justify-content: center;
}
.logo-img img {
  height: 48px; width: auto; object-fit: contain; display: block;
}
.logo-text { display: none; }

/* ── 네비게이션 */
.main-nav { display: flex; align-items: center; gap: 36px; }
.nav-item { position: relative; }
.nav-item > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--gray-dark);
  white-space: nowrap;
  transition: var(--trans);
}
.nav-item > a:hover,
.nav-item.active > a {
  background: var(--green-pale); color: var(--green-dark); font-weight: 700;
}
.arrow {
  display: inline-block; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--gray-mid); transition: transform .2s;
  flex-shrink: 0; margin-top: 1px;
}
.nav-item.has-dropdown:hover .arrow { transform: rotate(180deg); }
.dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 160px; background: var(--white);
  border: 1px solid var(--gray-light); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 6px; flex-direction: column; z-index: 300;
}
.nav-item.has-dropdown:hover .dropdown { display: flex; }
.sub-item {
  display: block; padding: 8px 14px;
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--gray-dark); border-radius: var(--radius); white-space: nowrap;
  transition: var(--trans);
}
.sub-item:hover { background: var(--green-pale); color: var(--green-dark); }

/* ── 헤더 액션 */
.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.header-username {
  font-size: var(--text-lg);
  color: var(--gray-mid); white-space: nowrap;
}

/* ── 모바일 햄버거 */
.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; padding: 4px;
  
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--gray-dark); border-radius: 2px; transition: var(--trans);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── 모바일 메뉴 드로어 */
.mobile-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  /* 헤더 radius(16px) 뒤까지 올라가서 흰 배경이 곡선 아래를 채움
     z-index:99 < header:100 이므로 헤더가 위에 덮임 → 곡선 형태 유지 */
  top: calc(var(--header-h) - var(--radius-xl));
  background: var(--white);
  z-index: 99;
  overflow-y: auto;
  overscroll-behavior: contain;   /* 드로어 끝에서 배경 스크롤 전파 차단 */
  /* padding-top: radius 겹침 보정 + 원래 16px */
  padding: calc(var(--radius-xl) + 16px) 0 32px;
}
.mobile-nav.open { 
  display: block;
}

.mobile-nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-dark); border-bottom: 1px solid var(--gray-light);
  cursor: pointer;
}
.mobile-nav-item.active { color: var(--green-dark); background: var(--green-pale); }
.mobile-sub-wrap { display: none; background: var(--gray-bg); }
.mobile-sub-wrap.open { display: block; }
.mobile-sub-item {
  display: block; padding: 10px 24px 10px 36px;
  font-size: var(--text-base);
  color: var(--gray-mid);
  border-bottom: 1px solid var(--gray-light);
}
.mobile-sub-item:hover { color: var(--green-dark); }

/* ── 페이지 헤더 */
.page-header {
  position: relative;
  background-image: url('../image/banner/banner5.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--white);
  padding: 58px 0;
  text-align: left;
  margin-top: -10px
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(190,190,190,0.2));
}
.page-header .container {
  position: relative;
  z-index: 1;
}
.page-header h1 {
  font-size: var(--text-3xl);
  font-weight: 700; margin-bottom: 6px; text-align: left;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.page-header p {
  font-size: var(--text-xl);
  opacity: .85; text-align: left;
}

/* ── 콘텐츠 래퍼 */
.content-wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 52px 24px 80px;
}

/* ══════════════════════════════════════════
   푸터
   ══════════════════════════════════════════ */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.75);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding: 32px 24px 24px;
  max-width: var(--container-max);
  margin: 0 auto;
}

/* 왼쪽 – 기관 정보 */
.footer-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: var(--text-sm);
  line-height: 1.7;
}
.footer-logo-text {
  font-size: var(--text-md);
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  display: block;
}
.footer-info p { color: rgba(255,255,255,.7); }
.footer-info a { color: rgba(255,255,255,.7); text-decoration: none; }
.footer-info a:hover { color: #fff; }

/* 정책 링크 (왼쪽 하단) */
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: var(--trans);
}
.footer-links a:hover { color: #fff; }

/* 오른쪽 – SNS + 패밀리사이트 */
.footer-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* SNS 아이콘 */
.footer-sns { display: flex; gap: 8px; align-items: center; }
.footer-sns-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  text-decoration: none;
  color: #fff;
  transition: var(--trans);
  flex-shrink: 0;
}
.footer-sns-btn:hover { transform: translateY(-2px); opacity: .85; }
.footer-sns-naver  { background: rgba(255,255,255,.2); }
.footer-sns-yt     { background: rgba(255,255,255,.2); }
.footer-sns-insta  { background: rgba(255,255,255,.2); }

/* 푸터 로고 이미지 */
.footer-logo-img-wrap {
  display: inline-block;
  margin-bottom: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.footer-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
  /* 흰색 배경 이미지를 푸터 다크 배경에서 보이게: brightness 필터 */
  filter: brightness(0) invert(1);
  opacity: .9;
}

/* 패밀리사이트 드롭다운 */
.footer-family { position: relative; }
.footer-family-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  color: rgba(255,255,255,.85);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans);
  white-space: nowrap;
}
.footer-family-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.footer-family-arrow { font-size: 10px; }
.footer-family-list {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px); right: 0;
  min-width: 160px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
  list-style: none;
  padding: 4px 0; margin: 0;
}
.footer-family-list.open { display: block; }
.footer-family-list li a {
  display: block; padding: 9px 16px;
  font-size: var(--text-sm);
  color: var(--gray-dark);
  text-decoration: none;
  transition: var(--trans);
}
.footer-family-list li a:hover { background: var(--green-pale); color: var(--green-dark); }

/* 카피라이트 */
.footer-copy {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 14px 0;
  font-size: var(--text-xs);
  color: rgba(255,255,255,.45);
  text-align: center;
}

