/* ==========================================================================
   HACCPLog 프런트 스타일

   왜 직접 쓰는가:
   기존 kcr.css는 지금은 없어진 한국문화연구원 페이지를 기준으로 컴파일된
   Tailwind 부분집합이고, 빌드 설정(tailwind.config·소스)이 저장소에 없다.
   그래서 마크업을 조금만 바꿔도 해당 클래스가 없어 화면이 조용히 깨진다.

   이 파일은 손으로 쓴 CSS다. 빌드가 필요 없고, 여기 있는 것이 전부다.
   현장 화면(app.css)과 같은 색·간격 토큰을 쓴다.
   ========================================================================== */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --primary-light: #eff6ff;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --success: #15803d;
    --success-bg: #f0fdf4;
    --radius: 10px;
    --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-body { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- 공통 레이아웃 ---------- */

.wrap {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 20px;
}

.site-main { flex: 1; width: 100%; }

.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
.section-white { background: var(--surface); }

.page-head {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 36px 0 28px;
}

.page-head h1 { margin: 0 0 6px; font-size: 26px; }
.page-head p { margin: 0; color: var(--text-muted); font-size: 15px; }

/* ---------- 헤더 ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 68px;
}

.brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.01em;
}

.brand:hover { text-decoration: none; }
.brand em { font-style: normal; color: var(--primary); }

.site-nav { display: flex; align-items: center; gap: 24px; }

.site-nav a:not(.btn) {
    color: #334155;
    font-weight: 600;
    font-size: 15px;
}

.site-nav a:not(.btn):hover { color: var(--primary); text-decoration: none; }
.site-nav a.on:not(.btn) { color: var(--primary); }

/* 로그인한 사용자 · 사업장명 */
.nav-user {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    max-width: 180px;
}

.nav-user strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user em {
    font-style: normal;
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-mobile .nav-user {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    max-width: none;
    padding: 10px 20px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.nav-mobile {
    display: none;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 8px 0 14px;
}

.nav-mobile a {
    display: block;
    padding: 12px 20px;
    font-weight: 600;
    color: #334155;
}

@media (max-width: 720px) {
    .site-nav { display: none; }
    .nav-toggle { display: flex; }
    .nav-mobile.open { display: block; }
}

/* ---------- 푸터 ---------- */

.site-footer {
    margin-top: auto;
    background: #0f172a;
    color: #cbd5e1;
    padding: 40px 0 28px;
    font-size: 14px;
}

.site-footer h3 { margin: 0 0 12px; color: #fff; font-size: 16px; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
}

.footer-grid p, .footer-grid li { margin: 0 0 6px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }

.footer-bottom {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #1e293b;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
}

/* ---------- 버튼 ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-dark { background: #0f172a; color: #fff; }
.btn-dark:hover { background: #1e293b; color: #fff; }
.btn-outline { border-color: var(--border-strong); }
.btn-outline:hover { background: #f1f5f9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }

/* ---------- 카드 ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}

.card + .card { margin-top: 14px; }
.card h2, .card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--text-muted); font-size: 15px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

/* ---------- 랜딩 ---------- */

.hero {
    background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    text-align: center;
    padding: 72px 0 64px;
    border-bottom: 1px solid var(--border);
}

.hero .eyebrow {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 14px;
}

.hero h1 {
    margin: 0 0 18px;
    font-size: 38px;
    line-height: 1.3;
    letter-spacing: -.02em;
}

.hero p {
    margin: 0 auto 28px;
    max-width: 620px;
    color: var(--text-muted);
    font-size: 17px;
}

@media (max-width: 720px) {
    .hero { padding: 48px 0 44px; }
    .hero h1 { font-size: 27px; }
    .hero p { font-size: 16px; }
}

/* ---------- 폼 ---------- */

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    max-width: 460px;
    margin: 0 auto;
}

.form-card h1 { margin: 0 0 6px; font-size: 22px; text-align: center; }
.form-card .sub { margin: 0 0 22px; text-align: center; color: var(--text-muted); font-size: 14px; }

.field { margin-bottom: 16px; }

.field label,
.field-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.field .req { color: var(--danger); margin-left: 2px; }

.input,
input[type="text"].input,
input[type="email"].input,
input[type="password"].input,
input[type="tel"].input,
input[type="date"].input,
select.input,
textarea.input {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
}

textarea.input { min-height: 120px; resize: vertical; }

.input:focus {
    outline: 3px solid #bfdbfe;
    border-color: var(--primary);
}

.input::placeholder { color: #94a3b8; }

.field-help { font-size: 13px; color: var(--text-muted); margin-top: 5px; }
.field-error { font-size: 13px; color: var(--danger); font-weight: 600; margin-top: 5px; }

.form-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
    font-size: 14px;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    margin-bottom: 10px;
}

.checkbox-line input { width: 18px; height: 18px; }

/* ---------- 알림 ---------- */

.alert {
    border-radius: var(--radius);
    padding: 13px 16px;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid;
}

.alert-info    { background: var(--primary-light); color: var(--primary); border-color: #bfdbfe; }
.alert-danger  { background: var(--danger-bg);     color: var(--danger);  border-color: #fecaca; }
.alert-success { background: var(--success-bg);    color: var(--success); border-color: #bbf7d0; }

/* ---------- 게시판 ---------- */

.board-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-top: 2px solid var(--text);
    font-size: 15px;
}

.board-table th,
.board-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.board-table th { background: #f1f5f9; font-size: 14px; font-weight: 700; }
.board-table td.subject { text-align: left; }
.board-table td.subject a { color: var(--text); font-weight: 600; }
.board-table td.subject a:hover { color: var(--primary); }
.board-table tbody tr:hover { background: #f8fafc; }
.board-table .empty-row td { padding: 60px 12px; color: var(--text-muted); }

.board-view {
    background: var(--surface);
    border-top: 2px solid var(--text);
    border-bottom: 1px solid var(--border);
}

.board-view .head { padding: 20px; border-bottom: 1px solid var(--border); }
.board-view .head h1 { margin: 0 0 8px; font-size: 21px; }
.board-view .meta { color: var(--text-muted); font-size: 14px; display: flex; gap: 14px; flex-wrap: wrap; }
.board-view .body { padding: 28px 20px; min-height: 220px; line-height: 1.8; }
.board-view .files { padding: 14px 20px; background: #f8fafc; border-top: 1px solid var(--border); font-size: 14px; }

.pager {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.pager a, .pager strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.pager strong { background: var(--primary); border-color: var(--primary); color: #fff; }

.search-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.search-bar .input { width: auto; min-width: 220px; }
.search-bar select.input { min-width: 120px; }

/* ---------- 표 (이용약관 등 문서형) ---------- */

.doc-body { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.doc-body h2 { font-size: 18px; margin: 28px 0 10px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body p, .doc-body li { color: #334155; font-size: 15px; }

.scroll-box {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px;
    background: #f8fafc;
    font-size: 14px;
    color: #334155;
}

/* ---------- 유틸 (꼭 필요한 것만) ---------- */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 14px; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.hidden { display: none; }
