/* 앱과 같은 색 (lib/theme.dart): 미색 바탕, 먹색 글자, 짙은 남색 강조, 금색 포인트 */
:root {
  --background: #F6F1E7;
  --surface: #FFFDF8;
  --text: #23201B;
  --text-secondary: #5E564B;
  --primary: #22385C;
  --gold: #A7832F;
  --border: #E3D9C6;
  --wrap: 800px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: 'Gowun Batang', 'Apple SD Gothic Neo', 'Malgun Gothic', serif;
  font-size: 20px;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: var(--primary); text-underline-offset: 4px; }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 14px; z-index: 10; }

/* 머리말 */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 20px; max-width: var(--wrap); margin: 0 auto; padding: 14px 16px;
}
.site-title {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 26px; font-weight: 700; color: var(--text); text-decoration: none;
}
.site-title img { width: 36px; height: 36px; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-header nav a {
  display: inline-block; padding: 10px 2px; font-size: 19px; font-weight: 700; text-decoration: none;
}
.site-header nav a[aria-current="page"] { color: var(--text); border-bottom: 3px solid var(--gold); }

main { max-width: var(--wrap); margin: 0 auto; padding: 24px 16px 56px; }

h1 { font-size: 34px; line-height: 1.35; margin: 16px 0 12px; }
h2 { font-size: 26px; line-height: 1.4; margin: 56px 0 12px; padding-top: 24px; border-top: 1px solid var(--border); }
h3 { font-size: 22px; line-height: 1.45; margin: 28px 0 6px; }
p { margin: 10px 0; }
ul, ol { padding-left: 1.3em; }
li { margin: 6px 0; }

.lead { font-size: 22px; color: var(--text-secondary); }
.updated { color: var(--text-secondary); font-size: 17px; }
.note { color: var(--text-secondary); font-size: 18px; }

/* 첫 화면 */
.hero { display: grid; gap: 28px; align-items: center; padding: 16px 0 8px; }
.badge {
  display: inline-block; padding: 4px 14px; border: 1px solid var(--gold); border-radius: 999px;
  color: #7A5F1E; font-size: 17px; font-weight: 700; background: var(--surface);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 58px; padding: 10px 26px; border-radius: 14px;
  font-family: inherit; font-size: 21px; font-weight: 700; text-decoration: none;
  background: var(--primary); color: #fff; border: 2px solid var(--primary);
}
.button.secondary { background: var(--surface); color: var(--primary); }

/* 손글씨 입력 그림 */
.pad {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 18px; max-width: 380px; width: 100%; margin: 0 auto;
  box-shadow: 0 10px 30px rgba(35, 32, 27, .08);
}
.pad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pad-box {
  position: relative; border: 2px dashed #CDBF9F; border-radius: 16px; background: #FFFEFB;
  height: 108px; display: flex; align-items: center; justify-content: center;
}
.pad-box.wide { grid-column: 1 / -1; height: 120px; }
.pad-box small {
  position: absolute; top: 6px; left: 12px; font-size: 15px; color: var(--text-secondary);
}
.pad-box b {
  font-family: 'Nanum Pen Script', 'Gowun Batang', cursive; font-weight: 400;
  font-size: 72px; line-height: 1; color: var(--primary); transform: rotate(-3deg);
}
.pad-find {
  margin-top: 14px; border-radius: 14px; background: var(--primary); color: #fff;
  text-align: center; font-size: 22px; font-weight: 700; padding: 10px;
}
.pad-result {
  margin: 14px 0 0; text-align: center; font-size: 19px; color: var(--text-secondary);
}
.pad-result strong { color: var(--text); }

/* 카드 */
.cards { display: grid; gap: 14px; margin: 16px 0; padding: 0; list-style: none; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; margin: 0;
}
.card h3 { margin: 0 0 4px; }
.card p { margin: 0; }
.card .eg { color: var(--text-secondary); font-size: 18px; margin-top: 4px; }

/* 순서 */
.steps { list-style: none; padding: 0; margin: 16px 0; counter-reset: step; display: grid; gap: 14px; }
.steps li {
  counter-increment: step; position: relative; margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px 18px 78px; min-height: 76px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 16px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.steps strong { display: block; font-size: 22px; }

.story { border-left: 4px solid var(--gold); padding: 4px 0 4px 18px; margin: 16px 0; }

/* 질문과 답 */
.faq { margin: 14px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.faq summary {
  cursor: pointer; padding: 18px 20px; font-size: 22px; font-weight: 700; list-style-position: outside;
}
.faq summary::-webkit-details-marker { color: var(--gold); }
.faq .answer { padding: 0 20px 16px; }
.faq .answer p:first-child { margin-top: 0; }

.contact {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; margin: 16px 0; text-align: center;
}
.contact .mail { font-size: 24px; font-weight: 700; }

/* 표 */
.table-wrap { overflow-x: auto; margin: 12px 0; }
table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 18px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-secondary); white-space: nowrap; }

/* 꼬리말 */
.site-footer { border-top: 1px solid var(--border); }
.site-footer .inner {
  max-width: var(--wrap); margin: 0 auto; padding: 22px 16px 44px;
  color: var(--text-secondary); font-size: 17px;
}
.site-footer p { margin: 4px 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.site-footer nav a { padding: 6px 0; font-weight: 700; }

@media (min-width: 760px) {
  h1 { font-size: 40px; }
  .hero { grid-template-columns: 1.15fr 1fr; padding-top: 32px; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* 좁은 화면에서는 표를 옆으로 밀지 않고 한 화면에 보이게 */
@media (max-width: 600px) {
  table { min-width: 0; font-size: 17px; }
  th, td { padding: 8px 6px; }
  th { white-space: normal; }
}
