
/* ==========================================================================
   LEXIQUE EAU DE VIGNE — Feuille de style dédiée
   Gabarit conforme à la charte typographique et chromatique de production
   ========================================================================== */

:root {
  --i: var(--color-ink, #1F1A14);
  --i2: var(--color-ink-2, #4A4036);
  --i3: var(--color-ink-3, #7A6B58);
  --ln: var(--color-line-soft, #D9CFBC);
  --ln-light: rgba(217, 207, 188, 0.4);
  --bx: var(--color-bordeaux, #701511);
  --bx-light: rgba(112, 21, 17, 0.08);
  --tl: var(--color-teal-deep, #23544F);
  --tl-light: rgba(35, 84, 79, 0.08);
  --oc: var(--color-ochre, #C9923A);
  --oc-light: rgba(201, 146, 58, 0.1);
  --cr: var(--color-cream, #FAF4E6);
  --cr-dark: #F3EBD9;
  --bg-card: #FFFFFF;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base container */
.lex-container {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  font-family: var(--font-body);
  color: var(--i);
  line-height: 1.68;
}

/* Fil d'Ariane */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--i3);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--i3);
  text-decoration: none;
  transition: color 0.15s ease;
}
.breadcrumb a:hover {
  color: var(--bx);
  text-decoration: underline;
}
.breadcrumb span[aria-current="page"] {
  color: var(--i);
  font-weight: 500;
}

/* En-tête / Hero */
.lex-hero {
  margin-bottom: 3rem;
  max-width: 52rem;
}
.edv-sur {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-style: italic;
  line-height: 1.35;
  color: var(--bx);
  margin: 0 0 0.8rem;
}
.lex-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
  color: var(--i);
  text-wrap: balance;
}
.edv-chapo {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--i2);
  border-left: 3px solid var(--oc);
  padding-left: 1.2rem;
  margin: 0 0 2.2rem;
}

/* Chiffres-clés */
.edv-chiffres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.4rem 1.8rem;
  border-top: 1px solid var(--i);
  border-bottom: 1px solid var(--ln);
  padding: 1.4rem 0;
  margin: 0 0 2.5rem;
}
.edv-chiffres div b {
  display: block;
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--bx);
}
.edv-chiffres div span {
  display: block;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--i3);
  margin-top: 0.35rem;
}

/* Barre d'outils et recherche */
.lex-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 244, 230, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--ln);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 2.8rem;
  box-shadow: 0 8px 24px rgba(31, 26, 20, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.lex-toolbar__search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.lex-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.lex-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--i3);
  pointer-events: none;
}

#lex-search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.6rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 1px solid var(--ln);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--i);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

#lex-search-input:focus {
  border-color: var(--bx);
  box-shadow: 0 0 0 3px rgba(112, 21, 17, 0.15);
}

.lex-clear-btn {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--i3);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.lex-clear-btn:hover {
  color: var(--bx);
}

.lex-counter {
  font-size: 0.875rem;
  color: var(--i3);
  white-space: nowrap;
}
.lex-counter strong {
  color: var(--bx);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Boutons filtres thématiques */
.lex-pills-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  scrollbar-width: thin;
}
.lex-pill {
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--ln);
  background: #FFFFFF;
  color: var(--i2);
  font-family: var(--font-body);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.lex-pill:hover {
  border-color: var(--bx);
  color: var(--bx);
  background: var(--cr);
}
.lex-pill.is-active {
  background: var(--bx);
  color: #FFFFFF;
  border-color: var(--bx);
  box-shadow: 0 2px 6px rgba(112, 21, 17, 0.25);
}

/* Barre alphabétique rapide */
.lex-az-bar {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--ln-light);
}
.lex-az-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bx);
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.lex-az-letter:hover {
  background: var(--bx);
  color: #FFFFFF;
}
.lex-az-letter.is-disabled {
  color: rgba(122, 107, 88, 0.35);
  pointer-events: none;
}

/* Groupes alphabétiques */
.lex-letter-group {
  margin-bottom: 3.5rem;
  scroll-margin-top: 8rem;
}
.lex-letter-header {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  border-bottom: 2px solid var(--bx);
  padding-bottom: 0.4rem;
  margin-bottom: 1.6rem;
}
.lex-letter-char {
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 1;
  color: var(--bx);
  margin: 0;
}
.lex-letter-count {
  font-size: 0.825rem;
  color: var(--i3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Grille de cartes */
.lex-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Fiche Lexique */
.lex-card {
  background: var(--bg-card);
  border: 1px solid var(--ln);
  border-radius: 8px;
  padding: 1.45rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  scroll-margin-top: 9rem;
}
.lex-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(31, 26, 20, 0.08);
  border-color: var(--oc);
}
.lex-card:target,
.lex-card.is-highlighted {
  border-color: var(--bx);
  box-shadow: 0 0 0 3px rgba(112, 21, 17, 0.18), 0 8px 24px rgba(31, 26, 20, 0.12);
}

.lex-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}
.lex-card__title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lex-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--i);
  margin: 0;
  letter-spacing: -0.015em;
}
.lex-anchor-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.lex-anchor-link:hover {
  color: var(--bx);
}

