/* ════════════════════════════════════════
   shared-header.css  –  공통 상단 네비게이션
   ════════════════════════════════════════ */

/* ── 고정 헤더 래퍼 ── */
.sh-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}
.sh-nav.sh-scrolled {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* ── 내부 레이아웃 ── */
.sh-nav-inner {
  position: relative;
  width: 100%;
  height: 60px;
  max-width: none;
  margin: 0;
  padding: 0 32px 0 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}

/* ── 로고 ── */
.sh-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.sh-logo img {
  display: block;
  width: 120px;
  height: 23px;
  object-fit: contain;
}

/* ── 링크 목록 (로고 오른쪽) ── */
.sh-links {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-left: 48px;
  flex-shrink: 0;
}
.sh-links--center {
  position: static;
  left: auto;
  transform: none;
}

/* ── 우측 액션 ── */
.sh-actions {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
  flex-shrink: 0;
}

/* MY 페이지 (파란 글씨) */
.sh-mypage-link {
  color: #708dff;
  font-size: 15px;
  font-weight: 500;
  font-family: "Paperlogy", "Malgun Gothic", sans-serif;
  text-decoration: none;
  white-space: nowrap;
  margin-right: 24px;
  transition: opacity 0.2s;
}
.sh-mypage-link:hover {
  opacity: 0.75;
}

/* 로그인 / 로그아웃 (파란 버튼) */
.sh-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 31px;
  padding: 0 16px;
  border-radius: 6px;
  background: #708dff;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  font-family: "Paperlogy", "Malgun Gothic", sans-serif;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  transition: opacity 0.2s;
}
.sh-login-btn:hover {
  opacity: 0.88;
}

/* ── 개별 링크 ── */
.sh-link {
  color: #555555;
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  font-family: "Paperlogy", "Malgun Gothic", sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 0.2s,
    opacity 0.2s;
  background: none;
  border: none;
  padding: 0;
}
.sh-link:hover {
  opacity: 0.75;
}

/* 현재 페이지 포커스 (로그인·회원가입 제외) */
.sh-link.sh-active {
  font-weight: 600;
  color: #333333;
}

/* ── 헤더 높이만큼 스페이서 ── */
.sh-spacer {
  height: 60px;
}

/* ── 상단 데드존 · 뒤로가기 (PC에서는 숨김, ≤1024에서만 노출) ── */
.sh-safe-dead {
  display: none;
  height: 0;
  min-height: 0;
  overflow: hidden;
}
.sh-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.sh-back-btn img {
  display: block;
  height: auto;
}
.sh-nav-grow {
  display: none;
  flex: 1;
  min-width: 0;
}

/* ── 모바일: 햄버거 버튼 (기본 숨김) ── */
.sh-burger {
  display: none;
  padding: 8px;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.sh-burger img {
  display: block;
}

/* ── 모바일 드로어 ── */
.sh-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.sh-drawer-backdrop[hidden] {
  display: none;
}
.sh-drawer-backdrop--open {
  opacity: 1;
}

.sh-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 269px;
  max-width: 75vw;
  background: #20222a;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
  padding: 0 22px 24px;
  box-sizing: border-box;
}
.sh-drawer[hidden] {
  display: none;
}
.sh-drawer--open {
  transform: translateX(0);
}

.sh-drawer-top {
  position: relative;
  padding-top: 56px;
}
.sh-drawer-close {
  position: absolute;
  top: 18px;
  right: 0;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}
.sh-drawer-close img {
  display: block;
  width: 14px;
  height: 14px;
}

.sh-drawer-logo {
  display: inline-block;
  margin-top: 16px;
  line-height: 0;
}
.sh-drawer-logo img {
  display: block;
  height: 24px;
  width: auto;
}

.sh-drawer-account {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 26px;
  padding-bottom: 22px;
  color: #fff;
}
.sh-drawer-mypage {
  font-size: 16px;
  font-weight: 500;
  color: #708dff;
  text-decoration: none;
  font-family: "Paperlogy", "Malgun Gothic", sans-serif;
}
.sh-drawer-login {
  font-size: 16px;
  font-weight: 400;
  color: #555555;
  text-decoration: none;
  font-family: "Paperlogy", "Malgun Gothic", sans-serif;
}

.sh-drawer-menu {
  display: flex;
  flex-direction: column;
}
.sh-drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
  border-bottom: 1px solid rgba(227, 227, 229, 0.4);
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 300;
  font-family: "Paperlogy", "Malgun Gothic", sans-serif;
}
.sh-drawer-item.sh-active {
  font-weight: 600;
  color: #ffffff;
}
.sh-drawer-item > span:first-child {
  display: block;
}
.sh-drawer-arrow {
  width: 7px;
  height: 14px;
  flex-shrink: 0;
  /* left-arrow.svg(←)를 가로로 뒤집어 우측 화살표(→)로 사용 */
  transform: scaleX(-1);
  display: block;
}

