/* ==========================================================================
   낮은울타리교회 · Homepage v2
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: var(--fs-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ======== Layout primitives ======== */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-6); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--space-6); }

/* ======== NAV · top ======== */
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

.nav-top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-top-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-h);
}
.brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  color: var(--fg);
}
.brand-sym {
  width: 52px; height: 17px;
}
.brand-sym g { stroke: currentColor; stroke-width: 1.8; fill: none; }
.brand-meta { display: flex; flex-direction: column; line-height: 1.15; }
.brand-meta .t1 { font-weight: 500; font-size: 14px; letter-spacing: -0.01em; }
.brand-meta .t2 { font-size: 9.5px; letter-spacing: 0.3em; color: var(--fg-muted); margin-top: 2px;}

.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-top .nav-links a {
  display: inline-block;
  padding: 8px 12px;
  font-size: 13.5px; font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: -0.005em;
  border-radius: 2px;
  white-space: nowrap;
  word-break: keep-all;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nav-top .nav-links a:hover { color: var(--fg); background: var(--surface-hover); }
.nav-top .nav-links a.active { color: var(--fg); }
.nav-top .nav-links a.active::after {
  content: ""; display: block; height: 1px; background: var(--fg);
  margin-top: 4px;
}
.nav-top-inner .nav-links { flex-wrap: nowrap; }

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }

.theme-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--fg);
  transition: background var(--dur-fast);
}
.theme-btn:hover { background: var(--surface-hover); }
.theme-btn .glyph { width: 12px; height: 12px; border-radius: 50%; background: var(--fg); flex-shrink: 0;}

.menu-btn {
  display: none;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  width: 36px; height: 36px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  position: relative;
  box-sizing: border-box;
  padding: 0;
  font: inherit;
}
.menu-btn::before, .menu-btn::after {
  content: ""; position: absolute; left: 9px; right: 9px; height: 1px; background: currentColor;
}
.menu-btn::before { top: 13px; }
.menu-btn::after { bottom: 13px; }

/* ======== NAV · side (tweak variant) ======== */
body[data-nav="side"] .site-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
body[data-nav="side"] .site-main { grid-column: 2; }
body[data-nav="side"] .site-footer { grid-column: 1 / -1; }
body[data-nav="side"] .nav-side { grid-row: 1 / span 2; }

/* Sidebar already shows nav / visit / hours, so collapse footer */
body[data-nav="side"] .site-footer-inner {
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
body[data-nav="side"] .footer-col-nav,
body[data-nav="side"] .footer-col-connect,
body[data-nav="side"] .footer-col-visit { display: none; }
body[data-nav="side"] .footer-brand { max-width: 640px; }
body[data-nav="side"] .nav-top { display: none; }
body[data-nav="side"] .nav-side { display: flex; }
.nav-side {
  display: none;
  flex-direction: column;
  border-right: 1px solid var(--rule);
  padding: var(--space-7) var(--space-6);
  position: sticky; top: 0; height: 100vh;
  background: var(--bg);
  gap: var(--space-6);
}
.nav-side .brand { flex-direction: column; align-items: flex-start; gap: var(--space-3);}
.nav-side .brand-sym { width: 72px; height: 23px; }
.nav-side .brand-meta .t2 { font-size: 9px; letter-spacing: 0.32em;}
.nav-side .nav-links {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-top: var(--space-5);
  border-top: 1px solid var(--rule);
  padding-top: var(--space-4);
}
.nav-side .nav-links li { border-bottom: 1px solid var(--rule); }
.nav-side .nav-links li:last-child { border-bottom: none; }
.nav-side .nav-links a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  font-size: 13px;
  border-radius: 0;
  color: var(--fg);
}
.nav-side .nav-links a::before {
  content: attr(data-num);
  color: var(--fg-muted);
  font-size: 10px; letter-spacing: 0.2em; font-weight: 400;
  width: 32px;
}
.nav-side .nav-links a:hover { background: transparent; color: var(--accent);}
.nav-side .nav-links a.active { color: var(--accent);}
.nav-side .nav-links a.active::after { display: none; }
.nav-side .nav-actions { margin-top: auto; flex-direction: column; align-items: stretch; gap: var(--space-3);}
.nav-side .theme-btn { justify-content: center; }
.nav-side .side-meta {
  font-size: 11px; color: var(--fg-muted); line-height: 1.8;
  padding-top: var(--space-5); border-top: 1px solid var(--rule);
  word-break: keep-all;
}
.nav-side .side-meta .k { font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase; display: block; margin-bottom: 2px;}

/* ======== Page header (editorial) ======== */
.page-head {
  padding: var(--space-9) 0 var(--space-8);
  border-bottom: 1px solid var(--rule);
}
.page-head-inner {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-6);
  align-items: start;
}
.page-head .num {
  font-size: 10.5px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--fg-muted);
}
.page-head .num .slash { margin: 0 6px; opacity: 0.5;}
.page-head h1 {
  font-size: 48px; font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.08;
  margin-bottom: var(--space-4);
  text-wrap: pretty;
}
.page-head .lede {
  font-size: 16px; color: var(--fg-muted);
  max-width: 52ch; line-height: 1.65;
}

