/*
 * L'Actualité Roquefortoise — feuille de styles éditoriale
 * ----------------------------------------------------------------------------
 * Tailwind est chargé via CDN (head.html) avec primary/secondary/accent
 * remappés sur la palette Vert/Indigo. Ce fichier contient :
 *   1. Base : antialiasing, scroll, focus accessibles
 *   2. Composants éditoriaux : kicker, lede, eyebrow, section heading
 *   3. Hero : titre, chips, décor topographique
 *   4. Cartes : rubrique, article, manifeste, place, tag
 *   5. Navigation : nav-link, footer link
 *   6. Prose / typographie longue forme (single.html)
 *   7. Pagination, impression, helpers
 *
 * Contrastes : tous les couples couleur/fond respectent WCAG AA (≥ 4.5:1).
 */

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

body {
  background: #fafaf9; /* stone-50 — papier crème */
}

a, button {
  transition: color 0.18s ease, background-color 0.18s ease,
              border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

/* Focus accessibles globaux (anneau vert sur fond clair, blanc sur fond sombre) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #047857;
  outline-offset: 3px;
  border-radius: 4px;
}
.bg-emerald-950 a:focus-visible,
.bg-stone-900 a:focus-visible,
.bg-emerald-950 button:focus-visible,
.bg-stone-900 button:focus-visible {
  outline-color: #ffffff;
}

/* =================================================================
   2. COMPOSANTS ÉDITORIAUX
   ================================================================= */

/* Eyebrow (au-dessus des titres de section) */
.section-eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #047857; /* emerald-700 — ratio 4.57 sur blanc, AA OK */
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}
.section-eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.75rem;
  height: 2px;
  background: #047857;
  border-radius: 1px;
}

/* Heading de section */
.section-heading {
  letter-spacing: -0.01em;
  line-height: 1.15;
}

/* =================================================================
   3. HERO
   ================================================================= */

.hero {
  /* min-h pour éviter un hero trop court sur grands écrans */
  min-height: 32rem;
  display: flex;
  align-items: center;
}
@media (min-width: 768px) {
  .hero { min-height: 38rem; }
}

/* Topographic SVG : positionné en couvrant le hero */
.hero-topographic svg {
  display: block;
}

/* Kicker éditorial (mention au-dessus du titre) */
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #6ee7b7; /* emerald-300 — ratio 9.3 sur emerald-950 */
  margin-bottom: 1.5rem;
}
.hero-kicker__bar {
  display: inline-block;
  width: 2rem;
  height: 2px;
  background: #34d399; /* emerald-400 */
  border-radius: 1px;
}
.hero-kicker__sep {
  opacity: 0.6;
}

/* Titre hero — tonalité éditoriale forte */
.hero-title {
  letter-spacing: -0.025em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25);
}
.hero-title__italic {
  color: #a7f3d0; /* emerald-200 — ratio ~12 sur emerald-950, AAA */
  font-feature-settings: "salt" 1, "ss01" 1;
}

/* Lede du hero */
.hero-lede {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.2);
}

/* Chips de navigation rapide (4 catégories sous le hero) */
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(2px);
}
.hero-chip:hover,
.hero-chip:focus-visible {
  background: #ffffff;
  color: #064e3b; /* emerald-900 — ratio 11+, AAA */
  border-color: #ffffff;
  transform: translateY(-1px);
}
.hero-chip__arrow {
  font-size: 0.875em;
  transition: transform 0.18s ease;
}
.hero-chip:hover .hero-chip__arrow,
.hero-chip:focus-visible .hero-chip__arrow {
  transform: translateX(2px);
}

/* =================================================================
   4. CARTES
   ================================================================= */

/* --- Rubrique (4 cartes des catégories sur la home) --- */
.rubrique-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e7e5e4; /* stone-200 */
  border-radius: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.rubrique-card:hover,
.rubrique-card:focus-visible {
  border-color: #047857;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(4, 120, 87, 0.35);
}
.rubrique-card__body {
  padding: 1.5rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}
