/* 주평교회 홈페이지 — 공통 스타일 (T-01a/T-02)
   팔레트·대비는 docs/03 §5 실측값. 고령 친화: 본문 ≥18px, 터치표적 ≥44px, 360px 무가로스크롤.
   웹폰트 없음(외부 의존 0·NFR). JS 없음. */

:root {
  --ink:    #1A1A1A;  /* 제목·구조 (흰 배경 17.4:1) */
  --ink-70: #4D4D4D;  /* ★T-13 본문·메뉴 = 먹농도 70% (흰 8.45:1 · 표어섹션 7.75:1 · 예배표헤더 7.97:1 — 전부 AAA) */
  --meta:   #4A4A4A;  /* 보조 (8.87:1) */
  --accent: #1E40AF;  /* 링크·버튼 (8.72:1, 위 흰글자 8.72:1) */
  --bg:     #FFFFFF;
  --panel:  #1A1A1A;  /* 히어로 단색 불투명 패널 (흰글자 17.4:1) */
  --line:   #D8D8D8;
  --maxw:   64rem;
  /* ★T-08i 교회 소개 타이포 색조 — 로고·캘리그래피 실색 파생·WCAG 실측(흰 배경 기준).
     순검정 지양: 본문=진회색. 제목·강조=브랜드 파스telle 어둡게(대비 통과). 고령우선. */
  --intro-ink:      #2A2A2A;  /* 소개 본문 (흰 배경 14.35:1) */
  --intro-meta:     #4A4A4A;  /* 소개 보조 (8.86:1) */
  --brand-teal:     #34818A;  /* 대제목·섹션 제목 (청록·4.51:1) */
  --brand-orange:   #9A6E22;  /* 섹션 번호 (주황·4.54:1) */
  --brand-green:    #3A6534;  /* 존재목적 강조 헤더 (초록·틴트 6.22:1·흰 6.79:1) */
  --intro-emph-bg:  #F1F6F4;  /* 존재목적 강조블록 배경(연청록 틴트) */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  font-size: 18px;                /* 고령 친화 본문 ≥18px */
  line-height: 1.65;
  color: var(--ink-70);
  background: var(--bg);
  overflow-x: hidden;             /* 360px 가로 스크롤 방지 백스톱 */
  word-break: keep-all;           /* 한글 단어 단위 줄바꿈 */
}
img { max-width: 100%; }
a { color: var(--accent); }

/* 접근성 유틸 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 .4rem 0;
}
.skip-link:focus { left: 0; }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }

/* ── 헤더 / 내비 ─────────────────────────────── */
.site-header { border-bottom: 2px solid var(--line); background: var(--bg); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding-top: .6rem; padding-bottom: .6rem; }
.brand {
  color: var(--ink); text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center; padding: 2px 4px;
}
.brand-text { font-size: 1.5rem; font-weight: 800; }   /* 로고 미승인 시 텍스트 폴백 */
.brand-logo { display: block; height: 63px; width: auto; }  /* ★T-08d 로고(T-08e 150% 확대 42→63px) — 높이 고정·종횡비 유지, width/height 속성이 CLS 방지 */
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 44px;   /* 터치표적 */
  padding: .35rem .7rem; color: var(--ink-70); text-decoration: none;
  border-radius: .4rem; font-size: 1.06rem;
}
.nav-link:hover { text-decoration: underline; }
.nav-link.is-current {                                            /* 현재 페이지 = 색 + 밑줄 이중단서 */
  color: var(--accent); font-weight: 700;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 3px;
}
.ext { font-size: .9em; }

/* ── 메인 ───────────────────────────────────── */
.main { display: block; }

/* 히어로 캐러셀 — 사진 슬라이드쇼 + 사진 위 단색 불투명 패널(scrim 아님·02 S-01 확정 · T-02b) */
.hero {
  position: relative; background: var(--ink); overflow: hidden;
  --hero-dot-clear: 68px;   /* ★T-12 dot 44px + bottom .5rem(8px) + 여백 16px — 표어 하한선 */
}

