/**
 * 피그플랜 서브페이지 스타일시트
 * 공지사항, 안기홍 박사, 활용 가이드, 업계 뉴스
 * 배치: /css/landing/pigplan-subpage.css
 */

:root {
  --primary: #1D9ADD;
  --primary-dark: #1a8bc7;
  --primary-light: #f0f9ff;
  --dark: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;
  --radius: 8px;
}

/* ========== 기본 레이아웃 ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-700);
  background: #f5f6f8;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ========== 헤더 ========== */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.header-left { display: flex; align-items: center; gap: 48px; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 28px; }
.nav-menu { display: flex; gap: 28px; }
.nav-menu a {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-600);
  transition: color 0.15s;
}
.nav-menu a:hover,
.nav-menu a.active { color: var(--primary); }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-link { font-size: 14px; color: var(--gray-500); }
.header-link:hover { color: var(--primary); }
.insight-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dark);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
}
.insight-cta:hover { background: #111827; }
.insight-cta .new-badge {
  background: #22c55e;
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
}

/* ========== 공통 레이아웃 ========== */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  min-height: calc(100vh - 56px - 48px);
}

/* 브레드크럼 */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-400); margin-bottom: 20px; }
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--gray-300); font-size: 10px; }
.breadcrumb .current { color: var(--gray-700); font-weight: 600; }

/* 페이지 헤더 */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--dark); }
.page-title { font-size: 22px; font-weight: 800; color: var(--dark); letter-spacing: -0.3px; }
.page-desc { font-size: 13px; color: var(--gray-500); margin-top: 3px; }
.page-count { font-size: 13px; color: var(--gray-500); flex-shrink: 0; }
.page-count strong { color: var(--primary); font-weight: 700; }

