/* =====================================================================
 * 냥지도 — 울산대 고양이 지도
 * (제자리·한눈에와 동일한 디자인 언어 — 울산대 그린 테마)
 * ===================================================================== */

:root {
  --navy: #0e4d2e;          /* 울산대 그린 (브랜드·헤더) */
  --navy-dark: #093a22;
  --accent: #14a058;        /* 인터랙션 그린 */
  --heart: #ff5577;         /* 하트 (보편색 유지) */
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #6b7686;
  --line: #e2e6ee;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(20, 40, 80, 0.06);
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ── 헤더 ── */
header.site { background: var(--navy); color: #fff; }
header.site .container {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; padding-top: 14px; padding-bottom: 14px;
}
.brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.brand small { display: block; font-size: 0.72rem; font-weight: 400; opacity: 0.8; }
.sitenav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sitenav a.cross-link {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff; font-size: 0.82rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
}
.sitenav a.cross-link:hover { background: rgba(255, 255, 255, 0.26); }

/* ── 히어로 ── */
.hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #e9f4ee; padding: 22px 0 26px;
}
.hero h1 { margin: 0 0 6px; font-size: 1.5rem; }
.hero p { margin: 0; opacity: 0.92; font-size: 0.95rem; }
.hero b { color: #fff; }

/* ── 통계 바 ── */
.statBar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
  width: fit-content;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 20px; margin: 16px 0 4px;
  font-size: 0.9rem; box-shadow: var(--shadow);
}
.statBar b { color: var(--accent); font-weight: 700; }

/* ── 지도 카드 ── */
.mapCard {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px; margin: 14px 0;
}
#map { height: 320px; border-radius: 8px; }
.mapHint { margin: 9px 4px 2px; font-size: 0.82rem; color: var(--muted); }

/* 지도 핀 = 동그란 고양이 사진 */
.pinWrap { background: none; border: none; }
.pin {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(20, 40, 80, 0.35);
  background-color: #e4f5ec; background-size: cover; background-position: center;
  outline: 2px solid var(--accent);
  transition: transform 0.12s;
}
.pin:hover { transform: scale(1.12); }
.clusterWrap { background: none; border: none; }
.clusterIcon {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(20, 40, 80, 0.35);
}

/* ── 갤러리 ── */
.galleryBar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin: 22px 0 12px;
}
.galleryTitle { margin: 0; font-size: 1.15rem; color: var(--text); }
.sortChips { display: flex; gap: 6px; }
.chip {
  font: inherit; font-size: 0.84rem; font-weight: 600;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px; margin-bottom: 40px;
}
.catCard {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.14s, box-shadow 0.14s;
}
.catCard:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(20, 40, 80, 0.14); }
.catPhoto {
  position: relative; aspect-ratio: 1 / 1;
  background-color: #e4f5ec; background-size: cover; background-position: center;
  cursor: pointer;
}
.catPhoto .multi {
  position: absolute; right: 7px; top: 7px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}
