* { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --bg: #FFF4F6;
  --ink: #3A2A30;
  --sub: #7A5A64;
  --accent: #C2255C;
  --accent-dark: #8F1A43;
  --card: #FFFFFF;
  --line: #F3D3DB;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Gowun Dodum', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.wrap { max-width: 1000px; margin: 0 auto; padding: 28px 24px 56px; }
.wrap.narrow { max-width: 760px; }

/* 상단 */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 32px;
}
.logo {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink); text-decoration: none;
  font-family: 'Jua', sans-serif; font-size: 32px; line-height: 1;
}
.logo:hover { color: var(--accent); }
.pill {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--accent); color: #FFFFFF;
  font-family: 'Jua', sans-serif; font-size: 17px; text-decoration: none; cursor: pointer;
}
.pill:hover { background: var(--accent-dark); color: #FFFFFF; }
.pill.soft { background: #FFE1E8; color: var(--accent-dark); }
.pill.soft:hover { background: #FFC2D1; color: var(--accent-dark); }
.pill.small { min-height: 36px; padding: 0 14px; font-size: 15px; }

/* 공통 흰 상자 */
.box { background: var(--card); border-radius: 28px; padding: 28px 32px; }
.box + .box { margin-top: 24px; }

h1, h2 { font-family: 'Jua', sans-serif; font-weight: 400; margin: 0; }
h1 { font-size: 30px; color: var(--accent); line-height: 1.3; }
h2 { font-size: 22px; margin-bottom: 14px; }

.intro { margin-bottom: 32px; }
.intro p { margin: 8px 0 0; color: #6B4E57; }

/* 글 카드 목록 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border-radius: 24px; padding: 14px;
  color: var(--ink); text-decoration: none;
  transition: transform .15s ease;
}
.card:hover { color: var(--ink); transform: translateY(-4px); }
.thumb { height: 150px; border-radius: 16px; overflow: hidden; background: #FFE1E8; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card:nth-child(5n+2) .thumb { background: #FFEFD6; }
.card:nth-child(5n+3) .thumb { background: #E3F1FF; }
.card:nth-child(5n+4) .thumb { background: #E4F6EA; }
.card:nth-child(5n+5) .thumb { background: #EFE6FF; }
.card-text { padding: 0 6px 6px; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-family: 'Jua', sans-serif; font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.date { font-size: 14px; color: var(--sub); }
.empty { color: var(--sub); }

/* 글 보기 */
.post h1 { margin-bottom: 6px; overflow-wrap: anywhere; }
.body { margin-top: 20px; overflow-wrap: anywhere; }
.body img { max-width: 100%; height: auto; display: block; margin: 16px 0; border-radius: 16px; }
.body img.zoomable { cursor: zoom-in; }
.body img.zoomable:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* 사진 크게 보기 */
.lb {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(24, 14, 18, 0.94);
  display: flex; align-items: center; justify-content: center;
}
.lb-img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-btn {
  position: absolute; width: 52px; height: 52px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #3A2A30;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lb-btn:hover { background: #FFFFFF; color: var(--accent); }
.lb-btn:focus-visible { outline: 3px solid #FFC2D1; outline-offset: 2px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  padding: 4px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #FFFFFF;
  font-family: 'Jua', sans-serif; font-size: 16px;
}

.back { display: inline-block; margin-top: 24px; text-decoration: none; font-family: 'Jua', sans-serif; }

/* 관리자 */
input[type="text"], input[type="password"], textarea {
  width: 100%; padding: 12px 16px; margin-bottom: 12px;
  border: 2px solid var(--line); border-radius: 16px; background: #FFFFFF;
  font-family: inherit; font-size: 16px; color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.6; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
#msg { color: var(--accent); min-height: 1.7em; margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.list li:last-child { border-bottom: 0; }
.list a.title { flex: 1 1 200px; min-width: 0; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.list a.title:hover { color: var(--accent); }

@media (max-width: 520px) {
  .wrap { padding: 20px 16px 40px; }
  .box { padding: 22px 20px; border-radius: 22px; }
  .logo { font-size: 28px; }
}
