/* 1004 시안: 교역자 칸, 사진, 선교 카드와 앨범, 모달
   사이트 styles.css 는 건드리지 않고 이 파일을 뒤에 덧붙인다.
   색, 서체, 곡선은 styles.css 토큰(--blue, --ink, --serif, --ease-soft)을 그대로 쓴다. */

:root {
  /* 머리글 로고와 같은 왼쪽 끝 (.site-header 의 padding 과 같은 식) */
  --edge: max(clamp(18px, 4vw, 40px), calc((100vw - 1280px) / 2));
  --line: #e6eaef;
}

/* ==========================================================
   ② Value 03 카드: 목사님 소개
   10-04 형 "세번째 장에 태목사님을 소개하는 걸 넣고 네번째 장은 없애줘도 돼"
   카드 세 장과 선 자리는 사이트 그대로 두고, 03 카드 안만 사람 소개로 바꾼다.
   ========================================================== */
.pastor-card {
  display: grid;
  grid-template-columns: clamp(180px, 17vw, 250px) minmax(0, 26em);
  column-gap: clamp(28px, 3.4vw, 52px);
  align-items: center;
}
.pastor-card .val-title { margin-bottom: 2px; }
.pastor-card .pastor-greet { margin-top: 14px; font-size: clamp(15.5px, calc(1.05vw + 2px), 17px); }
.pastor-card .pastor-team { margin: 20px 0 24px; }
.pastor-eng {
  font-family: var(--eng);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
}
/* 사진 자리: 다른 사람 얼굴은 쓰지 않는다. 중립 실루엣과 "교회 확인 중" 표시 */
.pastor-photo {
  position: relative;
  width: 100%;
  height: clamp(150px, 25vh, 236px);
  border-radius: 6px;
  background: #eef6ff;
  overflow: hidden;
  margin-bottom: 18px;
}
.pastor-card .pastor-photo { height: auto; aspect-ratio: 4 / 5; margin: 0; }
.pastor-photo svg {
  position: absolute; left: 50%; bottom: 0;
  translate: -50% 0;
  height: 86%; width: auto;
  color: #cfe3f7;
}
.pastor-photo .tbc {
  position: absolute; left: 10px; top: 10px;
  font-size: 13px; padding: 1px 8px;
}
.pastor-name {
  font-family: var(--serif);
  font-size: clamp(21px, calc(1.6vw + 2px), 25px); font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.pastor-role {
  margin-top: 2px;
  font-family: var(--eng);
  font-size: 14.5px; letter-spacing: 0.06em;
  color: var(--blue);
}
.pastor-greet {
  margin-top: 12px;
  font-size: 15px; line-height: 1.7;
  color: var(--gray);
}
.pastor-greet .tbc { margin-inline-end: 6px; font-size: 13px; padding: 1px 8px; }
.pastor-team {
  list-style: none;
  margin: 18px 0 18px; padding: 14px 0 0;
  border-top: 1px solid var(--line);
  display: grid; gap: 6px;
}
.pastor-team li {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 15.5px; line-height: 1.5;
  color: #3c4148;
}
.pastor-team li span {
  font-family: var(--eng);
  font-size: 13.5px; letter-spacing: 0.04em;
  color: var(--gray);
  white-space: nowrap;
}

/* ② 카드 사진: 제목 위 */
.val-photo {
  width: 100%; max-width: 30em;
  height: clamp(150px, 26vh, 260px);
  margin-bottom: clamp(18px, 2.6vh, 28px);
  border-radius: 6px;
  overflow: hidden;
  background: #eef1f4;
}
.photo-formats { display: contents; }
.val-photo img,
.min-photo img,
.mission-photo img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ==========================================================
   ③ Ministry: 맨 앞 종이 오른쪽에 사진 한 장
   ========================================================== */
.scene-bands { overflow: clip; overflow-anchor: none; }
.band-inner.has-photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(200px, 21vw, 300px);
  column-gap: clamp(28px, 4vw, 64px);
  align-items: start;
  align-content: start;
  padding-top: calc(clamp(8px, 1.6vh, 18px) + var(--sheet-inset, 0px));
}
.band-inner.has-photo > :not(.min-photo) { grid-column: 1; }
.min-photo {
  grid-column: 2; grid-row: 1 / span 3;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: #eef1f4;
  margin-top: 6px;
}
@media (min-width: 1050px) {
  .band-inner.has-photo { grid-template-columns: minmax(0, 1fr) 356px; }
  .band-inner.has-photo .min-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}
