/*
 * [kit] 공통 기능 화면의 기본 모양 — 직접 고치지 않는다 (templates/_kit 에서 관리).
 * 스킨의 style.css 보다 먼저 불러오고, 스킨은 아래 변수를 :root 에 정의해 색·글꼴·모서리를 맞춘다.
 * 더 바꾸고 싶으면 스킨 style.css 에서 .gw-* 를 덮어쓴다.
 *
 *   --gw-primary      대표색 (관리자 색상 설정이 덮어씀)      --gw-primary-ink  대표색 위 글자색
 *   --gw-accent       강조색 (관리자 색상 설정이 덮어씀)
 *   --gw-ink          본문 글자색        --gw-muted   보조 글자색
 *   --gw-bg           페이지 배경        --gw-surface 옅은 면(카드·입력 배경)
 *   --gw-line         구분선             --gw-radius  모서리
 *   --gw-font         본문 글꼴          --gw-font-head 제목 글꼴
 *   --gw-wrap         본문 최대 너비     --gw-gutter  좌우 여백
 */
:root {
  --gw-primary: #1f3a8a;
  --gw-primary-ink: #fff;
  --gw-accent: #e2572b;
  --gw-ink: #16181d;
  --gw-muted: #6b7280;
  --gw-bg: #fff;
  --gw-surface: #f5f6f8;
  --gw-line: #e3e5ea;
  --gw-radius: 10px;
  --gw-font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --gw-font-head: var(--gw-font);
  --gw-wrap: 1180px;
  --gw-gutter: clamp(20px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; word-break: keep-all; overflow-wrap: break-word; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--gw-bg); color: var(--gw-ink); font-family: var(--gw-font); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
[id] { scroll-margin-top: 96px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gw-skip { position: absolute; left: 12px; top: -60px; z-index: 1000; padding: 10px 16px; background: var(--gw-primary); color: var(--gw-primary-ink); border-radius: var(--gw-radius); text-decoration: none; }
.gw-skip:focus { top: 12px; }
.gw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.gw-wrap { width: 100%; max-width: calc(var(--gw-wrap) + var(--gw-gutter) * 2); margin-inline: auto; padding-inline: var(--gw-gutter); }
.gw-wrap--narrow { max-width: calc(820px + var(--gw-gutter) * 2); }
.gw-section { padding-block: clamp(48px, 8vw, 96px); }

/* 버튼 */
.gw-btn, .gw-submit { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border: 1px solid var(--gw-primary); border-radius: var(--gw-radius); background: var(--gw-primary); color: var(--gw-primary-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: filter .15s, background .15s, color .15s; }
.gw-btn:hover, .gw-submit:hover { filter: brightness(1.08); }
.gw-btn--ghost { background: transparent; color: var(--gw-ink); border-color: var(--gw-line); }
.gw-btn--ghost:hover { border-color: var(--gw-primary); color: var(--gw-primary); filter: none; }
.gw-submit:disabled { opacity: .6; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gw-primary); outline-offset: 2px; }

/* 문의 폼 */
.gw-form { display: grid; gap: 18px; }
.gw-form__row { display: grid; gap: 18px; }
@media (min-width: 640px) { .gw-form:not(.gw-form--compact) .gw-form__row { grid-template-columns: 1fr 1fr; } }
.gw-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.gw-label { display: block; margin-bottom: 7px; padding: 0; font-size: 14px; font-weight: 700; color: var(--gw-ink); }
.gw-req { color: #dc2626; }
.gw-opt { font-weight: 400; color: var(--gw-muted); }
.gw-input { display: block; width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--gw-line); border-radius: var(--gw-radius); background: var(--gw-bg); color: var(--gw-ink); font: inherit; font-size: 16px; }
.gw-input::placeholder { color: color-mix(in srgb, var(--gw-muted) 70%, transparent); }
.gw-input:focus { outline: none; border-color: var(--gw-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gw-primary) 22%, transparent); }
.gw-input[aria-invalid="true"] { border-color: #dc2626; }
.gw-textarea { min-height: 170px; resize: vertical; }
.gw-error { margin: 6px 0 0; font-size: 13px; color: #dc2626; }
.gw-choice__items { display: flex; flex-wrap: wrap; gap: 8px; }
.gw-choice__item { cursor: pointer; }
.gw-choice__item input { position: absolute; opacity: 0; pointer-events: none; }
.gw-choice__item span { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 18px; border: 1px solid var(--gw-line); border-radius: var(--gw-radius); font-size: 15px; }
.gw-choice__item input:checked + span { border-color: var(--gw-primary); background: color-mix(in srgb, var(--gw-primary) 10%, var(--gw-bg)); color: var(--gw-primary); font-weight: 700; }
.gw-choice__item input:focus-visible + span { outline: 2px solid var(--gw-primary); outline-offset: 2px; }
.gw-agree label { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--gw-muted); cursor: pointer; }
.gw-agree input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--gw-primary); flex: none; }
.gw-agree a { color: var(--gw-primary); text-underline-offset: 3px; }

