/* =====================================================
   루아흐 정신분석심리상담센터 — style.css (공통)
   색상 변경: :root 변수만 수정하세요
   ===================================================== */

/* ── 색상 변수 ── */
:root {
  --navy:       #3a2418;
  --blue:       #9c5f2e;
  --sky:        #d9a066;
  --light-blue: #faf0e4;
  --pale:       #fdf8f2;
  --white:      #ffffff;
  --gray:       #6b5544;
  --text:       #3a2a1e;
  --green:      #2e7d52;
  --red:        #c0392b;
  --orange:     #d35400;
  --admin-bar:  #241811;
}

/* ── 리셋 & 기본 ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── 관리자 상단 바 ── */
#adminBar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 40px;
  background: var(--admin-bar);
  z-index: 2000;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
#adminBar.visible { display: flex; }
.admin-bar-left {
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-bar-left::-webkit-scrollbar { display: none; }
.admin-bar-badge {
  font-size: 12px; color: #e0a458; font-weight: 600;
  letter-spacing: 1px; white-space: nowrap;
  padding-right: 8px; border-right: 1px solid rgba(255,255,255,0.15);
}
.admin-bar-btn {
  font-size: 12.5px; color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.08); border: none;
  padding: 5px 10px; border-radius: 3px; white-space: nowrap;
  transition: all 0.2s;
}
.admin-bar-btn:hover { background: rgba(255,255,255,0.18); color: var(--white); }
.admin-bar-logout {
  font-size: 12.5px; color: rgba(255,255,255,0.5);
  background: none; border: 1px solid rgba(255,255,255,0.15);
  padding: 4px 10px; border-radius: 3px; white-space: nowrap; flex-shrink: 0;
  transition: all 0.2s;
}
.admin-bar-logout:hover { color: var(--white); border-color: rgba(255,255,255,0.4); }
body.admin-mode nav { top: 40px; }
body.admin-mode { padding-top: 40px; }

/* ── 네비게이션 ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(156,95,46,0.1);
  padding: 0 20px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  transition: box-shadow 0.3s;
}
nav.scrolled { box-shadow: 0 2px 20px rgba(58,36,24,0.12); }
.nav-logo {
  font-family: 'Noto Serif KR', serif;
  font-size: 15px; font-weight: 600; color: var(--navy); line-height: 1.3;
}
.nav-logo span {
  color: var(--blue); font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 19px;
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-admin-btn {
  font-size: 12.5px; color: var(--gray); background: none;
  border: 1px solid #e8dccd; padding: 5px 10px; border-radius: 4px; transition: all 0.2s;
}
.nav-admin-btn:hover { color: var(--navy); border-color: var(--navy); }
.nav-menu-btn {
  background: none; border: none;
  display: flex; flex-direction: column; gap: 5px; padding: 6px 4px;
  -webkit-tap-highlight-color: transparent;
}
.nav-menu-btn span {
  display: block; width: 22px; height: 2px;
  background: var(--navy); border-radius: 2px; transition: all 0.3s;
}

/* ── 모바일 메뉴 ── */
.mobile-menu {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--white); z-index: 999;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--light-blue);
  background: var(--pale); min-height: 60px;
}
.mobile-menu-logo { font-family: 'Noto Serif KR', serif; font-size: 14.5px; font-weight: 600; color: var(--navy); }
.mobile-close-btn {
  background: none; border: none; font-size: 24px;
  color: var(--gray); padding: 4px; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu a {
  font-family: 'Noto Serif KR', serif; font-size: 18px; font-weight: 400;
  color: var(--navy); padding: 18px 24px;
  border-bottom: 1px solid var(--light-blue);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.15s; -webkit-tap-highlight-color: transparent;
}
.mobile-menu a:active { background: var(--pale); }
.mobile-menu a.active { color: var(--blue); }
.mobile-menu a::after { content: '›'; font-size: 20px; color: var(--sky); }

/* ── 모바일 메뉴 구분선 ── */
.menu-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 8px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 3px;
  color: var(--gray);
  text-transform: uppercase;
  background: var(--pale);
}
.menu-divider::before,
.menu-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--light-blue);
}
.menu-divider span { white-space: nowrap; }

