/*
 * Royal Plaza — feuille de style éditoriale
 * Tailwind est chargé via le CDN dans head.html ; ce fichier complète les styles prose,
 * la typographie magazine et quelques détails d'accessibilité.
 */

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

body {
  font-feature-settings: "kern", "liga", "onum";
}

/* Sélection texte aux couleurs de la marque */
::selection {
  background-color: rgba(124, 58, 237, 0.18);
  color: #1f2937;
}

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

/* Anchor offset pour ne pas masquer la cible sous le header sticky */
:target {
  scroll-margin-top: 6rem;
}

/* ───────────── Prose éditoriale ───────────── */
.prose { max-width: 68ch; }

.prose h2 {
  font-size: 1.75rem;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 1.3rem;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
}

.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.85;
  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.55rem;
  color: #374151;
}

.prose blockquote {
  margin: 2rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
}

.prose a {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 500;
}
.prose a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.prose strong { font-weight: 600; }

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

/* Tables prose */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.prose thead {
  border-bottom: 2px solid #d1d5db;
}
.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #111827;
  background: #f9fafb;
}
.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;
  }
}

/* ───────────── Drop-cap article (single.html .article-prose) ───────────── */
/*
 * Drop-cap éditorial sur le premier paragraphe du corps article.
 * Désactivé sur mobile pour ne pas casser la lisibilité.
 */
@media (min-width: 768px) {
  .article-prose > p:first-of-type::first-letter {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 4.25rem;
    line-height: 0.95;
    float: left;
    padding: 0.4rem 0.6rem 0 0;
    color: #7c3aed;
    background: linear-gradient(135deg, #7c3aed 0%, #f97316 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* ───────────── Utilitaires (line-clamp, focus, pagination) ───────────── */
.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 visible accessible */
a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Pagination interne Hugo */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
  list-style: none;
  padding-left: 0;
}
.pagination li { list-style: none; }
.pagination a,
.pagination .active,
.pagination .disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.85rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Lato', 'Helvetica Neue', sans-serif;
  transition: all 0.2s;
}
.pagination a {
  color: #374151;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}
.pagination a:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #7c3aed;
}
.pagination .active {
  color: white;
  background: #7c3aed;
  border: 1px solid #7c3aed;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
  background: transparent;
  border: 1px solid transparent;
}

/* ───────────── Animations subtiles ───────────── */
@keyframes rp-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  section, article {
    animation: rp-fade-up 0.5s ease-out backwards;
  }
}

/* ───────────── Print ───────────── */
@media print {
  header, footer, nav, aside { display: none !important; }
  .prose { max-width: 100%; }
  .prose a { color: #1f2937; text-decoration: none; }
  .article-prose > p:first-of-type::first-letter {
    -webkit-text-fill-color: #1f2937;
    background: none;
    color: #1f2937;
  }
}
