/* 따라쓰기용 글꼴 — 저장소에 함께 두어 인터넷 없이도 같은 모양으로 인쇄된다.
   Andika (SIL Open Font License 1.1), assets/fonts/LICENSE.txt 참고 */
@font-face {
  font-family: 'Andika';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/andika-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Andika';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/andika-700.woff2') format('woff2');
}

/* 활동지천국.com — 화면 스타일과 인쇄 스타일 */
:root {
  --bg: #fdfaf5;
  --surface: #ffffff;
  --ink: #1f2937;
  --ink-soft: #6b7280;
  --line: #e8e2d9;
  --accent: #f97316;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31, 41, 55, .06), 0 8px 24px rgba(31, 41, 55, .07);
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', sans-serif;
  --font-title: 'Jua', var(--font);
}

* { box-sizing: border-box; }
/* display 를 지정한 요소도 hidden 이면 확실히 사라지게 한다 */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 400; letter-spacing: -.01em; line-height: 1.3; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }

.skip {
  position: absolute; left: -9999px; top: 0; background: #111827; color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------- 머리말 */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(253, 250, 245, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 66px; flex-wrap: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; flex: none; }
.brand-mark svg { display: block; }
.brand-text { font-family: var(--font-title); font-size: 26px; line-height: 1.1; letter-spacing: -.01em; color: #1f2937; white-space: nowrap; }
.brand-text em { font-style: normal; color: #f97316; }

.nav { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; margin-left: auto; min-width: 0; padding: 6px 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 6px 9px; border-radius: 999px; text-decoration: none;
  font-size: 13.5px; color: var(--ink-soft); border: 1px solid transparent;
}
.nav a:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.nav a.is-active { background: #111827; border-color: #111827; color: #fff; }

/* --------------------------------------------------------------- 홈 */
.hero { padding: 52px 0 34px; max-width: 760px; }
.hero-eyebrow {
  margin: 0 0 14px; font-size: 13px; letter-spacing: .06em; color: var(--accent); font-weight: 700;
}
.hero h1 { margin: 0; font-size: clamp(32px, 5.6vw, 52px); }
.hero h1 em {
  font-style: normal; background: linear-gradient(transparent 62%, #fed7aa 62%); padding: 0 4px;
}

.cards {
  display: grid; gap: 14px; padding-bottom: 56px;
  max-width: 806px;                      /* 넓은 화면에서도 다섯 칸으로 고정 */
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
}
.card {
  --accent: #f97316;
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  text-align: center; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card-emoji {
  width: 46px; height: 46px; display: grid; place-items: center; font-size: 23px;
  border-radius: 13px; background: color-mix(in srgb, var(--accent) 12%, #fff);
}
.card-title { font-family: var(--font-title); font-size: 17px; line-height: 1.25; }
.card-go { font-size: 13px; line-height: 1.3; font-weight: 700; color: #f97316; }
.card-go.is-off { color: #9ca3af; }

/* --------------------------------------------------------- 활동지 화면 */
.crumb { display: flex; align-items: center; gap: 8px; padding: 20px 0 4px; font-size: 14px; color: var(--ink-soft); }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.layout { display: grid; grid-template-columns: 322px minmax(0, 1fr); gap: 26px; align-items: start; padding-bottom: 60px; }
.panel {
  position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.panel-head { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.panel-emoji {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; font-size: 21px;
  border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, #fff);
}
.panel-head { align-items: center; }
.panel-head h1 { margin: 0; font-size: 21px; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 5px; }
.field input[type=text], .field input[type=number], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink);
  padding: 9px 11px; border: 1px solid #d8d2c8; border-radius: 10px; background: #fff;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 11px; padding-right: 32px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #f97316; outline-offset: 1px; border-color: transparent; }
.field-check label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; font-weight: 500; color: #374151; }
/* 체크박스 색은 모든 활동지가 같다 (활동지별 색을 따라가지 않는다) */
.field-check input { width: 17px; height: 17px; accent-color: #f97316; }

/* 그림을 직접 보고 고르는 갤러리 */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 7px;
  max-height: 380px; overflow-y: auto; padding: 3px; margin: 0 -3px;
}
.gal {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px 5px; background: #fff; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 11px; font: inherit; color: var(--ink-soft);
  transition: border-color .12s ease, background .12s ease, transform .06s ease;
}
.gal:hover { border-color: #fdba74; background: #fffdfa; }
.gal:active { transform: translateY(1px); }
.gal.is-on { border-color: #f97316; background: #fff7ed; color: var(--ink); }
.gal-art { display: block; width: 100%; height: 66px; }
.gal-art img { width: 100%; height: 100%; display: block; object-fit: contain; }
.gal-name { font-size: 11.5px; line-height: 1.25; text-align: center; }
.gallery-empty {
  margin: 0; padding: 12px; font-size: 13px; line-height: 1.6; color: var(--ink-soft);
  border: 1px dashed #d8d2c8; border-radius: 10px; background: #fffdfa;
}

/* 숫자 조절 */
.stepper { display: flex; align-items: stretch; border: 1px solid #d8d2c8; border-radius: 10px; background: #fff; overflow: hidden; }
.stepper input[type=number] {
  flex: 1; min-width: 0; border: 0; border-radius: 0; text-align: center;
  font-weight: 700; font-size: 15px; padding: 9px 2px; -moz-appearance: textfield;
}
.stepper input[type=number]::-webkit-outer-spin-button,
.stepper input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }
.stepper:focus-within { outline: 2px solid #f97316; outline-offset: 1px; border-color: transparent; }
.step {
  flex: none; width: 40px; border: 0; background: #faf7f2; color: var(--ink);
  font: inherit; font-size: 19px; line-height: 1; cursor: pointer; user-select: none;
}
.step:hover { background: #f2ede5; }
.step:active { background: #e9e2d8; }

.actions { display: grid; gap: 8px; margin-top: 20px; }
.btn {
  font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
  padding: 11px 12px; border-radius: 10px; border: 1px solid #d8d2c8; background: #fff; color: var(--ink);
  transition: background .14s ease, border-color .14s ease, transform .06s ease;
}
.btn:hover { background: #faf7f2; }
.btn:active { transform: translateY(1px); }
/* 모든 활동지가 같은 색을 쓴다. .btn:hover 의 배경색이 이기지 않도록 여기서도 배경을 지정한다. */
.btn-refresh {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: #f97316; border: 0; color: #fff; font-size: 14.5px; padding: 12px;
}
.btn-refresh:hover { background: #ea6a06; }
.btn-refresh:active { background: #d95f02; }
.btn-primary {
  display: flex; align-items: baseline; justify-content: center; gap: 7px;
  background: #111827; border-color: #111827; color: #fff; padding: 12px;
}
.btn-primary:hover { background: #374151; }
.btn-main { font-size: 16px; }
.btn-sub { font-size: 12.5px; font-weight: 500; opacity: .75; white-space: nowrap; }
.panel-note { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; }

.sheets { display: grid; gap: 26px; padding-top: 4px; }
.sheet-wrap { margin: 0; }
.sheet-label { font-size: 15px; color: #4b5563; margin-bottom: 8px; font-weight: 700; }
.is-answer .sheet-label { color: #dc2626; }
.sheet {
  background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  box-shadow: var(--shadow); aspect-ratio: 210 / 297;
}
.sheet svg { display: block; width: 100%; height: 100%; }
.is-answer .sheet { border-color: #fecaca; }
.error { padding: 30px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; color: #991b1b; }
.notice {
  margin: 0; padding: 28px 30px; background: #fff; border: 1px dashed #d8d2c8; border-radius: 12px;
  color: var(--ink-soft); line-height: 1.75; font-size: 14.5px;
}
.notice b { color: var(--ink); }
.notice code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: #f3efe8; padding: 1px 5px; border-radius: 5px; color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); padding: 30px 0 44px; font-size: 14px; }
.site-footer p { margin: 0 0 6px; }
.copyright { font-weight: 700; }
.copyright-sub { font-size: 13px; color: var(--ink-soft); max-width: 760px; line-height: 1.6; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .panel { position: static; }
  .hero { padding: 36px 0 28px; }
}

/* ------------------------------------------------------------- 인쇄 */
@page { size: A4 portrait; margin: 0; }

@media print {
  html, body { background: #fff; margin: 0; padding: 0; }
  .no-print, .site-header, .site-footer, .panel, .crumb, .skip { display: none !important; }
  .wrap { max-width: none; padding: 0; margin: 0; }
  .layout { display: block; padding: 0; gap: 0; }
  .sheets { display: block; gap: 0; padding: 0; }
  .sheet-wrap { margin: 0; break-inside: avoid; page-break-inside: avoid; break-after: page; page-break-after: always; }
  .sheet-wrap:last-child { break-after: auto; page-break-after: auto; }
  .sheet {
    width: 210mm; height: 297mm; border: 0; border-radius: 0; box-shadow: none;
    overflow: hidden; aspect-ratio: auto;
  }
  .sheet svg { width: 210mm; height: 297mm; }
}
