/* ============================================================
   토브교회 예배 통역 앱 — dusk chapel 테마
   깊은 자주빛 잉크 + 따뜻한 황동색. 어두운 음향실/성전에서 눈이 편하고
   폰 배터리에도 유리한 다크 톤. 강조는 '실시간 자막'의 은은한 빛 하나에만.
   ============================================================ */
:root {
  --ink: #0b2347;
  --navy: #0b2347;
  --navy-deep: #06172f;
  --paper: #f7f9fc;
  --panel: #ffffff;
  --panel-2: #edf3fa;
  --line: rgba(11, 35, 71, 0.12);
  --gold: #bd8732;
  --gold-soft: #d9ad62;
  --text: #10284c;
  --muted: #65748a;
  --ok: #74cf98;
  --danger: #ec8f7c;
  --th: #83d3c8;
  --lo: #e9a9c9;
  --shadow: 0 18px 50px rgba(13, 36, 70, 0.13);
  --r: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(28, 71, 125, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(189, 135, 50, 0.08), transparent 55%),
    var(--paper);
}

a { color: var(--navy); }

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

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.nav-link {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.8);
  color: var(--muted);
  padding: 9px 13px;
  font: 600 13px/1 "Noto Sans KR", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.nav-link:hover { color: var(--text); border-color: rgba(216,166,74,.45); }
.nav-link:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }

.language-switcher {
  display: flex; flex-wrap: wrap; justify-content: flex-end;
  gap: 6px; margin-bottom: 12px;
}
.language-switcher button {
  appearance: none; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.85); color: var(--muted); padding: 7px 11px;
  font: 600 12px/1 "Noto Sans KR", system-ui, sans-serif; cursor: pointer;
}
.language-switcher button.active {
  color: #fff; background: var(--navy); border-color: var(--navy);
}

/* ---- 상단 브랜드 ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.brand .mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(145deg, var(--navy), var(--navy-deep));
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  flex: none;
  color: #fff; font: 700 28px/1 Georgia, serif;
}
.brand .mark svg { width: 24px; height: 24px; }
.brand h1 {
  font-family: "Noto Serif KR", serif;
  font-weight: 600;
  font-size: 19px;
  margin: 0;
  letter-spacing: -0.01em;
}
.version-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid rgba(216,166,74,.38);
  border-radius: 999px;
  background: rgba(216,166,74,.10);
  color: var(--gold-soft);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .02em;
  vertical-align: middle;
  white-space: nowrap;
}
.site-logo .version-badge {
  border-color: rgba(11,35,71,.18);
  background: rgba(11,35,71,.07);
  color: var(--navy);
}
.brand .sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }

.eyebrow {
  font-family: "Space Grotesk", "Noto Sans KR", system-ui, sans-serif;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}

/* ---- 홈 카드 ---- */
.hero {
  font-family: "Noto Serif KR", serif;
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 10px 0 6px;
}
.hero .accent { color: var(--gold-soft); }
.lede { color: var(--muted); font-size: 15px; max-width: 46ch; line-height: 1.6; }

.roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.role {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 18px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.role:hover { transform: translateY(-3px); border-color: rgba(216,166,74,.5); }
.role .ico { font-size: 22px; }
.role .rt {
  font-family: "Noto Serif KR", serif;
  font-weight: 600; font-size: 17px; margin: 10px 0 4px;
}
.role .rd { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---- 상태 표시 ---- */
.statusbar {
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 16px;
  margin: 18px 0;
  font-size: 13px;
}
.stat { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #5a5168; flex: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(116,207,152,.16); }
.dot.mic.on { background: var(--danger); box-shadow: 0 0 0 4px rgba(236,143,124,.16); }

/* ---- 버튼 ---- */
.btn {
  appearance: none; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 600;
  color: var(--ink);
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  border: none; border-radius: 13px;
  padding: 15px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px) scale(0.995); }
.btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.btn.active {
  background: linear-gradient(145deg, #ec8f7c, #c85b45);
  color: #fff;
}
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line); box-shadow: none;
}
.btn.ghost.off { color: var(--muted); }
.btn.block { width: 100%; }
.btn:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }

/* ============================================================
   운영자 페이지
   ============================================================ */
.op-controls { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.op-controls .btn.ghost { font-size: 14px; padding: 13px 17px; }
#interim {
  min-height: 26px; margin: 12px 2px; color: var(--gold-soft);
  font-size: 15px; font-style: italic; opacity: 0.9;
}
.op-corrected {
  min-height: 1.4em;
  padding: 16px 18px;
  margin: 8px 0 14px;
  border-radius: var(--r);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 20px; font-weight: 700; color: var(--text);
}
.op-corrected.flash { animation: op-corrected-pop 0.32s ease-out; }
@keyframes op-corrected-pop {
  from { transform: scale(0.985); opacity: 0.6; }
  to { transform: scale(1); opacity: 1; }
}
.op-lang-toggles {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-bottom: 10px; font-size: 13px; color: var(--muted);
}
.op-lang-toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.op-lang-toggles input { width: 16px; height: 16px; accent-color: var(--gold); }
.op-tr-lines { display: grid; gap: 8px; margin-bottom: 6px; }
.op-tr-line {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 15px; color: var(--text);
}
.op-tr-line[hidden] { display: none; }
.op-tr-line .tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: 6px; flex: none;
  background: rgba(255,255,255,.06); color: var(--muted);
}
.op-tr-line[data-lang="th"] .tag { color: var(--th); }
.op-tr-line[data-lang="lo"] .tag { color: var(--lo); }
.op-tr-line[data-lang="en"] .tag { color: var(--gold-soft); }
.op-tr-line[data-lang="th"] .txt { font-family: "Noto Sans Thai", "Noto Sans KR", sans-serif; }
.op-tr-line[data-lang="lo"] .txt { font-family: "Noto Sans Lao", "Noto Sans KR", sans-serif; }
.op-tr-line[data-lang="en"] .txt { font-family: system-ui, -apple-system, sans-serif; }
#hint { color: var(--muted); font-size: 13px; margin-top: 12px; line-height: 1.6; }

/* ---- 밀림 경고등 ---- */
.pace-alert {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(216,166,74,.4);
  background: rgba(216,166,74,.12);
  color: var(--gold);
  font: 700 14px/1.4 "Noto Sans KR", sans-serif;
}
.pace-alert[hidden] { display: none; }
.pace-alert.red {
  border-color: rgba(236,143,124,.45);
  background: rgba(236,143,124,.14);
  color: var(--danger);
}
.pace-alert .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: currentColor;
  animation: pace-blink 0.9s ease-in-out infinite;
  flex: none;
}
@keyframes pace-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: .35; box-shadow: 0 0 0 8px transparent; }
}

/* ---- 운영자 암호 게이트 ---- */
.pin-gate {
  min-height: 70dvh;
  display: flex; align-items: center; justify-content: center;
}
.pin-gate[hidden] { display: none; }
.pin-gate-box {
  width: min(320px, 100%);
  text-align: center;
  display: grid; gap: 14px; justify-items: center;
}
.pin-gate-box .mark {
  width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--navy), var(--navy-deep));
  color: #fff; font-size: 22px;
}
.pin-gate-label { color: var(--muted); font-size: 14px; margin: 0; }
.pin-input {
  width: 100%; text-align: center; letter-spacing: 0.3em;
  font-size: 22px; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}
.pin-input:focus { outline: 2px solid var(--gold-soft); }

/* ---- 관리자 허브 메뉴 ---- */
.admin-menu { display: grid; gap: 12px; }
.admin-menu-item {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border-radius: 13px;
  background: var(--panel); border: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  transition: border-color .15s ease, transform .12s ease;
}
.admin-menu-item:hover { border-color: var(--gold-soft); transform: translateY(-1px); }
.admin-menu-icon { font-size: 26px; flex: none; }
.admin-menu-text { display: grid; gap: 2px; }
.admin-menu-text strong { font-size: 16px; }
.admin-menu-text small { color: var(--muted); font-size: 13px; }
.pin-error { color: var(--danger); font-size: 13px; margin: 0; }

/* ---- 메인 이미지 관리 ---- */
.hero-admin-preview {
  border-radius: var(--r); overflow: hidden; margin-bottom: 20px;
  border: 1px solid var(--line); background: var(--panel-2);
  aspect-ratio: 4 / 3;
}
.hero-admin-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
#resetBtn { width: 100%; }

/* ============================================================
   말속도 안내 램프 (목사님 폰)
   ============================================================ */
