/* 열방드림교회 가정예배 — 큰 글씨 / 흰 카드 + 회색 캔버스 (omotalk 팔레트) */
:root {
  --ink: #202124;
  --muted: #858b94;
  --line: #eceef1;
  --paper: #fff;
  --canvas: #f7f8fa;
  --accent: #fee500;
  --accent-ink: #202124;
  --blue: #4d84bd;
  --red: #e45454;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow: 0 12px 36px #18202d18;
  --base-px: 22px; /* 글자 크기 조절(app.js)이 바꾼다 */
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: var(--base-px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---- 상단 고정 바 (글자 크기) ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .35rem .8rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.topbar__brand strong { color: var(--ink); font-size: .95rem; }
.topbar__brand { display: flex; align-items: center; gap: .4rem; }
.topbar__logo { display: block; height: 30px; width: auto; }

.splash {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #fff; transition: opacity .45s ease;
}
.splash.is-hidden { opacity: 0; pointer-events: none; }
.splash__logo { width: min(78vw, 360px); height: auto; }
.splash__title { margin: 0; font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: .08em; }
.fontctl { display: flex; gap: .4rem; }
.fontctl__btn {
  min-width: 3.1rem; min-height: 2.6rem; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink);
  font-size: 1rem; font-weight: 800;
}
.fontctl__btn:disabled { background: var(--line); color: var(--muted); cursor: default; }

/* ---- 헤더 / 날짜 이동 ---- */
.app-header { max-width: 40rem; margin: 0 auto; padding: 1rem 1rem .4rem; text-align: center; }
.app-header__title { margin: 0; font-size: 1.7rem; font-weight: 800; line-height: 1.4; letter-spacing: -.02em; }
.app-header__meta { margin: .2rem 0 .6rem; color: var(--muted); font-size: .9rem; }
.datenav {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem;
}
.datenav__input {
  min-height: 3rem; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
  font-size: .95rem;
}

/* ---- 레이아웃 / 카드 ---- */
.app-main { max-width: 40rem; margin: 0 auto; padding: .6rem .8rem 2rem; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1.2rem;
  margin: 0 0 1.1rem;
}
.card--notice { text-align: center; }
.card--plain { box-shadow: none; }
.card__head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.card__index {
  flex: none; display: grid; place-items: center;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .95rem; line-height: 1;
}
.card__title { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.4; letter-spacing: -.02em; }
.card__body > * + * { margin-top: .8rem; }

.lead { margin: 0; font-size: .85rem; font-weight: 700; color: var(--muted); }
.scripture { margin: 0; font-size: 1.05rem; line-height: 1.9; }
.commentary { margin: 0; font-size: 1rem; line-height: 1.9; }
.note { margin: 0; font-size: .85rem; color: var(--muted); }

/* ---- 버튼 ---- */
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn {
  min-height: 3rem; padding: .3rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: .95rem; line-height: 1.4;
}
.btn:disabled { color: var(--muted); background: var(--canvas); cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary.is-playing { background: var(--ink); border-color: var(--ink); color: var(--accent); }

/* ---- 찬송 ---- */
.hymn-audio { display: grid; gap: .5rem; }
.hymn-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-md); background: #000; }
.hymn-link, .bgm__link {
  display: inline-block; justify-self: start;
  min-height: 2.6rem; line-height: 2.6rem; padding: 0 .9rem;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  color: var(--blue); font-weight: 700; font-size: .9rem; text-decoration: none; background: var(--canvas);
}

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .3rem; background: var(--canvas); border-radius: var(--radius-md); }
.seg__btn {
  min-height: 3rem; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); font-weight: 800; font-size: .95rem;
}
.seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--accent); }

.hymn-view > * + * { margin-top: .5rem; }
.score { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; overflow: hidden; }
.score__img { display: block; width: 100%; height: auto; }

.lyric { padding: .7rem .9rem; background: var(--canvas); border-radius: var(--radius-md); }
.lyric__label { margin: 0; font-size: .85rem; font-weight: 800; color: var(--muted); }
.lyric__text { margin: 0; font-size: 1.15rem; line-height: 2; white-space: pre-line; }

