/* ✅ 기본 설정 */
html, body {
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans KR', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-x: hidden; /* 가로 스크롤 방지 */
  background: linear-gradient(
  to bottom,
  #ffffff 0%,     /* 하얀색 시작 */
  #fff0f5 70%,    /* 라벤더블러쉬 같은 연분홍 */
  #ffd1dc 82%,    /* 벚꽃잎 느낌 */
  #fcb7c2 95%,    /* 더 진해짐 */
  #e68cab 100%    /* 짙은 벚꽃핑크 */
);
}







/* ✅ 헤더 */
.welcome-text strong {
  font-weight: bold !important;
}

.header-top {
  display: flex;
  position: sticky;
  align-items: center;
  padding: 0.6rem 1rem;
  background-color: #fff;
  box-sizing: border-box;
  flex-shrink: 0;
  top: 0;
  z-index: 9000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06); 
}
 

.header-top::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0px;
  background: linear-gradient(to right, #fdee00, #ff1a1a);
}

.top-controls {
  display: flex;
  justify-content: space-between; /* ✅ 유지 */
  align-items: center;
  width: 100%;
  flex-wrap: nowrap; 
  z-index: 5000;
}

.left-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.floating-home-logo {
  position: relative;
  height: auto;
  margin-right: 6rem;
  margin-bottom: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.floating-home-logo:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* ✅ 데스크탑에서 크기 줄이기 */
@media (min-width: 640px) {
  .floating-home-logo {
    width: 120px
  }
}

@media (max-width: 640px) {
  .floating-home-logo {
    margin: 0 !important;
    position: static !important;
    width: 22vw;
    height: auto;
  }
}


.auth-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 100;
  letter-spacing: -0.5px;
  white-space: nowrap;
  padding: 0.3rem 0.5rem; 
}

@media (max-width: 640px) {
  .auth-buttons {
    gap: 4px; /* ✅ 모바일에서는 살짝 붙게 */
  }

  .auth-btn.write-post,
  .auth-btn.logout {
    margin-left: 0 !important;
  }
  .auth-btn.logout {
    margin-right: 1px
  }
}



.auth-btn.login {
  cursor: pointer;
  text-decoration: none;
  padding: 5px 10px 3px;
  background-color: white;
  color: #641df1;
  border: 1px solid #621dec;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5px;
  margin-bottom: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.auth-btn.login:hover {
  background-color: #4c16b9;
  color: white;
  box-shadow: 0 4px 8px rgba(157, 107, 255, 0.2);
}

.auth-btn.signup {
  background: none;
  border: none;
  color: #555;
  font-size: 0.9rem;
  padding: 6px 4px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}
.auth-btn.signup:hover {
  color: #007bff;
}

.auth-btn.write-post {
  margin-left: 10px;
  background-color: #ffffff;
  color: #333;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 4px 10px !important;
  border: 1px solid #ccc;
  border-radius: 4px; /* 너무 둥글지 않게 */
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none; /* 밑줄 제거 */
  transition: background-color 0.1s ease, border-color 0.1s ease;
}

.auth-btn.write-post:hover {
  background-color: #ffffff;
  border-color: #999;
  color: #000;
}

.auth-btn.logout {
  cursor: pointer;
  text-decoration: none;
  padding: 5px 10px;
  background-color: white;
  color: #641df1;
  border: 1px solid #621dec;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 1.5px;
  margin-bottom: 1px;
  margin-left: 10px;
  margin-right: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.auth-btn.logout:hover {
  background-color: #4c16b9;
  color: white;
  box-shadow: 0 4px 8px rgba(157, 107, 255, 0.2);
}




@media (max-width: 640px) {
  .light-switch {
    width: 60px;
    height: 30px;
    border-radius: 999px;
    flex-shrink: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
  }
}

@media (max-width: 640px) {
  .right-controls {
    gap: 4px !important; /* 기존 8px → 4px로 줄이기 */
  }

  .auth-btn.logout {
    margin-right: 0 !important;
  }

  .light-switch {
    margin-left: 0 !important;
    transform: scale(0.85);
  }
}



.logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.site-logo {
  width: 360px !important;
  height: auto !important;
  max-width: none !important;
  flex-shrink: 0;
  display: block;
}

@media (max-width: 640px) {
  .site-logo {
    width: 50vw !important;
    max-width: 360px !important;
  }
}

/* ✅ 검색창 전체 컨테이너 - 기존 유지 */
.search-container {
  position: relative;
  z-index: 1000;
  width: 100vw;
  margin-top: 3rem;
  max-width: none;
  padding: 0 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}




/* ✅ 검색 input - 기존 유지 */
.search-box {
  flex: 1;
  padding: 10px 52px 10px 5px; /* 🔑 오른쪽 버튼 공간 확보 */
  border: none;
  outline: none;
  font-size: 1rem;
  border-radius: 999px;
  background: transparent;
  box-sizing: border-box;      /* 🔥 꼭 필요함!! */
}

/* ✅ 검색 버튼 - 기존 유지 */
.icon-submit-btn {
  position: absolute;
  right: 1.5vw;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #9d6bff;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.icon-submit-btn i {
  color: #9d6bff;
  font-size: 1.5rem;
  transition: transform 0.2s ease, color 0.3s ease;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #9d6bff;
}
.icon-submit-btn:hover i {
  color: #caa8ff;
  transform: translateY(-50%) scale(1.15);
}


/* ✅ 하단 고정 푸터 - 기존 유지 */
.global-footer {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 52px;
  background: #faf7f3;
  border-top: 1px solid #ddd;
  text-align: center;
  line-height: 52px;
  font-size: 0.85rem;
  color: #666;
  z-index: 1000;
}

/* 회원가입 페이지에서는 푸터 고정 안함 - 기존 유지 */
body.no-fixed-footer footer {
  position: static;
}



/* ✅ 햄버거 버튼 기본 */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  width: 30px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
  z-index: 999999;
}



/* ✅ 줄 스타일 (세 줄) */
.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: #333; /* 기본 줄 색상 */
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* ✅ 햄버거 -> X자 애니메이션 */
.hamburger.open span:nth-child(1) {
  transform: translateY(9.5px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-9.5px) rotate(-45deg);
}

/* ✅ 모바일 화면에서 보이게 */
.hamburger span {
  background: #333;
}

/* ✅ 다크모드 대응 */
html.dark body .hamburger span {
  background: white;
}

/* ✅ 메뉴가 열렸을 때 오른쪽 상단으로 이동 */
.hamburger.is-in-menu {
  top: 1.2rem;
  right: 0.95rem;
  left: auto; /* 기존 left 무효화 */
  z-index: 3001;
}

.hamburger.is-in-menu span {
  background: rgb(252, 164, 164); /* 어두운 배경 위에서 보이게 */
}

html.dark body .hamburger.is-in-menu span {
  background: #eee; /* 다크모드 대응 */
}



/* ✅ 모바일 메뉴 */
.mobile-menu {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  top: 0;
  left: 0;
  width: 200px;              /* ✅ 데스크톱 기본 */
  height: 100vh;             /* ✅ 전체 화면 높이 */
  background-color: rgba(61, 39, 39, 0.8);
  color: white;
  z-index: 120000;
  border-radius: 3px;
  box-sizing: border-box;

  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;

  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;

  transition:
    transform 0.3s ease-in-out,
    opacity 0.3s ease-in-out,
    width 0.6s ease,
    border-radius 0.6s ease,
    padding 0.6s ease,
    box-shadow 0.6s ease;
}

.mobile-menu::-webkit-scrollbar {
  display: none;
}

/* ✅ 모바일에서만 70vw */
@media (max-width: 640px) {
  .mobile-menu {
    width: 70vw;
  }
}






html.dark body .mobile-menu{
  background-color: rgb(0, 0, 0, 0.7);
}

.mobile-menu.open {
  /* 열렸을 때의 상태: 화면에 보이고, 불투명함 */
  transform: translateX(0); 
  opacity: 1;
  pointer-events: auto; /* 메뉴가 열렸을 때 클릭 이벤트를 허용합니다. */

  /* 열릴 때와 닫힐 때 모두 동일한 트랜지션 적용 (위의 .mobile-menu에서 이미 정의) */
  /* 여기에 다시 transition을 정의할 필요가 없습니다. */
}

.mobile-menu-header {
    position: relative; /* 햄버거 버튼의 위치 기준 */
    width: 100%;
    height: 40px; /* 적절한 높이 설정 */
    margin-bottom: 2rem;
}


.mobile-auth-buttons {
  margin-top: 2rem; /* 헤더 공간을 고려하여 여백 조정 */
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-auth-buttons a {
  display: block;
  text-align: center;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.mobile-login {
  background-color: transparent;
  color: white; /* 흰색으로 변경 */
  border: 1px solid #aaa;
}
.mobile-login:hover {
  background-color: #4c16b9;
  color: white;
}

.mobile-signup {
  background-color: transparent;
  color: white; /* 흰색으로 변경 */
  border: 1px solid #aaa;
}
.mobile-signup:hover {
  color: white;
  background-color: #f0657f;
}

.social-login-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  color: white;
  transition: background 0.3s ease;
}

.naver-login {
  background-color: #1ec800;
}
.naver-login:hover {
  background-color: #18a700;
}

.google-login {
  background-color: #4285f4;
}
.google-login:hover {
  background-color: #3367d6;
}

.social-btn i {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.naver-img {
  width: 30px;
  height: 30px;
  margin-right: 0.5rem;
  vertical-align: middle;
}


/* ✅ 모바일 검색 결과 패널 (슬라이드 완성본) - 기존 유지 */
.mobile-search-results {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80vh;
  background: white;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1002;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s ease, opacity 0.4s ease;
  overflow-y: auto;
  padding: 1.5rem;
}

.mobile-search-results.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.results-inner {
  max-width: 600px;
  margin: 0 auto;
}

/* ✅ 모바일 검색 시 헤더 고정 검색창 길이 - 기존 유지 */
@media (max-width: 640px) {
  .search-form {
    max-width: 95% !important;
    width: 90%;
    display: flex;  
    box-sizing: border-box;
  }
}

/* 팝오버 로그인창 - 기존 유지 */
.login-box {
  display: none;
  position: absolute;
  top: 50px;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 1rem;
  padding-right: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 9100;
  width: 260px;
  box-sizing: border-box;
}

.login-box input {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.login-box button {
  width: 100%;
  padding: 0.5rem;
  background: #ff9696;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.login-footer-links {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: #666;
}

.login-footer-links a {
  color: #ff6f6f;
  text-decoration: none;
  margin: 0 0.2rem;
}

.login-footer-links a:hover {
  text-decoration: underline;
}


@media (max-width: 640px) {
  .header-top {
    position: sticky;
  }

  .logo-link {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    z-index: 2000;
    margin: 0 !important;
  }}
  

  /* 프리로더 전체 화면 덮기 */
  #preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff; /* 필요하면 배경색 지정 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.2s ease; /* 부드럽게 사라짐 */
  }
  
  #preloader.fade-out {
    opacity: 0;
    pointer-events: none;
  }

/* 스피너 애니메이션 */
.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #ccc;
  border-top: 6px solid #555;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


@media (max-width: 640px) {
  .auth-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;   /* 오른쪽 정렬 */
    align-items: center;         /* 세로 가운데 정렬 */
    width: 100%;
    gap: 0.5rem;
  }

  .light-switch {
    transform: scale(0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0; /* 혹시 밀려있으면 조정 */
  }

  .welcome-text {
    order: 1;                    /* 다음 줄로 내리기 */
    flex-basis: 100%;            /* 한 줄 전체 차지 */
    text-align: center;
    font-size: 0.75rem;
    margin-top: 0.2rem;
    white-space: nowrap;
    color: #666;
  }

  .header-top {
    padding-left: 3rem;          /* ✅ 햄버거 버튼 영역 확보! */
  }
}

@media (max-width: 640px) {
  .right-controls {
    transform: scale(0.65); /* ✅ 전체 줄 비율 축소 */
    transform-origin: right center; /* ✅ 오른쪽 기준으로 축소 */
  }

}


@media (max-width: 640px) {
  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .mobile-menu.open {
    /* 열렸을 때의 상태: 화면에 보이고, 불투명함 */
    display: flex;
    transform: translateX(0); 
    opacity: 1;
    pointer-events: auto; /* 메뉴가 열렸을 때 클릭 이벤트를 허용합니다. */
  
    /* 열릴 때와 닫힐 때 모두 동일한 트랜지션 적용 (위의 .mobile-menu에서 이미 정의) */
    /* 여기에 다시 transition을 정의할 필요가 없습니다. */
  }

}

body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  touch-action: none; /* 모바일 터치 막기 */
}

.spacer {
  height: 10rem;
}


.language-dropdown {
  position: relative;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-btn .fi {
  width: 1.5rem;
  height: 1.2rem;
}

.lang-menu {
  display: none;
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 999;
  min-width: 100px;
  padding: 0.3rem 0;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  text-decoration: none;
  color: #333;
  white-space: nowrap;  
}

.lang-option:hover {
  background-color: #f2f2f2;
}

/* 🌙 다크 모드 지원 */
html.dark .lang-menu {
  background: #222;
  border-color: #444;
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.05);
}

html.dark .lang-option {
  color: #eee;
}

html.dark .lang-option:hover {
  background-color: #333;
}

html.dark .lang-btn i {
  color: #ffffff; /* 원하는 색상으로 변경 */
}

/* ===== 데스크톱 메뉴 ===== */
.desktop-menu {
  display: flex;
  align-items: center;
  margin-left: 2rem;
  font-family: 'Noto Sans KR', sans-serif;
}

.desktop-menu .menu {
  display: flex;
  gap: 2.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.desktop-menu .menu-item {
  position: relative;
  font-weight: 600;
  cursor: pointer;
  color: #333;
  white-space: nowrap; /* 🔹 줄바꿈 방지 */
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.desktop-menu .menu-item:hover {
  color: #ff6f6f;
}

/* ===== 서브메뉴 ===== */
.desktop-menu .submenu {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  
  position: absolute;
  top: 2.2rem;
  left: 0;
  min-width: 160px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  list-style: none;
  padding: 0.5rem 0;
  z-index: 5000;
}

.desktop-menu .submenu li a {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  text-decoration: none;
  color: #333;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.desktop-menu .submenu li a:hover {
  background: #ffe8e8;
  color: #ff4b4b;
}

/* ===== 호버 시 보이기 ===== */
.desktop-menu .menu-item:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== 다크모드 ===== */
html.dark .desktop-menu .menu-item {
  color: #eee;
}

html.dark .desktop-menu .menu-item:hover {
  color: #ff9b9b;
}

html.dark .desktop-menu .submenu {
  background: #222;
  box-shadow: 0 6px 16px rgba(255,255,255,0.05);
}

html.dark .desktop-menu .submenu li a {
  color: #eee;
}

html.dark .desktop-menu .submenu li a:hover {
  background: #333;
  color: #ff8080;
}

/* ===== 모바일 숨기기 ===== */
@media (max-width: 640px) {
  .desktop-menu {
    display: none;
  }
}


.mobile-main-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.mobile-main-menu > li {
  width: 100%;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.mobile-main-menu a {
  display: block;
  padding: 1rem;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
}

.mobile-main-menu a:hover {
  background-color: rgba(255,255,255,0.1);
}

/* 서브메뉴 */
.mobile-submenu {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: rgba(0,0,0,0.3);
}

.mobile-submenu li a {
  font-size: 0.95rem;
  padding: 0.8rem;
}

/* 드롭다운 열릴 때 */
.mobile-dropdown.open > .mobile-submenu {
  display: block;
}

/* 🌙 다크모드 모바일 메뉴 */
html.dark .mobile-menu {
  background-color: rgba(30, 30, 30, 0.95);
  color: #eee;
}

html.dark .mobile-main-menu a {
  color: #eee;
}

html.dark .mobile-main-menu a:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

html.dark .mobile-submenu {
  background-color: rgba(255, 255, 255, 0.05);
}

html.dark .mobile-submenu li a {
  color: #ccc;
}

html.dark .mobile-submenu li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 드롭다운 활성화 상태 시 테두리 강조 */
html.dark .mobile-dropdown.open > a {
  background-color: rgba(255, 255, 255, 0.1);
}


