/* ==========================================================
   더행복나무 · 공통 스타일 (v2 — 정갈한 크림톤)
   ========================================================== */

/* Gmarket Sans — Medium 단일 웨이트 사용 (모든 font-weight를 Medium으로 매핑) */
@font-face {
  font-family: 'GmarketSans';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --green:        #2E7A47;
  --green-d:      #1F5E33;
  --green-soft:   #EDF3EE;
  --accent:       #B98A00;   /* 앰버 골드 (아주 절제된 서브 강조) */
  --ink:          #1A1E1B;
  --ink-2:        #2F3833;
  --gray:         #55605A;
  --gray-l:       #8B948E;
  --paper:        #FAF8F3;   /* 아이보리 크림 배경 */
  --paper-2:      #F4F1E9;   /* 조금 더 진한 크림 */
  --line:         #E5E1D5;   /* 크림톤 라인 */
  --line-soft:    #EFEBDF;
  --white:        #FFFFFF;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow-sm:    0 1px 2px rgba(26,30,27,.04);
  --shadow-md:    0 8px 30px rgba(26,30,27,.06);
  --header-height: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: 'GmarketSans', -apple-system, BlinkMacSystemFont,
               system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.65;
  font-weight: 500;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============ Header (공통, okcean-style) ============ */
header.site {
  position: fixed; inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-height);
  background: transparent;
  transition: background-color .35s ease, box-shadow .35s ease;
}
header.site.scrolled {
  background: rgba(250, 248, 243, .95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(26,30,27,.06);
}
.site-inner {
  display: flex; align-items: center;
  height: 100%;
  padding: 0 clamp(24px, 5vw, 60px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { height: 36px; width: auto; flex: none; }
.brand b {
  font-size: 1.02rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--ink); white-space: nowrap; display: block;
}
.brand span {
  font-size: .58rem; font-weight: 500; letter-spacing: .22em;
  color: var(--gray-l); white-space: nowrap; display: block; margin-top: 2px;
}

/* Nav (로고 옆에 붙고, actions는 오른쪽 끝으로) */
nav.site {
  display: flex; align-items: center;
  margin-left: 2.4rem;
  margin-right: auto;
  gap: clamp(18px, 2.4vw, 32px);
}
nav.site a {
  font-size: .92rem; font-weight: 500; color: var(--ink-2);
  padding: 8px 2px; position: relative; letter-spacing: -.005em;
  transition: color .2s;
}
nav.site a::after {
  content: ''; position: absolute; left: 2px; right: 2px; bottom: 2px;
  height: 1.5px; background: var(--green);
  transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
nav.site a:hover { color: var(--green); }
nav.site a:hover::after,
nav.site a.active::after { transform: scaleX(1); }
nav.site a.active { color: var(--green); font-weight: 600; }

/* Actions (오른쪽) */
.site-actions {
  display: flex; align-items: center; gap: 1rem;
}
.site-action-btn {
  padding: 9px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -.005em;
  transition: background .2s, color .2s, border-color .2s;
}
.site-action-btn:hover {
  background: var(--ink); color: #fff; border-color: var(--ink);
}

/* Hamburger (3-span) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center; align-items: stretch;
  width: 28px; height: 28px;
  gap: 6px; padding: 0;
  margin-left: 1rem;
  z-index: 60;
}
.menu-toggle span {
  width: 100%; height: 2px;
  background-color: var(--ink);
  border-radius: 1px;
  transition: transform .3s ease, opacity .25s ease, background-color .25s;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.menu-toggle.active span { background-color: #fff; }

/* ============ Page Hero (내부 페이지 상단) ============ */
.page-hero {
  position: relative;
  padding: 150px clamp(24px, 5vw, 60px) 90px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  text-align: center;
  overflow: hidden;
}
.eyebrow {
  display: inline-block; position: relative;
  font-size: .7rem; font-weight: 600; letter-spacing: .3em;
  color: var(--green);
  padding: 0 26px; margin-bottom: 22px;
  text-transform: uppercase;
}
.eyebrow::before, .eyebrow::after {
  content: ''; position: absolute; top: 50%;
  width: 16px; height: 1px; background: var(--green);
}
.eyebrow::before { left: 0; }
.eyebrow::after { right: 0; }

.page-hero h1 {
  font-size: clamp(1.7rem, 4.4vw, 2.4rem);
  font-weight: 600; line-height: 1.5;
  letter-spacing: -.02em; color: var(--ink);
  margin-bottom: 20px; word-break: keep-all;
}
.page-hero h1 .g { color: var(--green); font-weight: 700; }
.page-hero .lede {
  font-size: clamp(.95rem, 2.4vw, 1.05rem); font-weight: 400;
  color: var(--gray); max-width: 560px; margin: 0 auto;
  word-break: keep-all; line-height: 1.85;
}

/* 배경 이미지가 있는 히어로: 어두운 레이어 + 흰색 텍스트 */
.page-hero.has-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: none;
}
.page-hero.has-bg::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(0, 0, 0, .5);
  pointer-events: none;
}
.page-hero.has-bg > * { position: relative; z-index: 1; }
.page-hero.has-bg h1,
.page-hero.has-bg .lede { color: #fff; }
.page-hero.has-bg .lede { color: rgba(255, 255, 255, .9); }
.page-hero.has-bg h1 .g { color: #9BE0B2; }
.page-hero.has-bg .eyebrow { color: #fff; }
.page-hero.has-bg .eyebrow::before,
.page-hero.has-bg .eyebrow::after { background: rgba(255, 255, 255, .7); }

/* ============ Sections ============ */
main { padding-bottom: 0; }
.container {
  max-width: 1040px; margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 40px);
}
.container.narrow { max-width: 780px; }
.section { padding: 90px 0; }
.section.tight { padding: 60px 0; }

.sub-title {
  font-size: .7rem; font-weight: 600; letter-spacing: .28em;
  color: var(--green); margin-bottom: 12px; text-transform: uppercase;
}
.section h2 {
  font-size: clamp(1.45rem, 3.4vw, 1.9rem); font-weight: 600;
  letter-spacing: -.02em; color: var(--ink);
  margin-bottom: 20px; line-height: 1.45; word-break: keep-all;
}
.section h2 .g { color: var(--green); }
.section .h2-lede {
  font-size: 1rem; color: var(--gray); line-height: 1.85;
  margin-bottom: 40px; max-width: 640px; word-break: keep-all;
}
.section p {
  font-size: 1rem; line-height: 1.95; color: var(--gray); font-weight: 400;
  word-break: keep-all; margin-bottom: 16px;
}
.section p strong { color: var(--ink); font-weight: 600; }

/* ============ Cards ============ */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.grid.g-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .grid.g-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: border-color .25s, transform .25s;
}
.card:hover { border-color: var(--green); transform: translateY(-2px); }
.card .icon {
  width: 36px; height: 36px; color: var(--green);
  margin-bottom: 20px;
}
.card .icon svg { width: 100%; height: 100%; stroke-width: 1.5; }
.card .num {
  font-size: .78rem; font-weight: 600; letter-spacing: .16em;
  color: var(--green); margin-bottom: 16px; display: block;
}
.card h3 {
  font-size: 1.08rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--ink); margin-bottom: 10px; line-height: 1.5;
}
.card p {
  font-size: .92rem; line-height: 1.75; color: var(--gray);
  font-weight: 400; margin: 0;
}

/* ============ Image slot (placeholder) ============ */
.img-slot {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  aspect-ratio: 16 / 9;
  color: var(--gray-l); gap: 10px;
  overflow: hidden;
}
.img-slot svg { width: 28px; height: 28px; color: var(--line); opacity: .95; }
.img-slot small {
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gray-l); font-weight: 500;
}
.img-slot.portrait { aspect-ratio: 3 / 4; max-width: 220px; }
.img-slot.square { aspect-ratio: 1 / 1; }

