/* summernote-emoticon.css */

/* 이모티콘 모달 */
.gnu-emoji-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 16px;
  background: rgba(0,0,0,.35);
  z-index: 10001;
}
.gnu-emoji-modal.is-open { display: flex; }

.gnu-emoji-modal-box {
  width: min(520px, 96vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  overflow: hidden;
}

/* 헤더 */
.gnu-emoji-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 3;
}
.gnu-emoji-modal-title {
  font-size: 14px;
  font-weight: 800;
}
.gnu-emoji-close {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.gnu-emoji-close img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* ── 패키지 스트립 ──────────────────────────────────────── */
.gnu-emoji-pack-strip {
  display: flex;
  gap: 10px;
  padding: 14px 14px 10px;
  overflow-x: scroll;          /* 항상 스크롤 가능 */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid #f1f5f9;

  /* ✅ touch-action: pan-x  →  브라우저가 수평 스크롤만 허용
        pan-y 였던 게 문제 — 세로 스크롤만 허용해서 가로 터치가 막혔음 */
  touch-action: pan-x;

  cursor: grab;
  user-select: none;
  -webkit-user-select: none;

  /* 스크롤바 숨김 */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge */
}
.gnu-emoji-pack-strip::-webkit-scrollbar { display: none; }
.gnu-emoji-pack-strip.is-dragging { cursor: grabbing; }

.gnu-emoji-pack-btn {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: #fff;
  padding: 0;
  cursor: pointer;
  /* 터치 시 버튼 자체가 pan-x를 block하지 않도록 inherit */
  touch-action: inherit;
  -webkit-tap-highlight-color: transparent; /* 모바일 탭 하이라이트 제거 */
}
.gnu-emoji-pack-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none; /* img가 이벤트 흡수하지 않도록 */
}
.gnu-emoji-pack-btn.is-active { border-color: #3b82f6; }

/* 패키지 타이틀 */
.gnu-emoji-pack-title {
  padding: 10px 14px 8px;
  font-weight: 900;
  font-size: 14px;
}
.gnu-emoji-pack-title .gnu-emoji-expire {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #ef4444;
}

/* 이모티콘 그리드 */
.gnu-emoji-grid {
  padding: 10px 14px 14px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  max-height: 340px;
  overflow: auto;
}
.gnu-emoji-item {
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.gnu-emoji-item:hover { background: #f8fafc; }
.gnu-emoji-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
}

/* Summernote 이미지 삽입 팝업 위치 픽스 */
.note-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9999 !important;
  display: none;
}
.note-modal.open {
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.note-modal-backdrop {
  position: fixed !important;
  z-index: 9998 !important;
}
.note-modal-content {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  margin: 0 !important;
  width: 500px !important;
  max-width: 96vw !important;
  overflow: visible !important;
}
.note-modal-footer {
  height: auto !important;
  min-height: 56px;
  padding: 10px 15px !important;
  overflow: visible !important;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.note-modal-footer .note-btn {
  float: none !important;
}

/* ── 에디터 본문 / 뷰 출력 이모티콘 크기 제한 ───────────────
 * .note-editable : summernote 에디터 내부 (작성 시)
 * .view_content  : 게시글 본문 출력 영역 (일반적인 그누보드 클래스)
 * rf-emoticon-view : emoticon_replace.lib.php 출력 클래스
 * emoticon-img     : legacy 치환 클래스
 */
.note-editable .emoticon-img,
.note-editable .rf-emoticon-view,
.note-editable img[src*="/img/emoticon/"],
.view_content .emoticon-img,
.view_content .rf-emoticon-view,
.rf-emoticon-view,
.emoticon-img {
  width: 80px !important;
  height: 80px !important;
  object-fit: contain;
  vertical-align: middle;
}

/* ── 전체화면 모드 ─────────────────────────────────────────── */
.note-editor.note-frame.fullscreen,
.note-editor.note-airframe.fullscreen {
  z-index: 10000 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  background: #fff !important;
}
.note-editor.note-frame.fullscreen .note-editing-area,
.note-editor.note-airframe.fullscreen .note-editing-area {
  height: calc(100vh - 44px) !important;
  overflow: visible !important;
}
.note-editor.note-frame.fullscreen .note-editing-area .note-editable,
.note-editor.note-airframe.fullscreen .note-editing-area .note-editable {
  height: 100% !important;
  max-height: none !important;
  overflow: auto !important;
}

/* 전체화면 시 body에 추가되는 클래스 → 페이지 스크롤 차단 */
html.note-fullscreen-body,
body.note-fullscreen-body {
  overflow: hidden !important;
}

/* 에디터 댓글 이모티콘 크기 제한 */
.note-editable .emoticon-img,
.note-editable .rf-emoticon-view,
.note-editable img[src*="/img/emoticon/"],
.view_content .emoticon-img,
.view_content .rf-emoticon-view,
.rf-emoticon-view,
.emoticon-img {
  width: 80px !important;
  height: 80px !important;
  object-fit: contain;
  vertical-align: middle;
}