.lex-copy-btn {
  background: transparent;
  border: none;
  color: var(--i3);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  opacity: 0.5;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.lex-card:hover .lex-copy-btn,
.lex-copy-btn:hover {
  opacity: 1;
  color: var(--bx);
}

/* Badges thématiques */
.lex-badge {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
}
.lex-badge--cepages {
  background: rgba(112, 21, 17, 0.1);
  color: var(--bx);
}
.lex-badge--vigne {
  background: rgba(35, 84, 79, 0.1);
  color: var(--tl);
}
.lex-badge--cave {
  background: rgba(201, 146, 58, 0.15);
  color: #8C5E13;
}
.lex-badge--degustation {
  background: #F0EAE1;
  color: #5C2E20;
}
.lex-badge--labels {
  background: #E8ECEB;
  color: #1F453D;
}

/* Corps de fiche */
.lex-card__tldr {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--i);
  background: var(--cr);
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--oc);
  border-radius: 0 4px 4px 0;
  margin: 0 0 1rem;
}
.lex-card__tldr strong {
  color: var(--bx);
}

.lex-card__body {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--i2);
  margin-bottom: 1.1rem;
  flex: 1;
}
.lex-card__body p {
  margin: 0;
}

/* Encadré terrain */
.lex-card__field {
  background: #FAF8F5;
  border: 1px dashed var(--ln);
  border-radius: 6px;
  padding: 0.8rem 0.95rem;
  margin-bottom: 1.1rem;
  font-size: 0.88rem;
  line-height: 1.5;
}
.lex-field-badge {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--tl);
  margin-bottom: 0.35rem;
}

/* Pied de carte & liens */
.lex-card__foot {
  border-top: 1px solid var(--ln-light);
  padding-top: 0.85rem;
  margin-top: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.lex-card__crosslinks .lbl,
.lex-card__sitelinks .lbl {
  color: var(--i3);
  font-weight: 500;
  margin-right: 0.3rem;
}
.lex-tag-link {
  color: var(--bx);
  text-decoration: none;
  font-weight: 500;
  transition: text-decoration 0.15s ease;
}
.lex-tag-link:hover {
  text-decoration: underline;
}
.lex-ext-link {
  color: var(--tl);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.lex-ext-link:hover {
  color: var(--bx);
}
.lex-card__cuvee {
  background: var(--cr);
  border-radius: 4px;
  padding: 0.45rem 0.7rem;
  color: var(--i2);
}
.lex-card__cuvee a {
  color: var(--bx);
  font-weight: 600;
  text-decoration: none;
}
.lex-card__cuvee a:hover {
  text-decoration: underline;
}

/* Aucun résultat */
.lex-no-results {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--cr);
  border: 1px dashed var(--ln);
  border-radius: 8px;
}
.lex-no-results__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--bx);
  margin: 0 0 0.5rem;
}
.lex-no-results__desc {
  color: var(--i3);
  margin: 0 0 1.5rem;
}

/* Bannière finale CTA */
.lex-cta-banner {
  margin-top: 5rem;
  background: var(--cr);
  border: 1px solid var(--ln);
  border-radius: 12px;
  padding: 2.8rem 2rem;
  text-align: center;
}
.lex-cta-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--bx);
  margin-bottom: 0.6rem;
}
.lex-cta-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  color: var(--i);
}
.lex-cta-content p {
  max-width: 40rem;
  margin: 0 auto 1.8rem;
  color: var(--i2);
  font-size: 1.05rem;
}
.lex-cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Boutons universels */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--bx);
  color: #FFFFFF;
}
.btn--primary:hover {
  background: #540F0C;
  color: #FFFFFF;
}
.btn--secondary {
  background: var(--tl);
  color: #FFFFFF;
}
.btn--secondary:hover {
  background: #173B37;
  color: #FFFFFF;
}
.btn--outline {
  border-color: var(--i);
  color: var(--i);
  background: transparent;
}
.btn--outline:hover {
  background: var(--i);
  color: #FFFFFF;
}

/* Responsive */
@media (max-width: 640px) {
  .lex-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .lex-cards-grid {
    grid-template-columns: 1fr;
  }
  .lex-toolbar {
    padding: 0.8rem;
  }
  .lex-cta-buttons {
    flex-direction: column;
  }
  .lex-cta-buttons .btn {
    width: 100%;
  }
}