/* ── 반응형 ── */
@media (max-width: 1100px) {
  .sh-links {
    gap: 32px;
    margin-left: 32px;
  }
  .sh-mypage-link {
    margin-right: 20px;
  }
}

@media (max-width: 900px) {
  .sh-nav-inner {
    padding: 0 20px;
  }
  .sh-links--center {
    display: none !important;
  }
}
@media (max-width: 599px) {
  .sh-links {
    gap: 10px;
  }
  .sh-link {
    font-size: 11px;
  }
}

/* ── 공통 뒤로가기 규격 (페이지별 .mp-back-btn 등은 별도) ── */
.back-nav-btn {
  line-height: 0;
  border: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.back-nav-btn img {
  display: block;
}

/* ── PC(≥1025): 기존 데스크톱 헤더 ── */
@media (min-width: 1025px) {
  .sh-safe-dead {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
  }
  .sh-back-btn,
  .sh-nav-grow {
    display: none !important;
  }
  .sh-nav-inner {
    height: 60px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 32px 0 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  .sh-logo {
    display: flex !important;
  }
  .sh-links--center {
    display: flex !important;
  }
  .sh-actions {
    display: flex !important;
  }
  .sh-burger {
    display: none !important;
  }
  .sh-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
  }
  .sh-spacer {
    display: block !important;
    height: 60px !important;
  }
}

/* ── 모바일·태블릿(≤1024): 상단 데드존(~40px) + 뒤로가기·햄버거 동일 행 ── */
@media (max-width: 1024px) {
  .sh-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: none;
  }

  .sh-safe-dead {
    display: block;
    flex-shrink: 0;
    height: max(40px, env(safe-area-inset-top, 0px));
    min-height: 40px;
    background: #ffffff;
    pointer-events: none;
  }

  .sh-nav-inner {
    flex-shrink: 0;
    height: 60px;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 12px 0 4px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
  }

  .sh-back-btn {
    display: inline-flex !important;
  }

  .sh-nav-grow {
    display: block !important;
  }

  .sh-logo {
    display: none !important;
  }

  .sh-links--center,
  .sh-actions {
    display: none !important;
  }

  .sh-burger {
    display: inline-flex !important;
    flex-shrink: 0;
    margin-left: auto;
  }

  .sh-spacer {
    display: block !important;
    height: calc(60px + max(40px, env(safe-area-inset-top, 0px))) !important;
    overflow: hidden;
  }

  .sh-nav.sh-scrolled {
    box-shadow: none;
    border-bottom: none;
  }

  /* 공통 헤더로 통일 — 본문에 있던 뒤로가기는 숨김 */
  .mp-back-toolbar,
  .sg-back-btn,
  .fa-back-btn,
  .cp-back-btn {
    display: none !important;
  }
}

/* ── 로그인 필요 팝업 (회원가입 알림 팝업과 같은 모양) ── */
.sh-login-modal {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.sh-login-modal[hidden] {
  display: none !important;
}
.sh-login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
}
.sh-login-modal-dialog {
  position: relative;
  z-index: 1;
  width: 400px;
  height: 240px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border-radius: 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 20px;
  text-align: center;
  font-family: "Paperlogy", "Malgun Gothic", sans-serif;
}
.sh-login-modal-icon {
  width: 52px;
  height: 52px;
  display: block;
}
.sh-login-modal-title {
  margin: 12px 0 6px;
  font-size: 24px;
  font-weight: 600;
  color: #555555;
  line-height: 1.3;
}
.sh-login-modal-message {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 400;
  color: #555555;
  line-height: 1.5;
}
.sh-login-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.sh-login-modal-btn {
  width: 120px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #708dff;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  font-family: "Paperlogy", "Malgun Gothic", sans-serif;
  cursor: pointer;
  transition: opacity 0.2s;
}
.sh-login-modal-btn:hover {
  opacity: 0.9;
}
.sh-login-modal-btn--sub {
  background: #e8e8e8;
  color: #555555;
}
@media (max-width: 599px) {
  .sh-login-modal-dialog {
    height: auto;
    padding: 28px 20px 22px;
  }
  .sh-login-modal-title {
    font-size: 20px;
  }
  .sh-login-modal-message {
    font-size: 14px;
  }
  .sh-login-modal-btn {
    width: 110px;
  }
}

/* ════════════════════════════════════════
   로그인 상태: 프로필 버튼(그라데이션) + 계정 창
   ════════════════════════════════════════ */
.sh-actions [hidden] {
  display: none !important;
}

.sh-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.sh-profile-btn:focus-visible {
  outline: 2px solid #708dff;
  outline-offset: 3px;
  border-radius: 999px;
}

.sh-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8ea6ff 0%, #5a7bff 100%);
  flex-shrink: 0;
  overflow: hidden;
}
.sh-avatar svg {
  width: 15px;
  height: 18px;
  display: block;
}
.sh-avatar--lg {
  width: 60px;
  height: 60px;
}
.sh-avatar--lg svg {
  width: 25px;
  height: 30px;
}

.sh-profile-chevron {
  display: inline-flex;
  width: 19px;
  height: 10px;
  transition: transform 0.2s;
}
.sh-profile-chevron svg {
  width: 19px;
  height: 10px;
  display: block;
}
.sh-profile-btn[aria-expanded="true"] .sh-profile-chevron {
  transform: rotate(180deg);
}

/* 계정 창 */
.sh-account-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #f4f7fe;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(30, 50, 120, 0.1);
  overflow: hidden;
  transition: height 0.3s ease;
  font-family: "Paperlogy", "Malgun Gothic", sans-serif;
  color: #555555;
  z-index: 10000;
}
.sh-account-panel[hidden] {
  display: none !important;
}
.sh-ap-inner {
  padding: 23px 25px 19px 23px;
}

.sh-ap-head {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
}
.sh-ap-who {
  display: flex;
  flex-direction: column;
  row-gap: 5px;
  min-width: 0;
  padding-right: 50px;
}
.sh-ap-label {
  font-size: 12px;
  font-weight: 500;
  color: #708dff;
}
.sh-ap-id {
  font-size: 21px;
  font-weight: 500;
  color: #708dff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sh-ap-logout {
  position: absolute;
  top: 10px;
  right: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #929394;
  cursor: pointer;
}
.sh-ap-logout:hover {
  color: #555555;
}

.sh-ap-rows {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sh-ap-row {
  display: flex;
  align-items: center;
  column-gap: 25px;
  font-size: 15px;
  min-height: 26px;
}
.sh-ap-key {
  width: 53px;
  flex-shrink: 0;
  color: #555555;
}
.sh-ap-val {
  flex: 1;
  color: #555555;
}
.sh-ap-badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 3px;
  background: #708dff;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
}
.sh-ap-link {
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-weight: 300;
  font-size: 16px;
  color: #555555;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.sh-ap-link:hover {
  color: #708dff;
}

/* 알림 목록 · 내용 (상세보기 시 아래로 늘어남) */
.sh-ap-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e3e7ee;
}
.sh-ap-empty {
  padding: 18px 0 6px;
  text-align: center;
  font-size: 13px;
  color: #929394;
}
.sh-ap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sh-ap-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e3e7ee;
  border-radius: 6px;
  background: #ffffff;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}
.sh-ap-item:hover {
  border-color: #708dff;
}
.sh-ap-item-title {
  font-size: 13px;
  color: #555555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sh-ap-item-title em,
.sh-ap-detail-title em {
  font-style: normal;
  color: #ff8a3d;
}
.sh-ap-item.is-unread .sh-ap-item-title {
  font-weight: 600;
  color: #333333;
}
.sh-ap-item-date {
  font-size: 12px;
  color: #929394;
}

.sh-ap-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.sh-ap-pg {
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border: none;
  border-radius: 999px;
  background: none;
  font-family: inherit;
  font-size: 12px;
  color: #929394;
  cursor: pointer;
}
.sh-ap-pg.is-current {
  background: #708dff;
  color: #ffffff;
}
.sh-ap-pg:disabled {
  opacity: 0.35;
  cursor: default;
}
.sh-ap-pg--arrow {
  font-size: 15px;
  line-height: 1;
}

.sh-ap-detail-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #333333;
  line-height: 1.4;
}
.sh-ap-detail-date {
  margin: 6px 0 12px;
  font-size: 11px;
  color: #929394;
}
.sh-ap-detail-body {
  max-height: 260px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border: 1px solid #e3e7ee;
  border-radius: 6px;
  background: #ffffff;
  font-size: 13px;
  line-height: 1.7;
  color: #555555;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.sh-ap-ok {
  width: 100%;
  height: 36px;
  margin-top: 14px;
  border: none;
  border-radius: 6px;
  background: #708dff;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}
.sh-ap-ok:hover {
  opacity: 0.9;
}

@media (max-width: 1024px) {
  .sh-account-panel {
    display: none !important;
  }
}
