/* expertise.css — 마음 지식 화면 (expertise.html · cards/*.html, 2026-10-31 expertise.html 에서 나눔) */
:root {
  /* Yuja Lemon System (Primary) — v2 Lemon Refresh */
  --yuja-lemon: #FFE135;
  --yuja-lemon-amber: #F5C800;
  --yuja-forest: #142814;
  --yuja-forest-mid: #1E3D1E;
  --yuja-lemon-tint: #FEFCE8;
  /* Yuja Brand Points */
  --leaf-green: #4CAA48;
  --leaf-green-mid: #388E3C;
  --leaf-green-deep: #2D7A29;
  --leaf-green-light: #B8E0B5;
  --leaf-green-tint: #E8F5E7;
  /* Notion Canvas */
  --canvas: #FFFFFF;
  --canvas-cream: #F7F6F3;
  --surface: #F1F0EE;
  --surface-soft: #F8F7F5;
  --hairline: #E8E7E4;
  --hairline-strong: #D3D1CB;
  /* Text */
  --ink-deep: #1A1A1A;
  --ink: #37352F;
  --charcoal: #4B4945;
  --slate: #6F6E69;
  --steel: #9B9A97;
  --stone: #B5B4B0;
  --on-dark: #FFFFFF;
  --on-dark-muted: rgba(255, 255, 255, 0.70);
  /* Semantic */
  --success: #0F7B5C;
  --warning: #E67E22;
  --error: #C82014;
  /* Shadows */
  --shadow-subtle: rgba(15, 15, 15, 0.04) 0px 1px 2px 0px;
  --shadow-card: rgba(15, 15, 15, 0.08) 0px 4px 12px 0px;
  --shadow-modal: rgba(15, 15, 15, 0.14) 0px 14px 40px -8px;
}

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

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas-cream);
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Top Nav ── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  justify-content: space-between;
}

.nav-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--yuja-forest);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-logo .logo-dot {
  width: 8px;
  height: 8px;
  background: var(--leaf-green);
  border-radius: 50%;
  display: inline-block;
}

.btn-secondary {
  padding: 9px 18px;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 150ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: var(--surface);
}

/* ── Hero ── */
.hero {
  background: var(--canvas-cream);
  padding: 64px 32px 48px;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
  color: var(--ink-deep);
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: var(--slate);
  line-height: 1.55;
  margin-bottom: 0;
}

/* ── Main Container ── */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

/* ── Index Panel (Filters) ── */
.index-panel {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-subtle);
}

.filter-section {
  margin-bottom: 24px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: block;
}

.search-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--canvas);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 150ms ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--yuja-lemon);
}

.search-input::placeholder {
  color: var(--stone);
}

.result-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
  white-space: nowrap;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
  user-select: none;
}

.filter-chip:hover {
  background: var(--surface);
}

.filter-chip.active {
  background: var(--yuja-lemon-amber);
  color: var(--on-dark);
  border-color: var(--yuja-lemon-amber);
}

/* Type-specific active colors (optional, but requested to keep Notion/Starbucks mix) 
   We will use the primary accent for active state for consistency, but keep the badges colored. */

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.knowledge-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
  box-shadow: var(--shadow-subtle);
  position: relative;
  overflow: hidden;
}

.knowledge-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* Top border accent */
.knowledge-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--yuja-lemon-amber);
  opacity: 0;
  transition: opacity 200ms ease;
}
.knowledge-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
}

/* Yuja Category Tags */
.badge-category {
  background: var(--leaf-green-light);
  color: var(--leaf-green-deep);
}

