/*
 * BE Dampierre — Custom Theme Styles
 * Palette: Violet (#7c3aed) / Deep Violet (#6d28d9) / Orange (#f97316)
 * Fonts: Playfair Display (headings) / Lato (body)
 * TailwindCSS is loaded via CDN in head.html for utility classes.
 * This file handles prose styling, pagination, and edge cases.
 */

/* ==========================================================================
   BASE
   ========================================================================== */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Lato', system-ui, -apple-system, sans-serif;
  color: #1f2937;
  line-height: 1.7;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  line-height: 1.25;
}

a, button {
  transition: color 0.2s ease, background-color 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================================================
   PROSE — Article body content styling
   ========================================================================== */

.prose {
  max-width: 68ch;
}

/* Drop cap on first paragraph */
.prose > p:first-of-type::first-letter {
  font-family: 'Playfair Display', Georgia, serif;
  float: left;
  font-size: 3.25rem;
  line-height: 0.85;
  font-weight: 700;
  color: #7c3aed;
  margin-right: 0.15rem;
  margin-top: 0.1rem;
}

.prose h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ede9fe;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}

.prose h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #1f2937;
}

.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.85;
  color: #374151;
  font-size: 1.0125rem;
}

.prose a {
  color: #7c3aed;
  text-decoration: underline;
  text-decoration-color: #ddd6fe;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  font-weight: 500;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.prose a:hover {
  text-decoration-color: #7c3aed;
}

.prose strong {
  color: #111827;
  font-weight: 700;
}

.prose ul, .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }

.prose li {
  margin-bottom: 0.625rem;
  color: #374151;
  line-height: 1.75;
  font-size: 1.0125rem;
}

.prose ul li::marker { color: #f97316; }
.prose ol li::marker { color: #7c3aed; font-weight: 600; }

.prose blockquote {
  border-left: 3px solid #7c3aed;
  padding: 1.25rem 1.75rem;
  margin: 2rem 0;
  background: #faf5ff;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #4b5563;
  line-height: 1.75;
}

.prose img {
  border-radius: 10px;
  margin: 2rem 0;
}

.prose hr {
  border: none;
  height: 1px;
  background: #e5e7eb;
  margin: 2.5rem 0;
}

/* Prose Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
  overflow-x: auto;
  display: block;
}

.prose thead {
  border-bottom: 2px solid #d1d5db;
}

.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  background: #f9fafb;
  white-space: nowrap;
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}

.prose tbody tr:hover {
  background: #f9fafb;
}

@media (max-width: 640px) {
  .prose th, .prose td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.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;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

a:focus-visible, button:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   PAGINATION — Hugo internal template
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.pagination li {
  list-style: none;
}

.pagination a, .pagination .active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.pagination a {
  color: #374151;
  background: #f3f4f6;
}

.pagination a:hover {
  background: #e5e7eb;
  color: #111827;
}

.pagination .active {
  color: white;
  background: #7c3aed;
}

.pagination .disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
  header, footer, nav, .pagination { display: none !important; }
  .prose { max-width: 100%; }
  body { color: #000; background: #fff; }
}