/* ======== Footer ======== */
.site-footer {
  margin-top: var(--space-10);
  border-top: 1px solid var(--rule);
  padding: var(--space-8) var(--space-6) var(--space-7);
}
.site-footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: var(--space-6);
  align-items: start;
}
.footer-brand .brand-sym { width: 80px; height: 25px; margin-bottom: var(--space-3);}
.footer-brand .name { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 4px; }
.footer-brand .en { font-size: 9.5px; letter-spacing: 0.3em; color: var(--fg-muted); }
.footer-col h5 {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fg-muted); font-weight: 500;
  margin-bottom: var(--space-4);
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px;}
.footer-col ul a { color: var(--fg); transition: color var(--dur-fast); }
.footer-col ul a:hover { color: var(--accent); }
.footer-col address {
  font-style: normal;
  font-size: 13px; line-height: 1.75;
  color: var(--fg);
}
.footer-col address .muted { color: var(--fg-muted); font-size: 12px; }
.footer-bottom {
  max-width: var(--container-max);
  margin: var(--space-7) auto 0;
  padding: var(--space-5) 0 0;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--fg-muted); letter-spacing: 0.08em;
  flex-wrap: wrap; gap: var(--space-3);
}

/* ======== Pattern / rhythm · horizontal "fence" ======== */
.fence {
  display: flex; height: 18px; gap: 0; align-items: stretch;
  color: var(--fg);
}
.fence .bar {
  width: 3px; background: currentColor;
}
.fence .gap { flex: 0 0 auto; }

/* Small mark used as section ornament */
.mark-sym {
  display: inline-block;
  width: 104px; height: 30px;
}
.mark-sym g { stroke: currentColor; stroke-width: 2; fill: none; stroke-linejoin: round;}

/* ======== Section helpers ======== */
section.block {
  padding: var(--space-9) 0;
  border-bottom: 1px solid var(--rule);
}
section.block:last-child { border-bottom: none; }
.block-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-7);
  align-items: start;
}
.block-head .num {
  font-size: 10.5px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--fg-muted);
}
.block-head h2 {
  font-size: 34px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1;
  margin-bottom: var(--space-3);
  text-wrap: balance;
}
.block-head p { color: var(--fg-muted); font-size: 15px; max-width: 56ch;}

.eyebrow {
  font-size: 10.5px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--fg-muted);
}

/* ======== Buttons ======== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  font-size: 13.5px; font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
  cursor: pointer;
  line-height: 1;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: color-mix(in oklab, var(--fg) 85%, var(--accent));}
.btn-outline { background: transparent; color: var(--fg); border-color: var(--rule-strong);}
.btn-outline:hover { background: var(--surface-hover);}
.btn-accent { background: var(--accent); color: var(--color-warm-cream);}
.btn-accent:hover { background: color-mix(in oklab, var(--accent) 85%, var(--fg));}
.btn-ghost { color: var(--fg); padding-left: 0; padding-right: 0;}
.btn-ghost .arrow { transition: transform var(--dur-base) var(--ease-out); }
.btn-ghost:hover .arrow { transform: translateX(6px); }

/* ======== Cards ======== */
.card {
  border: 1px solid var(--rule);
  padding: var(--space-6);
  background: var(--bg);
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.card.elev { background: var(--bg-elevated);}

/* ======== Forms ======== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fg-muted);
}
.field label .req { color: var(--accent); margin-left: 2px;}
.input, .textarea {
  font-family: inherit; font-size: 16px; color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 14px 16px;
  width: 100%;
  max-width: 100%;
  transition: border-color var(--dur-fast);
}
.input:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
}
.input::placeholder, .textarea::placeholder { color: var(--fg-muted); }
.textarea { resize: vertical; min-height: 140px; line-height: 1.65;}

/* ======== Page main padding ======== */
.page-main {
  padding-bottom: var(--space-9);
}
body[data-nav="side"] .page-main { padding-top: 0; }

/* ======== Typography utilities ======== */
.serif { font-family: var(--font-sans);}
.tight { letter-spacing: -0.015em; }
.mute { color: var(--fg-muted);}
.cap { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-muted);}

/* ======== Responsive ======== */
@media (max-width: 960px) {
  .site-footer-inner {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-6);
  }
  .footer-brand {
    grid-column: 1 / -1;
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--rule);
    margin-bottom: var(--space-3);
  }
  .page-head h1 { font-size: 36px; }
  .page-head-inner, .block-head { grid-template-columns: 1fr; gap: var(--space-4);}
  body[data-nav="side"] .site-shell { grid-template-columns: 1fr; }
  body[data-nav="side"] .nav-side { display: none; }
  body[data-nav="side"] .nav-top { display: block; }
}

@media (max-width: 720px) {
  .menu-btn { display: inline-block; }
  .nav-links { display: none; }
  .nav-top[data-open="true"] .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: var(--space-3) var(--space-5);
    gap: 0;
  }
  .nav-top[data-open="true"] .nav-links a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    width: 100%;
  }
  .nav-top[data-open="true"] .nav-links li:last-child a { border-bottom: none; }
  .container, .container-narrow { padding: 0 var(--space-4);}
  .site-footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1;}
  .theme-btn .label { display: none; }
}

@media (max-width: 480px) {
  .site-footer-inner { grid-template-columns: 1fr;}
  .site-footer-inner > * { grid-column: 1 !important;}
  .page-head h1 { font-size: 30px; }
  .nav-top-inner { padding: var(--space-3) var(--space-4);}
  .brand-mark .name { font-size: 14px;}
  .brand-mark .en { font-size: 8px;}
}
