/*
* for supported in all modern browsers
* Copyright 마케터비
* 마케터비
* 모바일 전체화면 메뉴 — 원형 확산(circular reveal) 오픈 + 아코디언 서브메뉴
* (푸르지오 리버프론트 공식홈페이지 모바일 메뉴 벤치마킹)
*/

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 999999;
  visibility: hidden;
  pointer-events: none;
  /* 어두운 오버레이이므로 내부 기본 글자색을 흰색으로 고정한다.
     (reset.css 의 `a { color: inherit }` 때문에 링크는 이 값을 상속받는다) */
  color: #fff;
}
.mobile-nav.is-open {
  visibility: visible;
  pointer-events: auto;
}

/* 원형으로 퍼지며 전체화면을 덮는 검정 배경 */
.mobile-nav__backdrop {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  border-radius: 50%;
  transition: top 0.7s cubic-bezier(0.41, 0.005, 0.095, 0.95), border-radius 0.7s cubic-bezier(0.41, 0.005, 0.095, 0.95);
}
.mobile-nav.is-open .mobile-nav__backdrop {
  top: 0;
  border-radius: 0;
}

.mobile-nav__inner {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease 0.25s, transform 0.4s ease 0.25s;
}
.mobile-nav.is-open .mobile-nav__inner {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 3.75rem;
  flex-shrink: 0;
}
.mobile-nav .mobile-nav__logo {
  display: flex;
  align-items: center;
  height: 1.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff !important;
}
.mobile-nav__logo img {
  max-height: 100%;
  object-fit: contain;
}
.mobile-nav__close {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  cursor: pointer;
}
.mobile-nav__close i {
  position: absolute;
  width: 20px;
  height: 1.5px;
  background: #fff;
  border-radius: 2px;
}
.mobile-nav__close i:nth-child(1) {
  transform: rotate(45deg);
}
.mobile-nav__close i:nth-child(2) {
  transform: rotate(-45deg);
}

.mobile-nav__gnb {
  flex: 1 1 auto;
  padding: 12px 24px 24px;
}
.mobile-nav__depth0 {
  margin: 0;
  padding: 0;
  list-style: none;
}
.mobile-nav__depth0 > li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.mobile-nav .mobile-nav__depth0 > li > a.mobile-nav__toggle,
.mobile-nav .mobile-nav__depth0 > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 2px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff !important;
}
.mobile-nav .mobile-nav__depth0 > li > a.is-active {
  color: var(--theme-color) !important;
}
.mobile-nav__arrow {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.mobile-nav__arrow::before,
.mobile-nav__arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.5px;
  background: #fff;
  transition: transform 0.25s ease;
}
.mobile-nav__arrow::before {
  transform: translate(-50%, -50%) rotate(90deg);
}
.mobile-nav__arrow::after {
  transform: translate(-50%, -50%);
}
.mobile-nav__depth0 > li.is-expanded .mobile-nav__arrow::before {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* 아코디언: max-height 트릭으로 부드럽게 펼침/접힘
   (grid-template-rows: 0fr→1fr 트릭은 구형 iOS Safari 등에서 트랜지션이 씹혀
   서브메뉴가 0높이로 남는(=글자가 안보이는) 문제가 있어 max-height 방식으로 교체.
   JS(header.js)에서 펼칠 때 scrollHeight를 max-height에 직접 대입한다.) */
.mobile-nav__depth1-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.mobile-nav__depth1 {
  margin: 0;
  padding: 0;
  list-style: none;
}
/* 2차 메뉴 링크
   게시판/모듈 등 외부 CSS가 링크 색을 덮어써 어두운 배경과 겹쳐 보이지 않는 문제가
   있어, 오버레이 내부 색상은 !important 로 명시 고정한다. */
.mobile-nav .mobile-nav__depth1 > li > a {
  display: block;
  position: relative;
  padding: 13px 2px 13px 16px;
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82) !important;
  transition: color 0.2s ease;
}
/* 좌측 계층 표시선 */
.mobile-nav .mobile-nav__depth1 > li > a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 1px;
  background: rgba(255, 255, 255, 0.32);
  transition: background 0.2s ease, width 0.2s ease;
}
.mobile-nav .mobile-nav__depth1 > li > a:hover,
.mobile-nav .mobile-nav__depth1 > li > a:active {
  color: #fff !important;
}
.mobile-nav .mobile-nav__depth1 > li > a.is-active {
  color: var(--theme-color) !important;
  font-weight: 600;
}
.mobile-nav .mobile-nav__depth1 > li > a.is-active::before {
  background: var(--theme-color);
  width: 10px;
}
.mobile-nav__depth1 > li:last-child > a {
  padding-bottom: 20px;
}

.mobile-nav__contact {
  flex-shrink: 0;
  padding: 0 24px 32px;
}
.mobile-nav .mobile-nav__tel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 54px;
  border-radius: 999px;
  background-color: var(--theme-color);
  color: #fff !important;
  font-size: 1.05rem;
  font-weight: 700;
}

body.mobile-nav-open {
  overflow: hidden;
}

/* 다크모드에서도 오버레이는 항상 어두운 배경 + 밝은 글자 유지 */

@media (min-width: 1024px) {
  .mobile-nav {
    display: none;
  }
}