.rubrique-card__index {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #57534e; /* stone-600 — ratio 7+ sur blanc */
}
.rubrique-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1c1917; /* stone-900 */
  letter-spacing: -0.005em;
  line-height: 1.25;
  margin-top: 0.125rem;
}
.rubrique-card:hover .rubrique-card__title,
.rubrique-card:focus-visible .rubrique-card__title {
  color: #047857;
}
.rubrique-card__excerpt {
  font-size: 0.9375rem;
  color: #44403c; /* stone-700 */
  line-height: 1.55;
  flex-grow: 1;
}
.rubrique-card__cta {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #047857;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.rubrique-card__arrow {
  transition: transform 0.18s ease;
}
.rubrique-card:hover .rubrique-card__arrow,
.rubrique-card:focus-visible .rubrique-card__arrow {
  transform: translateX(4px);
}

/* --- Article card (homepage / list / related) --- */
.article-card {
  background: #ffffff;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover {
  border-color: #d6d3d1; /* stone-300 */
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -20px rgba(0, 0, 0, 0.18);
}
.article-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex-grow: 1;
}
.article-card__cat {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #065f46; /* emerald-800 — ratio ~8 sur emerald-50 */
  background: #ecfdf5; /* emerald-50 */
  padding: 0.3rem 0.625rem;
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
}
.article-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1c1917;
  letter-spacing: -0.005em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card__title a {
  color: inherit;
}
.article-card__excerpt {
  font-size: 0.9375rem;
  color: #44403c;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}
.article-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #57534e; /* stone-600 */
  margin-top: 0.25rem;
}
.article-card__sep {
  opacity: 0.6;
}
.article-card__readmore {
  color: #047857;
  font-weight: 600;
}
.article-card__readmore:hover {
  text-decoration: underline;
}

/* --- Manifeste éditorial (3 colonnes) --- */
.manifesto-card {
  position: relative;
  padding-top: 1.5rem;
  border-top: 2px solid #047857;
}
.manifesto-card__num {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #047857;
  margin-bottom: 1rem;
}
.manifesto-card__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1c1917;
  line-height: 1.3;
  margin-bottom: 0.875rem;
  letter-spacing: -0.005em;
}
.manifesto-card__body {
  font-size: 1rem;
  color: #44403c;
  line-height: 1.7;
}

/* --- Place card (Notre territoire) --- */
.place-card {
  display: flex;
  flex-direction: column;
}
.place-card__rule {
  display: block;
  width: 2.5rem;
  height: 2px;
  background: #047857;
  border-radius: 1px;
  margin-bottom: 1rem;
}
.place-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1c1917;
  line-height: 1.25;
  margin-bottom: 0.625rem;
  letter-spacing: -0.005em;
}
.place-card__body {
  font-size: 0.9375rem;
  color: #44403c;
  line-height: 1.65;
}

/* --- Tag chip (single.html) --- */
.tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: #f5f5f4; /* stone-100 */
  color: #44403c;
  border: 1px solid #e7e5e4;
}
.tag-chip:hover {
  background: #ecfdf5;
  color: #065f46;
  border-color: #d1fae5;
}
.tag-chip--static {
  cursor: default;
}

/* =================================================================
   5. NAVIGATION
   ================================================================= */
