/* =====================================================
   write_popup.css — 글쓰기 FAB + 바텀시트
   의존성: 없음 (독립 파일)
===================================================== */

/* ── 변수 ────────────────────────────────────────── */
:root {
  --wp-red:      #e8392a;
  --wp-red-dk:   #c0302a;
  --wp-ink:      #0f172a;
  --wp-card-bg:  #ffffff;
  --wp-sheet-bg: #ffffff;
  --wp-radius:   18px;
  --wp-shadow:   0 -4px 40px rgba(0,0,0,.18);
  --wp-t:        .28s cubic-bezier(.4,0,.2,1);
}

/* ── 딤 오버레이 ─────────────────────────────────── */
.wp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 30, 0);
  pointer-events: none;
  z-index: 9998;
  transition: background var(--wp-t);
}
.wp-overlay.open {
  background: rgba(10, 16, 30, .55);
  pointer-events: auto;
  backdrop-filter: blur(2px);
}

/* ── 바텀시트 ────────────────────────────────────── */
.wp-sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 9999;
  background: var(--wp-sheet-bg);
  border-radius: var(--wp-radius) var(--wp-radius) 0 0;
  padding: 14px 20px 40px;
  box-shadow: var(--wp-shadow);
  transform: translateY(100%);
  transition: transform var(--wp-t);
  /* 모바일 네비바 위에 올라오도록 */
  padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
}
.wp-sheet.open {
  transform: translateY(0);
}

/* 핸들 바 */
.wp-sheet__handle {
  width: 40px; height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 0 auto 18px;
}

/* 라벨 */
.wp-sheet__label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 0 0 14px 2px;
}

/* 카드 그리드 */
.wp-sheet__grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── 카드 ─────────────────────────────────────────── */
.wp-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: #f8fafc;
  border-radius: 14px;
  text-decoration: none !important;
  color: var(--wp-ink) !important;
  border: 1.5px solid #e2e8f0;
  transition:
    background var(--wp-t),
    border-color var(--wp-t),
    transform var(--wp-t),
    box-shadow var(--wp-t);
  position: relative;
  overflow: hidden;
}
.wp-card:active,
.wp-card:hover {
  background: #fff5f5;
  border-color: rgba(232, 57, 42, .3);
  transform: scale(.985);
  box-shadow: 0 4px 18px rgba(232, 57, 42, .1);
}

/* 카드 입장 애니메이션 */
.wp-sheet.open .wp-card:nth-child(1) { animation: wpCardIn .32s .08s both cubic-bezier(.4,0,.2,1); }
.wp-sheet.open .wp-card:nth-child(2) { animation: wpCardIn .32s .15s both cubic-bezier(.4,0,.2,1); }
.wp-sheet.open .wp-card:nth-child(3) { animation: wpCardIn .32s .22s both cubic-bezier(.4,0,.2,1); }
@keyframes wpCardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 아이콘 래퍼 */
.wp-card__icon-wrap {
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.wp-card__icon-wrap svg {
  width: 100%; height: 100%;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(232,57,42,.28));
}

/* 텍스트 */
.wp-card__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wp-card__text strong {
  font-size: .92rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.01em;
}
.wp-card__text span {
  font-size: .72rem;
  color: #64748b;
  font-weight: 400;
}

/* 화살표 */
.wp-card__arrow {
  color: #cbd5e1;
  transition: color var(--wp-t), transform var(--wp-t);
}
.wp-card:hover .wp-card__arrow,
.wp-card:active .wp-card__arrow {
  color: var(--wp-red);
  transform: translateX(3px);
}

/* ── FAB 버튼 ─────────────────────────────────────── */
.wp-fab {
  position: fixed;
  right: 22px;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px) + 16px);
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--wp-red);
  color: #fff;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 16px rgba(232, 57, 42, .45),
    0 1px 4px rgba(0,0,0,.2);
  transition:
    background var(--wp-t),
    transform var(--wp-t),
    box-shadow var(--wp-t);
  outline: none;
}
.wp-fab:hover {
  background: var(--wp-red-dk);
  transform: scale(1.08);
  box-shadow:
    0 6px 22px rgba(232, 57, 42, .55),
    0 2px 6px rgba(0,0,0,.2);
}
.wp-fab:active {
  transform: scale(.94);
}

/* 아이콘 전환 */
.wp-fab__icon {
  position: absolute;
  transition: opacity .2s, transform .2s;
}
.wp-fab__icon--pen   { opacity: 1; transform: rotate(0deg) scale(1); }
.wp-fab__icon--close { opacity: 0; transform: rotate(-45deg) scale(.6); }

.wp-fab.open .wp-fab__icon--pen   { opacity: 0; transform: rotate(45deg) scale(.6); }
.wp-fab.open .wp-fab__icon--close { opacity: 1; transform: rotate(0deg) scale(1); }

/* 열릴 때 FAB 색상 변화 */
.wp-fab.open {
  background: #334155;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

/* ── 기존 write_btn_wrap 숨김 ─────────────────────── */
/* .write_btn_wrap { display: none !important; } */