/*
 * Mon Petit Bolide — Custom Styles
 * Complement TailwindCSS CDN (charge dans head.html)
 */

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

/* ---- Prose (contenu articles markdown) ---- */
.prose {
  max-width: 68ch;
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

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

.prose li {
  margin-bottom: 0.5rem;
}

.prose blockquote {
  border-left: 3px solid;
  padding-left: 1.25rem;
  margin: 2rem 0;
  font-style: italic;
}

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

/* ---- Article content : drop cap (premiere lettre du premier paragraphe) ---- */
.article-content > p:first-of-type::first-letter {
  float: left;
  font-size: 3.5rem;
  line-height: 0.8;
  font-weight: 700;
  margin-right: 0.5rem;
  margin-top: 0.15rem;
  color: #dc2626;
  font-family: 'Oswald', sans-serif;
}

/* ---- TOC (table of contents) ---- */
#toc a {
  display: block;
  padding: 0.35rem 0;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
  border-left: 2px solid transparent;
  margin-left: -1.125rem;
  padding-left: 0.875rem;
}

#toc a:hover {
  color: #111827;
}

#toc a.toc-active {
  color: #dc2626;
  border-left-color: #dc2626;
  font-weight: 500;
}

#toc a.toc-h3 {
  padding-left: 1.5rem;
  font-size: 0.8rem;
  margin-left: -1.125rem;
}

/* ---- 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 / Accessibilite ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

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

/* ---- Hero parallaxe subtile ---- */
.hero-bg {
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

@media (max-width: 768px) {
  .hero-bg {
    background-attachment: scroll;
  }
}

/* ---- Cards hover lift ---- */
.card-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* ---- Image zoom au hover ---- */
.img-zoom {
  transition: transform 0.5s ease;
}

.group:hover .img-zoom {
  transform: scale(1.05);
}

/* ---- Back to top button ---- */
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Reading progress bar ---- */
#reading-progress {
  will-change: width;
}

/* ---- Print ---- */
@media print {
  header,
  footer,
  nav,
  #back-to-top,
  #reading-progress,
  aside {
    display: none !important;
  }

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