@media (min-width: 1050px) and (max-width: 1279px) {
  .band-inner.has-photo { padding-bottom: 3vh; }
  .band-inner.has-photo .min-col { gap: 16px; }
  .band-inner.has-photo .min-grid { margin-bottom: 16px; }
}
.min-photo.worship-player { aspect-ratio: auto; background: none; overflow: visible; }
.worship-player .sermon-stage { border-radius: 6px; box-shadow: none; background: #16191d; }
.worship-live { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 4px; background: #b8202b; color: #fff; font: 600 12px/1.6 var(--eng); pointer-events: none; }
.worship-history:not([hidden]) {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 6px; margin-top: 8px;
}
.worship-history .cards-arrow { width: 26px; height: 38px; }
.worship-thumbs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x mandatory; overscroll-behavior-inline: contain;
}
.worship-thumbs button {
  flex: 0 0 calc((100% - 18px) / 4); scroll-snap-align: start; aspect-ratio: 16 / 9;
  overflow: hidden; border: 2px solid transparent; padding: 0;
  border-radius: 5px; background: #eaf0f6; cursor: pointer;
}
.worship-thumbs button[aria-pressed="true"], .worship-thumbs button:focus-visible { border-color: var(--blue); }
.worship-thumbs img { pointer-events: none; }
.min-photo.stair { position: relative; aspect-ratio: auto; height: auto; background: none; overflow: visible; }
.scene-bands .band-inner > .stair { opacity: 1; transition: none; }
.stair-open { position: absolute; inset: 0; border-radius: 4px; cursor: pointer; }
.stair-open:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.stair-grid {
  display: grid;
  grid-template: repeat(4, minmax(0, 1fr)) / repeat(4, minmax(0, 1fr));
  aspect-ratio: 1;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 4px;
}
.stair-grid li { border-radius: 4px; overflow: hidden; }
.stair-grid img { object-position: center 40%; }
.stair-grid li:nth-child(2) img,
.stair-grid li:nth-child(3) img { object-position: center 45%; }
.stair-grid li:nth-child(5) img { object-position: 46% 48%; }
.stair-grid li:nth-child(7) img { object-position: 62% center; }
.stair-grid li:nth-child(1) { grid-area: 1 / 3 / auto / span 2; }
.stair-grid li:nth-child(2) { grid-area: 1 / 2; }
.stair-grid li:nth-child(3) { grid-area: 1 / 1; }
.stair-grid li:nth-child(4) { grid-area: 2 / 4 / span 2; }
.stair-grid li:nth-child(5) { grid-area: 2 / 2 / auto / span 2; }
.stair-grid li:nth-child(6) { grid-area: 3 / 3; }
.stair-grid li:nth-child(7) { grid-area: 4 / 4; }

.min-grid.min-community { row-gap: 22px; }
.outreach-photo { position: relative; }
.outreach-missions li { position: relative; }
.outreach-missions li::before { position: absolute; pointer-events: none; }
.outreach-missions a { grid-column: 1 / -1; display: grid; text-decoration: none; padding-left: 32px; }
.outreach-missions b::after { content: " ›"; color: var(--blue); }
.outreach-missions a:hover b, .outreach-missions a:focus-visible b { color: var(--blue); }

/* ==========================================================
   ④ Story: 유튜브 설교 자리에 해마다 선교 카드
   다른 칸보다 덜어 낸 모양: 사진, 해, 이름만. 누르면 앨범이 열린다.
   ========================================================== */
.hope-missions {
  flex: 0 1 auto; min-height: 0;
  width: 100%; max-width: 1040px;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(12px, 2vh, 22px);
  opacity: 0; translate: 0 18px;
  transition: opacity 0.9s var(--ease-soft) 0.5s, translate 0.9s var(--ease-soft) 0.5s;
}
.scene-logo.active .hope-missions { opacity: 1; translate: 0 0; }
/* 한 장씩 넘기는 덱: 가운데 한 해가 크게, 옆 해는 비스듬히 물러난다 */
.hope-missions {
  --mc-w: clamp(220px, min(46vw, 100dvh - 500px), 560px);
  --mc-cap: 120px;
}
.mdeck {
  position: relative; width: 100%;
  flex: none;
  height: calc(var(--mc-w) + var(--mc-cap));
  touch-action: pan-y;
  cursor: grab;
}
.mdeck.dragging { cursor: grabbing; }
.mdeck img { -webkit-user-drag: none; user-select: none; }
.mdeck-card {
  position: absolute; left: 50%; top: 0;
  width: var(--mc-w); margin-left: calc(var(--mc-w) / -2);
  display: block; color: #fff; text-decoration: none;
  transform-origin: 50% calc(var(--mc-w) / 2);
  will-change: transform, opacity;
}
.mdeck-photo {
  position: relative; display: block;
  aspect-ratio: 1 / 1;
  border-radius: 14px; overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}
.mdeck-photo img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: scale 0.6s var(--ease-soft);
}
.mdeck-photo.poster img { object-fit: contain; }
.mdeck-card:hover .mdeck-photo img { scale: 1.03; }
.mdeck-cap { display: block; margin-top: 16px; text-align: center; }
.mdeck-title {
  display: block;
  font-family: var(--serif);
  font-size: clamp(22px, calc(2.1vw + 2px), 30px); font-weight: 500; line-height: 1.35;
}
.mdeck-place {
  display: block; margin-top: 6px;
  font-size: 17px; color: rgba(255, 255, 255, 0.82);
}
.mdeck-card:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 10px; }

