:root {
  --primary: #1e3a5f;
  --primary-light: #2d5491;
  --primary-dark: #0f1d2f;
  --accent: #c9a84c;
  --accent-dark: #a08830;
  --surface: #f8f6f0;
  --white: #ffffff;
  --text: #2c2c2c;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ── 네비게이션 ── */
.nav-mobile {
  background: var(--primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.nav-brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.year-select {
  background: var(--primary-light);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: inherit;
}
.hamburger {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  font-size: 22px;
  line-height: 1;
}
.nav-menu {
  background: var(--primary-dark);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: none;
}
.nav-menu.open { display: block; }
.nav-menu a {
  display: block;
  padding: 12px 20px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: background 0.15s;
}
.nav-menu a:hover { background: rgba(255,255,255,0.08); }
.nav-menu a.active { color: var(--accent); font-weight: 600; background: rgba(201,168,76,0.1); }

/* ── 메인 콘텐츠 ── */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ── 공통 컴포넌트 ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card + .card, .card + .section-card { margin-top: 14px; }

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

.badge {
  display: inline-block;
  background: rgba(201,168,76,0.12);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.loading { text-align: center; padding: 60px 0; color: var(--text-light); }
.empty { text-align: center; padding: 60px 0; color: var(--text-light); }

/* ── 홈 ── */
.home-cover {
  background: var(--primary);
  color: white;
  border-radius: 16px;
  padding: 36px 24px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(30,58,95,0.25);
  margin-bottom: 14px;
}
.home-cover .year-tag {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.home-cover h1 { font-size: 26px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.home-cover .theme { color: rgba(255,255,255,0.75); font-size: 16px; font-style: italic; }

.verse-card {
  border-left: 4px solid var(--accent);
  background: rgba(201,168,76,0.06);
}
.verse-text { color: var(--text); line-height: 1.8; }
.verse-ref { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 6px; }

.info-row { display: flex; gap: 12px; align-items: flex-start; }
.info-row + .info-row { margin-top: 12px; }
.info-icon { font-size: 20px; flex-shrink: 0; }
.info-label { font-size: 11px; color: var(--text-light); font-weight: 500; margin-bottom: 1px; }
.info-value { font-weight: 500; }

/* ── 타임라인 ── */
.timeline { position: relative; padding-left: 80px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 56px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-time {
  position: absolute;
  left: -80px;
  width: 70px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  padding-top: 2px;
}
.timeline-dot {
  position: absolute;
  left: -30px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--white);
  z-index: 1;
}
.timeline-dot.first { background: var(--accent); border-color: var(--accent); }
.timeline-title { font-weight: 600; }
.timeline-detail { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* ── 조 편성 ── */
.team-card { margin-bottom: 12px; }
.team-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.team-name { font-weight: 700; color: var(--primary); font-size: 17px; }
.member-list { display: flex; flex-wrap: wrap; gap: 8px; }
.member-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--text);
}
.member-role { color: var(--text-light); font-size: 12px; margin-left: 4px; }

/* ── 예배 ── */
.worship-meta { margin-bottom: 14px; }
.worship-meta p { font-size: 14px; color: var(--text-light); }
.worship-meta strong { color: var(--primary); }
.worship-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.worship-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.worship-title { font-weight: 600; }
.worship-detail { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* ── 찬양 & 기도 ── */
.tab-bar {
  display: flex;
  background: #f0ece4;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-light);
  transition: all 0.15s;
}
.tab-btn.active { background: var(--white); color: var(--primary); box-shadow: var(--shadow); font-weight: 600; }

.hymn-toc { margin-bottom: 20px; }
.hymn-toc h3 { font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}
.toc-item:hover { color: var(--accent); }
.toc-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(30,58,95,0.08);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hymn-section { scroll-margin-top: 80px; margin-bottom: 28px; }
.hymn-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.hymn-num-big {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hymn-title-text { font-weight: 700; color: var(--primary); font-size: 17px; }
.hymn-img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.prayer-cat { margin-bottom: 12px; }
.prayer-cat-title {
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.prayer-cat-bar { width: 4px; height: 20px; background: var(--accent); border-radius: 2px; }
.prayer-item-list { list-style: none; }
.prayer-item-list li {
  display: flex;
  gap: 8px;
  font-size: 14px;
  padding: 4px 0;
  color: var(--text);
}
.prayer-item-list li::before { content: '•'; color: var(--accent); flex-shrink: 0; }

/* ── 갤러리 ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--border);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.15s; }
.gallery-item:hover img { opacity: 0.88; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}
.lightbox img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 8px; }
.lightbox-caption { color: rgba(255,255,255,0.7); font-size: 13px; margin-top: 12px; }
.lightbox-close { color: rgba(255,255,255,0.4); font-size: 12px; margin-top: 8px; }

/* ── 관리자 ── */
.admin-wrap { min-height: 100vh; background: var(--surface); }
.admin-header {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header-left { display: flex; align-items: center; gap: 12px; }
.admin-title { font-weight: 700; font-size: 16px; }
.admin-year-select {
  background: var(--primary-light);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: inherit;
}
.admin-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.admin-logout:hover { color: white; }
.admin-new-year {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
}
.admin-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
}
.admin-tab {
  padding: 12px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-light);
  white-space: nowrap;
  transition: color 0.15s;
}
.admin-tab.active { border-bottom-color: var(--accent); color: var(--primary); font-weight: 600; }
.admin-body { max-width: 640px; margin: 0 auto; padding: 20px 16px; }

/* ── 폼 ── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 5px; }
.form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.08); }
.form-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.item-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}
.item-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.item-row:last-child { margin-bottom: 0; }
.item-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; padding: 10px 18px; font-size: 14px; }
.btn-primary:hover:not(:disabled) { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: white; padding: 6px 14px; font-size: 13px; }
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--text-light); padding: 6px 10px; font-size: 12px; }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: none; border: none; color: var(--red); font-size: 13px; cursor: pointer; font-family: inherit; padding: 4px; }
.btn-danger:hover { opacity: 0.7; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; margin-top: 6px; }
.btn-add { width: 100%; padding: 10px; font-size: 13px; border: 1px dashed var(--border); background: none; color: var(--text-light); border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; margin-bottom: 12px; }
.btn-add:hover { border-color: var(--primary); color: var(--primary); }

.link-sm { font-size: 12px; color: var(--primary); background: none; border: none; cursor: pointer; font-family: inherit; text-decoration: underline; }

/* ── 업로드 존 ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.upload-zone:hover { border-color: var(--primary); }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--text-light); }
.upload-sub { font-size: 12px; color: var(--border); margin-top: 4px; }

/* ── 로그인 ── */
.login-wrap {
  min-height: 100vh;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box { width: 100%; max-width: 360px; }
.login-header { text-align: center; margin-bottom: 28px; }
.login-icon { font-size: 36px; margin-bottom: 8px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--primary); }
.error-msg { color: var(--red); font-size: 13px; margin-top: 6px; }

/* ── 푸터 ── */
.footer { text-align: center; font-size: 12px; color: #9ca3af; padding: 24px 0; border-top: 1px solid var(--border); margin-top: 20px; }

/* ── 반응형 ── */
@media (min-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