/* ---- 확대 보기 ---- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(32, 33, 36, .96); display: flex; flex-direction: column; }
.lightbox[hidden] { display: none; }
.lightbox__close {
  flex: none; align-self: flex-end; margin: .6rem;
  min-height: 3rem; padding: 0 1.2rem; border: 0; border-radius: var(--radius-md);
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1rem;
}
.lightbox__scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 0 .5rem 1rem; }
.lightbox__scroll img { display: block; width: 100%; max-width: none; height: auto; margin: 0 auto; background: #fff; cursor: zoom-in; }
.lightbox__scroll img.is-zoom { width: 220%; cursor: zoom-out; }

/* ---- 성경 ---- */
.bible-reading__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; }
.bible-reading__ref { font-size: 1.15rem; font-weight: 800; }
.bible-reading__title { color: var(--muted); font-size: .95rem; }
.bible-ref { margin: 0; font-size: 1.1rem; font-weight: 800; }
.bible-module > * + * { margin-top: .7rem; }

.ver-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
.ver-btn {
  min-height: 3rem; padding: .2rem .5rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); font-weight: 700; font-size: .95rem;
}
.ver-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--accent); }

.bible-note { margin: 0; padding: .8rem 1rem; background: var(--canvas); border-radius: var(--radius-md); color: var(--muted); font-size: .95rem; }

.verse-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.verse-row {
  display: block; position: relative;
  padding: .55rem 3.4rem .55rem .5rem; border-radius: var(--radius-md); border: 1px solid transparent;
}
.verse-row.verse-active { background: #fffbd1; border-color: var(--accent); }
.verse-num { display: inline; color: var(--muted); font-weight: 800; font-size: .8rem; margin-right: .35rem; vertical-align: .1em; }
.verse-text { display: inline; margin: 0; font-size: 1.05rem; line-height: 1.85; }
.verse-speak {
  position: absolute; top: .45rem; right: .3rem;
  width: 2.75rem; height: 2.75rem; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-size: 1rem; line-height: 1;
}
@media (max-width: 440px) {
  .card { padding-left: 14px; padding-right: 14px; }
  .app-main { padding-left: 10px; padding-right: 10px; }
}
.verse-nav { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.verse-position { font-weight: 800; color: var(--muted); font-size: .9rem; }

/* ---- 통성기도 ---- */
.prayer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.prayer-list__item { display: grid; grid-template-columns: 2rem 1fr; gap: .6rem; padding: .7rem .8rem; background: var(--canvas); border-radius: var(--radius-md); }
.prayer-list__n { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); font-weight: 800; font-size: .9rem; margin-top: .25rem; }
.prayer-list__text { font-size: 1.05rem; line-height: 1.9; }

.bgm { padding: .8rem; background: var(--canvas); border-radius: var(--radius-md); display: grid; gap: .6rem; }
.bgm__label { margin: 0; font-weight: 800; font-size: .95rem; }
.bgm__row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.bgm__vol { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 11rem; }
.bgm__vol-label { font-weight: 700; font-size: .9rem; }
.bgm__range { flex: 1; min-height: 2.6rem; accent-color: var(--ink); }
.bgm__frame-wrap { max-width: 14rem; }
.bgm__frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-sm); background: #000; }

/* ---- 시간표 ---- */
.table-wrap { overflow-x: auto; }
.schedule-table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.6; }
.schedule-table caption { text-align: left; font-weight: 800; padding-bottom: .4rem; color: var(--muted); }
.schedule-table th, .schedule-table td { padding: .5rem .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.schedule-table thead th { color: var(--muted); font-size: .85rem; }

/* ---- 푸터 ---- */
.app-footer { text-align: center; padding: 1rem 1rem 2.5rem; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.app-footer p { margin: 0; }
.app-footer__church { font-weight: 800; }

@media (min-width: 700px) {
  .ver-picker { grid-template-columns: repeat(4, 1fr); }
}
@media print {
  .topbar, .datenav, .btn-row, .bgm, .seg, .hymn-audio, .ver-picker { display: none !important; }
}
