/* ==========================================================
   PJF Porte-greffes — v1.3  (fidèle à la maquette 1.0.1)
   ========================================================== */

/* ── Variables (miroir tokens.css) ─────────────────────────── */
.pjf-pg {
  --pg-green-900: #1F3527;
  --pg-green-800: #2C4A2E;
  --pg-green-700: #3D5E3F;
  --pg-green-100: #DCE5D3;
  --pg-green-50:  #EEF2E8;
  --pg-cream-50:  #FBF8F0;
  --pg-cream-100: #F6F2E8;
  --pg-cream-200: #EDE6D4;
  --pg-terra-600: #C97B3A;
  --pg-ink:       #1B1D17;
  --pg-ink-soft:  #4A4F44;
  --pg-ink-mute:  #7A7E73;
  --pg-line:      #D9D4C3;
  --pg-line-soft: #EAE5D5;
  --pg-radius-lg: 16px;
  --pg-radius-xl: 24px;
  --pg-radius-pill: 999px;
  --pg-font-display: "Cormorant Garamond", Georgia, serif;
  --pg-font-body: "Manrope", -apple-system, sans-serif;
}

/* ── Reset dans le scope ────────────────────────────────────── */
.pjf-pg, .pjf-pg * {
  box-sizing: border-box;
}
.pjf-pg {
  background: var(--pg-cream-100);
  font-family: var(--pg-font-body);
  font-size: 16px;
  color: var(--pg-ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.pjf-pg p { margin: 0; }
.pjf-pg a { color: inherit; text-decoration: none; }

/* Reset headings WordPress */
.pjf-pg h3.pjf-pg-section-name {
  font-family: var(--pg-font-display) !important;
  font-size: 34px !important;
  font-weight: 500 !important;
  color: var(--pg-green-900) !important;
  line-height: 1.05 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  letter-spacing: -0.01em !important;
}
.pjf-pg h4.pjf-pg-card-name {
  font-family: var(--pg-font-display) !important;
  font-size: 23px !important;
  font-weight: 500 !important;
  color: var(--pg-green-900) !important;
  line-height: 1.15 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  letter-spacing: -0.01em !important;
}

/* ── Layout ─────────────────────────────────────────────────── */
.pjf-pg-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 64px;
  align-items: flex-start;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════ */

.pjf-pg-sidebar {
  position: sticky;
  top: 32px;
}

/* Label "Par espèce" */
.pjf-pg-nav-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--pg-terra-600);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

/* Nav */
.pjf-pg-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--pg-line);
}

.pjf-pg-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0 9px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--pg-ink-soft) !important;
  text-decoration: none !important;
  transition: color .15s, border-color .15s;
  line-height: 1.3;
}
.pjf-pg-nav-item:hover {
  color: var(--pg-green-900) !important;
}
.pjf-pg-nav-item.is-active {
  border-left-color: var(--pg-green-800);
  color: var(--pg-green-900) !important;
  font-weight: 600 !important;
}

.pjf-pg-nav-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--pg-ink-mute);
  font-family: var(--pg-font-display);
}

/* Légende vigueur */
.pjf-pg-vigor-legend {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--pg-line);
}
.pjf-pg-vigor-legend-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--pg-ink-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.pjf-pg-vigor-legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--pg-ink-soft);
}

/* ═══════════════════════════════════════════════════════════
   CONTENU
   ═══════════════════════════════════════════════════════════ */

.pjf-pg-content {
  display: flex;
  flex-direction: column;
  gap: 64px;
  min-width: 0;
}

.pjf-pg-section {
  scroll-margin-top: 32px;
  padding-top: 8px;
}

/* ── En-tête de section ─────────────────────────────────────── */
.pjf-pg-section-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--pg-line);
  margin-bottom: 26px;
}

/* Pastille botanique */
.pjf-pg-fruit-chip {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pg-green-50);
  border: 1px solid var(--pg-green-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pg-green-800);
  box-shadow: inset 0 0 0 1px rgba(31,53,39,0.08);
}