.nav-link {
  color: #44403c; /* stone-700 — ratio ~9.5 sur blanc */
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: #047857; /* emerald-700 — ratio 4.57 sur blanc */
}
.nav-link.is-active {
  color: #047857;
  font-weight: 600;
}
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: #047857;
  border-radius: 1px;
}
.nav-link--mobile.is-active::after {
  display: none;
}
.nav-link--mobile.is-active {
  background: linear-gradient(to right, #ecfdf5, transparent);
  padding-left: 0.75rem;
  border-left: 3px solid #047857;
}

/* Footer links — fond stone-900, texte stone-300, hover emerald-300 */
.site-footer__link {
  color: #d6d3d1; /* stone-300 — ratio 11+ sur stone-900 */
}
.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: #6ee7b7; /* emerald-300 — bonne brillance + ratio 9+ sur stone-900 */
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =================================================================
   6. PROSE / TYPOGRAPHIE LONGUE FORME
   ================================================================= */
.prose { max-width: 68ch; }

.prose h2 {
  font-size: 1.625rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: #1c1917;
}
.prose h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1c1917;
}
.prose p {
  margin-bottom: 1.5rem;
  line-height: 1.78;
  color: #44403c;
}
.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: #44403c;
  line-height: 1.7;
}
.prose blockquote {
  border-left: 4px solid #047857;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #44403c;
  background: #f5f5f4;
  border-radius: 0 0.5rem 0.5rem 0;
}
.prose a {
  text-decoration: underline;
  text-decoration-color: rgba(4, 120, 87, 0.4);
  text-underline-offset: 3px;
  font-weight: 500;
  color: #047857;
}
.prose a:hover {
  text-decoration-color: #047857;
  text-decoration-thickness: 2px;
}
.prose strong {
  font-weight: 700;
  color: #1c1917;
}
.prose img {
  border-radius: 0.5rem;
  margin: 2rem 0;
}

/* Tables prose */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
}
.prose thead {
  border-bottom: 2px solid #d6d3d1; /* stone-300 */
}
.prose th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #1c1917;
  background: #f5f5f4;
}
.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e7e5e4;
  color: #44403c;
}
.prose tbody tr:hover {
  background: #fafaf9;
}
@media (max-width: 640px) {
  .prose table {
    display: block;
    overflow-x: auto;
  }
  .prose th, .prose td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Article single — composants spécifiques */
.article-single__cat-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #065f46; /* emerald-800 — AAA sur emerald-50 */
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  padding: 0.4rem 0.875rem;
  border-radius: 0.25rem;
}
.article-single__cat-badge:hover {
  background: #d1fae5;
}
.article-single__cat-badge--static {
  cursor: default;
}

/* =================================================================
   6.bis. NAVIGATION CONTEXTUELLE — Breadcrumb & article pager
   ================================================================= */

/* --- Breadcrumb (fil d'Ariane) --- */
.breadcrumb {
  font-size: 0.8125rem;
  color: #57534e; /* stone-600 */
}
.breadcrumb__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.breadcrumb__link {
  color: #44403c;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.breadcrumb__link:hover,
.breadcrumb__link:focus-visible {
  color: #047857;
  border-bottom-color: #047857;
}
.breadcrumb__sep {
  color: #a8a29e; /* stone-400 */
  font-weight: 300;
  margin-left: 0.25rem;
}
.breadcrumb__current {
  color: #1c1917;
  font-weight: 500;
}

/* --- Article pager (prev / next dans le single) --- */
.article-pager__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .article-pager__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}
.article-pager__link {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1rem 1.25rem;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 0.5rem;
  color: #1c1917;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.article-pager__link:hover,
.article-pager__link:focus-visible {
  border-color: #047857;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -12px rgba(4, 120, 87, 0.3);
}
.article-pager__link--next {
  text-align: right;
  align-items: flex-end;
}
.article-pager__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #047857;
}
.article-pager__title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: #1c1917;
}

/* =================================================================
   7. UTILITAIRES, HELPERS, PRINT
   ================================================================= */

/* 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 (Hugo internal) */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid #e7e5e4;
  flex-wrap: wrap;
  list-style: none;
  padding-left: 0;
}
.pagination li { list-style: none; }
.pagination a,
.pagination .page-item.active .page-link,
.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: background 0.18s ease, color 0.18s ease;
  border: 1px solid #e7e5e4;
  background: #ffffff;
  color: #44403c;
}
.pagination a:hover {
  background: #f5f5f4;
  color: #047857;
  border-color: #d6d3d1;
}
.pagination .active,
.pagination .page-item.active .page-link {
  color: #ffffff;
  background: #047857;
  border-color: #047857;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Print */
@media print {
  header, footer, nav, .site-header, .site-footer { display: none !important; }
  .prose { max-width: 100%; }
  body { background: #fff; color: #000; }
}

/* Préférences utilisateur — réduit le mouvement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
