/*
 * Jouets Vintage — Custom Styles
 * Palette #4 Violet/Orange | Fonts #2 Playfair Display / Lato
 * TailwindCSS loaded via CDN in head.html
 */

/* ═══════════════════════════════════════════ */
/* BASE RESETS                                 */
/* ═══════════════════════════════════════════ */

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

::selection {
  background-color: #7c3aed;
  color: #ffffff;
}

/* ═══════════════════════════════════════════ */
/* ARTICLE PROSE — Premium Typography          */
/* ═══════════════════════════════════════════ */

.article-prose {
  max-width: 65ch;
}

/* H2 — Left accent bar */
.article-prose h2 {
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  scroll-margin-top: 5rem;
  position: relative;
  padding-left: 1.25rem;
}

.article-prose h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  background: linear-gradient(180deg, #7c3aed, #f97316);
  border-radius: 2px;
}

/* H3 — Subtle dot prefix */
.article-prose h3 {
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  scroll-margin-top: 5rem;
}

.article-prose p {
  margin-bottom: 1.35rem;
}

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

.article-prose li {
  margin-bottom: 0.6rem;
}

/* Blockquote — Card-style callout */
.article-prose blockquote {
  position: relative;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), rgba(249, 115, 22, 0.04));
  border-radius: 1rem;
  padding: 1.5rem 1.75rem 1.5rem 3.5rem;
  margin: 2rem 0;
  border: 1px solid rgba(124, 58, 237, 0.1);
}

.article-prose blockquote::before {
  content: '\201C';
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  font-size: 3rem;
  line-height: 1;
  color: #7c3aed;
  opacity: 0.3;
  font-family: 'Playfair Display', serif;
}

.article-prose blockquote p {
  color: #4b5563;
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* Tables — Clean and elegant */
.article-prose table {
  font-size: 0.9em;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.article-prose table thead th {
  background-color: #f9fafb;
  font-weight: 700;
  border-bottom: 2px solid #e5e7eb;
}

.article-prose table tbody tr {
  transition: background-color 0.15s;
}

.article-prose table tbody tr:hover {
  background-color: #faf5ff;
}

/* Lists — Enhanced with accent colored numbers */
.article-prose ol {
  counter-reset: list-counter;
  list-style: none;
  padding-left: 0;
}

.article-prose ol > li {
  counter-increment: list-counter;
  padding-left: 2.5rem;
  position: relative;
}

.article-prose ol > li::before {
  content: counter(list-counter);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.75rem;
  height: 1.75rem;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Unordered lists — Custom bullet */
.article-prose ul {
  list-style: none;
  padding-left: 0;
}

.article-prose ul > li {
  padding-left: 1.75rem;
  position: relative;
}

.article-prose ul > li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: #f97316;
  border-radius: 50%;
}

/* Nested lists */
.article-prose ul ul > li::before,
.article-prose ol ul > li::before {
  background: #d1d5db;
  width: 5px;
  height: 5px;
}

/* Inline code */
.article-prose :not(pre) > code {
  background: #f3f0ff;
  color: #7c3aed;
  padding: 0.15em 0.4em;
  border-radius: 0.35rem;
  font-size: 0.88em;
  font-weight: 500;
}

/* Horizontal rule */
.article-prose hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #e5e7eb, transparent);
  margin: 3rem 0;
}

/* ═══════════════════════════════════════════ */
/* PROSE (legacy — non-article pages)          */
/* ═══════════════════════════════════════════ */

.prose {
  max-width: 65ch;
}

.prose h2 {
  scroll-margin-top: 5rem;
}

.prose h3 {
  scroll-margin-top: 5rem;
}

/* ═══════════════════════════════════════════ */
/* 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;
}

/* ═══════════════════════════════════════════ */
/* FOCUS & ACCESSIBILITY                       */
/* ═══════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════ */
/* TRANSITIONS                                 */
/* ═══════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════ */
/* HERO ANIMATION                              */
/* ═══════════════════════════════════════════ */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* ═══════════════════════════════════════════ */
/* READING PROGRESS BAR                        */
/* ═══════════════════════════════════════════ */

#reading-progress {
  transition: width 0.15s ease-out;
}

/* ═══════════════════════════════════════════ */
/* PRINT                                       */
/* ═══════════════════════════════════════════ */

@media print {
  header, footer, nav, aside, .no-print, #reading-progress, #toc-container {
    display: none !important;
  }

  .prose, .article-prose {
    max-width: 100%;
  }

  body {
    background: white;
    color: black;
  }
}
