/* 기도의 방 — 차분하고 읽기 편한 모바일 우선 스타일 */

:root {
  --bg: #faf8f2;
  --card: #ffffff;
  --ink: #2d2a25;
  --muted: #8d8677;
  --line: #e9e2d3;
  --accent: #7c6c4d;
  --accent-dark: #5f5339;
  --accent-soft: #f4efe1;
  --danger: #a8563f;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(60, 50, 30, 0.07);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.6;
}

/* ---------- 헤더 ---------- */
.site-header {
  text-align: center;
  padding: 30px 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.brand {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.tagline {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.28em;
  text-indent: 0.28em;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---------- 홈: 주제 카드 그리드 ---------- */
.home-title {
  font-size: 17px;
  font-weight: 600;
  margin: 4px 2px 14px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
}

.topic-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 108px;
  padding: 18px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.topic-card:active { transform: scale(0.98); }

.topic-card:hover { border-color: var(--accent); }

.topic-num {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.topic-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  word-break: keep-all;
}

.empty-list {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

/* ---------- 기도문 보기 ---------- */
.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover { color: var(--ink); }

.prayer-article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
}

@media (min-width: 640px) {
  .prayer-article { padding: 40px 44px; }
}

.prayer-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

.prayer-meta {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--muted);
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 20px;
}

.prayer-body {
  line-height: 2;
  word-break: keep-all;
}

.prayer-body p { margin: 0 0 1.2em; }

.font-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 4px;
}

.font-btn {
  min-width: 52px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.font-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.font-label {
  min-width: 64px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.prayer-nav {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.prayer-nav a {
  flex: 1;
  display: block;
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prayer-nav a.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.empty-notice {
  text-align: center;
  padding: 30px 10px;
  color: var(--muted);
}

.empty-notice p { margin: 0 0 8px; }

/* ---------- 버튼 / 폼 ---------- */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn:hover { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

.btn-ghost:hover { background: var(--accent-soft); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #e5c9bd;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.btn-small {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  max-width: 560px;
  margin: 0 auto;
}

.form-card.wide { max-width: 720px; }

.form-title {
  margin: 0 0 18px;
  font-size: 19px;
  font-weight: 700;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 260px;
  line-height: 1.9;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-actions .btn { flex: 1; }

.form-error {
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #f9ece6;
  color: var(--danger);
  font-size: 14px;
}

/* ---------- 관리자 목록 ---------- */
.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-bar h2 {
  margin: 0;
  font-size: 19px;
}

.admin-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-row .row-title {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions { display: flex; gap: 8px; }

.logout-row {
  text-align: center;
  margin-top: 8px;
}

/* ---------- 기타 ---------- */
.loading, .error {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
}

.demo-banner {
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  font-size: 13px;
  color: var(--accent-dark);
}

.site-footer {
  text-align: center;
  padding: 18px 16px 34px;
  border-top: 1px solid var(--line);
}

.admin-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.admin-link:hover { color: var(--ink); }