/* ── 페이지 공통 헤더 배너 ── */
.page-banner {
  height: 200px;
  background:
    linear-gradient(160deg, rgba(45,25,12,0.68) 0%, rgba(60,35,20,0.52) 50%, rgba(140,80,25,0.4) 100%),
    url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1600&q=80&fit=crop') center/cover no-repeat;
  display: flex; align-items: flex-end;
  padding: 0 24px 28px;
  margin-top: 60px;
  position: relative; overflow: hidden;
}
body.admin-mode .page-banner { margin-top: 100px; }
.page-banner::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(217,160,102,0.18) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.page-banner-content { position: relative; z-index: 1; }
.page-banner-label {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 12.5px; color: rgba(255,255,255,0.5);
  letter-spacing: 3px; text-transform: uppercase; margin-bottom: 6px;
}
.page-banner-title {
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(22px, 5vw, 30px); font-weight: 600;
  color: var(--white); line-height: 1.3;
}
.page-banner-sub {
  font-size: 13.5px; color: rgba(255,255,255,0.55); margin-top: 6px;
}

/* ── 섹션 공통 ── */
.page-content { padding: 40px 20px 60px; max-width: 800px; margin: 0 auto; }
.section-label {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 12.5px; letter-spacing: 3px; color: var(--blue);
  text-transform: uppercase; margin-bottom: 6px;
}
.section-title {
  font-family: 'Noto Serif KR', serif;
  font-size: clamp(18px, 4vw, 24px); font-weight: 600;
  color: var(--navy); margin-bottom: 10px; line-height: 1.4;
}
.section-divider { width: 36px; height: 2px; background: var(--blue); margin-bottom: 24px; }
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── 카드 공통 ── */
.card {
  background: var(--white); border-radius: 12px;
  padding: 22px 20px; box-shadow: 0 2px 16px rgba(58,36,24,0.07);
  margin-bottom: 14px;
}

/* ── 폼 공통 ── */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 500; color: var(--navy); margin-bottom: 5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid #e8dccd; border-radius: 6px;
  font-size: 15px; font-family: 'Noto Sans KR', sans-serif;
  color: var(--text); background: var(--pale); outline: none;
  transition: border-color 0.2s; -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--blue); background: var(--white); }
.form-group textarea { resize: vertical; }
.btn {
  padding: 11px 22px; border: none; border-radius: 7px;
  font-size: 14.5px; font-family: 'Noto Sans KR', sans-serif; font-weight: 500;
  transition: all 0.2s; -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--blue); }
