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

html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-feature-settings: 'ss01', 'ss02';
}

img { max-width: 100%; height: auto; }

/* Card hover — subtle lift */
.post-card {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
  border: 1px solid #E5E7EB;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -12px rgba(15, 17, 23, 0.12), 0 4px 8px -4px rgba(15, 17, 23, 0.06);
  border-color: #D4D4D8;
}

/* Tag chip */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: #F5F5F7;
  color: #1A1A1A;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}
.chip:hover { background: #EEEEF2; }
.chip.active {
  background: #4F46E5;
  color: #ffffff;
  border-color: #4F46E5;
}

/* Small inline tag (inside a card / detail) */
.tag-inline {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(79, 70, 229, 0.08);
  color: #4F46E5;
  transition: background-color 160ms ease;
}
.tag-inline:hover { background: rgba(79, 70, 229, 0.14); }

/* Category button */
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  margin-left: -10px;
  border-radius: 8px;
  font-size: 14px;
  color: #1A1A1A;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease;
}
.cat-item:hover { background: #F5F5F7; }
.cat-item.active { background: rgba(79, 70, 229, 0.08); color: #4F46E5; font-weight: 600; }
.cat-item .count { font-size: 12px; color: #6B7280; }
.cat-item.active .count { color: #4F46E5; }

/* Skeleton */
.skeleton-card {
  height: 180px;
  border-radius: 14px;
  background: linear-gradient(90deg, #F5F5F7 0%, #EEEEF2 50%, #F5F5F7 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Article prose */
.prose-body { font-size: 17px; line-height: 1.8; color: #1A1A1A; }
.prose-body p { margin: 0 0 1.2em; }
.prose-body h2 { font-size: 1.5rem; font-weight: 700; margin: 2em 0 0.7em; letter-spacing: -0.01em; }
.prose-body h3 { font-size: 1.2rem; font-weight: 600; margin: 1.6em 0 0.6em; }
.prose-body ul, .prose-body ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose-body li { margin-bottom: 0.4em; }
.prose-body blockquote {
  border-left: 3px solid #4F46E5;
  padding: 4px 0 4px 16px;
  color: #6B7280;
  font-style: italic;
  margin: 1.4em 0;
}
.prose-body code {
  background: #F5F5F7;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  color: #4F46E5;
}

/* Toast visible */
#toast.show { opacity: 1; transform: translate(-50%, -6px); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Popular list item */
.popular-item {
  display: block;
  padding: 2px 0;
  transition: color 160ms ease;
}
.popular-item:hover .popular-title { color: #4F46E5; }
.popular-item .popular-num {
  font-size: 12px;
  font-weight: 700;
  color: #4F46E5;
  letter-spacing: 0.02em;
}
.popular-item .popular-title {
  font-size: 14px;
  color: #1A1A1A;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 160ms ease;
}
.popular-item .popular-meta { font-size: 12px; color: #6B7280; margin-top: 3px; }

/* Focus */
:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
  border-radius: 4px;
}
</style>