/* 16:9 고정 프레임 = 레이아웃 시프트 0(티켓②). 프레임은 뷰포트가 담당, 슬라이드는 채움. */
.hero-viewport {
  position: relative; width: 100%;
  aspect-ratio: 1600 / 901;       /* P-9 1.78:1 = 16:9 */
  min-height: 280px;              /* 모바일서 하단 패널과 좌우 nav 분리 공간 확보(02 S-01 눌림 방지 겸) */
  max-height: 74vh;
  overflow: hidden;
}
.hero-viewport:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.hero-track {
  display: flex; height: 100%; margin: 0; padding: 0; list-style: none;
  transition: transform .5s ease;
  will-change: transform;
}
.hero-slide { flex: 0 0 100%; width: 100%; height: 100%; }
.hero-img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;                            /* cover = 시프트 0·프레임 채움 */
  /* ★T-17 잘림을 위25:아래75로 배분(종전 center=50:50) — 넓고 낮은 창에서 max-height:74vh 가
     걸리면 위아래가 잘려 나가는데, 균등 배분이면 첨탑 십자가 끝이 먼저 잘린다(27" 전체화면 실측).
     상단 몫을 줄여 십자가를 살린다. 대가 = 앞마당 화단이 덜 보임(오너 승인). */
  object-position: center 25%;
}

/* 이전/다음 버튼 — 터치표적 ≥44px(고령 친화) */
.hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 48px; height: 48px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,26,26,.55); color: #fff;
  border: 2px solid rgba(255,255,255,.75); border-radius: 50%;
  font-size: 2rem; line-height: 1; cursor: pointer;
}
.hero-nav:hover { background: rgba(26,26,26,.82); }
.hero-nav:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.hero-prev { left: .6rem; }
.hero-next { right: .6rem; }

/* dot 인디케이터 — 사진 하단 중앙(오너 지시). 표적 폭 ≥44px, 시각 점은 작게. */
/* ★T-08l 감싼 네모(pill) 박스 제거 — 배경/라운드 삭제. flex·gap·z-index 유지. */
/* ★T-12 상단 → 하단 이설. 표어와 겹치지 않도록 .hero-overlay 가 --hero-dot-clear 만큼 비켜선다. */
.hero-dots {
  position: absolute; bottom: .5rem; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; gap: .2rem; padding: 0;
}
.hero-dot {
  width: 44px; height: 44px; padding: 0; margin: 0; cursor: pointer;   /* 터치표적 44×44(T-07 R1 수정1·gemini major) */
  background: transparent; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.hero-dot::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid #fff; background: transparent; transition: background .2s;
  /* ★T-08l 박스 제거 후 밝은 슬라이드(석양 등)서 흰 dot 가독 보강 — 박스 부활 없이 그림자만 */
  box-shadow: 0 1px 3px rgba(0,0,0,.6), 0 0 2px rgba(0,0,0,.55);
}
.hero-dot[aria-selected="true"]::before { background: #fff; }
.hero-dot:focus-visible { outline: 3px solid #fff; outline-offset: -2px; border-radius: .4rem; }

/* ★T-08f 히어로 표어 캘리그래피 — 검은 불투명 패널 제거, 투명 이미지 + drop-shadow로 가독 확보 */
.hero-overlay {
  position: absolute; left: 50%; bottom: max(8%, var(--hero-dot-clear)); transform: translateX(-50%); z-index: 2;
  width: 100%; display: flex; justify-content: center;
  padding: 0 1rem; box-sizing: border-box;
  pointer-events: none;                          /* 캐러셀 컨트롤 클릭 방해 안 함(표어는 하단·nav 버튼은 세로중앙이라 무충돌) */
}
.hero-motto {
  display: block; width: 88%; max-width: 520px; height: auto;  /* 모바일 ~80% 화면폭·데스크톱 최대 520px */
  /* 검은 박스 대신 은은한 그림자 — 밝은 슬라이드(석양·밝은 하늘)서도 파스텔 표어 가독 */
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.7)) drop-shadow(0 0 4px rgba(0,0,0,.55));
}
.hero-motto-text {                /* 폴백(이미지 미승인 시)·검은박스 없이 text-shadow로 가독 */
  margin: 0; text-align: center; color: #fff; font-weight: 700;
  font-size: clamp(1.1rem, 4.5vw, 1.6rem);
  text-shadow: 0 2px 8px rgba(0,0,0,.85), 0 0 4px rgba(0,0,0,.6);
}

