/* 
 * 레이아웃 스타일 파일
 * 헤더, 푸터, 그리드 시스템 등 레이아웃 관련 스타일을 정의
 */

/* 메인 컨테이너 */
.main-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 네비게이션 바 */
.navigation {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999; /* z-index 값을 더 높게 조정하여 다른 요소들 위에 표시되도록 함 */
  padding: var(--spacing-md) calc((100% - var(--max-width-content)) / 2);
  background: transparent; /* 배경 투명하게 변경 */
  box-shadow: none; /* 그림자 제거 */
  transition: all 0.3s ease;
}

/* 스크롤 시 네비게이션 바 스타일 */
.navigation.scrolled {
  background: rgba(
    255,
    255,
    255,
    0.65
  ); /* 스크롤 시 배경색 추가 (더 투명하게) */
  backdrop-filter: blur(8px); /* 블러 효과 추가 */
  -webkit-backdrop-filter: blur(8px); /* Safari 지원 */
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05); /* 스크롤 시 그림자 추가 */
}

.nav-container {
  max-width: var(--max-width-container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--spacing-lg);
}

.logo {
  width: 180px;
  height: auto;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.menu-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.menu-list {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
}

.menu-item {
  position: relative;
}

.menu-link {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  color: var(--text-secondary);
  padding: var(--spacing-sm) 0;
  transition: color 0.3s ease;
}

.menu-link:hover {
  color: var(--primary-color);
}

/* 활성 메뉴 아이템 스타일 */
.menu-item.active .menu-link {
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
}

/* 서브메뉴 */
.submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--menu-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-md);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  min-width: 160px;
  z-index: 1001;
}

.menu-item:hover .submenu {
  opacity: 1;
  visibility: visible;
}

.submenu a {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  color: var(--text-secondary);
  line-height: 2.2;
  padding: var(--spacing-xs) var(--spacing-sm);
  text-align: center;
  transition: all 0.3s ease;
  border-radius: var(--border-radius-sm);
}

.submenu a:hover {
  color: var(--primary-color);
  background-color: rgba(255, 65, 73, 0.1);
}

/* 검색 아이콘 */
.search-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  /* background: var(--white); */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.search-btn:hover {
  border-color: var(--primary-color);
  /* background-color: var(--border-color); */
}

.search-btn:hover svg {
  stroke: var(--white);
}

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 10002;
  flex-shrink: 0;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-secondary);
  margin: 5px auto;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 모바일 메뉴 */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 350px;
  height: 100vh;
  background-color: var(--white);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 10001;
  padding: 80px 20px 20px;
  overflow-y: auto;
  display: none;
  transition: right 0.3s ease;
}

.mobile-menu.open {
  right: 0;
  display: block;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  display: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
  display: block;
}

.mobile-menu .menu-list {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}

.mobile-menu .menu-item {
  width: 100%;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.mobile-menu .menu-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 0;
}

.mobile-menu .menu-link::after {
  content: "+";
  font-size: 20px;
  transition: transform 0.3s ease;
}

.mobile-menu .menu-item.open .menu-link::after {
  transform: rotate(45deg);
}

.mobile-menu .submenu {
  position: static;
  transform: none;
  opacity: 1;
  visibility: visible;
  background: transparent;
  box-shadow: none;
  padding: 0 0 0 15px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu .menu-item.open .submenu {
  max-height: 500px;
}

body.menu-open {
  overflow: hidden;
}

/* 공통 상단 섹션 */
.sub-hero-section {
  width: 100%;
  background-size: cover;
  background-position: center;
  color: var(--white);
  text-align: left;
  padding: var(--spacing-3xl) 0 var(--spacing-3xl);
}

.sub-hero-section.business-hero {
  background-image: url("/images/content/pages/business/주요사업.jpg");
}
.sub-hero-section.about-hero {
  background: url("/images/content/pages/about/intro-top-bg.jpg") center/cover;
}
.sub-hero-content {
  max-width: var(--max-width-content);
  margin: 100px auto 30px;
  padding: 0 var(--spacing-lg);
}

.sub-hero-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--spacing-lg);
  line-height: 1.2;
}

.sub-hero-title .highlight {
  color: var(--text-navy);
  display: block;
}

.sub-hero-title span:last-child {
  color: var(--white);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.sub-hero-description {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-normal);
  max-width: 680px;
  line-height: 1.6;
  color: var(--text-light-navy);
}

/* 섹션 공통 레이아웃 */
.section {
  width: 100%;
  padding: var(--spacing-5xl) var(--spacing-lg);
  overflow-x: hidden;
}

/* 메인 콘텐츠 섹션 */
.main-content-section {
  width: 100%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: var(--spacing-xl) 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xl);
}

