/* =====================
   OEhub 디자인 시스템
   ===================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

:root {
  --color-primary: #FF8C42;
  --color-primary-light: #FFF0E6;
  --color-primary-dark: #E8623A;
  --color-text: #1A1A1A;
  --color-text-sub: #6B7280;
  --color-bg: #FFFFFF;
  --color-bg-sub: #FAFAFA;
  --color-border: #F0F0F0;
  --color-border-dark: #E0E0E0;
  --font-base: 'Noto Sans KR', sans-serif;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 56px;
  --header-height: 52px;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
  /* 전체 화면을 사이드바 + 오른쪽으로 분할 */
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* =====================
   사이드바 (왼쪽 고정)
   ===================== */
.oehub-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  overflow: hidden;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

/* 사이드바 접힌 상태 */
.oehub-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.oehub-sidebar.collapsed .nav-label {
  display: none;
}

.oehub-sidebar.collapsed .sidebar-logo-text {
  display: none;
}

.oehub-sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 0.65rem 0;
}

/* 사이드바 상단 — 로고 + 토글 */
.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--color-border);
  gap: 0.5rem;
  flex-shrink: 0;
}

.oehub-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}

.oehub-logo:hover {
  color: var(--color-primary-dark);
}

.sidebar-logo-text {
  font-size: 1.15rem;
  font-weight: 700;
}

/* 사이드바 토글 버튼 */
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--color-text-sub);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  font-size: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sidebar-toggle:hover {
  background: var(--color-bg-sub);
  color: var(--color-text);
}

/* 사이드바 네비게이션 */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  color: var(--color-text-sub);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 6px;
  margin: 0.1rem 0.5rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.sidebar-nav-item .nav-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* 사이드바 하단 — 유저 영역 */
.sidebar-footer {
  border-top: 1px solid var(--color-border);
  padding: 0.75rem 0;
  flex-shrink: 0;
}

/* =====================
   오른쪽 영역
   ===================== */
.oehub-right {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.2s ease;
  min-width: 0;
  height: 100vh;
}

/* 사이드바 접힘 시 오른쪽 영역 확장 */
body.sidebar-collapsed .oehub-right {
  margin-left: var(--sidebar-collapsed-width);
}

/* =====================
   상단 헤더 (오른쪽 영역 안)
   ===================== */
.oehub-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  flex-shrink: 0;
  gap: 0.75rem;
}

.header-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =====================
   메인 콘텐츠
   ===================== */
/* 메인 콘텐츠 영역 */
/* .oehub-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;

  margin-left: auto;
  margin-right: auto;
} */

.oehub-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.oehub-content {
  max-width: 1200px;
  margin: 0 auto;
}
/* =====================
   버튼
   ===================== */
.btn-oehub {
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-base);
}

.btn-oehub:hover {
  background: var(--color-primary);
  color: white;
}

.btn-oehub-solid {
  background: var(--color-primary);
  color: white;
  border: 1.5px solid var(--color-primary);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-base);
}

.btn-oehub-solid:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
}

/* =====================
   카드
   ===================== */
.oehub-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: box-shadow 0.15s;
}

.oehub-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* =====================
   폼
   ===================== */
.oehub-input {
  width: 100%;
  border: 1.5px solid var(--color-border-dark);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.92rem;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.15s;
  outline: none;
}

.oehub-input:focus {
  border-color: var(--color-primary);
}

.oehub-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.35rem;
  display: block;
}

/* =====================
   배지
   ===================== */
.badge-verified {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.badge-member {
  background: #EFF6FF;
  color: #2563EB;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* =====================
   익명 표시
   ===================== */
.author-anon {
  font-size: 0.82rem;
  color: var(--color-text-sub);
}

.author-writer {
  font-size: 0.82rem;
  color: var(--color-primary);
  font-weight: 600;
}

/* =====================
   구분선
   ===================== */
.sidebar-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0.5rem 0.75rem;
}

/* =====================
   반응형
   ===================== */
@media (max-width: 768px) {
  .oehub-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .oehub-sidebar.mobile-open {
    transform: translateX(0);
  }
  .oehub-right {
    margin-left: 0;
  }
  body.sidebar-collapsed .oehub-right {
    margin-left: 0;
  }
  .oehub-main {
    padding: 1rem;
  }
}


/* =====================
   메인 페이지
   ===================== */
.oehub-feature-card {
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.oehub-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

.home-list-item {
  color: var(--color-text);
  transition: background 0.1s;
  border-radius: 4px;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.home-list-item:hover {
  background: var(--color-bg-sub);
}

.home-list-item:last-child {
  border-bottom: none !important;
}


/* =====================
   커뮤니티
   ===================== */
.community-post-item {
  transition: background 0.1s;
  color: var(--color-text);
}

.community-post-item:hover {
  background: var(--color-bg-sub);
}

/* 탭 커스텀 */
.nav-tabs .nav-link {
  color: var(--color-text-sub);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 1rem;
}

.nav-tabs .nav-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: none;
  font-weight: 600;
}

.nav-tabs .nav-link:hover {
  color: var(--color-primary-dark);
  border-color: transparent;
  border-bottom-color: var(--color-primary-light);
}

.nav-tabs {
  border-bottom: 1px solid var(--color-border);
}


/* Toast UI Editor 스크롤바 수정 */
/* Toast UI Editor 전체 스크롤바 수정 */
html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

.toastui-editor-defaultUI {
  border-radius: 0.375rem;
  overflow: hidden;
}

.toastui-editor-ww-container,
.toastui-editor-contents {
  overflow-x: hidden !important;
}

/* 위키 내부 링크 */
.wiki-link {
  color: #2563EB;
  text-decoration: none;
  border-bottom: 1px solid #93C5FD;
}

.wiki-link:hover {
  background: #EFF6FF;
}

/* 존재하지 않는 문서 링크 */
.wiki-link-missing {
  color: #DC2626;
  text-decoration: none;
  border-bottom: 1px dashed #FCA5A5;
}

.wiki-link-missing:hover {
  background: #FEF2F2;
}

/* 위키 미주 */


section[data-footnotes] h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-sub);
  margin-bottom: 0.75rem;
}

section[data-footnotes] h2::before {
  content: '📌 ';
}

/* Footnotes → 참고 로 변경은 JS로 */
section[data-footnotes] ol {
  padding-left: 1.5rem;
  font-size: 0.85rem;
  color: var(--color-text-sub);
}

section[data-footnotes] ol li {
  margin-bottom: 0.25rem;
  line-height: 1.6;
}

section[data-footnotes] a {
  color: var(--color-primary);
  text-decoration: none;
}