/* prefers-reduced-motion:reduce → 슬라이드 전환 애니메이션 제거(자동전환은 JS가 OFF·티켓④) */
@media (prefers-reduced-motion: reduce) {
  .hero-track { transition: none; }
}

/* 홈 본문 */
.home-body { padding-top: 1.5rem; padding-bottom: 2.5rem; }

/* ★T-08j 홈 환영 메시지 이미지 (종전 service-card 대체) — 히어로 아래·흰 본문에 자연 조화 */
.welcome { margin: 0 auto 1.6rem; text-align: center; }
.welcome-img { display: block; width: 55%; max-width: 384px; height: auto; margin: 0 auto; }  /* ★T-08k 60% 축소(무채색 그레이본·시선 과탈취 완화): 모바일 55%·데스크톱 최대 384px */

.card { border: 1px solid var(--line); border-radius: .75rem; padding: 1.1rem 1.2rem; margin: 0 auto 1.5rem; max-width: 34rem; text-align: center; }
.service-card { background: #F7F8FC; border-color: #C9D2F0; }
.card-label { margin: 0 0 .2rem; color: var(--meta); font-size: 1rem; }
.service-time { margin: .1rem 0; font-size: 1.7rem; font-weight: 800; color: var(--ink-70); }
.service-sub { margin: .3rem 0 0; color: var(--meta); }

/* CTA 버튼 2개 */
.cta { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin: 0 auto 1.4rem; max-width: 34rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: .6rem 1.4rem; flex: 1 1 12rem;
  font-size: 1.15rem; font-weight: 700; text-decoration: none; border-radius: .6rem;
  border: 2px solid var(--accent);
}
.btn-primary { background: var(--accent); color: #fff; }        /* 8.72:1 */
.btn-primary:hover { background: #16307e; }
.btn-secondary { background: #fff; color: var(--accent); }      /* 8.72:1 */
.btn-secondary:hover { background: #EEF2FF; }

.home-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: center; margin-bottom: 1.2rem; }
.home-link { display: inline-flex; align-items: center; min-height: 44px; padding: .3rem .5rem; color: var(--accent); font-weight: 600; }

/* ── ★T-08b 교회 표어 섹션 (홈 전용) ─────────────────── */
.motto { background: #F7F5EF; border-top: 1px solid var(--line); padding: 2.2rem 0 2.6rem; }  /* 아이보리 밴드 — 파스텔 캘리그래피 대비 확보 */
.motto-inner { text-align: center; }
.motto-title { font-size: 1.4rem; font-weight: 800; color: var(--ink); margin: 0 0 1.1rem; }   /* #1A1A1A on #F7F5EF ≈ 16:1 */
.motto-img { display: block; width: 100%; max-width: 500px; height: auto; margin: 0 auto 1.5rem; }
.motto-practice { list-style: none; counter-reset: mp; margin: 0 auto; padding: 0; max-width: 32rem; text-align: left; }
.motto-item {
  counter-increment: mp; position: relative; padding: .6rem 0 .6rem 2rem;
  color: var(--ink-70); line-height: 1.55; border-top: 1px solid #E7E2D4;   /* 항목 구분선 */
}
.motto-item:first-child { border-top: 0; }
.motto-item::before { content: counter(mp) "."; position: absolute; left: 0; top: .6rem; font-weight: 800; color: var(--accent); }  /* 파랑 번호 8.72:1 */
.motto-item-ref { display: inline; margin-left: .45rem; color: var(--meta); font-size: .92rem; }  /* 성경 출처 #4A4A4A ≈ 8:1 */

/* 콘텐츠/플레이스홀더 페이지 공통 */
.page-body { padding: 2rem 1rem 3rem; }
.page-title { font-size: 1.9rem; margin: .5rem 0 1.2rem; text-align: center; color: var(--ink); }  /* ★T-13 제목은 100% 유지(body 70% 상속 차단) */
.prep { font-size: 1.15rem; color: var(--ink-70); text-align: center; }
.prep-sub { color: var(--meta); text-align: center; }
.section-title { font-size: 1.5rem; margin: 1.6rem 0 .8rem; color: var(--ink); }

/* ── T-04 설교 Tier1 임베드 ─────────────────── */
.sermon-latest { margin: 0 auto; max-width: 46rem; }
.embed-frame {              /* 16:9 고정 프레임 — Shorts 세로영상 와도 무붕괴(레터박스) */
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: .6rem; overflow: hidden;
}
.embed-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-fallback { margin: .8rem 0 0; color: var(--meta); font-size: 1.02rem; text-align: center; }
.embed-fallback a { font-weight: 700; }

/* ── T-05 Tier2 지난 설교 목록 ─────────────── */
.sermon-archive { margin: 2.2rem auto 0; max-width: 52rem; }
.sermon-msg { margin: 0 0 1rem; color: var(--meta); font-size: 1.05rem; text-align: center; }
.sermon-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.2rem; }
.sermon-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; background: #fff;
}
.sermon-card:hover { border-color: var(--accent); }
.sermon-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sermon-thumb {                     /* ★16:9 고정 — 세로영상(Shorts) 와도 무붕괴(AC-T05.8) */
  display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden;
}
.sermon-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sermon-info { display: flex; flex-direction: column; gap: .3rem; padding: .7rem .8rem .9rem; }
.sermon-title { font-size: 1.05rem; font-weight: 700; color: var(--ink-70); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sermon-date { font-size: .95rem; color: var(--meta); }

/* ── ★T-08i 교회 소개 콘텐츠 ─────────────────── */
.intro { margin: 0 auto 2.4rem; max-width: 44rem; }
.intro-headline {                                  /* 대제목 — 브랜드 청록·큰 글씨(대형 텍스트 4.51:1) */
  margin: 0 0 1.6rem; text-align: center; line-height: 1.35;
  color: var(--brand-teal); font-weight: 800;
  font-size: clamp(1.5rem, 5vw, 2rem);
}
.intro-h2 {                                        /* 섹션 제목 '1.·2.' — 청록, 상단 브랜드 라인 */
  margin: 1.8rem 0 .8rem; font-size: 1.4rem; font-weight: 800;
  color: var(--brand-teal); line-height: 1.4;
  padding-bottom: .35rem; border-bottom: 2px solid #D7E5E6;
}
.intro-num { color: var(--brand-orange); }         /* 번호만 주황(파스telle 위계·4.54:1) */
.intro-p {                                         /* 본문 — 진회색(순검정 아님·14.35:1) */
  margin: .7rem 0; color: var(--intro-ink); line-height: 1.75; font-size: 1.08rem;
}
.intro-emph {                                      /* 존재 목적 강조블록 — 연청록 틴트·가운데 정렬 */
  margin: 1.5rem 0; padding: 1.4rem 1.2rem; text-align: center;
  background: var(--intro-emph-bg); border-radius: .7rem;
  border: 1px solid #DCEAE7;
}
.intro-emph-title {                                /* 강조 헤더 — 브랜드 초록(틴트 위 6.22:1) */
  margin: 0 0 .7rem; font-size: 1.2rem; font-weight: 800; color: var(--brand-green);
}
.intro-emph-body {                                 /* 강조 본문 — 진회색(틴트 위 13.14:1) */
  margin: 0; color: var(--intro-ink); line-height: 1.7; font-size: 1.06rem;
}

/* ── T-03 교회안내 ──────────────────────────── */
.guide-section { margin: 0 auto 2rem; max-width: 40rem; }
.service-table { width: 100%; border-collapse: collapse; margin: .3rem 0; }
.service-table th, .service-table td {
  padding: .7rem .5rem; text-align: left; border-bottom: 1px solid var(--line);
  font-size: 1.05rem; vertical-align: top;
}
.service-table thead th { background: #F7F8FC; font-weight: 700; color: var(--ink-70); border-bottom: 2px solid #C9D2F0; }
.service-table th[scope="row"] { font-weight: 700; color: var(--ink-70); }
.service-table td { color: var(--meta); }
.guide-line { margin: .55rem 0; font-size: 1.1rem; }
.guide-label { display: inline-block; min-width: 4.8rem; font-weight: 700; color: var(--meta); }
.guide-val { color: var(--ink-70); }
.guide-tel { font-weight: 700; }               /* tel: 링크 강조(고령친화) */
.guide-map { display: block; width: 100%; border-radius: .6rem; margin: 1rem 0; border: 1px solid var(--line); }
.guide-mapbtn { display: inline-flex; flex: 0 1 auto; margin: .6rem 0; }

/* ── T-06 소식·앨범 ─────────────────────────── */
.album { margin: 0 auto 1.5rem; max-width: 52rem; }
.album-grid { display: grid; gap: 1rem; }
.album-grid-1 { grid-template-columns: 1fr; }
.album-grid-2 { grid-template-columns: repeat(2, 1fr); }
.album-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .album-grid-2, .album-grid-3 { grid-template-columns: 1fr; } }
.album-item { margin: 0; }
.album-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: .5rem; border: 1px solid var(--line); }
.album-thumb img { width: 100%; height: 100%; object-fit: cover; }
.album-cap { font-size: .95rem; color: var(--meta); margin: .35rem 0 0; text-align: center; }
/* 확대 보기 — CSS :target(외부 JS 0) */
.album-lightbox {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.92); align-items: center; justify-content: center; padding: 1rem;
}
.album-lightbox:target { display: flex; }
.album-lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; border-radius: .3rem; }
.album-close {
  position: absolute; top: 1rem; right: 1rem; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2rem; line-height: 1; background: rgba(0,0,0,.55);
  border-radius: 50%; text-decoration: none;
}
.album-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.news-cafe { text-align: center; margin: 1.5rem auto 0; max-width: 34rem; }
.news-cafe-lead { font-size: 1.15rem; color: var(--ink-70); margin: 0 0 1rem; }
.news-cafe .btn { display: inline-flex; flex: 0 1 auto; }
.news-cafe-note { font-size: 1rem; color: var(--meta); margin: .8rem 0 0; }

/* ── 푸터 ───────────────────────────────────── */
.site-footer { border-top: 2px solid var(--line); background: #FAFAFA; margin-top: 1rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; align-items: center; padding: 1.3rem 1rem; color: var(--meta); font-size: 1rem; }
.f-name { font-weight: 700; color: var(--ink-70); }
.f-cafe { font-weight: 600; }

/* ── 반응형 ─────────────────────────────────── */
@media (max-width: 699px) {
  .hero-overlay { bottom: max(7%, var(--hero-dot-clear)); }
}
@media (min-width: 700px) {
  .header-inner { flex-wrap: nowrap; justify-content: space-between; }
  .hero-overlay { bottom: max(11%, var(--hero-dot-clear)); }
}