/* 알림 */
.gw-flash { margin-bottom: 22px; padding: 15px 18px; border-radius: var(--gw-radius); font-weight: 600; font-size: 15px; }
.gw-flash--success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.gw-flash--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* 미리보기 띠 */
.gw-preview-bar { position: relative; z-index: 200; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; padding: 8px var(--gw-gutter); background: #111; color: #fff; font-size: 13px; }
.gw-preview-bar b { color: #fcd34d; }
.gw-preview-bar code { padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, .12); font-size: 12px; }
.gw-preview-bar a { margin-left: auto; color: #fff; }

/* 분류 필터 */
.gw-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; }
.gw-filter a { display: inline-flex; padding: 8px 16px; border: 1px solid var(--gw-line); border-radius: 999px; color: var(--gw-muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.gw-filter a:hover { color: var(--gw-primary); border-color: var(--gw-primary); }
.gw-filter a.is-current { background: var(--gw-primary); border-color: var(--gw-primary); color: var(--gw-primary-ink); }

/* 게시판 목록 (줄) */
.gw-list { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--gw-ink); }
.gw-list li { border-bottom: 1px solid var(--gw-line); }
.gw-list a { display: flex; align-items: center; gap: 16px; padding: 18px 8px; color: inherit; text-decoration: none; }
.gw-list a:hover { background: var(--gw-surface); }
.gw-list a:hover .gw-list__title { color: var(--gw-primary); }
.gw-list__no { flex: none; width: 48px; text-align: center; font-size: 14px; color: var(--gw-muted); }
.gw-list__no b { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--gw-accent); color: #fff; font-size: 12px; }
.gw-list__title { flex: 1; min-width: 0; font-weight: 600; }
.gw-list__title em { margin-right: 8px; font-style: normal; font-size: 14px; color: var(--gw-primary); }
.gw-list__date { flex: none; font-size: 14px; color: var(--gw-muted); }
@media (max-width: 560px) { .gw-list__no { display: none; } .gw-list a { flex-wrap: wrap; gap: 4px 12px; } .gw-list__title { flex-basis: 100%; } }

/* 게시판 목록 (카드) */
.gw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 24px; margin: 0; padding: 0; list-style: none; }
.gw-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
.gw-card__thumb { display: block; aspect-ratio: 4 / 3; margin-bottom: 8px; overflow: hidden; border-radius: var(--gw-radius); background: var(--gw-surface); }
.gw-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gw-card:hover .gw-card__thumb img { transform: scale(1.04); }
.gw-card__cat { font-size: 13px; font-weight: 700; color: var(--gw-accent); }
.gw-card__title { font-family: var(--gw-font-head); font-size: 18px; line-height: 1.4; }
.gw-card:hover .gw-card__title { color: var(--gw-primary); }
.gw-card__text { font-size: 14px; color: var(--gw-muted); }
.gw-card__date { font-size: 13px; color: var(--gw-muted); }
.gw-empty { margin: 0; padding: 64px 20px; border-radius: var(--gw-radius); background: var(--gw-surface); text-align: center; color: var(--gw-muted); }

/* 페이지네이션 */
.gw-pager { display: flex; justify-content: center; gap: 6px; margin-top: 48px; }
.gw-pager a { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 8px; border: 1px solid var(--gw-line); border-radius: var(--gw-radius); color: var(--gw-muted); font-weight: 600; text-decoration: none; }
.gw-pager a:hover { border-color: var(--gw-primary); color: var(--gw-primary); }
.gw-pager a.is-current { background: var(--gw-primary); border-color: var(--gw-primary); color: var(--gw-primary-ink); }

/* 게시글 상세 */
.gw-post { padding-block: clamp(40px, 7vw, 80px); }
.gw-post__back { display: inline-block; margin-bottom: 24px; color: var(--gw-muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.gw-post__back:hover { color: var(--gw-primary); }
.gw-post__head { padding-bottom: 24px; border-bottom: 2px solid var(--gw-ink); }
.gw-post__cat { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--gw-primary); }
.gw-post__head h1 { margin: 0; font-family: var(--gw-font-head); font-size: clamp(24px, 4vw, 34px); line-height: 1.35; }
.gw-post__meta { margin: 12px 0 0; font-size: 14px; color: var(--gw-muted); }
.gw-post__thumb { display: block; width: 100%; margin-top: 32px; border-radius: var(--gw-radius); }
.gw-post .gw-prose { margin-top: 32px; min-height: 160px; }
.gw-post__nav { margin-top: 56px; border-top: 1px solid var(--gw-line); }
.gw-post__nav a { display: flex; gap: 16px; padding: 16px 8px; border-bottom: 1px solid var(--gw-line); color: inherit; text-decoration: none; font-size: 15px; }
.gw-post__nav a:hover { background: var(--gw-surface); }
.gw-post__nav span { flex: none; width: 56px; color: var(--gw-muted); }
.gw-post__nav b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.gw-post__list { margin: 32px 0 0; text-align: center; }

/* 본문 (관리자가 쓴 HTML·정책 문서) */
.gw-prose { font-size: 16px; line-height: 1.85; }
.gw-prose > * { margin-block: 0; }
.gw-prose > * + * { margin-top: 1.2em; }
.gw-prose h2 { margin-top: 2.2em; font-family: var(--gw-font-head); font-size: 22px; line-height: 1.4; }
.gw-prose h3 { margin-top: 1.8em; font-family: var(--gw-font-head); font-size: 18px; }
.gw-prose a { color: var(--gw-primary); text-underline-offset: 3px; }
.gw-prose ul, .gw-prose ol { padding-left: 1.3em; }
.gw-prose blockquote { margin-inline: 0; padding: 16px 20px; border-left: 4px solid var(--gw-accent); background: var(--gw-surface); border-radius: 0 var(--gw-radius) var(--gw-radius) 0; }
.gw-prose img { border-radius: var(--gw-radius); }
.gw-prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gw-prose th, .gw-prose td { padding: 10px 12px; border: 1px solid var(--gw-line); text-align: left; }
.gw-prose th { background: var(--gw-surface); }

/* 오류 화면 */
.gw-errorpage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; padding: 80px var(--gw-gutter); text-align: center; }
.gw-errorpage__code { margin: 0; font-size: clamp(72px, 14vw, 128px); font-weight: 800; line-height: 1; color: color-mix(in srgb, var(--gw-primary) 22%, transparent); }
.gw-errorpage h1 { margin: 8px 0 0; font-family: var(--gw-font-head); font-size: clamp(22px, 4vw, 30px); }
.gw-errorpage p { max-width: 460px; margin: 12px 0 0; color: var(--gw-muted); }
.gw-errorpage__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 32px; }
.gw-errorpage__detail { width: 100%; max-width: 900px; max-height: 380px; margin-top: 40px; padding: 20px; overflow: auto; border-radius: var(--gw-radius); background: #111; color: #ddd; font-size: 12px; text-align: left; white-space: pre-wrap; }

/* 스크롤 등장 효과 (kit.js): [data-reveal] */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; } }
