/*
 * LomiWiki custom CSS overrides for the Liberty skin.
 *
 * This file is an additional site-specific stylesheet loaded by the
 * wiki-lomi-custom-css plugin. It does not require editing the Liberty
 * skin index.html or bundled assets.
 *
 * The Liberty skin is licensed under GNU GPL v3. This custom stylesheet
 * is provided under GNU GPL v3 or later to remain compatible with the
 * Liberty skin.
 *
 * Created/modified for LomiWiki.
 */

/* =========================================
   로미위키 custom navbar CSS
   - 기본 liberty 구조 유지
   - navbar 높이 소폭 확대
   - 로고는 잘림 방지 위해 약간 축소
   - 우측 검색창/유저아이콘 수직 중앙 정렬
   - 본문 상단 여백 보정
   ========================================= */

/* PC / 공통 */
.Liberty .nav-wrapper {
  min-height: 3.6rem !important;
}

.Liberty .nav-wrapper .navbar {
  min-height: 3.6rem !important;
}

/* 본문이 navbar와 겹치지 않게 조금 더 보정 */
.Liberty .content-wrapper {
  margin-top: 3.8rem !important;
}

/* 로고: 높이는 navbar에 맞추되 이미지 자체는 조금 줄여 잘림 방지 */
.Liberty .nav-wrapper .navbar .navbar-brand {
  height: 3.6rem !important;
  background-size: auto 1.62rem !important;
  background-repeat: no-repeat !important;
  background-position: left center !important;
}

/* 메뉴 글씨 수직 중앙 정렬 */
.Liberty .nav-wrapper .navbar .navbar-nav .nav-item .nav-link,
.Liberty .nav-wrapper .navbar .navbar-nav > li > a,
.Liberty .nav-wrapper .navbar .navbar-login .nav-link,
.Liberty .nav-wrapper .navbar .navbar-login > a {
  display: flex !important;
  align-items: center !important;
  height: 3.6rem !important;
}

/* 검색창 수직 중앙 정렬 */
.Liberty .nav-wrapper .navbar .form-inline {
  display: flex !important;
  align-items: center !important;
  height: 3.6rem !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* 검색 input / 버튼 높이 미세 보정 */
.Liberty .nav-wrapper .navbar .form-inline .form-control,
.Liberty .nav-wrapper .navbar .form-inline .btn {
  align-self: center !important;
}

/* 유저 아이콘 수직 중앙 정렬 */
.Liberty .nav-wrapper .navbar .navbar-login {
  display: flex !important;
  align-items: center !important;
  height: 3.6rem !important;
}

.Liberty .nav-wrapper .navbar .navbar-login .fa,
.Liberty .nav-wrapper .navbar .navbar-login .profile-img {
  align-self: center !important;
}

/* =========================================
   모바일 메뉴: 가운데 고정 표시
   ========================================= */
@media (max-width: 1023px) {
  /* navbar/dropdown 잘림 방지 */
  .Liberty .nav-wrapper,
  .Liberty .nav-wrapper .navbar,
  .Liberty .nav-wrapper .navbar .dropdown {
    overflow: visible !important;
  }

  /* 드롭다운을 화면 가운데 고정 */
  .Liberty .nav-wrapper .navbar .dropdown-menu {
    position: fixed !important;
    top: 72px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;

    width: min(320px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    min-width: 220px !important;

    max-height: calc(100vh - 96px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;

    box-sizing: border-box !important;
    z-index: 9999 !important;
  }

  /* 메뉴 글 줄바꿈 허용 */
  .Liberty .nav-wrapper .navbar .dropdown-menu .dropdown-item,
  .Liberty .nav-wrapper .navbar .dropdown-menu a {
    white-space: normal !important;
    word-break: keep-all !important;
  }
}