.pjf-pg-section-latin {
  font-size: 13.5px;
  color: var(--pg-ink-mute);
  font-style: italic;
  margin-top: 4px;
}

.pjf-pg-section-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pg-ink-mute);
  white-space: nowrap;
}

/* Intro */
.pjf-pg-section-intro {
  font-size: 17px;
  color: var(--pg-ink-soft);
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 20px;
}

/* ── Grille ─────────────────────────────────────────────────── */
.pjf-pg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

/* ── Carte ──────────────────────────────────────────────────── */
.pjf-pg-card {
  background: #fff;
  border: 1px solid var(--pg-line-soft);
  border-radius: var(--pg-radius-lg);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.pjf-pg-card:hover {
  box-shadow: 0 8px 24px rgba(31,53,39,.10);
  transform: translateY(-2px);
}

/* Body de la carte : gère le padding et l'empilement vertical */
.pjf-pg-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 26px 22px;
}

.pjf-pg-card-sub {
  font-size: 13px;
  color: var(--pg-ink-mute);
  font-style: italic;
  margin-top: 3px;
}

.pjf-pg-card-vigor {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 14px;
}

.pjf-pg-card-vlabel {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pg-green-700);
  letter-spacing: 0.01em;
}

.pjf-pg-card-desc {
  font-size: 15px;
  color: var(--pg-ink-soft);
  line-height: 1.65;
  margin: 0 0 20px;
  flex: 1;
}

/* Footer espacement */
.pjf-pg-card-footer {
  border-top: 1px solid var(--pg-line-soft);
  background: var(--pg-cream-50);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pjf-pg-card-spacing-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pg-ink-mute);
}
.pjf-pg-card-spacing-label svg {
  color: var(--pg-terra-600);
  flex-shrink: 0;
}

.pjf-pg-card-spacing-value {
  font-family: var(--pg-font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--pg-green-900);
  white-space: nowrap;
}

/* ── Jauge de vigueur ───────────────────────────────────────── */
.pjf-pg-vigor {
  display: flex;
  gap: 4px;
  width: 92px;
  flex-shrink: 0;
}
.pjf-pg-vigor-bar {
  flex: 1;
  height: 7px;
  border-radius: 4px;
}
.pjf-pg-vigor-bar--full  { background: var(--pg-green-700); }
.pjf-pg-vigor-bar--half  { background: linear-gradient(90deg, var(--pg-green-700) 50%, var(--pg-green-100) 50%); }
.pjf-pg-vigor-bar--empty { background: var(--pg-green-100); }

/* ── Bandeau conseil ────────────────────────────────────────── */
.pjf-pg-advice {
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 32px 36px;
  background: var(--pg-cream-200);
  border-radius: var(--pg-radius-xl);
  border: 1px solid var(--pg-line);
}

.pjf-pg-advice-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--pg-green-800);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pg-cream-50);
}

.pjf-pg-advice-body {
  flex: 1;
}
.pjf-pg-advice-title {
  font-family: var(--pg-font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--pg-green-900);
  line-height: 1.15;
}
.pjf-pg-advice-body p {
  font-size: 15px;
  color: var(--pg-ink-soft);
  line-height: 1.6;
  margin: 6px 0 0;
}

.pjf-pg-advice-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 28px;
  background: var(--pg-green-800);
  color: #fff !important;
  border-radius: var(--pg-radius-pill);
  font-family: var(--pg-font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background .15s;
}
.pjf-pg-advice-btn:hover {
  background: var(--pg-green-900);
  color: #fff !important;
}

/* ── Lien boutique (catégorie) ──────────────────────────────── */
.pjf-pg-shop-link {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  margin-bottom: 28px;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--pg-green-800) !important;
  text-decoration: none !important;
  border-bottom: 1px solid var(--pg-green-100);
  padding-bottom: 2px;
  transition: color .15s, border-color .15s;
}
.pjf-pg-shop-link:hover {
  color: var(--pg-terra-600) !important;
  border-color: var(--pg-terra-600);
}
.pjf-pg-shop-link svg { color: currentColor; flex-shrink: 0; }