.catInfo { padding: 10px 12px 11px; }
.catName { font-size: 0.98rem; font-weight: 800; color: var(--text); cursor: pointer; }
.catName .noname { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.catArea { font-size: 0.78rem; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catBottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.catTime { font-size: 0.74rem; color: var(--muted); }

/* ── 하트 버튼 ── */
.heartBtn {
  font: inherit; display: inline-flex; align-items: center; gap: 4px;
  background: #fff0f3; border: 1px solid #ffd6df; color: var(--heart);
  font-size: 0.82rem; font-weight: 700;
  padding: 4px 11px; border-radius: 999px; cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.heartBtn .hIcon { font-size: 0.9rem; line-height: 1; }
.heartBtn.on { background: #ffe0e7; border-color: #ffb3c4; }
.heartBtn.pop { animation: heartPop 0.32s ease; }
@keyframes heartPop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
.heartBtn.big { font-size: 1rem; padding: 9px 20px; margin: 8px 0 2px; }

.empty {
  grid-column: 1 / -1; text-align: center; color: var(--muted);
  padding: 44px 16px; background: var(--card);
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ── 푸터 ── */
footer.site { margin-top: 30px; border-top: 1px solid var(--line); }
footer.site .container { padding: 18px 16px 30px; text-align: center; }
.foot-links a { color: var(--accent); font-weight: 600; }
.copyright { margin-top: 8px; font-size: 0.78rem; color: var(--muted); line-height: 1.7; }

/* ── 플로팅 등록 버튼 ── */
.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  background: var(--accent); color: #fff; border: none;
  font: inherit; font-size: 0.98rem; font-weight: 800;
  padding: 14px 20px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(20, 110, 60, 0.45);
}
.fab:hover { background: var(--navy); }

/* ── 버튼 공통 ── */
button {
  font: inherit; border: 1px solid var(--line); background: var(--card);
  color: var(--text); padding: 10px 16px; border-radius: 8px; cursor: pointer;
  font-size: 0.92rem;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
button.primary:hover { filter: brightness(0.95); }
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { background: #e8f6ee; color: var(--accent); }
button.report-link {
  background: transparent; border-color: transparent; color: var(--muted);
  font-size: 0.82rem; padding: 6px 4px; white-space: nowrap;
}
button.report-link:hover { color: var(--heart); text-decoration: underline; background: transparent; }
button.report-link.admin { color: #d6363b; }

/* ── 모달 ── */
.modal {
  position: fixed; inset: 0; background: rgba(15, 30, 50, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px;
}
.modal.hidden, .hidden { display: none !important; }
.modal-box {
  background: var(--card); border-radius: var(--radius);
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  padding: 20px; box-shadow: 0 12px 40px rgba(20, 40, 80, 0.28);
  scrollbar-width: none; -ms-overflow-style: none;   /* 스크롤바 숨김(스크롤 유지) */
}
.modal-box::-webkit-scrollbar { display: none; }
.modal-box h3 { margin: 0 0 12px; font-size: 1.2rem; color: var(--navy); }
.modal-box form label { display: block; font-size: 0.86rem; font-weight: 600; margin-top: 12px; }
.modal-box form input[type="text"] {
  width: 100%; margin-top: 5px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 0.95rem;
  background: #fff; color: var(--text);
}
.modal-box form input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #cfeadd; }
.fieldLabel { display: block; font-size: 0.86rem; font-weight: 600; }
.req { color: var(--heart); }
.hint { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.nudge {
  font-size: 0.78rem; color: #2f6b48; background: #eef7f1;
  border: 1px solid #cfe7d8; border-radius: 8px; padding: 9px 11px; margin: 12px 0 0; line-height: 1.55;
}
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.actions .report-link { margin-right: auto; }
.actions .report-link + .report-link { margin-right: 0; }

/* 드롭존 (사진 업로드) */
.dropzone {
  display: block; margin-top: 6px; border: 1.5px dashed #c3ddcd; border-radius: 10px;
  background: #f6fbf8; cursor: pointer; overflow: hidden;
}
.dropzoneInner {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 22px 12px; text-align: center;
}
.dropIcon { font-size: 26px; }
.dropText { font-weight: 700; font-size: 0.92rem; }
.dropSub { font-size: 0.76rem; color: var(--muted); }
.dropThumbs { display: none; flex-wrap: wrap; gap: 8px; padding: 10px; }
.dropThumbs.show { display: flex; }
.dropThumb {
  position: relative; width: 78px; height: 78px; border-radius: 8px;
  background-size: cover; background-position: center; border: 1px solid var(--line);
}
.dropThumb .rep {
  position: absolute; left: 4px; bottom: 4px; font-size: 0.62rem; font-weight: 700;
  background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 6px;
}
.dropAdd {
  width: 78px; height: 78px; border-radius: 8px; border: 1.5px dashed #c3ddcd;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--muted); background: #f6fbf8;
}

/* 상세 사진 */
.dphoto { width: 100%; max-height: 340px; object-fit: contain; background: #f0f2f7; border-radius: 10px; margin: 0 0 8px; }
.thumbs { display: flex; gap: 6px; margin: 2px 0 8px; flex-wrap: wrap; }
.thumbs img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); cursor: pointer; }
.thumbs img.active { border-color: var(--accent); }

/* ── 토스트 ── */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: var(--navy); color: #fff; font-weight: 600; font-size: 0.9rem;
  padding: 11px 20px; border-radius: 10px; z-index: 2000;
  box-shadow: 0 6px 20px rgba(20, 40, 80, 0.25);
}

/* ── 모바일 ── */
@media (max-width: 480px) {
  header.site .container { justify-content: center; text-align: center; padding-top: 12px; padding-bottom: 12px; }
  .sitenav { width: 100%; justify-content: center; }
  .hero { text-align: center; padding: 12px 0 16px; }
  .hero h1 { font-size: 1.15rem; margin-bottom: 3px; }
  .hero p { font-size: 0.84rem; line-height: 1.5; }
  #map { height: 260px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .modal-box form input[type="text"] { font-size: 16px; } /* iOS 자동확대 방지 */
}
