/* =========================================================
   의의나무교회 — Oaks Community Church
   Design System v2
   ========================================================= */

:root {
  /* Sage green + cream palette */
  --sage-50:  #f4f6f1;
  --sage-100: #e6ebdf;
  --sage-200: #cdd6bf;
  --sage-300: #a9b894;
  --sage-400: #889a71;
  --sage-500: #6b7d56;
  --sage-600: #556544;
  --sage-700: #434f37;
  --sage-800: #2f382a;
  --sage-900: #1d231a;

  --cream-50:  #fcfaf4;
  --cream-100: #f7f2e6;
  --cream-200: #efe7d2;
  --cream-300: #e3d6b4;

  --ink:       #1d231a;
  --ink-soft:  #40473c;
  --ink-mute:  #6d7467;
  --line:      #dcd9ce;
  --line-soft: #eae6d9;

  --accent:    #8a9471;

  --font-serif: "Fraunces", "Noto Serif KR", ui-serif, Georgia, serif;
  --font-sans:  "Inter", "Pretendard", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;

  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(29,35,26,0.04), 0 2px 8px rgba(29,35,26,0.03);
  --shadow-md: 0 4px 16px rgba(29,35,26,0.06), 0 12px 32px rgba(29,35,26,0.05);
  --shadow-lg: 0 20px 40px rgba(29,35,26,0.12), 0 8px 20px rgba(29,35,26,0.06);

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  --page-max: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream-50);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Korean: break between words, never mid-word */
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
}
/* Headings: balanced multi-line wrapping so short words don't get isolated on one line */
h1, h2, h3, h4, h5, h6,
.t-display, .t-h1, .t-h2, .t-h3 {
  word-break: keep-all;
  text-wrap: balance;
  overflow-wrap: break-word;
}
/* Body copy: pretty wrapping to avoid orphan words */
p, .t-body, .t-lead {
  text-wrap: pretty;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { padding: 0; margin: 0; list-style: none; }

/* ---------- Type ---------- */
.t-eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-600);
}
.t-display {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(44px, 6.5vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
}
.t-h1 {
  font-family: var(--font-serif);
  font-weight: 350;
  font-size: clamp(36px, 4.5vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.t-h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.t-h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.25;
}
.t-lead {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.t-body { font-size: 16px; line-height: 1.7; color: var(--ink-soft); text-wrap: pretty; }
.t-small { font-size: 14px; line-height: 1.55; color: var(--ink-mute); }
.t-micro { font-size: 12px; letter-spacing: 0.04em; color: var(--ink-mute); }
.t-serif-it { font-family: var(--font-serif); font-style: italic; font-weight: 350; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.section { padding: clamp(64px, 10vw, 128px) 0; }
.section--tight { padding: clamp(48px, 7vw, 80px) 0; }

.divider { height: 1px; background: var(--line-soft); width: 100%; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(252, 250, 244, 0.82);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.nav__brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
img.nav__brand-logo {
  width: auto;
  height: 40px;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
.nav__brand-sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-top: 2px;
}
.nav__menu {
  display: flex;
  gap: clamp(16px, 2.2vw, 32px);
  align-items: center;
}
.nav__link {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.2s;
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--sage-700); }
.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px; background: var(--sage-600);
}
.nav__cta {
  font-size: 13px;
  padding: 10px 18px;
  border: 1px solid var(--sage-700);
  border-radius: 100px;
  color: var(--sage-700);
  transition: all 0.2s;
  white-space: nowrap;
}
.nav__cta:hover { background: var(--sage-700); color: var(--cream-50); }

.nav__mburger {
  display: none;
  width: 40px; height: 40px;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
}
.nav__mburger span {
  display: block; height: 1.5px; background: var(--ink); border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}

@media (max-width: 1024px) {
  .nav__menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 16px 0 28px;
    background: var(--cream-50);
    border-bottom: 1px solid var(--line);
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu .nav__link, .nav__menu .nav__cta {
    padding: 14px var(--gutter);
    width: 100%;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--line-soft);
    font-size: 15px;
  }
  .nav__menu .nav__cta {
    color: var(--sage-700);
    border-top: 1px solid var(--line-soft);
  }
  .nav__menu .nav__cta:hover { background: transparent; color: var(--sage-800); }
  .nav__link[aria-current="page"]::after { display: none; }
  .nav__link[aria-current="page"] {
    background: var(--cream-100);
  }
  .nav__mburger { display: flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 100px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--sage-700);
  color: var(--cream-50);
}
.btn--primary:hover { background: var(--sage-800); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--sage-700); color: var(--sage-700); }
.btn__arrow { transition: transform 0.2s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Footer ---------- */
.footer {
  background: var(--sage-800);
  color: var(--cream-100);
  padding: 80px 0 40px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(247, 242, 230, 0.12);
}
.footer__brand {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 2px;
}
.footer__brand-en {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage-300);
  margin-bottom: 18px;
}
.footer__tag {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--sage-200);
  font-size: 15px;
  max-width: 360px;
  line-height: 1.55;
  margin: 0;
}
.footer__title {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-300);
  margin-bottom: 18px;
}
.footer__list li { margin-bottom: 10px; font-size: 14px; color: var(--cream-200); }
.footer__list a:hover { color: var(--cream-50); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 12px;
  color: var(--sage-300);
}
@media (max-width: 768px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer__bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* ---------- Page header (shared across sub-pages) ---------- */
.phead {
  padding: clamp(72px, 11vw, 130px) 0 clamp(56px, 8vw, 96px);
  background:
    radial-gradient(ellipse 60% 50% at 72% 30%, rgba(168,184,148,0.22), transparent 60%),
    var(--cream-50);
  border-bottom: 1px solid var(--line-soft);
}
.phead__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.phead__eyebrow::before { content:""; width: 28px; height:1px; background: var(--sage-500); }
.phead h1 { margin: 0 0 24px; }
.phead p { max-width: 680px; margin: 0; }

/* ---------- Animations ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.9s ease forwards;
}
.fade-up--d1 { animation-delay: 0.08s; }
.fade-up--d2 { animation-delay: 0.18s; }
.fade-up--d3 { animation-delay: 0.28s; }
.fade-up--d4 { animation-delay: 0.38s; }
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Helpers ---------- */
.mark-tree { color: var(--sage-700); }
.stack-sm > * + * { margin-top: 12px; }
.stack-md > * + * { margin-top: 20px; }
.stack-lg > * + * { margin-top: 32px; }

/* Image fallback: gradient + label when photo not provided */
.ph-photo {
  background: linear-gradient(135deg, var(--sage-300), var(--sage-600)) !important;
  position: relative;
  overflow: hidden;
}
.ph-photo[data-src]::before {
  content: attr(data-src);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: rgba(252, 250, 244, 0.88);
  padding: 20px;
  text-align: center;
  line-height: 1.5;
}
/* When img inside ph-photo fails, hide the gradient-after overlay */
.ph-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