/* 반응형 - 모바일 */
@media (max-width: 767px) {
  .main-content-section {
    padding: 0 20px;
  }
}

/* 관리자 페이지용 메인 콘텐츠 섹션 (gap 제거) */
.admin-content-section {
  width: 100%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: var(--spacing-xl) 0;
  display: flex;
  flex-direction: column;
}

.page-specific-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.section.gray-bg {
  background-color: var(--background-light);
}

/* 공지사항 섹션 - 다른 페이지에서 사용될 수 있으므로 남겨둡니다. */
.notice-section {
  background-color: var(--background-light);
  display: flex;
  justify-content: center;
  gap: var(--spacing-5xl);
  padding: var(--spacing-5xl) var(--spacing-lg) var(--spacing-lg);
}

.notice-content {
  display: flex;
  gap: var(--spacing-5xl);
  max-width: var(--max-width-content);
}

.notice-text {
  width: 474px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3xl);
}

.notice-cards {
  width: 592px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 9px 0 0;
  position: relative;
}

/* 푸터 */
.footer {
  background-color: var(--background-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-4xl) var(--spacing-lg);
}

.footer-content {
  width: 100%;
  max-width: 900px;
  margin: auto;
}

.footer-links {
  display: flex;
  justify-content: space-between;
  /* gap: 156px; */
}

.footer-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  /* width: 160px; */
}

/* 데스크탑에서는 아코디언 아이콘 숨기기 */
.accordion-icon {
  display: none;
}

.footer-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  line-height: 1;
  text-align: center;
}

.footer-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-menu a {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  color: var(--text-muted);
  line-height: 1.125;
  text-align: center;
  transition: color 0.3s ease;
}

.footer-menu a:hover {
  color: var(--text-secondary);
}

.social-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.social-link span {
  color: var(--text-muted);
  font-size: var(--font-size-base);
  display: block;
}

.footer-bottom {
  width: 100%;
  max-width: 1220px;
  height: 96.58px;
  position: relative;
  margin: auto;
}

.footer-divider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--border-light);
}

.footer-copyright {
  position: absolute;
  top: 36.58px;
  left: 0;
  width: 100%;
  max-width: 1207px;
}

.footer-copyright p {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-normal);
  color: var(--text-muted);
  line-height: 1.67;
  text-align: center;
  margin-bottom: 0;
}

/* 반응형 - 태블릿 */
@media (max-width: 1023px) {
  .navigation {
    padding: 15px 0; /* 좌우 패딩 137px로 변경 */
  }
  .nav-container {
    padding: 0 var(--spacing-lg);
    justify-content: space-between;
  }

  .desktop-menu {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .section {
    padding: var(--spacing-3xl) var(--spacing-lg);
  }

  .notice-section {
    flex-direction: column;
    gap: var(--spacing-2xl);
    padding: var(--spacing-3xl) var(--spacing-lg);
  }

  .notice-content {
    flex-direction: column;
    gap: var(--spacing-2xl);
  }

  .notice-text,
  .notice-cards {
    width: 100%;
  }

  .footer {
    padding: var(--spacing-3xl) var(--spacing-lg);
  }

  .footer-links {
    flex-wrap: wrap;
    gap: var(--spacing-2xl);
    justify-content: center;
  }

  .footer-bottom {
    width: 100%;
  }

  .footer-copyright {
    width: 100%;
  }
}

/* 반응형 - 모바일 */
@media (max-width: 767px) {
  .navigation {
    padding: 15px 0;
  }

  .logo {
    width: 150px;
  }

  .sub-hero-description {
    font-size: var(--font-size-sm);
    text-align: left;
  }
  .footer-links {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .footer-column {
    width: 100%;
  }

  /* 푸터 아코디언 메뉴 */
  .footer-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 0;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-light);
  }

  .footer-column-header .footer-title {
    margin: 0;
    text-align: left;
  }

  .accordion-icon {
    font-size: 24px;
    font-weight: bold;
    transition: transform 0.3s ease;
    display: block; /* 모바일에서는 아코디언 아이콘 보이기 */
  }

  .footer-column-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(45deg);
  }

  .footer-menu,
  .social-links {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    width: 100%;
  }

  .footer-menu {
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .footer-column-header[aria-expanded="true"] + .footer-menu,
  .footer-column-header[aria-expanded="true"] + .social-links {
    max-height: 500px;
  }

  .footer-menu a {
    display: block;
    padding: 10px 0;
    text-align: left;
  }

  .social-links {
    padding: 20px 0 0 0;
  }

  .social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    text-decoration: none;
  }

  .social-link span {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    display: block;
  }

  .social-link:hover span {
    color: var(--text-secondary);
  }
}
