/* =========================================================
   고잉처치 (GOING CHURCH) — 정적 사이트 스타일시트
   컬러 컨셉: "함께 걸어가는 여정" — 따뜻한 테라코타(여정의 온기) +
   깊은 슬레이트 블루(신뢰·믿음) + 부드러운 아이보리 배경.
   ========================================================= */

:root {
  /* --- 색상 팔레트 --- */
  --color-bg: #FAF6F1;           /* 따뜻한 아이보리 배경 */
  --color-bg-alt: #F2EBE1;       /* 섹션 교차용 소프트 샌드 */
  --color-surface: #FFFFFF;      /* 카드 배경 */
  --color-text: #33302C;         /* 웜 차콜 본문 */
  --color-text-muted: #6B655D;   /* 보조 텍스트 */
  --color-border: #E4DACB;       /* 구분선 */

  --color-primary: #C1694F;      /* 테라코타 — 메인 액션 */
  --color-primary-dark: #A6543D;
  --color-secondary: #435560;    /* 딥 슬레이트 블루 — 헤더/푸터 */
  --color-secondary-dark: #313F48;
  --color-accent: #D9A441;       /* 골드 — 포인트 강조 */

  --font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;

  --header-height: 88px;
  --radius: 14px;
  --shadow-soft: 0 8px 24px rgba(51, 48, 44, 0.08);
  --max-width: 1120px;
}

/* --- 리셋 & 기본 --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }

.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;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* 접근성: 키보드 포커스 표시 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 88px 0; }
.section.hero { padding: 0; }
.section:nth-of-type(even) { background: var(--color-bg-alt); }

.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 900;
  margin: 0 0 8px;
  text-align: center;
  letter-spacing: -0.01em;
}

.section-sub {
  text-align: center;
  color: var(--color-text-muted);
  margin: 0 0 40px;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
  font-size: 1rem;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-outline {
  background: transparent;
  border-color: #fff;
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.15); }

/* =========================================================
   헤더 & 네비게이션
   ========================================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(250, 246, 241, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.logo-img {
  height: 44px;
  width: auto;
}

.logo-wide {
  height: 64px;
  width: auto;
  display: block;
}

.main-nav ul {
  display: flex;
  gap: 8px;
}

.nav-link {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 500;
  color: var(--color-secondary-dark);
  transition: background .2s ease, color .2s ease;
}
.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
  background: var(--color-primary);
  color: #fff;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--color-secondary-dark);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   히어로 (Home)
   ========================================================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding-top: var(--header-height);
  /* 히어로 이미지가 준비되면 아래 그라디언트 위에
     background-image: url('../images/hero.jpg'); background-size: cover; background-position: center;
     를 추가하고 어둡게 하려면 그라디언트를 반투명 오버레이로 남겨두세요. */
  background: linear-gradient(135deg, var(--color-secondary-dark) 0%, var(--color-secondary) 45%, var(--color-primary) 100%);
}

.hero-inner {
  max-width: 720px;
  padding: 0 24px;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--color-accent);
  margin-bottom: 18px;
  font-weight: 700;
}

.hero-title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.35;
  margin: 0 0 20px;
}

.hero-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.88);
  margin: 0 0 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* =========================================================
   예배안내 요약 카드
   ========================================================= */
.worship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}

.worship-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.worship-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: #F6E4DB;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.worship-time {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--color-secondary-dark);
  margin: 0;
}

/* =========================================================
   이번주 말씀 (유튜브)
   ========================================================= */
.video-wrap {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: #111;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* 설교 목록 (최근 4편) */
.sermon-list {
  list-style: none;
  padding: 0;
  margin: 22px auto 0;
  max-width: 860px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.sermon-list > li {
  min-width: 0;
}

.sermon-item {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.sermon-item:hover,
.sermon-item:focus-visible {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.sermon-item.is-active {
  border-color: var(--color-primary);
}

.sermon-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 12px 16px;
}

.sermon-title {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.35;
  color: var(--color-secondary-dark);
}

.sermon-item.is-active .sermon-title {
  color: var(--color-primary-dark);
}

.sermon-meta {
  font-size: .8rem;
  color: var(--color-text-muted);
}

.sermon-more {
  text-align: center;
  margin: 18px 0 0;
}

.sermon-more a {
  color: var(--color-primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.sermon-more a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .sermon-list { grid-template-columns: 1fr; }
}

/* =========================================================
   교회소식
   ========================================================= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.news-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.news-card > a {
  display: block;
  width: calc(100% + 52px);
  margin: -26px -26px 18px;
}

.news-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top center;
  transition: opacity 0.15s ease;
}

.news-card > a:hover .news-image,
.news-card > a:focus-visible .news-image {
  opacity: 0.85;
}

.news-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.news-card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--color-secondary-dark);
}

.news-card p:last-child {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.94rem;
}

/* =========================================================
   About
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 56px;
}

.pastor-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  align-items: center;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-soft);
}

.pastor-photo {
  width: 180px;
  height: 180px;
  margin: 0 auto 16px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  box-shadow: var(--shadow-soft);
}

.pastor-role {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.pastor-name {
  margin: 4px 0 0;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--color-secondary-dark);
}

.pastor-profile {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
  word-break: keep-all;
  padding-left: 36px;
  border-left: 1px solid var(--color-border);
}

.pastor-profile dl { margin: 0; }

.pastor-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pastor-profile dt {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-primary-dark);
}

.pastor-profile dd {
  margin: 0 0 2px;
  padding-left: 12px;
  position: relative;
}

.pastor-profile dd::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
}

.welcome-message {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-soft);
}

.welcome-message h3 {
  margin: 0 0 14px;
  color: var(--color-secondary-dark);
}

.welcome-message p {
  margin: 0;
  color: var(--color-text);
}

.worship-detail h3 {
  text-align: center;
  color: var(--color-secondary-dark);
  margin-bottom: 20px;
}

.worship-table {
  max-width: 560px;
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.worship-table th,
.worship-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.worship-table thead th {
  background: var(--color-secondary);
  color: #fff;
  font-weight: 700;
}

.worship-table tbody tr:last-child td,
.worship-table tbody tr:last-child th {
  border-bottom: none;
}

/* =========================================================
   Community
   ========================================================= */
.new-family {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow-soft);
}

.new-family h3 {
  margin: 0 0 12px;
  color: var(--color-secondary-dark);
  font-size: 1.3rem;
}

.new-family p {
  color: var(--color-text-muted);
  margin: 0 0 24px;
}

.gallery h3 {
  text-align: center;
  color: var(--color-secondary-dark);
  margin-bottom: 6px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.gallery-item {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--color-bg-alt), var(--color-border));
  box-shadow: var(--shadow-soft);
}

/* =========================================================
   Contact
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-soft);
}

.form-row {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-secondary-dark);
}

.form-row input,
.form-row textarea {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.98rem;
  background: var(--color-bg);
  color: var(--color-text);
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--color-primary);
}

.form-status {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--color-primary-dark);
  min-height: 1.2em;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.info-block h3 {
  margin: 0 0 12px;
  color: var(--color-secondary-dark);
}

.info-block address {
  font-style: normal;
  color: var(--color-text-muted);
  margin: 0 0 18px;
}

.map-embed {
  display: block;
  border-radius: 10px;
  min-height: 220px;
}

.map-placeholder {
  height: 220px;
  border-radius: 10px;
  background: repeating-linear-gradient(
    45deg,
    var(--color-bg-alt),
    var(--color-bg-alt) 12px,
    var(--color-border) 12px,
    var(--color-border) 24px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-muted);
}

.map-placeholder p { margin: 0; font-weight: 600; }
.map-placeholder span { font-weight: 400; font-size: 0.85rem; }

.account-placeholder {
  color: var(--color-text-muted);
  margin: 0;
}

.account-info {
  color: var(--color-text);
  font-weight: 600;
  margin: 0;
  line-height: 1.6;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--color-secondary-dark);
  color: rgba(255,255,255,0.82);
  padding: 48px 0;
  text-align: center;
}

.footer-inner p { margin: 6px 0; font-size: 0.92rem; }

.footer-logo {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 14px !important;
}
.footer-logo span {
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.6);
  margin-left: 8px;
}

.footer-copy {
  margin-top: 20px !important;
  font-size: 0.8rem !important;
  color: rgba(255,255,255,0.5);
}

/* =========================================================
   목록형 세부 페이지 (주보/행사/외부행사)
   ========================================================= */
.list-page {
  padding-top: 140px;
  min-height: 60vh;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
}

.item-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.item-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.item-card > a {
  display: block;
}

.item-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: opacity 0.15s ease;
}

.item-image--poster {
  /* 글자가 있는 포스터는 잘리지 않도록 전체를 보여준다 */
  object-fit: contain;
  background: var(--color-bg-alt);
}

.item-card > a:hover .item-image,
.item-card > a:focus-visible .item-image {
  opacity: 0.85;
}

.item-body {
  padding: 20px 22px 24px;
}

.item-date {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}

.item-body h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--color-secondary-dark);
}

.item-body p:last-child {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* =========================================================
   반응형 — 태블릿 / 모바일
   ========================================================= */
@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .welcome-message {
    text-align: left;
  }
  .pastor-card {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .pastor-profile {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-left: 0;
    padding-top: 22px;
    border-left: 0;
    border-top: 1px solid var(--color-border);
    max-width: 300px;
    margin: 0 auto;
    width: 100%;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .section { padding: 64px 0; }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .main-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .main-nav ul {
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 4px;
  }
  .nav-link {
    display: block;
    padding: 14px 16px;
  }

  .hamburger { display: flex; }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }

  .hide-mobile { display: none; }
}

@media (max-width: 480px) {
  .header-inner { padding: 0 16px; }
  .container { padding: 0 16px; }
  .logo-text { font-size: 0.92rem; }
  .logo-wide { height: 50px; }
  .worship-grid { grid-template-columns: repeat(2, 1fr); }
}

.item-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: var(--color-primary); border-radius: 999px; vertical-align: 1px;
}
.item-intro { text-align: center; color: var(--color-text-muted); margin: -8px 0 0; }

/* 외부 링크: WFM재정연구소 */
.pastor-profile .ext-link {
  color: var(--color-primary, inherit);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pastor-profile .ext-link::after { content: " ↗"; font-size: 0.8em; }
.footer-partner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 640px;
  margin: 28px auto 8px;
  padding: 14px 22px 14px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  text-align: left;
  transition: background .2s, transform .2s;
}
.footer-partner:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.footer-partner img {
  width: 240px;
  height: auto;
  border-radius: 10px;
  flex-shrink: 0;
}
.footer-partner-text strong { display: block; color: #fff; font-size: 1.15rem; margin-bottom: 4px; }
.footer-partner-text span { font-size: 0.85rem; color: rgba(255,255,255,0.75); line-height: 1.5; }
@media (max-width: 560px) {
  .footer-partner { flex-direction: column; text-align: center; padding: 18px; }
  .footer-partner img { width: 220px; }
}
