/* ============================================================
   base.css — 모든 섹션이 같이 쓰는 기본 모양
   (초기화, 글자, 버튼, 사진 자리, 입력칸, 안내 메시지)
   ============================================================ */

/* ── 초기화 ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
body {
  margin: 0; background: var(--c-flour); color: var(--c-ink);
  font-family: var(--f-sans); font-size: var(--fs-body); line-height: 1.7;
  word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--c-crust); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--c-butter); color: var(--c-cocoa); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 200; padding: 0.7rem 1.1rem;
  background: var(--c-cocoa); color: #fff; border-radius: var(--r-sm); transition: top .2s;
}
.skip:focus { top: 1rem; }

/* ── 바깥 틀 ── */
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section) 0; position: relative; }

/* ── 섹션 머리 (영문 작은 제목 + 한글 큰 제목) ── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--f-accent); font-style: italic; font-weight: 500;
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem); color: var(--c-crust); letter-spacing: 0.01em;
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; }
.h2 {
  font-size: var(--fs-h2); font-weight: 760; line-height: 1.22; letter-spacing: -0.035em;
  margin-top: 0.9rem; white-space: pre-line; text-wrap: balance;
}
.lead { font-size: var(--fs-lead); color: var(--c-muted); margin-top: 1.1rem; max-width: 40em; }
.head { margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.head--center { text-align: center; }
.head--center .lead { margin-left: auto; margin-right: auto; }

/* ── 버튼 ── */
.btn {
  --bg: var(--c-crust); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 54px; padding: 0 1.6rem; border-radius: 999px; border: 0;
  background: var(--bg); color: var(--fg); font-weight: 650; font-size: 1rem; letter-spacing: -0.01em;
  transition: background-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
  white-space: nowrap;
}
.btn:hover { --bg: var(--c-crust-d); transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(133, 73, 26, .8); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--ghost { --bg: transparent; --fg: currentColor; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--ghost:hover { --bg: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--light { --bg: var(--c-paper); --fg: var(--c-cocoa); }
.btn--light:hover { --bg: #fff; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ── 사진 자리 ── 사진이 없거나 늦게 뜨면 빵 색 번짐이 보임 */
.slot {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background:
    radial-gradient(120% 90% at 20% 15%, rgba(239, 203, 123, .55), transparent 60%),
    radial-gradient(90% 80% at 85% 90%, rgba(163, 94, 37, .45), transparent 65%),
    var(--c-salt);
}
.slot img { width: 100%; height: 100%; object-fit: cover; }

/* ── 입력칸 ── */
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field > label, .field > .label { font-weight: 650; font-size: 0.95rem; }
.req { color: var(--c-crust); margin-left: 0.15rem; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 0.8rem 1rem; border-radius: var(--r-sm);
  border: 1.5px solid var(--c-line); background: #fff; font-size: 1rem; line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
  appearance: none; -webkit-appearance: none;
}
.select {
  padding-right: 2.6rem; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2375665A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 1rem center;
}
.textarea { min-height: 120px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #A89A8D; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-crust); box-shadow: 0 0 0 4px rgba(163, 94, 37, .14); }
.field.is-bad .input, .field.is-bad .select { border-color: var(--c-error); }
.field__err { color: var(--c-error); font-size: var(--fs-small); min-height: 0; }
.field__hint { color: var(--c-muted); font-size: var(--fs-small); }

/* 고르는 칩 (라디오) */
.chips, .chips.field { display: flex; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.chips .field__err { flex-basis: 100%; }
.chips legend { font-weight: 650; font-size: 0.95rem; margin-bottom: 0.5rem; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.05rem; border-radius: 999px;
  border: 1.5px solid var(--c-line); background: #fff; font-size: 0.95rem; transition: all .2s;
}
.chip input:checked + span { background: var(--c-cocoa); border-color: var(--c-cocoa); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--c-crust); outline-offset: 2px; }

/* 동의 체크 */
.agree { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 0.6rem; font-size: 0.95rem; }
.agree input[type=checkbox] { width: 22px; height: 22px; margin: 0.1rem 0 0; accent-color: var(--c-crust); cursor: pointer; }
.agree__more {
  border: 0; background: none; color: var(--c-muted); font-size: var(--fs-small);
  text-decoration: underline; text-underline-offset: 3px; padding: 0.1rem 0;
}
.agree__text {
  grid-column: 1 / -1; margin: 0.2rem 0 0.3rem; padding: 0.9rem 1rem; border-radius: var(--r-sm);
  background: var(--c-salt); color: var(--c-muted); font-size: 0.85rem; white-space: pre-line; line-height: 1.65;
}

/* ── 화면 아래 짧은 안내 ── */
.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 300;
  transform: translate(-50%, 140%); opacity: 0;
  background: var(--c-cocoa); color: #fff; padding: 0.85rem 1.3rem; border-radius: 999px;
  box-shadow: var(--shadow); max-width: calc(100vw - 2rem); text-align: center; font-size: 0.95rem;
  transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.toast.is-show { transform: translate(-50%, 0); opacity: 1; }

/* ── 등장 효과 준비 (motion.js가 있을 때만 숨겼다 보여 줌) ── */
.motion-on [data-reveal] { opacity: 0; transform: translateY(28px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 휴대폰에서 화면이 좌우로 밀리지 않게: 화면 밖으로 나간 것은 잘라 냄.
   overflow-x: clip 은 hidden 과 달리 스크롤 상자를 만들지 않아 위에 붙는 메뉴(sticky)가 그대로 동작함 */
html, body { overflow-x: clip; overscroll-behavior-x: none; max-width: 100%; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