/* ── Lien boutique (carte porte-greffe) ─────────────────────── */
.pjf-pg-card-shop-link {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--pg-green-800) !important;
  text-decoration: none !important;
  border-bottom: 1px solid var(--pg-green-100);
  padding-bottom: 2px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.pjf-pg-card-shop-link:hover {
  color: var(--pg-terra-600) !important;
  border-color: var(--pg-terra-600);
}
.pjf-pg-card-shop-link svg { color: currentColor; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ── Tablette ── */
@media (max-width: 1024px) {
  .pjf-pg-layout { grid-template-columns: 190px 1fr; gap: 36px; }
  .pjf-pg-cards  { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile ── */
@media (max-width: 700px) {

  /* Wrapper : padding horizontal pour éviter que le contenu touche les bords */
  .pjf-pg {
    padding-left: 16px;
    padding-right: 16px;
    overflow-x: hidden;
  }

  /* Layout : colonne unique */
  .pjf-pg-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* ── Sidebar → grille de chips ── */
  .pjf-pg-sidebar {
    position: static;
    margin-bottom: 28px;
  }

  .pjf-pg-nav-label { margin-bottom: 10px; }

  .pjf-pg-nav {
    flex-direction: row;
    flex-wrap: wrap;      /* toutes les catégories visibles, retour à la ligne si besoin */
    gap: 6px;
    border-left: none;
    border-bottom: none;
    overflow: visible;
  }

  .pjf-pg-nav-item {
    flex-shrink: 0;
    border: 1px solid var(--pg-line);
    border-radius: var(--pg-radius-pill);
    padding: 5px 12px;
    margin-left: 0;
    font-size: 12px !important;
    white-space: nowrap;
    background: #fff;
    line-height: 1.4;
  }
  .pjf-pg-nav-item.is-active {
    background: var(--pg-green-800) !important;
    border-color: var(--pg-green-800) !important;
    color: #fff !important;
    font-weight: 600 !important;
  }

  .pjf-pg-nav-count    { display: none; }
  .pjf-pg-vigor-legend { display: none; }

  /* ── Sections ── */
  .pjf-pg-content { gap: 44px; }

  .pjf-pg-section-head {
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 20px;
  }

  /* Icône fruit : taille réduite sur mobile */
  .pjf-pg-fruit-chip {
    width: 44px;
    height: 44px;
  }

  /* Titre section */
  .pjf-pg h3.pjf-pg-section-name {
    font-size: 24px !important;
  }

  /* Badge "X porte-greffes" : passe en dessous si ça déborde */
  .pjf-pg-section-badge {
    margin-left: 0;
    order: 3;
    width: 100%;
    font-size: 11px;
    padding-left: 56px; /* aligne sous le texte (après l'icône) */
  }

  .pjf-pg-section-intro {
    font-size: 15px;
    margin-bottom: 14px;
  }

  /* Lien boutique catégorie */
  .pjf-pg-shop-link {
    margin-bottom: 20px;
  }

  /* ── Grille cartes ── */
  .pjf-pg-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* ── Bandeau conseil ── */
  .pjf-pg-advice {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 14px;
    border-radius: var(--pg-radius-lg);
  }
  .pjf-pg-advice-icon { width: 44px; height: 44px; }
  .pjf-pg-advice-title { font-size: 20px; }
  .pjf-pg-advice-btn {
    width: 100%;
    justify-content: center;
    height: 44px;
    font-size: 14px;
  }
}

/* ── Très petit mobile ── */
@media (max-width: 420px) {

  .pjf-pg {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pjf-pg-card-body {
    padding: 18px 18px 18px;
  }
  .pjf-pg-card-footer {
    padding: 12px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .pjf-pg-section-badge { padding-left: 0; }
}