/* 넘김 단추와 점: 파란 바탕 위 흰색 */
.mission-nav { display: flex; align-items: center; justify-content: center; gap: 22px; }
.mission-nav .cards-dots { gap: 2px; }
.mission-nav .cards-dots button {
  position: relative; width: 24px; height: 24px; padding: 0;
  background: none; border: 0; border-radius: 0;
}
.mission-nav .cards-dots button::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background-color 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}
.mission-nav .cards-dots button.on::before { background: #fff; transform: scale(1.15); }

/* ==========================================================
   모달: 세 가지 크기
   S 사람 소개(좁게), M 안내 문서(넓게, 안에서 스크롤), F 앨범(화면 전체)
   폰에서는 S와 M이 아래에서 올라오는 시트, F는 그대로 화면 전체
   ========================================================== */
html.modal-open, html.modal-open body { overflow: hidden; }

dialog.modal {
  border: 0; padding: 0;
  margin: auto;
  width: min(920px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  font-family: var(--sans);
}
dialog.modal[open] {
  display: flex; flex-direction: column;
  animation: modal-in 0.42s var(--ease-soft) both;
}
dialog.modal::backdrop {
  background: rgba(11, 11, 14, 0.6);
  backdrop-filter: blur(3px);
  animation: modal-fade 0.42s var(--ease-soft) both;
}
@keyframes modal-in { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

dialog.modal-s { width: min(560px, calc(100vw - 48px)); }

.modal-bar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 60px;
  padding: 0 14px 0 clamp(22px, 3.4vw, 44px);
  border-bottom: 1px solid var(--line);
}
.modal-close {
  margin-left: auto;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.25s var(--ease-soft);
}
.modal-close:hover, .modal-close:focus-visible { background: #f1f4f7; }
.modal-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }

.modal-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(26px, 4vw, 46px) clamp(22px, 3.4vw, 44px) clamp(34px, 5vw, 56px);
  line-height: 1.85;
}
.modal-hero {
  margin: calc(-1 * clamp(26px, 4vw, 46px)) calc(-1 * clamp(22px, 3.4vw, 44px)) clamp(26px, 4vw, 40px);
  height: clamp(180px, 30vh, 300px);
  overflow: hidden;
  background: #eef1f4;
}
.modal-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }

.modal h2 {
  font-family: var(--serif);
  font-size: clamp(27px, calc(3vw + 2px), 38px); font-weight: 600;
  line-height: 1.45; letter-spacing: -0.01em;
  margin-bottom: 14px;
  word-break: keep-all;
}
.modal .lead {
  font-size: clamp(17px, calc(1.25vw + 2px), 19px);
  color: #444a52;
  margin-bottom: 8px;
  max-width: 62ch;
  word-break: keep-all;
}
/* 소제목: 왼쪽 선이 아니라 제목 위 짧은 가로선 */
.modal h3 {
  font-family: var(--serif);
  font-size: clamp(20px, calc(1.8vw + 2px), 24px); font-weight: 600;
  line-height: 1.6;
  margin: 40px 0 12px;
}
.modal h3::before {
  content: ""; display: block;
  width: 28px; height: 3px;
  margin-bottom: 12px;
  background: var(--blue);
}
.modal p { margin-bottom: 12px; max-width: 64ch; word-break: keep-all; }
.modal p:last-child { margin-bottom: 0; }
.modal a { color: var(--blue); }
.modal dl.facts {
  display: grid;
  grid-template-columns: minmax(96px, max-content) 1fr;
  gap: 10px 22px;
  margin: 0 0 18px;
  max-width: 64ch;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.modal dl.facts dt { font-weight: 600; color: var(--gray); font-size: 16px; }
.modal .tbl { width: 100%; max-width: 64ch; border-collapse: collapse; margin: 0 0 18px; font-size: 17px; line-height: 1.6; }
.modal .tbl th, .modal .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.modal .tbl thead th { font-size: 15px; font-weight: 600; color: var(--gray); background: #f7f9fb; border-bottom-color: #d5dce4; }
.modal .tbl tbody th { font-weight: 600; }
.modal .tbl small { display: block; font-size: 14.5px; font-weight: 400; color: var(--gray); }
.modal .cards { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.modal .cards li { padding: 16px 18px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 6px; }
.modal .cards b { display: block; font-family: var(--serif); font-size: 18.5px; font-weight: 600; }
.modal .cards .eng { font-family: var(--eng); font-size: 13.5px; color: var(--gray); letter-spacing: 0.03em; margin: 2px 0 6px; }
.modal .cards p { font-size: 16.5px; line-height: 1.75; margin: 0; }
.modal .steps { list-style: none; margin: 0 0 18px; padding: 0; counter-reset: st; max-width: 64ch; }
.modal .steps li { counter-increment: st; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.modal .steps li::before { content: counter(st); width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font: 600 14px/26px var(--eng); text-align: center; margin-top: 2px; }
.modal .steps b { display: block; font-weight: 600; }
.modal .steps span { color: #4a5059; font-size: 16.5px; }
.modal .chips { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.modal .chips li { padding: 5px 14px; border: 1px solid #cfe6fb; background: #f2f9ff; color: #1d6fae; font-size: 16px; border-radius: 999px; }
.modal .note { font-size: 15.5px; color: var(--gray); }
.modal .note .tbc { margin-inline-end: 8px; }

/* 교회 소개 모달: 세 가지 잇다를 사진과 함께 */
.about-values { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.about-values li {
  display: grid; grid-template-columns: clamp(120px, 18vw, 200px) 1fr; gap: clamp(16px, 2.4vw, 28px);
  align-items: start;
}
.about-values figure { aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #eef1f4; }
.about-values img { display: block; width: 100%; height: 100%; object-fit: cover; }
.about-values b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--blue); margin-bottom: 4px; }
.about-values p { font-size: 17px; line-height: 1.85; margin: 0; }

/* 선교 앨범으로 가는 작은 줄 (돌봄과 선교 모달 안) */
.album-links { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.album-links button {
  width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  text-align: left; font: inherit; color: var(--ink);
}
.album-links figure { aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #eef1f4; margin-bottom: 8px; }
.album-links figure.is-empty { background: #f7f9fb; border: 1.5px dashed #cdd4dc; }
.album-links img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-links span { display: block; font-size: 15px; line-height: 1.5; }
.album-links em { display: block; font-style: normal; font-family: var(--eng); font-size: 13px; font-weight: 600; letter-spacing: 0.16em; color: var(--gray); }

/* 섬기는 사람들 모달 (S) */
.staff-lead {
  display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: center;
  padding-bottom: 22px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.staff-lead .pastor-photo { height: 140px; margin: 0; }
.staff-lead .pastor-photo:not(:has(img)),
.staff-list .staff-mark:not(:has(img)) { display: none; }
.staff-lead:not(:has(.pastor-photo img)),
.staff-list li:not(:has(.staff-mark img)) { grid-template-columns: minmax(0, 1fr); }
.staff-lead .pastor-photo img,
.staff-list .staff-mark img { width: 100%; height: 100%; object-fit: cover; }
.staff-lead .pastor-photo:has(img) svg { display: none; }
.staff-lead .pastor-photo .tbc { left: 6px; top: 6px; font-size: 12px; padding: 0 6px; }
.staff-lead b { display: block; font-family: var(--serif); font-size: 23px; font-weight: 600; }
.staff-lead .pastor-role { margin-bottom: 8px; }
.staff-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 18px; }
.staff-list li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; }
.staff-list .staff-mark { width: 44px; margin: 0; font-size: 19px; }
.staff-list b { display: block; font-family: var(--serif); font-size: 17.5px; font-weight: 600; line-height: 1.4; }
.staff-list span { font-family: var(--eng); font-size: 14px; letter-spacing: 0.05em; color: var(--blue); }

/* ---------- 앨범 (F): 화면 전체, 잉크 바탕 ---------- */
dialog.modal-f {
  width: 100vw; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; inset: 0;
  border-radius: 0;
  background: var(--ink);
  color: #fff;
}
dialog.modal-f[open] { animation: modal-fade 0.42s var(--ease-soft) both; }
.modal-f .modal-bar {
  height: 68px;
  padding: 0 clamp(10px, 1.6vw, 20px) 0 var(--edge);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.modal-f .modal-close { color: #fff; }
.modal-f .modal-close:hover, .modal-f .modal-close:focus-visible { background: rgba(255, 255, 255, 0.1); }
.album-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.album-tabs::-webkit-scrollbar { display: none; }
.album-tabs button {
  flex: none;
  padding: 7px 14px;
  border: 1px solid transparent; border-radius: 999px;
  background: none; color: rgba(255, 255, 255, 0.6);
  font: 500 15px/1.4 var(--sans);
  cursor: pointer; white-space: nowrap;
}
.album-tabs button em { font-style: normal; font-family: var(--eng); font-weight: 600; margin-inline-end: 6px; }
.album-tabs button:hover { color: #fff; }
.album-tabs button[aria-current="true"] { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.modal-f .modal-body {
  padding: clamp(26px, 4vh, 44px) var(--edge) clamp(40px, 6vh, 72px);
}
.album-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; margin-bottom: clamp(20px, 3vh, 32px); }
.album-head h2 { color: #fff; margin: 0; }
.album-retry { color: inherit; background: transparent; border: 1px solid currentColor; padding: 8px 14px; font: inherit; cursor: pointer; }
.album-head p { color: rgba(255, 255, 255, 0.6); font-size: 15.5px; margin: 0; }
.album-head .tbc { background: transparent; border-color: rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.65); margin-inline-end: 8px; }
.album-grid {
  --cols: 4;
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: var(--row, clamp(150px, 15vw, 230px));
  grid-auto-flow: dense;
  gap: clamp(6px, 0.8vw, 12px);
}
.album-grid li { position: relative; border-radius: 6px; overflow: hidden; background: #1b1c21; }
.album-grid.is-mosaic li { cursor: zoom-in; }
.album-grid li:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.album-grid li.sh-w { grid-column: span 2; }
.album-grid li.sh-t { grid-row: span 2; }
.album-grid li.sh-b { grid-column: span 2; grid-row: span 2; }
.album-grid img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-soft); }
.album-grid li:hover img { transform: scale(1.03); }
/* 아래에서 스르륵 떠오름: 스크립트가 .in 을 달면 나타난다(시차는 transition-delay) */
:is(.album-grid, .stair-grid).js-reveal li { opacity: 0; translate: 0 36px; transition: opacity 0.7s var(--ease-soft), translate 0.8s var(--ease-soft); }
.stair-grid.js-reveal li:not(.in) { transition: none; }
:is(.album-grid, .stair-grid).js-reveal li:is(.in, :focus-visible) { opacity: 1; translate: 0 0; }
.album-grid li.is-video, .album-grid li.is-empty {
  display: grid; place-items: center; align-content: center; gap: 10px;
  background: #16171c;
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px; text-align: center;
}
.album-grid li.is-video svg { width: 40px; height: 40px; fill: rgba(255, 255, 255, 0.5); }
.album-grid .tbc { background: transparent; border-color: rgba(255, 255, 255, 0.28); color: rgba(255, 255, 255, 0.6); }

/* ---------- 폰 ---------- */
@media (max-width: 640px) {
  /* ② 03 카드 목사님 소개: 사진 자리는 위에 낮게, 글은 그 아래 */
  .pastor-card { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .pastor-card .pastor-photo { aspect-ratio: auto; height: 15vh; }
  .pastor-card .pastor-photo .tbc { left: 6px; top: 6px; font-size: 12px; padding: 0 6px; }
  .pastor-eng { display: none; }
  .pastor-card .val-title { margin-bottom: 0; }
  .pastor-card .pastor-greet { margin-top: 10px; font-size: 14.5px; }
  .pastor-card .pastor-team { margin: 14px 0 16px; padding-top: 10px; gap: 4px; }
  .pastor-card .pastor-team li { font-size: 14.5px; }
  .pastor-card .pastor-team li span { font-size: 12.5px; }
  .val-photo { height: 17vh; margin-bottom: 16px; }
  .val-title { margin-bottom: 12px; }
  .val-copy { margin-bottom: 16px; }

  /* ③ 큰 제목이 없어져 사진이 글 옆에 걸리지 않게, 이름표 바로 밑 가로 사진 한 장 */
  /* 짧은 폰에서도 세 띠와 본문이 머리글과 넘김 막대 사이에 오게 한다. */
  .scene-bands {
    --band-tighten: clamp(0px, calc((840px - 100dvh) / 10), 6px);
    --band-h: calc(var(--bar-w) - var(--band-tighten));
    --tag-h: calc(26px - var(--band-tighten));
    padding-bottom: calc(var(--sheet-bot) + 36px - 4 * var(--band-tighten));
  }
  .scene-bands .band-tag { padding-top: calc(9px - var(--band-tighten)); }
  .band-inner.has-photo { display: flex; position: relative; }
  .min-photo {
    width: 100%; height: clamp(56px, 9vh, 110px); aspect-ratio: auto; margin: 0 0 12px;
  }
  .min-photo.worship-player { width: 80%; height: auto; align-self: center; margin-bottom: 8px; }
  .worship-history:not([hidden]) { margin-top: 6px; }
  .worship-history .cards-arrow { width: 22px; height: 36px; }
  .worship-history .cards-arrow svg { width: 12px; height: 12px; }
  .worship-thumbs button { flex-basis: 64px; }
  .min-photo.outreach-photo { height: auto; aspect-ratio: 16 / 9; }
  .band-inner.has-photo { padding-top: calc(6px + var(--sheet-inset, 0px)); padding-bottom: 8px; }
  .band-inner.has-photo > .min-grid { margin-bottom: 8px; }
  .band-inner .min-col { gap: 10px; }
  .band-inner .min-grid { gap: 8px; }
  .band-inner :is(.min-items, .min-list li, .min-dl dt, .min-dl dd, .min-steps b, .min-steps span) {
    line-height: 1.45;
  }
  .band-inner.has-worship-player > .min-grid { gap: 6px; margin-bottom: 4px; }
  .has-worship-player .min-col { gap: 6px; }
  .has-worship-player :is(.min-list li, .min-dl dt, .min-dl dd, .min-steps b, .min-steps span) { line-height: 1.35; }
  .has-worship-player .min-steps { gap: 3px; }
  .has-worship-player .min-steps li { grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; }
  .band-inner .min-steps li::before { width: 20px; height: 20px; line-height: 20px; }
  .band-inner .min-steps b { font-size: 14px; word-break: keep-all; overflow-wrap: anywhere; }
  .band-inner .min-steps span { font-size: 13.5px; }
  .band-inner .outreach-missions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band-inner .outreach-missions li {
    grid-template: auto 1fr / 20px minmax(0, 1fr);
    align-content: start; gap: 3px 5px;
  }
  .band-inner .outreach-missions li::before { grid-row: auto; }
  .band-inner .outreach-missions span { grid-column: 1 / -1; }
  .outreach-missions a { grid-template-columns: minmax(0, 1fr); gap: 3px; padding-left: 25px; }
  .outreach-missions a:focus-visible b { outline: 2px solid var(--blue); }
  .stair-grid {
    grid-template: repeat(2, clamp(44px, 6vh, 60px)) / repeat(6, minmax(0, 1fr));
    aspect-ratio: auto;
  }
  .stair-grid li:nth-child(1) { grid-area: 1 / 5 / auto / span 2; }
  .stair-grid li:nth-child(2) { grid-area: 1 / 4; }
  .stair-grid li:nth-child(3) { grid-area: 1 / 2 / auto / span 2; }
  .stair-grid li:nth-child(4) { grid-area: 1 / 1; }
  .stair-grid li:nth-child(5) { grid-area: 2 / 6; }
  .stair-grid li:nth-child(6) { grid-area: 2 / 4 / auto / span 2; }
  .stair-grid li:nth-child(7) { grid-area: 2 / 3; }
  .min-grid.min-community { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }

  /* ④ 선교 덱 */
  .hope-missions { --mc-w: clamp(200px, min(72vw, 100dvh - 420px), 560px); --mc-cap: 100px; gap: 14px; }
  .mdeck-cap { margin-top: 12px; }
  .mdeck-title { font-size: 22px; }
  .mdeck-place { font-size: 15px; margin-top: 4px; }

  /* 모달: S와 M은 아래에서 올라오는 시트 */
  dialog.modal:not(.modal-f) {
    width: 100vw;
    max-height: 90dvh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }
  dialog.modal:not(.modal-f)[open] { animation: sheet-in 0.42s var(--ease-soft) both; }
  .modal-bar { height: 54px; padding: 0 8px 0 20px; }
  .modal-body { padding: 22px 20px 36px; }
  .modal-hero { margin: -22px -20px 22px; height: 170px; }
  .modal h3 { margin-top: 32px; }
  .modal .cards { grid-template-columns: 1fr; }
  .modal .tbl { font-size: 15.5px; }
  .modal .tbl th, .modal .tbl td { padding: 9px 8px; }
  .about-values li { grid-template-columns: 1fr; gap: 10px; }
  .about-values figure { aspect-ratio: 16 / 9; }
  .album-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-lead { grid-template-columns: 88px 1fr; gap: 16px; }
  .staff-lead .pastor-photo { width: 88px; height: 110px; border-radius: 6px; }
  .staff-lead .pastor-photo .tbc { display: none; }
  .staff-list { grid-template-columns: 1fr; }

  /* 앨범: 2열, 해 고르기는 제목 밑 줄로 */
  .modal-f .modal-bar { height: auto; flex-wrap: wrap; padding: 10px 6px 8px 18px; row-gap: 6px; }
  .modal-f .album-tabs { order: 3; width: 100%; margin-left: -10px; }
  .album-tabs button { padding: 6px 10px; font-size: 14px; }
  .modal-f .modal-body { padding: 20px 14px 40px; }
  .album-head { margin-bottom: 16px; }
  .album-grid { gap: 6px; }
}
@keyframes sheet-in { from { translate: 0 100%; } to { translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  dialog.modal[open], dialog.modal::backdrop, dialog.modal:not(.modal-f)[open] { animation: none; }
}

/* 덧붙임: 작은 글 조각 */
.about-values .num { font-family: var(--eng); font-size: 14px; font-weight: 600; letter-spacing: 0.16em; color: var(--gray); margin-inline-end: 10px; vertical-align: 2px; }
.modal .sub { margin: 22px 0 8px; font-size: 16px; font-weight: 600; color: var(--gray); }
.staff-list div { min-width: 0; }

/* 홈 안내: 처음 방문하는 순서 */
.guide-sub { margin: 24px 0 6px; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.guide-steps { list-style: none; margin: 0; padding: 0; counter-reset: gs; }
.guide-steps li { counter-increment: gs; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; padding: 11px 0; border-bottom: 1px solid #e3e8ee; }
.guide-steps li::before { content: counter(gs); width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font: 600 14px/26px var(--eng); text-align: center; margin-top: 2px; }
.guide-steps b, .guide-steps span { grid-column: 2; }
.guide-steps b { display: block; font-weight: 600; color: var(--ink); }
.guide-steps span { color: #4a5059; font-size: 16.5px; line-height: 1.7; }

/* 아이패드 폭(가로 1376, 1180, 세로 820): HOPE 로고는 줄이고 선교 앨범은 키운다.
   해, 제목, 점은 그대로 첫 화면에 들어온다 */
@media (min-width: 700px) and (max-width: 1400px) and (min-height: 600px) {
  .scene-logo { gap: clamp(20px, 3.4vh, 40px); }
  .scene-logo .hope-logo { width: min(19vw, 210px); }
  .hope-missions { --mc-w: clamp(260px, min(58vw, 100dvh - 456px), 640px); }
}

/* 낮은 가로 화면(가로로 돌린 폰): 로고를 줄이고 설명 줄을 덜어 한 화면에 맞춘다 */
@media (max-height: 560px) {
  .scene-logo .hope-logo { width: min(18vw, 130px); }
  .hope-missions { --mc-w: clamp(130px, calc(100dvh - 250px), 560px); --mc-cap: 66px; gap: 8px; }
  .mdeck-cap { margin-top: 8px; }
  .mdeck-title { font-size: 19px; }
  .mdeck-place { display: none; }
}
@media (max-height: 420px) {
  .scene-logo .hope-brand { display: none; }
  .hope-missions { --mc-w: clamp(120px, calc(100dvh - 190px), 560px); }
}

/* 터치 큰 화면(아이패드): 움직이는 카드 위의 흐림 효과는 걷고, 넘김 때 농도만 바뀌는 그림자 판은
   따로 띄워 두어 매 프레임 다시 그리지 않게 한다. PC(마우스)와 폰은 그대로 */
@media (hover: none) and (pointer: coarse) and (min-width: 700px) {
  .mdeck-photo img { transition: none; }
  .card-rise, .band-rise { will-change: opacity; }
}

/* 섬기는 사람들: About 안, 교회 위치 위 */
.ab-staff { max-width: 880px; margin: 0 auto clamp(72px, 11vh, 130px); }
.ab-staff .community-head { margin-bottom: clamp(28px, 4.5vh, 48px); }

/* Value 세 장의 사진을 카드 위쪽 끝에서 끝까지 표시한다. */
.acc-inner-full { padding-inline: 0; justify-content: flex-start; }
.acc-inner-full .val-photo-full { max-width: none; width: 100%; height: clamp(220px, 40vh, 400px); border-radius: 0; flex: none; }
.acc-inner-full :is(.val-title, .val-copy) { padding-inline: clamp(20px, 3vw, 56px); }
@media (max-width: 767px) {
  .acc-inner-full .val-photo-full { height: 30vh; }
  .acc-inner-full :is(.val-title, .val-copy) { padding-inline: 16px; }
}

/* ---------- 사진 크게 보기 ---------- */
dialog.album-zoom {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; inset: 0; padding: 0; border: 0;
  background: rgba(8, 9, 12, 0.94); color: #fff;
  display: none; place-items: center;
}
dialog.album-zoom[open] { display: grid; animation: modal-fade 0.3s var(--ease-soft) both; }
dialog.album-zoom::backdrop { background: transparent; }
.album-zoom img { max-width: 94vw; max-height: 90dvh; width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.album-zoom button {
  position: absolute; display: grid; place-items: center;
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer;
}
.album-zoom button:hover, .album-zoom button:focus-visible { background: rgba(255, 255, 255, 0.24); }
.album-zoom .az-close { top: 14px; right: 14px; }
.album-zoom .az-nav { top: 50%; translate: 0 -50%; }
.album-zoom .az-prev { left: 14px; }
.album-zoom .az-next { right: 14px; }
@media (max-width: 640px) {
  .album-zoom .az-nav { top: auto; bottom: 18px; translate: 0 0; }
  .album-zoom .az-prev { left: calc(50% - 56px); }
  .album-zoom .az-next { right: calc(50% - 56px); }
}
@media (prefers-reduced-motion: reduce) {
  :is(.album-grid, .stair-grid).js-reveal li { opacity: 1; translate: none; transition: none; }
  .album-grid img { transition: none; }
  dialog.album-zoom[open] { animation: none; }
}

/* 12-02 형: 가치 카드 글은 두 줄. 넓은 화면에서 둘째 줄이 한 줄에 들어가게 글자 크기를 칸 폭에 맞춘다 */
@media (min-width: 768px) {
  .val-copy { max-width: none; container-type: inline-size; }
  .val-copy .vc-fit { display: block; font-size: max(14px, min(1em, calc(100cqi / 43))); }
}

/* 12-02 형: 예배 영상 위 제목 */
.worship-head { margin: 0 0 12px; }

/* 12-02 형: HOPE 선교 넘김, 화면 좌우 끝에 겹쳐 놓는 화살표 */
.hope-missions { position: relative; }
.mdeck-arrow {
  position: absolute; z-index: 20;
  top: calc(var(--mc-w) / 2); translate: 0 -50%;
  width: 56px; height: 56px; padding: 0; border: 0; background: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  filter: drop-shadow(0 1px 5px rgba(0, 0, 0, 0.35));
  transition: opacity 0.3s var(--ease-soft);
}
.mdeck-prev { left: calc(50% - 50vw + 16px); }
.mdeck-next { right: calc(50% - 50vw + 16px); }
.mdeck-arrow svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mdeck-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
.mdeck-arrow[disabled] { opacity: 0.3; cursor: default; }
@media (max-width: 767px) {
  .mdeck-arrow { width: 44px; height: 44px; }
  .mdeck-arrow svg { width: 26px; height: 26px; }
  .mdeck-prev { left: calc(50% - 50vw + 2px); }
  .mdeck-next { right: calc(50% - 50vw + 2px); }
}

/* 12-02 형: 앨범 창은 오른쪽 위 X 대신 가운데 아래에 떠 있는 「앨범 닫기」 */
.modal-f .modal-bar:empty { display: none; }
.modal-f .modal-body { padding-bottom: calc(clamp(40px, 6vh, 72px) + 72px); }
.album-close {
  position: absolute; z-index: 5;
  left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(16px, 3vh, 28px));
  translate: -50% 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px 13px 20px;
  border: 0; border-radius: 999px;
  background: #fff; color: var(--ink);
  font: 600 16px/1 var(--sans);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: background 0.25s var(--ease-soft);
}
.album-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.album-close:hover, .album-close:focus-visible { background: #e9edf2; }
@media (max-width: 767px) {
  .modal-f .modal-body { padding-bottom: calc(40px + 64px); }
  .album-close { padding: 12px 20px 12px 17px; font-size: 15px; }
}
