/*
 * LINKER Hugo Base - Custom CSS
 * Note: TailwindCSS est chargé via CDN dans head.html
 * Ce fichier est pour les styles custom additionnels
 */

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

/* 2026-12-04 passe UI/UX : titres équilibrés (pas de mot orphelin en fin de titre), paragraphes sans veuve,
   ancres qui ne passent pas sous l'en-tête collant, sélection aux couleurs du site, respect de « réduire les animations ». */
h1, h2 { text-wrap: balance; }
h3, p, li, figcaption { text-wrap: pretty; }
[id] { scroll-margin-top: 6rem; }
::selection { background: rgb(var(--color-primary) / 0.25); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

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

/* Prose styling pour le contenu markdown */
.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.75;
  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;
}
.prose blockquote {
  border-left: 4px solid;
  padding: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #57534e;
  background: #fafaf9;
  border-radius: 0 0.5rem 0.5rem 0;
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 0.2s;
}
.prose a:hover {
  text-decoration-thickness: 2px;
}
.prose strong {
  font-weight: 600;
}
.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;
  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;
  }
}

/* Line clamp 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 states pour accessibilité */
a:focus-visible, button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Pagination (Hugo internal template) */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  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.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.pagination a {
  color: #374151;
  background: #f3f4f6;
}
.pagination a:hover {
  background: #e5e7eb;
}
.pagination .active {
  color: white;
  background: var(--tw-color-primary, #2563eb);
}
.pagination .disabled {
  opacity: 0.5;
  pointer-events: none;
}

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

/* Table styling */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.prose table th {
  background-color: #f3f4f6;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border: 1px solid #e5e7eb;
}
.prose table td {
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
}
.prose table tr:nth-child(even) {
  background-color: #f9fafb;
}

/* =====================================================================================================================
   2026-12-05 refonte des gabarits service / zone / service + ville (ui/page-locale.html) — corps éditorial mis en page.
   Les numéros de section sont des compteurs CSS (aucun texte ajouté dans le HTML).
   ===================================================================================================================== */
#contenu { counter-reset: plsec; }
.pl-corps { color: #374151; font-size: 1.0625rem; line-height: 1.8; }
.pl-corps > * { margin-top: 0; margin-bottom: 0; }
.pl-corps > * + * { margin-top: 1.15rem; }
.pl-corps strong { color: #111827; font-weight: 650; background: linear-gradient(transparent 62%, rgb(var(--color-primary) / 0.22) 62%); }
.pl-corps a { color: rgb(var(--color-secondary)); font-weight: 600; text-decoration: underline; text-decoration-color: rgb(var(--color-primary) / 0.45); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.pl-corps a:hover { color: rgb(var(--color-accent)); text-decoration-color: rgb(var(--color-accent)); }
.pl-corps h3 { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: #111827; line-height: 1.35; margin-top: 2rem; }
.pl-intro { font-size: 1.15rem; line-height: 1.75; color: #1f2937; padding-bottom: 2.25rem; margin-bottom: .5rem; border-bottom: 1px solid #e5e7eb; }
@media (min-width: 768px) { .pl-intro { font-size: 1.25rem; } }
.pl-intro > p:first-child::first-letter { font-family: var(--font-heading); font-weight: 700; float: left; font-size: 3.4em; line-height: .9; margin: .08em .12em 0 0; color: rgb(var(--color-secondary)); }
.pl-section { counter-increment: plsec; padding-top: 2.75rem; }
.pl-section + .pl-section { margin-top: .75rem; border-top: 1px solid #f0f0f0; }
.pl-h2 { position: relative; font-size: 1.55rem; line-height: 1.25; font-weight: 700; color: #111827; letter-spacing: -0.01em; margin-bottom: 1.25rem; text-wrap: balance; }
@media (min-width: 768px) { .pl-h2 { font-size: 1.9rem; } }
.pl-h2::before { content: counter(plsec, decimal-leading-zero); display: flex; align-items: center; justify-content: center; min-width: 2.6rem; height: 1.7rem; padding: 0 .6rem; margin-bottom: .9rem; border-radius: 999px; background: rgb(var(--color-primary) / 0.12); color: rgb(var(--color-secondary)); font-family: var(--font-body); font-size: .78rem; font-weight: 700; letter-spacing: .08em; width: max-content; }
/* listes : cartes à coche */
.pl-corps ul { list-style: none; padding: 0; display: grid; gap: .65rem; }
@media (min-width: 640px) { .pl-section .pl-corps ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pl-corps ul > li { position: relative; margin: 0; padding: .9rem 1rem .9rem 3rem; border-radius: 1rem; background: #fafaf9; border: 1px solid #ececea; line-height: 1.6; font-size: 1rem; }
.pl-corps ul > li::before { content: ""; position: absolute; left: 1rem; top: 1.05rem; width: 1.3rem; height: 1.3rem; border-radius: 999px; background: rgb(var(--color-accent)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.7 5.3a1 1 0 0 1 0 1.4l-8 8a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.4L8 12.6l7.3-7.3a1 1 0 0 1 1.4 0Z' clip-rule='evenodd'/%3E%3C/svg%3E") center / .85rem no-repeat; }
.pl-corps ol { padding-left: 1.4rem; list-style: decimal; }
.pl-corps ol > li { margin-top: .5rem; padding-left: .3rem; }
.pl-corps ol > li::marker { color: rgb(var(--color-secondary)); font-weight: 700; }
/* images du corps : pleine colonne, coins arrondis, ombre */
.pl-corps p:has(> img.corps-img) { margin: 2rem 0; }
.pl-corps img.corps-img, .corps-img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 1.5rem; box-shadow: 0 25px 50px -20px rgb(17 24 39 / .35); }
@media (min-width: 1024px) { .pl-corps p:has(> img.corps-img) { margin-left: -2rem; margin-right: -2rem; } }
.pl-corps blockquote { border-left: 4px solid rgb(var(--color-primary)); background: #fafaf9; border-radius: 0 1rem 1rem 0; padding: 1.1rem 1.4rem; color: #44403c; }
.pl-corps table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: .95rem; }
.pl-corps th, .pl-corps td { padding: .6rem .8rem; border-bottom: 1px solid #e5e7eb; text-align: left; }
/* FAQ */
.pl-faq summary::-webkit-details-marker { display: none; }
.pl-faq-reponse > * + * { margin-top: .9rem; }
.pl-faq-reponse a { color: rgb(var(--color-secondary)); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
/* sommaire */
.pl-sommaire summary::-webkit-details-marker { display: none; }
.pl-sommaire-lien.is-actif { color: #111827; font-weight: 600; }
@media (min-width: 1024px) { .pl-sommaire-lien.is-actif { border-left-color: rgb(var(--color-accent)); } }
/* raccourci flottant de devis (téléphone) */
.pl-barre { transform: translateY(120%); transition: transform .3s ease; background: linear-gradient(to top, rgb(255 255 255 / .96) 55%, rgb(255 255 255 / 0)); }
.pl-barre.pl-barre-on { transform: translateY(0); }
/* page contact (2026-12-05) : intro et mention de confidentialité autour du formulaire */
.pl-contact > p { font-size: 1.05rem; line-height: 1.7; color: #374151; }
.pl-contact > p:first-child { font-size: 1.1rem; color: #1f2937; padding-bottom: 1.75rem; margin-bottom: 1.75rem; border-bottom: 1px solid #f0f0ee; }
.pl-contact > p:last-child { margin-top: 1.5rem; font-size: .875rem; color: #6b7280; }
.pl-contact > p:last-child a, .pl-contact a { color: rgb(var(--color-secondary)); text-decoration: underline; text-underline-offset: 3px; }
/* H2 et H3 du corps des listes (/services/, /zones/) et des articles (2026-12-05) */
.pl-corps h2 { font-family: var(--font-heading); font-size: 1.5rem; line-height: 1.25; font-weight: 700; color: #111827; letter-spacing: -0.01em; text-wrap: balance; }
@media (min-width: 768px) { .pl-corps h2 { font-size: 1.85rem; } }
.pl-corps > h2 { margin-top: 2.75rem; }
.pl-corps > h2::before { content: ""; display: block; width: 2.5rem; height: .25rem; border-radius: 999px; background: rgb(var(--color-primary)); margin-bottom: 1rem; }
.pl-corps > h3 { margin-top: 2rem; }
.pl-article > p:first-child { font-size: 1.15rem; color: #1f2937; }
