/* ── 플래시 메시지 ─────────────────────────────── */
.flash-container { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.flash--success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.flash--error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }

/* ── 서브페이지 히어로 ─────────────────────────── */
.subpage-hero { background: var(--blue); color: #fff; padding: 56px 0 40px; }
.subpage-hero .subpage-category { font-size: 13px; opacity: .7; margin-bottom: 6px; }
.subpage-hero .subpage-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; margin: 0; }

/* ── 게시판 공통 ───────────────────────────────── */
.section { padding: 56px 0; }
.board-toolbar { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.board-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.board-table th { background: var(--blue); color: #fff; padding: 12px 10px; text-align: center; font-weight: 600; }
.board-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: center; color: var(--muted); }
.board-table .col-title { text-align: left; }
.board-table .col-title a { color: var(--text); font-weight: 500; }
.board-table .col-title a:hover { color: var(--blue); }
.board-table tbody tr:hover { background: var(--soft-bg); }
.board-table .notice-row { background: #f0f5ff; }
.board-table .notice-row td { color: var(--text); }
.board-empty { padding: 60px 0; text-align: center; color: var(--muted); }

.badge-notice { background: var(--blue); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 4px; margin-right: 4px; }

/* ── 페이징 ───────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 32px 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 8px; border-radius: 8px; font-size: 14px;
  border: 1px solid var(--line); color: var(--text); transition: .15s; }
.pagination a:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }

/* ── 검색 ──────────────────────────────────────── */
.board-search { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.board-search input { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; width: 280px; }

/* ── 버튼 ──────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 22px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: .15s; text-decoration: none; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--outline { border: 1.5px solid var(--blue); color: var(--blue); background: transparent; }
.btn--outline:hover { background: var(--blue); color: #fff; }
.btn--danger { background: #ef4444; color: #fff; }
.btn--danger:hover { background: #dc2626; }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.btn--link-danger { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 13px; padding: 2px 6px; }

/* ── 게시글 상세 ───────────────────────────────── */
.post-view { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 32px; margin-bottom: 24px; }
.post-view__head { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.post-view__title { font-size: 1.25rem; font-weight: 700; margin: 0 0 10px; }
.post-view__meta { display: flex; gap: 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.post-view__body { line-height: 1.8; min-height: 120px; white-space: pre-wrap; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.post-view__attachments { background: var(--soft-bg); border-radius: 8px; padding: 14px 16px; margin-top: 20px; margin-bottom: 0; }
.post-view__attachments ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.attach-link { color: var(--blue); font-size: 13px; }
.post-view__actions { display: flex; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.pw-check-form { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.pw-check-form.hidden { display: none; }

.post-nav { border-top: 1px solid var(--line); margin-top: 24px; }
.post-nav__item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.post-nav__label { color: var(--muted); min-width: 60px; }
.post-nav__item a:hover { color: var(--blue); }

/* ── 댓글 ──────────────────────────────────────── */
.comments { margin-top: 32px; }
.comments__title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--blue); }
.comment { border-bottom: 1px solid var(--line); padding: 14px 0; }
.comment__meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.comment__meta strong { color: var(--text); }
.comment__actions { display: flex; gap: 6px; margin-left: auto; }
.comment__body { font-size: 14px; line-height: 1.6; }

/* 댓글 수정/삭제 폼 */
.cmt-pw-form { margin-top: 8px; }
.cmt-pw-form.hidden { display: none; }
.cmt-edit-area { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-family: inherit; resize: vertical; box-sizing: border-box; margin-bottom: 8px; }
.cmt-pw-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cmt-pw-row input[type=password] { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; width: 130px; }
.cmt-confirm-btn { font-size: 12px !important; padding: 5px 12px !important; height: auto !important; line-height: 1.4 !important; }

/* 수정 링크 버튼 */
.btn--link-edit { background: none; border: none; color: var(--blue); font-size: 13px; cursor: pointer; padding: 0; font-family: inherit; }
.btn--link-edit:hover { text-decoration: underline; }
.btn--link-danger { background: none; border: none; color: #c00; font-size: 13px; cursor: pointer; padding: 0; font-family: inherit; }
.btn--link-danger:hover { text-decoration: underline; }
.comment-form { background: var(--soft-bg); border-radius: 10px; padding: 16px; margin-top: 20px; }
.comment-form__top { display: flex; gap: 8px; margin-bottom: 10px; }
.comment-form__top input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-family: inherit; }
.comment-form__bottom { display: flex; gap: 8px; }
.comment-form__bottom textarea { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; resize: vertical; font-family: inherit; }

/* ── 글쓰기 폼 ─────────────────────────────────── */
.write-form { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 14px; font-weight: 600; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=email],
.form-row textarea, .form-row select {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  font-family: inherit; transition: border-color .15s; width: 100%; box-sizing: border-box; }
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--blue); }
.form-row--half { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check-row { flex-direction: row; gap: 20px; align-items: center; flex-wrap: wrap; }
.check-label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.required { color: #ef4444; }

/* ── 비밀글 ────────────────────────────────────── */
/* ── 글쓰기 폼 (wf) ─────────────────────────────── */
.wf { width: 100%; }
.wf-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--blue);
  margin-bottom: 0;
}
.wf-table th {
  width: 120px;
  background: #f4f7fb;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #2c3e60;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #dde4ef;
  border-right: 1px solid #dde4ef;
  white-space: nowrap;
}
.wf-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #dde4ef;
  vertical-align: middle;
}
.wf-table input[type=text],
.wf-table input[type=password],
.wf-table input[type=email] {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid #cdd5e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.wf-table input[type=text]:focus,
.wf-table input[type=password]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(32,110,178,.10);
}
.wf-table textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cdd5e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.7;
}
.wf-table textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(32,110,178,.10);
}
.wf-content-row th { vertical-align: top; padding-top: 16px; }
.wf-checks { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
.wf-check { display: flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; user-select: none; }
.wf-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.wf-check span { color: #3a4a6b; font-weight: 500; }
.wf-table input[type=file] { font-size: 13px; }
.wf-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.wf-hint--err { color: #c00; font-weight: 600; }
.wf-file-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.wf-file-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #2c3e60; background: #f4f7fb; border: 1px solid #dde4ef; border-radius: 5px; padding: 5px 10px; }
.wf-file-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-file-remove { background: none; border: none; cursor: pointer; color: #999; font-size: 14px; font-weight: 700; padding: 0 2px; line-height: 1; }
.wf-file-remove:hover { color: #c00; }
.wf-actions { display: flex; justify-content: center; gap: 12px; padding: 24px 0 8px; border-top: 1px solid #dde4ef; margin-top: 0; }
.wf-actions .btn { min-width: 100px; text-align: center; }

.secret-box { max-width: 400px; margin: 60px auto; text-align: center; padding: 40px; background: var(--soft-bg); border-radius: 16px; }
.secret-icon { font-size: 3rem; margin-bottom: 16px; }
.secret-box p { font-size: 15px; margin-bottom: 20px; }
.secret-box form { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.secret-box input { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }

/* ── 갤러리 그리드 ─────────────────────────────── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-bottom: 32px; }
.gallery-card { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); transition: box-shadow .2s, transform .2s; }
.gallery-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.gallery-card__thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--soft-bg); }
.gallery-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-card__no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.gallery-card__info { padding: 12px 14px; }
.gallery-card__title { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.gallery-card__meta { font-size: 12px; color: var(--muted); margin: 0; }

/* 갤러리 뷰 — 이미지 목록 (원본 50%, 중앙 정렬) */
.gallery-view-grid { display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 24px 0; }
.gallery-view-item { width: 50%; cursor: pointer; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); transition: box-shadow .2s; }
.gallery-view-item:hover { box-shadow: var(--shadow); }
.gallery-view-item img { width: 100%; height: auto; display: block; }

/* 갤러리 라이트박스 */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 9000; align-items: center; justify-content: center; }
.lightbox.is-open { display: flex; }
.lightbox__inner { position: relative; max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox__inner img { max-width: 90vw; max-height: 80vh; object-fit: contain; border-radius: 6px; }
.lightbox__inner p { color: #ccc; font-size: 13px; margin: 0; }
.lightbox__close { position: fixed; top: 18px; right: 22px; background: none; border: none; color: #fff; font-size: 36px; cursor: pointer; line-height: 1; z-index: 9001; }
.lightbox__prev, .lightbox__next { position: fixed; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 28px; padding: 12px 16px; cursor: pointer; border-radius: 6px; z-index: 9001; transition: background .2s; }
.lightbox__prev:hover, .lightbox__next:hover { background: rgba(255,255,255,.3); }
.lightbox__prev { left: 12px; }
.lightbox__next { right: 12px; }

/* 갤러리 write — 기존 이미지 */
.gallery-existing-list { flex-direction: row; flex-wrap: wrap; gap: 12px; }
.gallery-exist-item { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.gallery-exist-label { cursor: pointer; }
.gallery-exist-label input[type=checkbox] { position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; accent-color: #c00; z-index: 1; cursor: pointer; }
.gallery-exist-thumb { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); transition: opacity .2s; display: block; }

/* 갤러리 write — 새 이미지 미리보기 */
.gallery-img-preview { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.gallery-preview-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gallery-preview-thumb { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.gallery-preview-name { font-size: 11px; color: var(--muted); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.gallery-preview-item .wf-file-remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #c00; color: #fff; border: none; font-size: 12px; cursor: pointer; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center; }

/* 갤러리 툴바 */
.gallery-toolbar p { font-size: 13px; color: var(--muted); margin: 0; }

/* ── 관리자 ────────────────────────────────────── */
.admin-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-section-title { font-size: 1rem; font-weight: 700; margin: 32px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--blue); }
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.admin-stat-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--soft-bg); border-radius: 10px; border: 1px solid var(--line); transition: .15s; }
.admin-stat-card:hover { background: var(--blue-soft); border-color: var(--blue); }
.admin-stat-card__cat { font-size: 11px; color: var(--muted); }
.admin-stat-card__name { font-size: 14px; font-weight: 700; }
.admin-stat-card__count { font-size: 18px; font-weight: 800; color: var(--blue); }

/* ── 로그인/인증 박스 ───────────────────────────── */
.auth-box { max-width: 420px; margin: 60px auto; padding: 40px; background: var(--soft-bg); border-radius: 16px; }
.auth-box__title { font-size: 1.4rem; font-weight: 700; text-align: center; margin-bottom: 28px; }

/* ── 서브페이지 레이아웃 ────────────────────────── */
.subpage-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.side-menu { position: sticky; top: 80px; }
.sub-content { min-width: 0; }

/* ── 인사말 ─────────────────────────────────────── */
.welcome-body p { line-height: 1.9; margin-bottom: 16px; }
.director-sign { display: flex; align-items: center; justify-content: flex-end; gap: 28px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.director-photo { width: 120px; height: 150px; overflow: hidden; border: 1px solid #ccc; flex-shrink: 0; }
.director-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.director-name { font-size: 14px; color: var(--text); text-align: right; line-height: 1.6; }


/* ── 원장약력 ────────────────────────────────────── */
.profile-hero-card {
  display: flex; gap: 32px; align-items: center;
  background: linear-gradient(135deg, #e8f4ff 0%, #f5faff 50%, #fff 100%);
  border-radius: 16px; padding: 32px 36px; margin-bottom: 36px;
  border: 1px solid #ddeeff;
}
.profile-photo { width: 110px; height: 140px; border-radius: 10px; overflow: hidden; border: 1px solid #ccc; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.profile-hero-card > div > span { font-size: 12px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .15em; display: block; margin-bottom: 8px; }
.profile-hero-card > div > h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 12px; color: #1a2340; }
.profile-section { margin-bottom: 28px; }
.profile-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--blue); }
.profile-section h4 { font-size: 14px; font-weight: 600; color: var(--blue); margin: 12px 0 8px; }
.profile-list { padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.profile-list li { font-size: 14px; line-height: 1.6; }
.profile-list--columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 20px; }
.career-block { margin-bottom: 20px; }

/* ── 시험일정 테이블 ─────────────────────────────── */
.exam-table-wrap { display: flex; flex-direction: column; gap: 28px; }
.exam-table-wrap h3 { font-size: 15px; font-weight: 700; color: var(--blue); margin: 0; }
.exam-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.exam-table th { background: var(--blue); color: #fff; padding: 10px 12px; text-align: center; font-weight: 600; }
.exam-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; color: var(--text); }
.exam-table tbody tr:hover { background: var(--soft-bg); }
.exam-note { font-size: 13px; color: var(--muted); background: var(--soft-bg); padding: 12px 16px; border-radius: 8px; border-left: 3px solid var(--blue); }

/* ── 오시는길 ────────────────────────────────────── */
.map-area { margin: 20px 0; border-radius: 12px; overflow: hidden; }
.contact-info-box { background: var(--soft-bg); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.contact-info-box p { margin: 0; font-size: 14px; }
.contact-info-box strong { color: var(--blue); margin-right: 8px; }

/* ── 반응형 ─────────────────────────────────────── */
@media (max-width: 768px) {
  .subpage-layout { grid-template-columns: 1fr; }
  .side-menu { position: static; }
  .form-row--half { grid-template-columns: 1fr; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-list--columns { grid-template-columns: 1fr; }
  .history-year { grid-template-columns: 60px 1fr; }
  .profile-hero-card { flex-direction: column; text-align: center; }
  .board-table .col-author, .board-table .col-views { display: none; }
  .gallery-view-grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox__prev { left: 4px; }
  .lightbox__next { right: 4px; }
}

.post-view__actions--right { justify-content: flex-end; }

/* ── 수정 폼 기존 파일 목록 ─────────────────────── */
.wf-existing-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.wf-existing-item { display: flex; align-items: center; gap: 10px; }
.wf-existing-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.wf-existing-label input[type=checkbox] { width: 15px; height: 15px; accent-color: #c00; cursor: pointer; }
.wf-existing-name { color: #2c3e60; }
.wf-del-badge { font-size: 11px; font-weight: 700; color: #fff; background: #c00; border-radius: 4px; padding: 1px 7px; }

.board-comment-cnt { font-size: 11px; color: #e85c1a; font-weight: 700; margin-left: 5px; vertical-align: middle; }
