@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;600;700;900&display=swap');

:root {
  --img-cm-hero: url('/images/bg/cm-hero-bg.webp?v=20261116_235636');
  --img-comm-mission: linear-gradient(135deg, #001322 0%, #002B49 52%, #0F4C75 100%);
  /* [배경 이미지 경로 설정] public/images/bg/ 에 사진 업로드 후 경로만 변경하세요 */
  --img-hero-poster: none;
  --img-welcome-bg: url('/images/bg/welcome-bg.webp');
  --img-mission-bg: url('/images/bg/mission-bg.webp?v=20261116_203412');
  --img-pastor-photo: url('/images/bg/pastor-1st.webp?v=20261116_222449');

  --img-comm-adult: url('/images/bg/comm-adult.webp?v=20261116_222449');
  --img-comm-bebe: url('/images/bg/comm-bebe.webp');
  --img-comm-youth: url('/images/bg/comm-youth.webp');
  --img-comm-kids: url('/images/bg/comm-kids.webp?v=20261116_204745');
  --img-comm-friday: linear-gradient(135deg, #001322 0%, #002B49 55%, #0F4C75 100%);

  --img-worship-hero: url('/images/bg/worship-hero.webp?v=20261116_203412');
  --img-worship-monthly: url('/images/bg/worship-monthly.webp?v=20261116_222449');

  /* 베를린 블루(Berlin Blue) 브랜드 컬러 팔레트 */
  --berlin-deep: #001B30;
  --berlin-darker: #001322;
  --berlin: #003153;
  --berlin-mid: #0F4C75;
  --berlin-soft: #8EBEE0;
  --berlin-tint: #E9F2F8;
  --berlin-border: #BDD4E6;

  --white: #FFFFFF;
  --off-white: #F5F8FA;
  --ink: #0F1722;
  --ink-sub: #475569;
  --ink-muted: #7C8B9E;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;

  /* 서브페이지(로그인·회원가입·사진첩·마이페이지·관리자) 호환 변수 */
  --bg: #FFFFFF;
  --bg-alt: #F5F8FA;
  --bg-warm: #F5F8FA;
  --bg-cream: #F5F8FA;
  --surface: #FFFFFF;
  --card-bg: #FFFFFF;
  --navy: #003153;
  --navy-deep: #001B30;
  --brand: #003153;
  --brand-dark: #001B30;
  --brand-hover: #0F4C75;
  --brand-soft: #E9F2F8;
  --gold: #0F4C75;
  --gold-soft: #E9F2F8;
  --primary: #003153;
  --primary-hover: #0F4C75;
  --primary-light: #E9F2F8;
  --accent: #003153;
  --accent-hover: #0F4C75;
  --accent-soft: #E9F2F8;
  --text: #0F1722;
  --text-light: #475569;
  --text-muted: #7C8B9E;
  --border: #E2E8F0;

  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  --font-serif: 'Noto Serif KR', Georgia, serif;

  --container-w: 1220px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden], .skip-link { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: clip;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

body { padding-top: var(--header-h); }
body.has-dark-hero { padding-top: 0 !important; }
body.scroll-locked { overflow: hidden !important; }

a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 28px;
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
}

.eyebrow-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--berlin-tint);
  color: var(--berlin);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* 공통 버튼 (메인 및 서브페이지 통합) */
.btn, button.btn, a.btn, .btn-solid-pill, .btn-border-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary, .btn-solid-pill {
  background: var(--berlin);
  color: #FFFFFF;
  border-color: var(--berlin);
  box-shadow: 0 6px 18px rgba(0, 49, 83, 0.16);
}

.btn-primary:hover, .btn-solid-pill:hover {
  background: var(--berlin-mid);
  border-color: var(--berlin-mid);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 49, 83, 0.22);
}

.btn-outline, .btn-secondary, .btn-border-pill {
  background: #FFFFFF;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-outline:hover, .btn-secondary:hover, .btn-border-pill:hover {
  border-color: var(--berlin);
  background: var(--berlin-tint);
  color: var(--berlin);
}

.btn-full { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 0.96rem; font-weight: 700; }
.btn-danger { background: #B91C1C; color: #FFFFFF; border-color: #B91C1C; }
.btn-danger:hover { background: #991B1B; }

/* 공통 입력 폼 & 포털 모달 */
input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="date"], input[type="number"], input[type="file"], select, textarea, .form-control {
  width: 100%;
  padding: 12px 14px;
  background: var(--off-white);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

input:focus, select:focus, textarea:focus, .form-control:focus {
  background: #FFFFFF;
  border-color: var(--berlin);
  box-shadow: 0 0 0 3px rgba(0, 49, 83, 0.10);
}

.portal-form { display: flex; flex-direction: column; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 7px; font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.form-field > span { color: var(--ink-sub); font-weight: 600; }

.nav-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 19, 34, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.nav-modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: #FFFFFF;
  color: var(--ink);
  border-radius: 24px;
  padding: 30px 28px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 56px rgba(0, 19, 34, 0.28);
}

.nav-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.nav-modal-title { display: block; font-size: 1.25rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.nav-modal-sub { margin: 6px 0 0; font-size: 0.86rem; color: var(--ink-sub); line-height: 1.5; }

/* 이벤트 팝업 & 토스트 */
.event-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 19, 34, 0.62);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.event-popup-card {
  width: 100%;
  max-width: 430px;
  background: #FFFFFF;
  color: var(--ink);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(0, 19, 34, 0.32);
}

.event-popup-img { width: 100%; max-height: 360px; object-fit: cover; }
.event-popup-body { padding: 22px 24px; }
.event-popup-title { margin: 0 0 8px; font-size: 1.2rem; font-weight: 800; }
.event-popup-text { margin: 0; font-size: 0.92rem; color: var(--ink-sub); white-space: pre-line; }

.event-popup-foot {
  display: flex;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--off-white);
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

.event-popup-foot button { background: none; border: none; color: var(--ink-sub); font-weight: 600; cursor: pointer; }

.hs-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--berlin-deep);
  color: #FFFFFF;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2000;
}

.hs-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
