* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif; }
body { background: #2a1f19; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
img { display: block; width: 100%; height: auto; }

:root { --accent: #c8451e; }

.container { position: relative; width: 100%; max-width: 450px; margin: 0 auto; background: #fcf6ef; min-height: 100vh; overflow: hidden; }

/* 슬라이드 */
.swiper { width: 100%; }
.swiper-slide { background: #fcf6ef; }
.swiper-pagination.swiper-pagination-progressbar { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 450px; height: 4px; z-index: 30; }
.swiper-pagination-progressbar .swiper-pagination-progressbar-fill { background: var(--accent); }

/* 표지 이미지 등장 효과 */
.cover img { animation: coverIn 1.6s ease-out both; }
@keyframes coverIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* D-day 띠 */
.countdown { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 20px 0; color: #fff; font-size: 16px; font-weight: 600; letter-spacing: -0.2px;
  background: linear-gradient(to right, #dc4f17 0%, #f08a28 50%, #dc4f17 100%); }

/* 이미지 사이에 들어가는 전화 버튼 목록 (안전·응급 안내) */
.calls { background: #fcf6ef; padding: 4px 19px 6px; display: flex; flex-direction: column; gap: 9px; }
.call { display: grid; grid-template-columns: 1fr auto 40px; align-items: center; gap: 10px; padding: 13px 12px 13px 16px; background: #fff; border: 1px solid #f0dfcf; border-radius: 12px; box-shadow: 0 3px 10px rgba(184,56,15,.07); text-decoration: none; color: #2a1f19; }
.call .ci b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.call .ci small { display: block; font-size: 11.5px; color: #6e5f55; margin-top: 2px; }
.call .cn { font-size: 13px; font-weight: 700; color: #b8380f; }
.call .cb { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; background: linear-gradient(140deg, #e2561a, #f6b13a); }
.call.urgent { background: #2a1f19; border-color: #2a1f19; color: #fff; }
.call.urgent .ci small { color: #e9d6c6; }
.call.urgent .cn { color: #f6b13a; font-size: 18px; }

/* 햄버거 메뉴 */
.menu-btn { position: absolute; top: 24px; right: 16px; z-index: 49; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.35); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.menu-btn span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 1px; }

.dimmed { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); z-index: 40; opacity: 0; visibility: hidden; transition: opacity .3s; }
.dimmed.active { opacity: 1; visibility: visible; }

.side-menu { position: fixed; top: 0; right: -230px; width: 220px; height: 100%; background: rgba(255,255,255,.97); z-index: 100; transition: right .3s ease; padding-top: 72px; overflow-y: auto; }
.side-menu.active { right: max(0px, calc((100vw - 450px) / 2)); }
.close-btn { position: absolute; top: 24px; right: 16px; font-size: 20px; width: 40px; height: 40px; transition: transform .2s; }
.close-btn:hover { transform: rotate(-90deg); }
.side-menu ul { border-top: 1px solid #ddd; }
.side-menu li { list-style: none; border-bottom: 1px solid #ddd; }
.side-menu li a, .side-menu li button { display: block; width: 100%; text-align: left; padding: 12px 18px; font-size: 14px; color: #222; text-decoration: none; letter-spacing: -0.04em; }
.side-menu li a.on { color: var(--accent); font-weight: 700; }
.menu-actions { margin-top: 32px; }
.menu-actions button { color: var(--accent) !important; font-weight: 600; }

/* 이전/다음 */
.page-nav { position: fixed; bottom: 32px; right: max(16px, calc((100vw - 450px) / 2 + 16px)); z-index: 35; display: flex; gap: 10px; }
.page-nav button { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.88); color: var(--accent); font-size: 30px; line-height: 44px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.page-nav button[hidden] { display: none; }

/* 처음 열 때 스와이프 안내 */
.swipe-hint { position: fixed; inset: 0; max-width: 450px; margin: 0 auto; background: rgba(0,0,0,.55); z-index: 98; display: flex; align-items: center; justify-content: center; transition: opacity .5s; pointer-events: none; }
.swipe-hint.hide { opacity: 0; }
.swipe-hint div { text-align: center; color: #fff; }
.swipe-hint .hand { display: inline-block; font-size: 44px; animation: swipe 1.2s ease-in-out infinite; }
.swipe-hint p { margin-top: 10px; font-size: 15px; }
@keyframes swipe { 0%,100% { transform: translateX(24px); } 50% { transform: translateX(-24px); } }

/* 비상연락망 팝업 */
.popup-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 101; display: none; }
.popup { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: calc(100% - 48px); max-width: 320px; max-height: 80vh; overflow-y: auto; background: #fff; border-radius: 12px; z-index: 102; display: none; }
.popup.show, .popup-bg.show { display: block; }
.popup-head { position: relative; padding: 18px; text-align: center; color: #fff; font-size: 16px; background: var(--accent); border-radius: 12px 12px 0 0; }
.popup-close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #fff; font-size: 18px; width: 32px; height: 32px; }
.popup ul { padding: 8px 22px 18px; }
.popup li { list-style: none; display: flex; align-items: center; padding: 14px 0; border-bottom: 1px solid #eee; }
.popup li:last-child { border-bottom: 0; }
.popup .who { flex: 1; font-size: 13px; color: #999; }
.popup .who b { color: #333; font-size: 15px; font-weight: 600; margin-left: 4px; }
.popup .act { display: flex; gap: 8px; }
.popup .act a { width: 34px; height: 34px; border-radius: 50%; background: #f4ece8; display: flex; align-items: center; justify-content: center; font-size: 15px; text-decoration: none; }
.popup .pending { font-size: 12px; color: #bbb; }

.toast { position: fixed; left: 50%; bottom: 18%; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 13px; z-index: 200; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }
