/* ---------------------------------------------------------------------
   Hand-written CSS for the handful of classes used across templates that
   aren't plain Tailwind utilities. The Tailwind CDN build (see base.html /
   admin/base.html) provides everything else via its JIT compiler at
   runtime, but it can't process a custom stylesheet with @apply, so these
   are written out as plain CSS.
--------------------------------------------------------------------- */

/* Admin sidebar navigation links */
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.admin-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
.admin-nav-link.active {
  background-color: rgba(59, 130, 246, 0.15);
  color: #ffffff;
  border-left-color: #3b82f6;
}

/* Generic content card used throughout the admin UI and public site */
.card {
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.dark .card {
  background-color: #111827;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  background-color: #2563eb;
  color: #ffffff;
  transition: background-color 0.15s ease;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background-color: #1d4ed8; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  background-color: transparent;
  color: inherit;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn-secondary:hover { background-color: rgba(0, 0, 0, 0.04); }
.dark .btn-secondary { border-color: #374151; }
.dark .btn-secondary:hover { background-color: rgba(255, 255, 255, 0.06); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  background-color: #dc2626;
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn-danger:hover { background-color: #b91c1c; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

/* Multi-line text truncation (Tailwind's line-clamp plugin isn't loaded via the CDN build) */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Minimal "prose" styling fallback for rendered post content
   (Tailwind's official typography plugin isn't loaded via the CDN build) */
.prose { max-width: 65ch; line-height: 1.75; }
.prose h2 { font-size: 1.5rem; font-weight: 800; margin-top: 2rem; margin-bottom: 1rem; }
.prose h3 { font-size: 1.25rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.prose p { margin-top: 1rem; margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 1rem 0; padding-left: 1.5rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0.375rem 0; }
.prose a { color: #2563eb; text-decoration: underline; }
.prose img { border-radius: 0.75rem; margin: 1.5rem 0; }
.prose blockquote { border-left: 4px solid #93c5fd; padding-left: 1rem; font-style: italic; color: #6b7280; margin: 1.5rem 0; }
.prose code { background: rgba(0,0,0,0.06); padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-size: 0.875em; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 0.75rem; overflow-x: auto; }
.prose pre code { background: transparent; padding: 0; }
.dark .prose { color: #e5e7eb; }
.dark .prose blockquote { color: #9ca3af; }
.dark .prose code { background: rgba(255,255,255,0.08); }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.11) 37%, rgba(0,0,0,0.06) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 0.5rem;
}
.dark .skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.05) 63%);
  background-size: 400% 100%;
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Simple content-editable rich text toolbar surface */
.rte-surface { min-height: 320px; outline: none; }
.rte-surface:empty:before { content: attr(data-placeholder); color: #9ca3af; }

/* Drag-and-drop upload zone */
.dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dropzone:hover { border-color: #3b82f6; background-color: rgba(59,130,246,0.04); }
.dark .dropzone { border-color: #374151; }

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