/*
 * Boulangerie Le Goff Derval — Custom CSS
 * Palette : Orange brûlé / Teal sur fond crème
 * WCAG AA respecté : tous les couples texte/fond ont un contraste ≥ 4.5:1
 */

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

body {
  background-color: #fdfaf6;
  color: #1c1917;
  font-family: 'Nunito', system-ui, sans-serif;
}

/* Texture papier kraft subtile sur fond global */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 25% 30%, rgba(194,65,12,0.03) 0, transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(20,184,166,0.03) 0, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

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

/* ---------- Focus accessibilité ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid #c2410c;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: .75rem 1rem;
  background: #c2410c;
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 .5rem 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header sticky avec backdrop blur ---------- */
.site-header {
  background: rgba(253,250,246,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid rgba(194,65,12,0.12);
}

/* ---------- Hero ornaments (séparateur "épi" en bas du hero) ---------- */
.hero-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  width: 100%;
  height: 48px;
  display: block;
}

/* ---------- Carte rubrique : underline animé sur hover ---------- */
.cat-card {
  position: relative;
  isolation: isolate;
}
.cat-card::after {
  content: '';
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.25rem;
  height: 2px;
  background: linear-gradient(90deg, #c2410c 0%, #14b8a6 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}
.cat-card:hover::after,
.cat-card:focus-within::after { transform: scaleX(1); }

/* ---------- Pilier d'engagement : icône "tampon" ---------- */
.pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f9f0e3;
  border: 1.5px solid rgba(194,65,12,0.25);
  color: #7c2d12;
}

/* ---------- Bouton primaire : fond foncé pour contraste AA garanti ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: #c2410c;
  color: #fff;
  border-radius: .5rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 6px 14px -6px rgba(124,45,18,.4);
}
.btn-primary:hover {
  background: #9a3412;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px rgba(124,45,18,.5);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: rgba(255,255,255,.95);
  color: #7c2d12;
  border: 1.5px solid rgba(124,45,18,.3);
  border-radius: .5rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
}
.btn-secondary:hover {
  background: #fff;
  border-color: #c2410c;
  transform: translateY(-1px);
}

/* ---------- Tag/chip catégorie ---------- */
.chip {
  display: inline-block;
  padding: .25rem .75rem;
  background: rgba(194,65,12,.08);
  color: #7c2d12;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(194,65,12,.18);
}

/* ---------- Prose (markdown) ---------- */
.prose { max-width: 70ch; }
.prose h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.6rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1c1917;
  position: relative;
  padding-left: 1rem;
}
.prose h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: .5em;
  bottom: .5em;
  width: 4px;
  background: #c2410c;
  border-radius: 2px;
}
.prose h3 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: .75rem;
  font-weight: 700;
  color: #44403c;
}
.prose p {
  margin-bottom: 1.4rem;
  line-height: 1.78;
  color: #1c1917;
}
.prose ul, .prose ol {
  margin-bottom: 1.4rem;
  padding-left: 1.5rem;
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li {
  margin-bottom: .5rem;
  color: #1c1917;
}
.prose blockquote {
  border-left: 4px solid #c2410c;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #44403c;
  background: #fdf6ec;
  border-radius: 0 .5rem .5rem 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose a {
  color: #9a3412;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.prose a:hover {
  color: #c2410c;
  text-decoration-thickness: 2px;
}
.prose strong { font-weight: 700; color: #1c1917; }
.prose img {
  border-radius: .75rem;
  margin: 1.75rem 0;
}

/* ---------- Tables ---------- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: .95rem;
  border: 1px solid #f0dcc1;
  border-radius: .5rem;
  overflow: hidden;
}
.prose thead { background: #f9f0e3; }
.prose th {
  padding: .85rem 1rem;
  text-align: left;
  font-weight: 700;
  color: #7c2d12;
  font-family: 'Merriweather', serif;
  font-size: .9rem;
}
.prose td {
  padding: .75rem 1rem;
  border-top: 1px solid #f0dcc1;
  color: #1c1917;
}
.prose tbody tr:hover { background: #fdf6ec; }
@media (max-width: 640px) {
  .prose table { font-size: .85rem; }
  .prose th, .prose td { padding: .55rem .65rem; }
}

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

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #f0dcc1;
}
.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 .75rem;
  border-radius: .5rem;
  font-size: .9rem;
  font-weight: 600;
}
.pagination a {
  color: #44403c;
  background: #fff;
  border: 1px solid #f0dcc1;
}
.pagination a:hover {
  background: #f9f0e3;
  border-color: #c2410c;
}
.pagination .active {
  color: #fff;
  background: #c2410c;
  border: 1px solid #c2410c;
}
.pagination .disabled { opacity: .4; pointer-events: none; }

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

/* ---------- Reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}
