/* ================================
   Custom CSS — 내 블로그
   ================================ */

/* Font */
:root {
  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --accent: #0f172a;
}

html {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
}

/* ================================
   View Transitions
   ================================ */
.view {
  animation: fadeIn 0.25s ease-out both;
}

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

/* ================================
   Post List Item
   ================================ */
.post-item {
  border-bottom: 1px solid #f1f5f9;
  padding: 2rem 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.post-item:last-child {
  border-bottom: none;
}

.post-item:hover .post-title {
  color: #475569;
}

.post-item .post-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  transition: color 0.15s ease;
}

@media (min-width: 640px) {
  .post-item .post-title {
    font-size: 1.4rem;
  }
}

.post-item .post-excerpt {
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-item .post-meta {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

/* ================================
   Detail Article
   ================================ */
#detail-content h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  #detail-content h1 {
    font-size: 2.5rem;
  }
}

#detail-content .detail-meta {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #f1f5f9;
}

#detail-content .detail-body {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: #1e293b;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ================================
   Textarea auto-grow feel
   ================================ */
#post-body {
  min-height: 320px;
}

/* ================================
   Toast
   ================================ */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: #0f172a;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.25s ease-out both;
  max-width: 360px;
}

.toast.toast-error {
  background: #ef4444;
}

.toast.toast-success {
  background: #0f172a;
}

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

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

/* ================================
   Modal
   ================================ */
#delete-modal.modal-open {
  display: flex;
}

/* ================================
   Focus styles
   ================================ */
*:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

/* ================================
   Reduced motion
   ================================ */
@media (prefers-reduced-motion: reduce) {
  .view,
  .toast,
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================
   Scrollbar (subtle)
   ================================ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}