/* ========== 탭 필터 ========== */
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.tab-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab-btn {
  padding: 6px 14px;
  border-radius: 3px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ========== 검색 ========== */
.search-bar { display: flex; gap: 4px; margin-bottom: 0; }
.search-select {
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gray-600);
  background: var(--white);
  font-family: inherit;
}
.search-input {
  width: 200px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.search-btn {
  height: 36px;
  padding: 0 16px;
  background: var(--gray-700);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.search-btn:hover { background: var(--dark); }

/* ========== 리스트 ========== */
.list-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  overflow: hidden;
}

/* 리스트 헤더 행 */
.list-head {
  display: flex;
  align-items: center;
  padding: 13px 20px;
  background: #3a4d63;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  gap: 14px;
  letter-spacing: 0.03em;
}
.list-head .col-badge { width: 50px; text-align: center; flex-shrink: 0; }
.list-head .col-title { flex: 1; }
.list-head .col-date { width: 80px; text-align: center; flex-shrink: 0; }
.list-head .col-views { width: 60px; text-align: center; flex-shrink: 0; }
.list-head-thumb { width: 72px; flex-shrink: 0; }

/* 리스트 아이템 */
.list-item {
  display: flex;
  align-items: center;
  padding: 0 20px;
  min-height: 56px;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.12s;
  cursor: pointer;
  gap: 14px;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #eef6fc; }
.list-item:hover .list-item-title { color: var(--primary); }

/* 공지 고정 */
.list-item.pinned { background: #fafbfd; }
.list-item.pinned .list-item-badge-pin {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  background: var(--dark);
  margin-right: 6px;
  line-height: 15px;
}

/* 분류 뱃지 */
.list-item-badge {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 50px;
  text-align: center;
  line-height: 18px;
}
.badge-system { background: #fef2f2; color: #dc2626; }
.badge-general { background: var(--primary-light); color: var(--primary); }
.badge-update { background: #f0fdf4; color: #16a34a; }
.badge-breeding { background: #fef3c7; color: #d97706; }
.badge-environment { background: #ecfdf5; color: #059669; }
.badge-feed { background: #fce7f3; color: #db2777; }
.badge-analysis { background: #ede9fe; color: #7c3aed; }
.badge-video { background: #fee2e2; color: #b91c1c; }
.badge-pdf { background: #dbeafe; color: #2563eb; }
.badge-manual { background: #e0e7ff; color: #4f46e5; }
.badge-faq { background: #f3f4f6; color: #6b7280; }
.badge-policy { background: #fef2f2; color: #dc2626; }
.badge-market { background: #fff7ed; color: #ea580c; }
.badge-tech { background: #f0f9ff; color: #0284c7; }
.badge-intl { background: #f5f3ff; color: #7c3aed; }

/* 리스트 본문 */
.list-item-body { flex: 1; min-width: 0; padding: 10px 0; }
.list-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  transition: color 0.15s;
}
.list-item-desc {
  font-size: 12px;
  color: var(--gray-400);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.list-item-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.list-item-date { font-size: 12px; color: var(--gray-400); white-space: nowrap; width: 80px; text-align: center; }
.list-item-new {
  display: inline-block;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 2px;
  line-height: 15px;
  letter-spacing: -0.2px;
}
.list-item-views { font-size: 12px; color: var(--gray-400); white-space: nowrap; width: 60px; text-align: center; }

/* 썸네일 */
.list-item-thumb {
  width: 72px;
  height: 50px;
  border-radius: 4px;
  background: var(--gray-100);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-400);
  overflow: hidden;
}

/* ========== 페이지네이션 ========== */
.pagination { display: flex; justify-content: center; align-items: center; gap: 3px; margin-top: 24px; }
.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; font-weight: 600; }
.page-btn.nav { width: auto; padding: 0 10px; font-size: 12px; }

/* ========== 빈 상태 ========== */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state-icon { font-size: 32px; color: var(--gray-300); margin-bottom: 12px; }
.empty-state-msg { font-size: 14px; color: var(--gray-400); margin-bottom: 4px; }
.empty-state-sub { font-size: 12px; color: var(--gray-300); }

/* ========== 상세 페이지 ========== */
.detail-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* 상세 헤더 */
.detail-header { padding: 24px 28px 18px; border-bottom: 1px solid var(--gray-200); }
.detail-top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.detail-category { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.detail-utils { display: flex; gap: 4px; }
.detail-util-btn {
  padding: 4px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 3px;
  background: var(--white);
  font-size: 11px;
  color: var(--gray-500);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  gap: 3px;
}
.detail-util-btn:hover { border-color: var(--primary); color: var(--primary); }
.detail-util-btn svg { width: 12px; height: 12px; }
.detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.4;
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}
.detail-meta { display: flex; gap: 4px; font-size: 12px; color: var(--gray-400); flex-wrap: wrap; }
.detail-meta-item { display: flex; align-items: center; gap: 4px; }
.detail-meta-item::after { content: '|'; color: var(--gray-300); margin-left: 4px; }
.detail-meta-item:last-child::after { display: none; }
.meta-label { color: var(--gray-500); font-weight: 500; }

/* 상세 본문 */
.detail-body { padding: 28px; line-height: 1.85; color: var(--gray-700); font-size: 14px; }
.detail-body-inner { max-width: 720px; }
.detail-body p { margin-bottom: 14px; }
.detail-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 24px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}
.detail-body ul { margin: 8px 0 14px 20px; }
.detail-body li { margin-bottom: 4px; font-size: 13px; }
.detail-body img { max-width: 100%; border-radius: 6px; margin: 14px 0; }
.detail-body blockquote {
  border-left: 3px solid var(--gray-300);
  padding: 12px 18px;
  background: var(--gray-50);
  margin: 16px 0;
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.7;
}
.detail-body .info-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--primary);
  padding: 14px 18px;
  margin: 16px 0;
}
.detail-body .info-box-title { font-size: 13px; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.detail-body .info-box p { margin-bottom: 0; font-size: 13px; }

/* 영상 */
.video-placeholder {
  background: #1a1a1a;
  border-radius: 6px;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  cursor: pointer;
}
.video-placeholder::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left: 32px solid rgba(255,255,255,0.7);
  margin-left: 4px;
}
.video-placeholder:hover::after { border-left-color: rgba(255,255,255,0.95); }

/* 첨부파일 */
.detail-attachments { padding: 14px 28px; background: var(--gray-50); border-top: 1px solid var(--gray-100); }
.attach-title { font-size: 12px; font-weight: 600; color: var(--gray-500); margin-bottom: 8px; }
.attach-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gray-600);
  margin-right: 6px;
  cursor: pointer;
  transition: all 0.12s;
}
.attach-item:hover { border-color: var(--primary); color: var(--primary); }
.attach-ext {
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
}
.attach-ext.pdf { background: #dc2626; }
.attach-ext.xlsx { background: #16a34a; }

/* 이전/다음글 */
.detail-nav { display: flex; border-top: 1px solid var(--gray-200); }
.detail-nav-item { flex: 1; padding: 14px 28px; cursor: pointer; transition: background 0.12s; min-width: 0; }
.detail-nav-item:hover { background: var(--gray-50); }
.detail-nav-item + .detail-nav-item { border-left: 1px solid var(--gray-200); }
.detail-nav-item.is-next { text-align: right; }
.detail-nav-label { font-size: 11px; color: var(--gray-400); font-weight: 600; margin-bottom: 4px; }
.detail-nav-title {
  font-size: 13px;
  color: var(--gray-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}
.detail-nav-item:hover .detail-nav-title { color: var(--primary); }
.detail-nav-date { font-size: 11px; color: var(--gray-300); margin-top: 2px; }
.detail-nav-empty { flex: 1; padding: 14px 28px; }

/* 하단 버튼 */
.back-to-list { display: flex; justify-content: center; margin-top: 24px; }
.back-btn {
  padding: 9px 32px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.back-btn:hover { border-color: var(--primary); color: var(--primary); }

/* 작성자 카드 */
.author-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 20px;
}
.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.author-name { font-size: 14px; font-weight: 700; color: var(--dark); }
.author-desc { font-size: 12px; color: var(--gray-400); margin-top: 1px; }

/* ========== 푸터 ========== */
.footer { background: var(--white); border-top: 1px solid var(--gray-200); padding: 12px 24px; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 11px;
  color: var(--gray-500);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: var(--primary); }

/* ========== 반응형 ========== */

/* 햄버거 아이콘 (기본 숨김) */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.hamburger {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gray-700);
  position: relative;
}
.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gray-700);
}
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

/* ≤1024px: 햄버거 메뉴 전환 */
@media (max-width: 1024px) {
  .mobile-menu-toggle { display: flex; align-items: center; }
  .nav-menu { display: none !important; }
  .header-right { display: none !important; }
  .header-left { gap: 0; }
}

/* ≤768px: 서브페이지 모바일 */
@media (max-width: 768px) {
  .page-container { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .page-title { font-size: 18px; }
  .page-desc { font-size: 12px; }
  .page-count { font-size: 12px; }
  .detail-header { padding: 16px; }
  .detail-title { font-size: 17px; }
  .detail-body { padding: 16px; font-size: 13px; }
  .detail-body img { max-width: 100%; height: auto; }
  .detail-attachments { padding: 12px 16px; }
  .list-item { padding: 0 12px; min-height: 48px; gap: 8px; }
  .list-item-title { font-size: 13px; }
  .list-item-thumb { display: none; }
  .list-head { display: none; }
  .list-head-thumb { display: none; }
  .list-item-views { display: none; }
  .list-item-date { width: auto; }
  .search-bar { flex-wrap: wrap; }
  .search-input { width: 100%; }
  .search-select { flex-shrink: 0; }
  .search-btn { flex-shrink: 0; }
  .filter-row { flex-direction: column; align-items: flex-start; }
  .tab-filter { width: 100%; }
  .tab-btn { font-size: 12px; padding: 5px 10px; }
  .detail-nav { flex-direction: column; }
  .detail-nav-item + .detail-nav-item { border-left: none; border-top: 1px solid var(--gray-200); }
  .detail-nav-item.is-next { text-align: left; }
  .detail-nav-item { padding: 12px 16px; }
  .header-inner { padding: 0 12px; }
  .logo img { height: 24px; }
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; }

  /* 페이지네이션 */
  .pagination { gap: 2px; flex-wrap: wrap; justify-content: center; }
  .page-btn { width: 32px; height: 32px; font-size: 12px; border-radius: 4px; }
  .page-btn.nav { padding: 0 10px; font-size: 12px; white-space: nowrap; }
}

/* ≤480px: 최소 모바일 */
@media (max-width: 480px) {
  .header { height: 44px; }
  .page-container { padding: 10px 8px; }
  .breadcrumb { font-size: 11px; margin-bottom: 10px; }
  .page-title { font-size: 16px; }
  .page-header { padding-bottom: 10px; margin-bottom: 10px; }
  .list-item { padding: 0 10px; min-height: 44px; gap: 6px; }
  .list-item-title { font-size: 12px; white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; }
  .list-item-date { font-size: 11px; width: auto; }
  .list-item-badge { font-size: 10px; padding: 1px 6px; min-width: 40px; }
  .list-item-desc { display: none; }
  .detail-title { font-size: 16px; }
  .detail-meta { font-size: 11px; }
  .detail-body { padding: 12px; font-size: 13px; line-height: 1.75; }
  .author-card { padding: 10px 12px; gap: 10px; }
  .author-avatar { width: 36px; height: 36px; font-size: 14px; }
  .pagination { margin-top: 14px; gap: 1px; }
  .page-btn { width: 28px; height: 28px; font-size: 11px; }
  .page-btn.nav { padding: 0 6px; font-size: 11px; }
  .footer { padding: 8px 10px; }
  .footer-inner { font-size: 10px; }
}