.btn-secondary { background: var(--light-blue); color: var(--blue); }
.btn-secondary:hover { background: var(--blue); color: var(--white); }
.btn-danger { background: #ffebee; color: var(--red); }
.btn-danger:hover { background: var(--red); color: var(--white); }
.btn-full { width: 100%; padding: 13px; text-align: center; }

/* ── 관리자 에디터 영역 ── */
.admin-edit-bar {
  display: none; align-items: center; justify-content: space-between;
  background: #fff8e1; border: 1px dashed #f9a825;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px;
}
.admin-edit-bar.visible { display: flex; }
.admin-edit-bar span { font-size: 13.5px; color: #e65100; font-weight: 500; }
.admin-edit-bar-btns { display: flex; gap: 6px; }

/* ── 게시판 공통 ── */
.post-list { display: flex; flex-direction: column; gap: 1px; }
.post-item {
  background: var(--white); padding: 16px 18px;
  border-bottom: 1px solid var(--light-blue);
  display: flex; align-items: center; gap: 12px;
  transition: background 0.15s; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.post-item:hover { background: var(--pale); }
.post-num { font-size: 12.5px; color: var(--gray); min-width: 28px; text-align: center; }
.post-title { flex: 1; font-size: 15px; color: var(--navy); line-height: 1.5; }
.post-title .new-badge {
  display: inline-block; font-size: 11px; background: var(--blue);
  color: var(--white); padding: 1px 5px; border-radius: 3px; margin-left: 6px; vertical-align: middle;
}
.post-meta { font-size: 12.5px; color: var(--gray); white-space: nowrap; }
.post-detail {
  background: var(--white); border-radius: 12px;
  padding: 24px 20px; box-shadow: 0 2px 16px rgba(58,36,24,0.07);
  display: none;
}
.post-detail.visible { display: block; }
.post-detail-header {
  padding-bottom: 14px; border-bottom: 1px solid var(--light-blue); margin-bottom: 18px;
}
.post-detail-title { font-family: 'Noto Serif KR', serif; font-size: 18px; color: var(--navy); margin-bottom: 8px; line-height: 1.4; }
.post-detail-meta { font-size: 13.5px; color: var(--gray); }
.post-detail-body { font-size: 15px; color: var(--text); line-height: 1.95; white-space: pre-wrap; }
.post-detail-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ── 관리자 글쓰기 패널 ── */
.write-panel {
  background: var(--pale); border-radius: 12px;
  padding: 20px; margin-bottom: 16px; display: none;
  border: 1px solid var(--light-blue);
}
.write-panel.visible { display: block; }
.write-panel h3 {
  font-family: 'Noto Serif KR', serif; font-size: 16px;
  color: var(--navy); margin-bottom: 14px;
}
.write-panel textarea { height: 160px; }
.write-panel-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }

/* ── 토스트 ── */
.toast {
  position: fixed; bottom: 76px; left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: var(--navy); color: var(--white);
  padding: 11px 22px; border-radius: 22px; font-size: 14.5px;
  opacity: 0; pointer-events: none; transition: all 0.3s;
  z-index: 9999; white-space: nowrap; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 관리자 로그인 모달 ── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.52); z-index: 3000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 16px; padding: 28px 24px;
  width: 100%; max-width: 320px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.28); position: relative;
}
.modal-title { font-family: 'Noto Serif KR', serif; font-size: 17px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.modal-sub { font-size: 13.5px; color: var(--gray); margin-bottom: 22px; }
.modal-input-group { margin-bottom: 12px; }
.modal-input-group label { display: block; font-size: 12.5px; font-weight: 500; color: var(--navy); margin-bottom: 5px; }
.modal-input-group input {
  width: 100%; padding: 11px 13px; border: 1px solid #e8dccd; border-radius: 7px;
  font-size: 15px; font-family: 'Noto Sans KR', sans-serif; outline: none;
  background: var(--pale); transition: border-color 0.2s; -webkit-appearance: none;
}
.modal-input-group input:focus { border-color: var(--blue); background: var(--white); }
.modal-login-btn {
  width: 100%; padding: 13px; background: var(--navy); color: var(--white);
  border: none; border-radius: 7px; font-size: 15px;
  font-family: 'Noto Sans KR', sans-serif; font-weight: 500; margin-top: 4px; transition: background 0.2s;
}
.modal-login-btn:hover { background: var(--blue); }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 20px; color: var(--gray); padding: 4px; }
.modal-error { color: var(--red); font-size: 13.5px; margin-top: 8px; display: none; }
.modal-error.show { display: block; }

/* ── 플로팅 버튼 ── */
.float-btns {
  position: fixed; right: 14px; bottom: 20px;
  display: flex; flex-direction: column; gap: 8px; z-index: 100;
}
.float-btn {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: 0 4px 14px rgba(58,36,24,0.25);
  transition: all 0.25s; border: none; -webkit-tap-highlight-color: transparent;
}
.float-btn:hover { background: var(--blue); transform: scale(1.07); }
.float-btn:active { transform: scale(0.95); }
.float-btn.phone { background: var(--blue); }

/* ── 푸터 ── */
footer { background: var(--navy); padding: 36px 20px; }
.footer-logo { font-family: 'Noto Serif KR', serif; font-size: 16px; color: var(--white); margin-bottom: 10px; }
.footer-info { font-size: 13.5px; color: rgba(255,255,255,0.68); line-height: 2.1; }
.footer-info a { color: rgba(255,255,255,0.68); }
.footer-bottom { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; text-align: center; color: rgba(255,255,255,0.35); }

/* ── 빈 상태 ── */
.empty-state { text-align: center; padding: 48px 16px; color: var(--gray); font-size: 14.5px; }
.empty-state span { display: block; font-size: 32px; margin-bottom: 10px; }

/* ── PC 반응형 ── */
@media (min-width: 768px) {
  .page-content { padding: 48px 40px 72px; }
  .page-banner { height: 220px; padding: 0 48px 32px; }
  nav { padding: 0 40px; }
}
@media (min-width: 1024px) {
  nav { padding: 0 60px; }
  .page-content { padding: 56px 60px 80px; }
}
