/* 화도교회 중등부 주보 — 원래 종이 주보 웹판(2026.11.29)의 색과 구성을 그대로 잇는다.
   한 줄 기둥(680px) 안에 머리말 → 바로가기 → 예배순서 → 광고 → 원본 사진. 편집 권한이 있으면 칸마다 [고치기]. */
:root {
  --ink: #292b2b;
  --muted: #6f6863;
  --accent: #a54b31;
  --accent-ink: #84442d;
  --line: #e8dfd6;
  --paper: #ffffff;
  --bg: #f7f4ef;
  --head: #fff1e5;
  --head-line: #edd9c8;
  --soft: #fff5eb;
  --reading: #faf8f4;
  --btn: #94472e;
  --btn-ink: #ffffff;
  --nav-ink: #554238;
  --date: #68544c;
  --focus: #dc986f;
  --field: #ffffff;
  --field-line: #d6c9bd;
  --danger: #a3321c;
  --toast: #2c2623;
  --toast-ink: #fbf6f1;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ece5de; --muted: #aaa098; --accent: #e39a7e; --accent-ink: #f0b49b;
    --line: #3b332e; --paper: #24201d; --bg: #1a1715; --head: #2d231e; --head-line: #4a382e;
    --soft: #33261f; --reading: #2a2522; --btn: #b5583a; --btn-ink: #ffffff; --nav-ink: #e6d3c8;
    --date: #cfb8ab; --focus: #e8a57f; --field: #1f1b19; --field-line: #4b413a; --danger: #ff8f73;
    --toast: #f1e9e2; --toast-ink: #231e1b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #ece5de; --muted: #aaa098; --accent: #e39a7e; --accent-ink: #f0b49b;
  --line: #3b332e; --paper: #24201d; --bg: #1a1715; --head: #2d231e; --head-line: #4a382e;
  --soft: #33261f; --reading: #2a2522; --btn: #b5583a; --btn-ink: #ffffff; --nav-ink: #e6d3c8;
  --date: #cfb8ab; --focus: #e8a57f; --field: #1f1b19; --field-line: #4b413a; --danger: #ff8f73;
  --toast: #f1e9e2; --toast-ink: #231e1b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  line-height: 1.7; word-break: keep-all; overflow-wrap: break-word;
}
main {
  max-width: 680px; margin: 0 auto; padding-block: 18px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
header { background: var(--head); border: 1px solid var(--head-line); border-radius: 20px; padding: 25px 23px 22px; text-align: center; }
header .eyebrow { font-size: 13px; letter-spacing: .15em; color: var(--accent); font-weight: 800; }
h1 { font-size: clamp(24px, 6.4vw, 34px); line-height: 1.3; letter-spacing: -.055em; margin: 10px 0 14px; text-wrap: balance; }
header .date { font-size: 14px; color: var(--date); font-variant-numeric: tabular-nums; }
nav.jump { display: flex; gap: 7px; margin: 14px 0; }
nav.jump a { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--nav-ink); font-size: 13px; font-weight: 700; text-decoration: none; padding: 10px 3px; }
section { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; margin: 14px 0; padding: 19px 17px; scroll-margin-top: 12px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
h2 { font-size: 20px; letter-spacing: -.04em; margin: 0; color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); text-align: right; margin: 0 0 7px; }
.order { display: flex; align-items: baseline; gap: 9px; padding: 12px 0; border-top: 1px solid var(--line); }
.name { font-weight: 800; flex: 0 0 auto; font-size: 15px; }
.standing { color: var(--accent); }
.who { margin-left: auto; text-align: right; color: var(--muted); font-size: 13px; min-width: 0; }
.who small { display: block; font-size: 11px; }
.sermon { margin: 0 0 12px; background: var(--soft); padding: 12px 14px; border-radius: 10px; font-weight: 700; color: var(--accent-ink); }
details.scripture { border-top: 1px solid var(--line); }
details.scripture > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 13px 0; font-weight: 800; font-size: 15px; flex-wrap: wrap; }
details.scripture > summary::-webkit-details-marker { display: none; }
details.scripture > summary::after { content: "＋"; margin-left: auto; color: var(--accent); font-size: 20px; }
details.scripture[open] > summary::after { content: "−"; }
summary .ref { font-size: 13px; font-weight: 600; color: var(--accent); }
summary .who { margin-left: 0; }
.reading { background: var(--reading); border-radius: 12px; padding: 12px 14px; margin: 0 0 13px; font-size: 16px; line-height: 1.9; }
.reading p { margin: 0 0 10px; }
.reading p:last-child { margin-bottom: 0; }
.verse { display: inline-block; color: var(--accent); font-size: 12px; margin-right: 8px; min-width: 12px; font-variant-numeric: tabular-nums; }
.notices { padding-left: 21px; margin: 0; }
.notices li { padding: 7px 0; }
.callout { background: var(--soft); border-radius: 13px; padding: 15px; margin-top: 9px; }
.callout p { margin: 0 0 12px; font-size: 15px; }
.callout p:last-child { margin-bottom: 0; }
.button { display: flex; align-items: center; justify-content: space-between; text-decoration: none; background: var(--btn); color: var(--btn-ink); font-weight: 800; border-radius: 11px; padding: 14px 16px; min-height: 48px; }
.source { color: var(--muted); font-size: 13px; text-align: center; margin-top: 18px; }
.source > summary { cursor: pointer; justify-content: center; font-weight: 600; list-style: none; padding: 8px 0; }
.source > summary::-webkit-details-marker { display: none; }
.source img { width: 100%; height: auto; display: block; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; }
.empty { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* 편집 도구 */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.toolbar .grow { flex: 1 1 auto; }
.week-pick { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 700; min-width: 0; }
.week-pick select { max-width: 100%; }
.btn, .btn-quiet, .btn-danger {
  font: inherit; font-size: 14px; font-weight: 700; border-radius: 10px; padding: 8px 14px; cursor: pointer;
  border: 1px solid transparent; line-height: 1.4; min-height: 40px;
}
.btn { background: var(--btn); color: var(--btn-ink); }
.btn-quiet { background: var(--paper); color: var(--accent-ink); border-color: var(--field-line); }
.btn-danger { background: var(--paper); color: var(--danger); border-color: var(--danger); }
.btn.small, .btn-quiet.small { font-size: 13px; padding: 5px 11px; min-height: 34px; }
button:disabled { opacity: .5; cursor: default; }
.edit-note { background: var(--soft); color: var(--accent-ink); border-radius: 12px; padding: 11px 14px; font-size: 13px; margin: 0 0 12px; }
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 4px 0 10px; }
.meta { font-size: 12px; color: var(--muted); margin-right: auto; }
.form { display: grid; gap: 12px; background: var(--reading); border: 1px dashed var(--field-line); border-radius: 13px; padding: 14px; margin: 6px 0 14px; text-align: left; }
.form-title { font-weight: 800; font-size: 15px; color: var(--accent-ink); }
.form-help { font-size: 13px; color: var(--muted); margin: -4px 0 0; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 700; min-width: 0; }
.field input, .field textarea, .field select, .week-pick select {
  font: inherit; font-size: 15px; font-weight: 400; color: var(--ink); background: var(--field);
  border: 1px solid var(--field-line); border-radius: 9px; padding: 8px 10px; width: 100%; min-width: 0;
}
.field textarea { min-height: 96px; line-height: 1.7; resize: vertical; }
.field textarea.long { min-height: 240px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.row-list { display: grid; gap: 10px; }
.row-edit { display: grid; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
.row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-no { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.row-head .spacer { flex: 1 1 auto; }
.mini { font: inherit; font-size: 13px; border: 1px solid var(--field-line); background: var(--paper); color: var(--ink); border-radius: 8px; min-width: 36px; min-height: 34px; padding: 3px 8px; cursor: pointer; }
.row-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.preview { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; font-size: 14px; line-height: 1.8; max-height: 320px; overflow: auto; }
.preview p { margin: 0 0 6px; }
.status { font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.status.warn { color: var(--danger); }
.photo-preview { max-width: 220px; border: 1px solid var(--line); border-radius: 8px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 1000;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px); width: max-content;
  background: var(--toast); color: var(--toast-ink); border-radius: 12px; padding: 11px 16px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
:focus-visible, .button:focus-visible, summary:focus-visible, nav.jump a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (max-width: 520px) {
  .row-fields { grid-template-columns: 1fr; }
  header { padding: 22px 16px 19px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.songs { display: flex; flex-direction: column; gap: 2px; margin: -6px 0 12px; padding-left: 18px; font-size: 13px; color: var(--muted); }
.songs span::before { content: "♪ "; color: var(--accent); }
.inline-form { display: inline; margin: 0; }
.teacher-link { text-align: center; font-size: 12px; margin: 8px 0 0; }
.teacher-link a { color: var(--muted); }
header h1 + .date { margin-top: 0; }

/* 찬양 곡 제목 링크 */
.songs a.song-link { color: var(--accent-ink); text-decoration: none; align-self: flex-start; }
.songs a.song-link::before { content: "▶ "; color: var(--accent); font-size: 11px; }
.songs a.song-link:hover, .songs a.song-link:focus-visible { text-decoration: underline; }

/* 찬양 화면(show.js) — PPT 와 같은 16:9, 글자는 위쪽, 한 화면 2줄 */
.show { position: fixed; inset: 0; z-index: 900; background: #000; display: flex; align-items: center; justify-content: center; outline: none; }
.show-stage { position: relative; width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; background: #111622; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; }
@supports (height: 100dvh) { .show-stage { width: min(100vw, calc(100dvh * 16 / 9)); } }
.show-stage.black { background: #000; }
.show-text { position: absolute; left: 3%; right: 3%; margin: 0; text-align: center; color: #fff; line-height: 1.32; word-break: keep-all; overflow-wrap: anywhere;
  font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
.show-title, .show-lyric { font-weight: 700; }
.show-title, .show-sub, .show-by { left: 4%; right: 4%; }
.show-bar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; max-width: calc(100% - 16px);
  background: rgba(20, 24, 34, .88); color: #dfe3ec; padding: 6px 8px; border-radius: 10px; font-size: 13px; transition: opacity .3s; }
.show-btn { background: transparent; color: inherit; border: 1px solid rgba(255, 255, 255, .28); border-radius: 7px; padding: 5px 10px; min-height: 34px; font: inherit; cursor: pointer; white-space: nowrap; }
.show-btn:hover, .show-btn:focus-visible { background: rgba(255, 255, 255, .12); }
.show-info { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.show-help { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); color: #8a93a8; font-size: 12px; white-space: nowrap; transition: opacity .3s; pointer-events: none; }
.show.idle .show-bar, .show.idle .show-help { opacity: 0; pointer-events: none; }
.show.idle { cursor: none; }
.show.idle .show-stage { cursor: none; }
@media (max-width: 640px), (hover: none) { .show-help { display: none; } }