body.pace-monitor {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  transition: background 0.4s ease;
}
.pace-root {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.pace-label {
  font: 800 clamp(28px, 8vw, 56px)/1.3 "Noto Sans KR", sans-serif;
  color: #fff;
  text-align: center;
  text-shadow: 0 4px 20px rgba(0,0,0,.2);
}
body.pace-monitor.pace-normal { background: linear-gradient(160deg, #1c4fa8, #0b2347); }
body.pace-monitor.pace-yellow { background: linear-gradient(160deg, #e8b23d, #b9791f); animation: pace-pulse 1.1s ease-in-out infinite; }
body.pace-monitor.pace-red { background: linear-gradient(160deg, #e2543c, #a52f1f); animation: pace-pulse 0.6s ease-in-out infinite; }
@keyframes pace-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

/* ============================================================
   성도(설교 듣기) 페이지
   ============================================================ */
body.listen .wrap { max-width: 620px; }
.lang-pick { display: grid; gap: 12px; margin: 22px 0; }
.lang-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 18px 20px;
  color: var(--text); font-size: 18px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.lang-btn .flag { font-size: 24px; }
.lang-btn.chosen { border-color: var(--gold); background: var(--panel-2); }
.lang-btn:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }

#live { display: none; flex-direction: column; min-height: 78dvh; }
.live-top {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 13px; margin-bottom: 8px;
}
#status.on::before {
  content: "●"; color: var(--ok); margin-right: 6px; font-size: 10px;
  vertical-align: middle;
}
.subtitle-options {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 10px 0 12px; color: var(--muted); font-size: 13px;
}
.dual-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.dual-toggle input { width: 18px; height: 18px; accent-color: var(--gold); }
.subtitles {
  flex: 1; display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px; min-height: 360px;
}
.subtitles.single { grid-template-rows: minmax(0, 1fr); }
.subtitle-pane {
  display: flex; align-items: center;
  font-size: clamp(28px, 7vw, 46px);
  line-height: 1.42; font-weight: 600;
  letter-spacing: -0.01em;
  padding: 26px 22px;
  border-radius: 20px;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(216,166,74,.10), transparent 70%),
    var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid rgba(216,166,74,.55);
  box-shadow: 0 0 60px rgba(216,166,74,.08), var(--shadow);
  text-shadow: 0 0 26px rgba(236,206,138,.18);
  min-height: 2.4em;
}
.subtitle-pane.secondary {
  border-top-color: rgba(131,211,200,.55);
  background: radial-gradient(120% 120% at 50% 0%, rgba(131,211,200,.08), transparent 70%), var(--panel);
}
/* 같은 px이 다르게 보이는 문자 체계를 실제 시각 크기에 맞춰 보정 */
.subtitle-pane.lang-th { font-size: clamp(29px, 7.2vw, 47px); line-height: 1.48; }
.subtitle-pane.lang-lo { font-size: clamp(29px, 7.25vw, 48px); line-height: 1.5; }
.subtitle-pane.lang-en { font-size: clamp(28px, 6.9vw, 46px); line-height: 1.42; }
.subtitle-pane[hidden] { display: none; }
.subtitle-feed {
  flex: 1;
  min-height: 360px;
  height: min(58dvh, 620px);
  max-height: min(58dvh, 620px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 4px 4px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 100%);
}
.subtitle-waiting {
  margin: auto 0;
  color: var(--muted);
  text-align: center;
  font-size: 18px;
}
.subtitle-entry {
  flex: none;
  padding: 6px 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  opacity: 1;
  animation: subtitle-rise .24s ease-out;
}
.subtitle-entry.latest {
  opacity: 1;
  border-bottom-color: transparent;
  border-radius: 10px;
  background: rgba(189,135,50,.12);
}
.subtitle-text {
  color: var(--text);
  font-size: clamp(18px, 4.8vw, 24px);
  line-height: 1.42;
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.subtitle-entry.latest .subtitle-text { font-weight: 600; }
.subtitle-text + .subtitle-text { margin-top: 3px; color: var(--text); }
.subtitle-text.lang-th { font-size: clamp(19px, 4.95vw, 25px); line-height: 1.47; }
.subtitle-text.lang-lo { font-size: clamp(19px, 5vw, 25px); line-height: 1.49; }
.subtitle-text.lang-en { font-size: clamp(18px, 4.7vw, 24px); line-height: 1.42; }
@keyframes subtitle-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { transform: translateY(0); }
}
.live-actions { display: flex; gap: 12px; margin-top: 16px; }
body.listen.black-mode {
  --paper: #030507;
  --panel: #090c11;
  --panel-2: #10151d;
  --line: rgba(255,255,255,.13);
  --text: #f2f5f8;
  --muted: #b1bac7;
  background: #030507;
}
body.listen.black-mode .nav-link { background: rgba(255,255,255,.06); }
body.listen.black-mode .language-switcher button {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
  color: var(--muted);
}
body.listen.black-mode .language-switcher button.active {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  color: #101418;
}
body.listen.black-mode .subtitle-entry.latest {
  background: rgba(216,166,74,.30);
  box-shadow: inset 3px 0 0 var(--gold-soft);
}
#notice {
  display: none;
  background: rgba(216,166,74,.10);
  border: 1px solid rgba(216,166,74,.3);
  color: var(--gold-soft);
  border-radius: 12px; padding: 12px 14px;
  font-size: 13.5px; line-height: 1.55; margin-top: 14px;
}
.listen-hint { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 18px; }

/* ============================================================
   앞 화면 자막 (OBS)
   ============================================================ */
body.screen {
  background: transparent;
}
#screenRoot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 4vh 5vw 6vh;
}
.sline {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.28;
  color: #ffffff;
  /* PPT 위에서도 또렷하게 — 두꺼운 외곽선 + 그림자 */
  text-shadow:
    0 0 2px #000, 0 2px 2px #000,
    2px 0 2px #000, -2px 0 2px #000, 0 -2px 2px #000,
    0 4px 18px rgba(0, 0, 0, 0.85);
  -webkit-text-stroke: 1px rgba(0,0,0,0.55);
}
.sline.th { color: #eafffb; }
.sline.lo { color: #ffeef7; }
.sline.en { color: #fff6dc; }
.sline.ko { color: #ffffff; }
.sline.flash { animation: fadein 0.35s ease; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- 반응형 ---- */
@media (max-width: 560px) {
  .op-controls { flex-direction: column; align-items: stretch; }
  .statusbar { gap: 10px; }
}

/* 접근성: 모션 최소화 존중 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   토브교회 공식 홈페이지
   ============================================================ */
.site-home, .site-subpage { background: var(--paper); color: var(--navy); }
.site-header {
  width: min(1180px, calc(100% - 40px)); margin: 0 auto;
  min-height: 84px; display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 28px; border-bottom: 1px solid var(--line);
}
.site-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; font-size: 20px; letter-spacing: -.04em; }
.church-symbol { height: 38px; width: auto; display: block; object-fit: contain; }
.site-nav { display: flex; justify-content: center; gap: clamp(18px, 3vw, 40px); }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; padding: 10px 0; }
.site-nav a:hover, .site-nav a.active { color: var(--navy); }
.language-switcher.compact { margin: 0; flex-wrap: nowrap; }
.language-switcher.compact button { padding: 6px 8px; font-size: 11px; }

.site-home main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.church-hero { min-height: 650px; display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: clamp(32px, 7vw, 90px); padding: 72px 0 80px; }
.church-hero-copy h1 { max-width: 650px; margin: 14px 0 24px; font-family: "Noto Sans KR", system-ui, sans-serif; font-weight: 700; font-size: clamp(42px, 6vw, 78px); line-height: 1.16; letter-spacing: -.02em; color: var(--navy-deep); white-space: pre-line; word-break: keep-all; overflow-wrap: break-word; }
.church-hero-copy > p:not(.eyebrow) { max-width: 560px; color: var(--muted); font-size: clamp(16px, 2vw, 20px); line-height: 1.8; }
.church-hero-art { position: relative; isolation: isolate; }
.church-hero-art::before { content: ""; position: absolute; inset: -28px 28px 28px -28px; border: 1px solid rgba(189,135,50,.38); border-radius: 6px; z-index: -1; }
.church-hero-art img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 28px 70px rgba(6,23,47,.23); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.site-button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: 4px; font-weight: 800; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.site-button:hover { transform: translateY(-2px); }
.site-button.primary { background: var(--navy); color: #fff; box-shadow: 0 14px 30px rgba(11,35,71,.18); }
.site-button.secondary { border: 1px solid rgba(11,35,71,.28); color: var(--navy); background: #fff; }
.site-button.centered { margin: 34px auto 0; width: fit-content; }

.church-section { display: grid; grid-template-columns: minmax(220px,.62fr) 1.38fr; gap: clamp(28px, 7vw, 100px); padding: 88px 0; border-top: 1px solid var(--line); }
.church-section h2 { margin: 5px 0 0; font: 700 clamp(28px, 4vw, 44px)/1.3 "Noto Sans KR", system-ui, sans-serif; letter-spacing: -.02em; }
.section-number { font-family: "Space Grotesk", "Noto Sans KR", system-ui, sans-serif; color: var(--gold); font-weight: 800; letter-spacing: .16em; margin: 0; }
.section-lead { margin: 0; font: 600 clamp(22px, 3.3vw, 36px)/1.6 "Noto Sans KR", system-ui, sans-serif; letter-spacing: -.015em; }
.section-copy { color: var(--muted); line-height: 1.7; }
.denomination { margin: 0 0 18px; color: var(--gold); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.mission-copy { margin-top: 28px; color: var(--muted); font-size: 16px; line-height: 1.85; }
.mission-copy p { margin: 0 0 14px; }
.pastor-card { margin-top: 32px; padding: 24px 28px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-radius: 4px; }
.pastor-card span { color: rgba(255,255,255,.67); font-size: 13px; }
.pastor-card strong { font: 700 22px/1.3 "Noto Serif KR", serif; }
.schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.schedule-content { min-width: 0; }
.schedule-grid article { padding: 34px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--navy); box-shadow: 0 12px 34px rgba(11,35,71,.06); }
.schedule-grid article > span { color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.schedule-grid h3 { margin: 30px 0 8px; font-size: 22px; }
.schedule-grid p { margin: 0; color: var(--muted); font-size: 17px; }
.offering-card { margin-top: 16px; padding: 20px 22px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; border: 1px solid var(--line); background: var(--panel-2); }
.offering-card > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.offering-card > strong { color: var(--navy); font-size: 15px; }
.copy-account { border: 1px solid rgba(11,35,71,.2); border-radius: 4px; background: #fff; color: var(--navy); padding: 9px 12px; font: 700 12px/1.2 "Noto Sans KR", sans-serif; cursor: pointer; }
.copy-account:hover { border-color: var(--gold); }
.featured-video { align-items: start; }
.video-frame { position: relative; width: 100%; overflow: hidden; aspect-ratio: 16 / 9; background: var(--navy-deep); border-radius: 5px; box-shadow: 0 22px 55px rgba(6,23,47,.18); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.text-link { display: inline-block; margin-top: 22px; color: var(--navy); font-weight: 800; text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: 4px; }
.contact-list { display: grid; gap: 22px; }
.contact-photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; box-shadow: 0 20px 50px rgba(6,23,47,.18); }
.visit-note { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.contact-list > div:not(.contact-actions):not(.contact-photo) { display: grid; grid-template-columns: 90px 1fr; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.contact-list span { color: var(--muted); font-size: 13px; }
.contact-list strong, .contact-list a { color: var(--navy); font-size: 18px; text-decoration: none; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-actions a { padding: 12px 16px; background: var(--panel-2); border-radius: 4px; font-size: 14px; font-weight: 700; }
.site-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 46px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.site-footer strong { color: var(--navy); font-size: 15px; }
.site-footer span { font-family: "Space Grotesk", "Noto Sans KR", system-ui, sans-serif; letter-spacing: .08em; }
.site-footer-right { display: flex; align-items: center; gap: 16px; }
.site-footer-right a { color: var(--muted); text-decoration: none; font-family: "Noto Sans KR", system-ui, sans-serif; letter-spacing: 0; }
.site-footer-right a:hover { color: var(--navy); }

.subpage-main { width: min(1050px, calc(100% - 40px)); margin: 0 auto; padding: 80px 0 110px; }
.subpage-heading { max-width: 760px; margin-bottom: 54px; }
.subpage-heading h1 { margin: 12px 0 18px; color: var(--navy-deep); font: 700 clamp(38px, 6vw, 68px)/1.18 "Noto Serif KR", serif; letter-spacing: -.05em; }
.subpage-heading > p:last-child { color: var(--muted); font-size: 18px; line-height: 1.7; }
.church-roles { grid-template-columns: repeat(3, 1fr); }
.church-roles .role { min-height: 245px; border-radius: 5px; padding: 30px; border-top: 4px solid var(--navy); }
.church-roles .ico { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .15em; }
.church-roles .rt { margin-top: 62px; font-size: 23px; color: var(--navy); }
.church-roles .rd { font-size: 14px; line-height: 1.7; }
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 34px 22px; }
.video-grid article h2 { margin: 16px 2px 0; font-size: 17px; line-height: 1.5; }

/* ---- 갤러리 ---- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gallery-grid figure {
  margin: 0; overflow: hidden; border-radius: 10px;
  aspect-ratio: 1 / 1; background: var(--panel-2);
  border: 1px solid var(--line);
}
.gallery-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-empty { color: var(--muted); font-size: 15px; padding: 40px 0; text-align: center; }
.gallery-empty[hidden] { display: none; }
.gallery-main .gallery-grid figure { cursor: pointer; }

/* ---- 사진 확대 보기 모달 ---- */
/* 모바일 기본값: 화면 전체를 채우는 뷰어(가로/세로 모드 모두 flex로 자연스럽게 대응) */
.photo-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.photo-modal[hidden] { display: none; }
.photo-modal-backdrop { position: absolute; inset: 0; background: rgba(6,23,47,.92); }
.photo-modal-box {
  position: relative; z-index: 1;
  width: 100%; height: 100dvh; max-height: 100dvh;
  background: var(--navy-deep);
  display: flex; flex-direction: column; gap: 10px;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
}
.photo-modal-box img {
  flex: 1; min-height: 0; width: 100%;
  object-fit: contain; border-radius: 8px; background: #000;
}
.photo-modal-caption { flex: none; margin: 0; color: #fff; font-size: 14px; line-height: 1.6; }
.photo-modal-caption[hidden] { display: none; }
.photo-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; font-size: 16px;
}
.photo-modal-share {
  flex: none;
  appearance: none; border: none; cursor: pointer; border-radius: 13px;
  padding: 13px 20px; font-weight: 700; font-size: 15px; color: var(--ink);
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
}

/* 태블릿 이상: 화면 꽉 채우지 않고 가운데 카드 형태로 */
@media (min-width: 640px) {
  .photo-modal { padding: 24px; }
  .photo-modal-box {
    width: min(560px, 100%); height: auto; max-height: 90dvh;
    background: var(--panel); border-radius: 16px; padding: 20px;
    box-shadow: 0 30px 80px rgba(0,0,0,.4);
  }
  .photo-modal-box img { flex: none; max-height: 65dvh; background: var(--panel-2); }
  .photo-modal-caption { color: var(--text); }
  .photo-modal-close { top: -14px; right: -14px; background: var(--navy); }
}

/* ---- 갤러리 관리(암호로 보호) ---- */
.gallery-admin-controls { display: grid; gap: 12px; margin-bottom: 30px; }
.gallery-upload-label {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; border-radius: 13px; cursor: pointer;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  color: var(--ink); font-weight: 700; font-size: 15px;
}
.gallery-upload-label input[type="file"] { display: none; }
.gallery-status { color: var(--muted); font-size: 13px; min-height: 18px; }
.gallery-admin-item { display: grid; gap: 6px; }
.gallery-caption-input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; background: var(--panel); color: var(--text);
}
.gallery-caption-input:focus { outline: 2px solid var(--gold-soft); }
.gallery-grid figure { position: relative; }
.gallery-delete {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(6,23,47,.55); color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.gallery-delete:hover { background: var(--danger); }

body:not(.screen) #notice { color: #8a5d17; }

@media (max-width: 850px) {
  .site-header { grid-template-columns: auto 1fr; gap: 12px; padding: 14px 0; }
  .site-nav { order: 3; grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; border-top: 1px solid var(--line); padding-top: 8px; }
  .language-switcher.compact { justify-self: end; }
  .church-hero { min-height: 0; grid-template-columns: 1fr; padding-top: 48px; }
  .church-hero-art { max-width: 680px; }
  .church-section { grid-template-columns: 1fr; padding: 66px 0; }
  .church-roles { grid-template-columns: 1fr; }
  .church-roles .role { min-height: 0; }
  .church-roles .rt { margin-top: 30px; }
}

@media (max-width: 560px) {
  .site-header, .site-home main, .site-footer, .subpage-main { width: min(100% - 28px, 1180px); }
  .site-logo { font-size: 18px; }
  .language-switcher.compact { gap: 3px; }
  .language-switcher.compact button { padding: 6px; }
  .site-nav { gap: 24px; }
  .church-hero { padding: 42px 0 62px; }
  .church-hero-copy h1 { font-size: clamp(38px, 12vw, 56px); }
  .church-hero-art::before { inset: -12px 12px 12px -12px; }
  .church-section { padding: 56px 0; }
  .schedule-grid, .video-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .schedule-grid article { padding: 28px; }
  .offering-card { grid-template-columns: 1fr; gap: 8px; }
  .copy-account { width: fit-content; }
  .contact-list > div:not(.contact-actions) { grid-template-columns: 1fr; gap: 6px; }
  .subpage-main { padding: 52px 0 80px; }
  .subpage-heading { margin-bottom: 34px; }
}
