/* ========================================
   K&B 홈페이지 - 공통 디자인 시스템
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;900&display=swap');

/* ── CSS 변수 ─────────────────────────── */
:root {
  --primary: #1a2744;
  --primary-light: #253563;
  --accent: #c9a227;
  --accent-light: #e8c355;
  --danger: #e94560;
  --bg: #f0f4f8;
  --bg-white: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --text-dark: #1a1a2e;
  --text-body: #444444;
  --text-light: #888888;
  --border: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Noto Sans KR', sans-serif;
  --header-h: 70px;
}

/* ── 리셋 & 기본 ─────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }

/* ── 레이아웃 유틸 ───────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.section-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 48px;
}
.section-header { margin-bottom: 48px; }
.section-header .badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 100px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ── 헤더/네비 ───────────────────────── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  z-index: 1000;
  transition: var(--transition);
}
#header.scrolled {
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}
.logo-text span { color: var(--accent); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-menu a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-body);
  transition: var(--transition);
}
.nav-menu a:hover,
.nav-menu a.active {
  background: var(--primary);
  color: #fff;
}
.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--accent-light) !important; }

/* 햄버거 */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2.5px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  z-index: 999;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-md);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text-body);
  transition: var(--transition);
}
.mobile-nav a:hover { background: var(--bg); color: var(--primary); }

/* ── 버튼 ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.7);
}
.btn-outline-white:hover { background: rgba(255,255,255,0.15); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c73652; }

/* ── 카드 ─────────────────────────────── */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.card-body { padding: 24px; }
.card-tag {
  display: inline-block;
  background: #eef2ff;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.4;
}
.card-text {
  font-size: 0.875rem;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ── 그리드 ───────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

/* ── 폼 ───────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-dark);
  background: #fff;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 39, 68, 0.08);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── 배지 ─────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-accent { background: var(--accent); color: #fff; }
.badge-success { background: #10b981; color: #fff; }
.badge-gray { background: #e2e8f0; color: #666; }

/* ── 페이지 상단 ─────────────────────── */
.page-hero {
  margin-top: var(--header-h);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 500px; height: 500px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.page-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
}
.page-hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  margin-top: 8px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 20px;
}
.breadcrumb a { color: rgba(255,255,255,0.7); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb-sep { font-size: 0.7rem; }

/* ── 푸터 ─────────────────────────────── */
#footer {
  background: var(--primary);
  color: rgba(255,255,255,0.8);
  padding: 60px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .logo { color: #fff; margin-bottom: 16px; }
.footer-brand p { font-size: 0.875rem; line-height: 1.8; color: rgba(255,255,255,0.6); }
.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul li a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  transition: var(--transition);
}
.footer-col ul li a:hover { color: var(--accent); }
.footer-contact-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
}
.footer-contact-item span:first-child { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ── 유틸리티 ─────────────────────────── */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-light { color: var(--text-light); }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }

/* ── 알림 & 토스트 ────────────────────── */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

.toast {
  position: fixed;
  bottom: 30px; right: 30px;
  background: var(--primary);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── 로딩 스피너 ─────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-dark); margin-bottom: 8px; }

/* ── 애니메이션 ───────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.animate-fadeIn { animation: fadeIn 0.4s ease forwards; }

[data-aos] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* ── 반응형 ───────────────────────────── */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-menu, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .section { padding: 60px 0; }
  .section-title { font-size: 1.6rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .page-hero-title { font-size: 1.7rem; }
  .container { padding: 0 16px; }
}

@media (max-width: 480px) {
  .btn-lg { padding: 14px 28px; font-size: 0.95rem; }
}

/* ── 모달 ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 24px;
}
.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none;
  font-size: 1.4rem;
  color: var(--text-light);
  transition: var(--transition);
}
.modal-close:hover { color: var(--text-dark); }

/* 이미지 업로드 */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #f8fafc;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: #eef2ff;
}
.upload-zone .icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }
.upload-zone p { font-size: 0.875rem; color: var(--text-light); }
.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.upload-preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-item .remove-btn {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}
.upload-preview-item .remove-btn:hover { background: var(--danger); }

/* 게시판 테이블 */
.board-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.board-table th {
  background: var(--primary);
  color: #fff;
  padding: 14px 20px;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
}
.board-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-body);
}
.board-table tr:last-child td { border-bottom: none; }
.board-table tr:hover td { background: #f8fafc; }
.board-table .post-title-link {
  color: var(--text-dark);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.board-table .post-title-link:hover { color: var(--primary); }
.board-table .num-col { width: 60px; text-align: center; color: var(--text-light); }
.board-table .date-col { width: 100px; text-align: center; color: var(--text-light); }
.board-table .view-col { width: 70px; text-align: center; color: var(--text-light); }
.board-table .author-col { width: 90px; text-align: center; }

/* 검색바 */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.search-bar .form-control { max-width: 300px; }
.search-bar select { max-width: 140px; }

/* 페이지네이션 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}
.pagination button {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-body);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 게시글 상세 */
.post-view {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.post-view-header {
  padding: 32px 40px 24px;
  border-bottom: 1px solid var(--border);
}
.post-view-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 16px;
}
.post-view-meta {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.post-view-body {
  padding: 40px;
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text-body);
}
.post-view-body p { margin-bottom: 16px; }
.post-view-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}
.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 24px 40px;
  border-top: 1px solid var(--border);
}
.post-images img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.post-images img:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }

/* 댓글 */
.comments-section {
  padding: 32px 40px;
  border-top: 1px solid var(--border);
}
.comments-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 24px;
}
.comment-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.comment-author { font-weight: 600; font-size: 0.875rem; color: var(--text-dark); }
.comment-date { font-size: 0.78rem; color: var(--text-light); }
.comment-content { font-size: 0.9rem; color: var(--text-body); line-height: 1.6; }
.comment-form {
  margin-top: 24px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 20px;
}
.comment-form h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
}

/* 이미지 라이트박스 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  color: #fff;
  font-size: 2rem;
  background: none;
  cursor: pointer;
  opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }
