/* Phone layer (owner, 2026-11-22): a phone is not a squeezed desktop. Rules from the mobile reference study
   (docs/research/mobile-rea.md): smaller headings, body 15/24, tighter rhythm, one slim header that steps aside while
   reading, sub-tabs that stay in view, and only what a visitor needs. Everything here is phone-only; desktop is unchanged. */
@media (max-width: 760px) {
  :root { --t-h1: 28px; --t-h2: 21px; --t-h3: 18px; --t-lead: 17px; --t-body: 15px; --t-small: 14px; --t-cap: 13px;
    --header-h: 56px; --s4: 24px; --s5: 40px; --s6: 56px; }
  .is-home, .is-inner { --sec: 48px; }
  p, li, dd { line-height: 1.6; }

  /* one slim header (56px) and the bottom bar both step aside on scroll down, return on scroll up */
  .header-in { min-height: 56px !important; height: 56px !important; padding-top: 0 !important; padding-bottom: 0 !important; }
  .header, .bar { transition: transform var(--spring-snappy-dur) var(--spring-snappy); }
  .menu-btn { display: inline-flex !important; align-items: center; justify-content: center; line-height: 1 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
  body.chrome-hide .header { transform: translateY(-100%); }
  body.chrome-hide .bar { transform: translateY(100%); }

  /* page head: the title only; no breadcrumb or subline */
  .page-head { display: contents; }
  .crumb, .page-line { display: none !important; }
  .page-title { margin: 16px var(--margin) 12px; font-size: var(--t-h1) !important; line-height: 34px; }

  /* sub-tabs: a sticky strip under the header, underline for the active tab */
  .subnav { position: sticky; top: var(--header-h); z-index: var(--z-sticky); display: flex; flex-wrap: nowrap; gap: 0; overflow-x: auto;
    width: auto; max-width: none; margin: 0 0 var(--s3); padding: 0 var(--margin); border-radius: 0;
    background: rgba(247,246,242,.97); box-shadow: inset 0 -1px 0 var(--rule); transition: transform var(--spring-snappy-dur) var(--spring-snappy); scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  body.chrome-hide .subnav { transform: translateY(calc(-1 * var(--header-h))); }   /* follows the header up without re-laying out */
  .subnav a { flex: 1 0 auto; justify-content: center; min-height: 44px; padding: 0 12px; border-radius: 0; background: none !important;
    box-shadow: inset 0 -2px 0 transparent !important; font-size: 15px; white-space: nowrap; }
  .subnav a[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--ink) !important; }

  /* sections: whitespace between them, no heavy rule above every heading */
  .sh { border-top: 0 !important; padding-top: 0 !important; }
  .sh p { font-size: var(--t-small) !important; }

  /* a heading that repeats the active tab stays for screen readers only */
  main[data-page="history"] .sec:first-of-type > .sh h2,
  main[data-page="staff"] .sec:first-of-type > .sh h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  /* decorative art and intros the title already says */
  .greet-art, .album-lead, #gallery .sh p { display: none !important; }
}

/* ---------- per page, phone only: keep what a visitor needs, drop what repeats or decorates ---------- */
@media (max-width: 760px) {
  /* home: the service times reach the first screen */
  .hm-hero { height: 64svh !important; min-height: 380px !important; }

  /* 교회 소개: the four statements and values as quiet rows; the growth words as one line; partner names without the long notes */
  .in-four li { grid-template-columns: 32px 1fr; padding: 8px 0; font-size: var(--t-body) !important; line-height: 1.5; }
  .in-words { display: block; font: 700 var(--t-lead)/1.6 var(--sans); color: var(--ink); }
  .in-words li { display: inline; padding: 0; border-radius: 0; background: none !important; color: var(--ink) !important; font: inherit; }
  .in-words li + li::before { content: " · "; color: var(--ink-3); font-weight: 400; }
  .in-words span { display: none; }
  .in-grow .in-words li { opacity: 1 !important; transform: none !important; }
  .in-words::after { content: " 성장합니다"; font-weight: 400; color: var(--ink-2); }
  .in-values li { padding: 8px 0; font-size: var(--t-body) !important; }
  .in-bonds dd { display: none; }
  .in-bonds div { padding: 8px 0; }

  /* 걸어온 길: words carry the story; only the last ("지금") photo stays */
  .tl-stage, .tl-list li:not(:last-child) .tl-inline { display: none !important; }
  .tl-list li { padding: var(--s2) 0; }

  /* 섬기는 분들: photo beside name and role; the facts run full width below */
  .st-lead { grid-template-columns: 88px minmax(0, 1fr) !important; column-gap: 16px !important; align-items: start; }
  .st-lead > img { grid-row: 1 / span 3; width: 88px !important; }
  .st-lead-in { display: contents; }
  .st-lead .st-role, .st-lead h3, .st-lead .st-motto { grid-column: 2; margin: 0; }
  .st-lead .st-facts { grid-column: 1 / -1; margin-top: var(--s2); }
  .st-lead .st-facts div { grid-template-columns: 88px minmax(0, 1fr) !important; column-gap: 16px; }

  /* 예배: no decorative plate; five past sermons, the channel link has the rest */
  #sermon .plate { display: none; }
  #sermon .archive li:nth-child(n+6) { display: none; }

  /* 앨범: four events of the newest year before "더 보기" */
  .al-year.is-partial .al-ev:nth-of-type(n+5) { display: none; }
}

/* ---------- motion and loading states (all sizes) ---------- */
/* page to page: a short cross-fade instead of a blink; the header stays put (browsers without support just navigate) */
/* page transitions live in elim-fluid.css */

/* remote photos fade in on a quiet tile; a broken photo keeps the tile instead of a broken-image icon */
.img-fade img[src*="google"] { opacity: 0; transition: opacity var(--spring-smooth-dur) var(--spring-smooth); background: #EEEDE7; }
.img-fade img[src*="google"].is-in { opacity: 1; }
.img-fade img[src*="google"].is-broken { opacity: 1; color: transparent; }
@media (prefers-reduced-motion: reduce) { .img-fade img[src*="google"] { transition: none; } }

/* album: a year that failed to load says so, with one way to retry */
.al-fail { margin: 0 0 var(--s2); font: 400 var(--t-small)/1.5 var(--sans); color: var(--ink-2); }
.al-fail button { min-height: 44px; margin-left: 8px; padding: 0 12px; border: 0; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--rule); font: 600 var(--t-small)/1 var(--sans); color: var(--ink); cursor: pointer; }
