/*
 * Aux Pierres Magiques — Custom Theme Styles
 * Palette 4: Violet (#7c3aed) / Deep Violet (#6d28d9) / Orange (#f97316)
 * Fonts 5: Merriweather (headings) / Nunito (body)
 */

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

/* ——— Transitions ——— */
a, button {
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* ——— Hero crystal decorations ——— */
.crystal {
  position: absolute;
  opacity: 0.08;
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #f97316 100%);
}

.crystal-1 {
  width: 180px;
  height: 240px;
  top: -40px;
  left: 8%;
  clip-path: polygon(50% 0%, 100% 35%, 85% 100%, 15% 100%, 0% 35%);
  animation: float-slow 18s ease-in-out infinite;
}

.crystal-2 {
  width: 120px;
  height: 160px;
  bottom: 10%;
  right: 12%;
  clip-path: polygon(50% 0%, 90% 30%, 100% 70%, 65% 100%, 35% 100%, 0% 70%, 10% 30%);
  animation: float-slow 22s ease-in-out infinite reverse;
  opacity: 0.06;
}

.crystal-3 {
  width: 80px;
  height: 110px;
  top: 30%;
  right: 5%;
  clip-path: polygon(50% 0%, 100% 40%, 80% 100%, 20% 100%, 0% 40%);
  animation: float-slow 15s ease-in-out infinite 3s;
  opacity: 0.05;
}

.crystal-4 {
  width: 60px;
  height: 85px;
  bottom: 20%;
  left: 15%;
  clip-path: polygon(50% 0%, 95% 25%, 100% 65%, 70% 100%, 30% 100%, 0% 65%, 5% 25%);
  animation: float-slow 20s ease-in-out infinite 6s;
  opacity: 0.04;
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(3deg); }
}

/* ——— Hero sparkle accents ——— */
.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #f97316;
  border-radius: 50%;
  animation: sparkle-pulse 4s ease-in-out infinite;
}

.sparkle-1 { top: 25%; left: 20%; animation-delay: 0s; }
.sparkle-2 { top: 40%; right: 25%; animation-delay: 1.5s; }
.sparkle-3 { bottom: 30%; left: 35%; animation-delay: 3s; }

@keyframes sparkle-pulse {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* ——— Hero divider ——— */
.hero-divider {
  display: inline-block;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f97316, transparent);
  margin: 1.5rem auto;
}

/* ——— Card hover effect ——— */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

/* ——— Pillar icon shapes ——— */
.pillar-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(109, 40, 217, 0.05));
  margin-bottom: 1.25rem;
}

.pillar-icon svg {
  width: 28px;
  height: 28px;
  stroke: #7c3aed;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ——— Prose — Article content styling ——— */
.prose {
  max-width: 68ch;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.prose h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: #374151;
}

.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.5rem;
  color: #374151;
  line-height: 1.7;
}

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

.prose a {
  color: #6d28d9;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 0.2s;
}

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

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

.prose img {
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

/* ——— Tables ——— */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
}

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

.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: #faf5ff;
}

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

/* ——— Line clamp ——— */
.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;
}

/* ——— Focus states (a11y) ——— */
a:focus-visible, button:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ——— Pagination ——— */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  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: #ede9fe;
  color: #6d28d9;
}

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

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

/* ——— Header scroll shadow ——— */
.header-scrolled {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

/* ——— Mobile menu transition ——— */
.mobile-menu-enter {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

.mobile-menu-open {
  max-height: 400px;
  opacity: 1;
}

/* ——— Section decorative separator ——— */
.section-sep {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #f97316);
  border-radius: 2px;
  margin: 0 auto 2rem;
}

/* ——— Print ——— */
@media print {
  header, footer, nav { display: none !important; }
  .prose { max-width: 100%; }
}