/* Type Badges */
.badge-type {
  background: var(--surface);
  color: var(--charcoal);
}
.badge-type.이론 { background: #EEF2FF; color: #4F46E5; }
.badge-type.연구 { background: #F0FDF4; color: #15803D; }
.badge-type.학자 { background: #FFF7ED; color: #C2410C; }
.badge-type.도서 { background: #FDF4FF; color: #7E22CE; }
.badge-type.사례 { background: #F0F9FF; color: #0369A1; }
.badge-type.칼럼 { background: #FFF1F2; color: #BE123C; }
.badge-type.뉴스 { background: #FFFBEB; color: #92400E; }
.badge-type.역사 { background: #F8FAFC; color: #475569; }
.badge-type.법칙 { background: #F0FDFA; color: #0F766E; }

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-deep);
  line-height: 1.3;
  margin-bottom: 8px;
}

.card-title .title-sub {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--charcoal);
  margin-top: 4px;
  line-height: 1.35;
}

.card-author {
  font-size: 14px;
  color: var(--slate);
  margin-bottom: 16px;
}

.card-body {
  font-size: 16px;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--surface);
  gap: 12px;
}

.card-source {
  font-size: 14px;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.card-source-label {
  font-weight: 600;
  color: var(--charcoal);
}

.has-links {
  display: flex;
  gap: 6px;
}

.link-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.link-dot.youtube { background: #DC2626; }
.link-dot.paper { background: #2563EB; }
.link-dot.web { background: #16A34A; }

/* ── Empty State ── */
.empty-state {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 80px 40px;
  text-align: center;
  color: var(--slate);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  animation: fadeIn 200ms ease;
}

.modal-overlay.open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--canvas);
  border-radius: 12px;
  max-width: min(98vw, 880px);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  box-shadow: var(--shadow-modal);
  animation: slideUp 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 32px;
  margin-top: 16px;
}

.modal-foot-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--canvas);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  transition: background 150ms ease, color 150ms ease;
}

.modal-foot-close:hover {
  background: var(--surface);
  color: var(--ink);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--canvas);
  cursor: pointer;
  font-size: 18px;
  color: var(--slate);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}

.modal-close:hover {
  background: var(--surface);
  color: var(--ink);
}

.modal-header {
  margin-bottom: 24px;
}
/* 닫기 버튼 자리는 제목 첫 줄만 비운다 — 괄호 병기·학자 이름은 끝까지 쓴다 */
.modal-header .modal-title { padding-right: 52px; }
.modal-header .modal-title .title-sub { margin-right: -52px; }

.modal-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.modal-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink-deep);
  line-height: 1.2;
  margin-bottom: 8px;
}

.modal-title .title-sub {
  display: block;
  font-size: 18px;
  font-weight: 500;
  color: var(--charcoal);
  margin-top: 6px;
  line-height: 1.35;
}

.modal-author {
  font-size: 16px;
  color: var(--slate);
}

.modal-body {
  font-size: 17px;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 32px;
}

.modal-body p {
  margin-bottom: 16px;
}
.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.modal-link-btn {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 150ms ease;
}

.modal-link-btn:hover {
  background: var(--canvas);
  border-color: var(--yuja-lemon-amber);
  color: var(--yuja-lemon-amber);
}

.modal-book {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.modal-book-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--yuja-lemon-amber);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.modal-book-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-deep);
  margin-bottom: 4px;
}

.modal-book-meta {
  font-size: 14px;
  color: var(--slate);
}

.modal-origin {
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--slate);
}

.modal-origin a {
  color: var(--yuja-lemon-amber);
  font-weight: 600;
  text-decoration: none;
}
.modal-origin a:hover {
  text-decoration: underline;
}

/* ── Footer ── */
footer {
  background: var(--yuja-forest);
  color: var(--on-dark-muted);
  text-align: center;
  padding: 48px 32px;
  font-size: 14px;
}

footer .footer-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--leaf-green);
  margin-bottom: 12px;
}

/* ── Floating Actions ── */
.floating-actions {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 90;
  align-items: flex-end;
}

.frap-btn {
  width: 50px;
  height: 50px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 150ms ease, color 150ms ease;
  color: var(--charcoal);
  text-decoration: none;
}

.frap-btn:hover {
  color: var(--yuja-lemon-amber);
}

.frap-btn:active {
  transform: scale(0.95);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .top-nav { padding: 0 16px; }
  .hero { padding: 48px 16px; }
  .main-container { padding: 0 16px 64px; }
  .index-panel { padding: 24px; }
  .search-row { flex-direction: column; align-items: stretch; }
  .result-count { align-self: flex-end; }
  .filter-chip-row { overflow-x: auto; padding-bottom: 8px; flex-wrap: nowrap; }
  .modal-overlay { padding: 8px; }
  .modal { padding: 20px 16px; max-height: 94dvh; }
  .modal-title { font-size: 24px; }
  .floating-actions { bottom: 24px; right: 16px; }
  .frap-btn { width: 44px; height: 44px; }
}

/* 마음 지식 안내 (P5, 2026-10-31) */
.yj-view-who { font-size: 13px; font-weight: 700; color: var(--ed-sub); margin-bottom: 6px; }
.yj-modal-note { margin: 20px 0 8px; font-size: 14px; line-height: 1.75; color: var(--ed-sub); }
.yj-modal-note a { color: var(--ed-ink); font-weight: 600; text-underline-offset: 3px; }