/* ============ Callout / Signoff ============ */
.callout {
  background: var(--green-soft);
  border-left: 3px solid var(--green);
  padding: 22px 26px; margin: 34px 0; border-radius: 2px;
}
.callout p { color: var(--ink); font-weight: 500; margin: 0; font-size: .98rem; line-height: 1.7; }

.signoff {
  margin-top: 50px; padding-top: 34px; border-top: 1px solid var(--line);
  text-align: right;
}
.signoff .name {
  font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink);
}
.signoff .title { font-size: .88rem; color: var(--gray); margin-top: 6px; }

/* ============ Footer ============ */
footer.site {
  background: #343E27;
  color: rgba(255,255,255,.72);
  padding: 60px clamp(24px, 5vw, 60px);
  font-size: .88rem; line-height: 1.75;
  border-top: 1px solid var(--line);
}
footer.site .foot-inner {
  max-width: 1080px; margin: 0 auto;
  display: grid; gap: 36px;
  grid-template-columns: 1fr auto; align-items: flex-start;
}
footer.site .foot-brand b {
  color: #fff; font-size: 1.02rem; letter-spacing: -.01em;
  display: block; margin-bottom: 10px; font-weight: 600;
}
footer.site .foot-info {
  font-size: .82rem; opacity: .8; line-height: 1.85;
}
footer.site .foot-donate {
  background: rgba(255,255,255,.05);
  padding: 20px 24px; border-radius: var(--radius-sm);
  color: #fff; font-size: .88rem; min-width: 240px;
  border: 1px solid rgba(255,255,255,.09);
}
footer.site .foot-donate .label {
  color: #E8C879; font-weight: 600;
  display: block; margin-bottom: 8px; font-size: .72rem;
  letter-spacing: .18em; text-transform: uppercase;
}
footer.site .foot-divider {
  max-width: 1080px; margin: 32px auto 0;
  padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: .78rem; opacity: .55; text-align: center;
}

/* ============ Responsive ============ */
@media (max-width: 780px) {
  :root { --header-height: 64px; }

  /* 모바일: nav를 풀스크린 오버레이로 */
  nav.site {
    position: fixed; inset: 0;
    margin: 0; padding: 0;
    background-color: var(--green-d);
    z-index: 40;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 1.8rem;
    opacity: 0; pointer-events: none;
    transition: opacity .4s ease;
    border: none; box-shadow: none;
  }
  nav.site.open { opacity: 1; pointer-events: auto; }
  nav.site a {
    padding: 0; border: none;
    font-size: 1.4rem;
    color: rgba(255,255,255,.9);
    font-weight: 500;
    letter-spacing: -.02em;
  }
  nav.site a::after { display: none; }
  nav.site a:hover,
  nav.site a.active { color: #F3E0A6; }

  .site-actions { display: none; }
  .menu-toggle { display: flex; }
  .brand span { display: none; }
  .brand img { height: 30px; }

  .section { padding: 60px 0; }
  .page-hero { padding: 110px clamp(24px, 5vw, 60px) 60px; }
  footer.site .foot-inner { grid-template-columns: 1fr; }
  footer.site .foot-donate { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
