/* Fiche projet : bandeau sombre (identique au détail d'une offre) + fiche technique. */
:root { --pf-green: var(--dark-green, #09871b); --pf-green-soft: #eaf6ee; --pf-ink: #17241a; --pf-muted: #5d6d63; --pf-line: #e3ebe6; --pf-orange: #ff5c00; }

body.fiche-page { background: #f4f7f5; color: var(--pf-ink); }

/* ---- Bandeau (repris du détail d'offre) ---- */
.offer-hero { min-height: 46vh; background-size: cover; background-position: center; background-repeat: no-repeat; position: relative; }
.offer-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(1,8,3,.75) 0%, rgba(1,8,3,.88) 40%, rgba(0,5,2,.98) 100%); }
.offer-hero > .container { position: relative; z-index: 1; }
.offer-breadcrumb { --bs-breadcrumb-divider-color: rgba(255,255,255,.6); font-size: .95rem; }
.offer-breadcrumb a { color: rgba(255,255,255,.85); text-decoration: none; }
.offer-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.offer-hero-title { font-size: 2.3rem; font-weight: 700; line-height: 1.25; max-width: 900px; text-shadow: 0 2px 12px rgba(0,0,0,.55); }
.offer-hero-meta { font-size: 1rem; opacity: .95; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
@media (max-width: 768px) { .offer-hero { min-height: 34vh; } .offer-hero-title { font-size: 1.5rem; } .offer-hero-meta { font-size: .85rem; } }

.back-link { display: inline-flex; align-items: center; color: var(--pf-green); font-weight: 600; text-decoration: none; transition: transform .2s ease; }
.back-link:hover { color: #076816; transform: translateX(-4px); }

/* Bande des chiffres clés, juste sous le bandeau */
.pf-top { background: #fff; border-bottom: 1px solid var(--pf-line); }
.pf-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.pf-ref { font: 600 .78rem/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; color: var(--pf-muted); background: #f1f5f3; border: 1px solid var(--pf-line); border-radius: 6px; padding: .35rem .6rem; }
.pf-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .32rem .8rem; text-decoration: none; }
.pf-chip.dom { background: var(--pf-green-soft); color: var(--pf-green); }
a.pf-chip.dom:hover { background: #d5ecdc; }
.pf-chip.st-en_cours { background: #fff1e6; color: #c2410c; }
.pf-chip.st-termine { background: #eef2f0; color: #475569; }
.pf-chip.phare { background: #fff7d6; color: #92650a; }
.pf-print-title { display: none; }
/* ---- Chiffres clés ---- */
.pf-kpis { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--pf-line); }
.pf-kpi { padding: 1.05rem 1.2rem; border-right: 1px solid var(--pf-line); min-width: 0; }
.pf-kpi:last-child { border-right: none; }
.pf-kpi .l { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--pf-muted); font-weight: 700; margin-bottom: .35rem; display: flex; align-items: center; gap: .4rem; }
.pf-kpi .l i { color: var(--pf-green); }
.pf-kpi .v { font-size: 1.15rem; font-weight: 800; line-height: 1.25; }
.pf-kpi .v.big { font-size: 1.7rem; color: var(--pf-green); }
@media (max-width: 992px) { .pf-kpis { grid-template-columns: repeat(2, 1fr); } .pf-kpi:nth-child(2) { border-right: none; } .pf-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--pf-line); } }
@media (max-width: 520px) { .pf-kpis { grid-template-columns: 1fr; } .pf-kpi { border-right: none; border-bottom: 1px solid var(--pf-line); } .pf-kpi:last-child { border-bottom: none; } }

/* ---- Corps ---- */
.pf-body { padding: 2rem 0 3rem; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; max-width: 900px; margin: 0 auto; }
.pf-main > * + * { margin-top: 1.5rem; }
.pf-card { background: #fff; border: 1px solid var(--pf-line); border-radius: 14px; padding: 1.6rem 1.75rem; }
.pf-card h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--pf-green); font-weight: 800; margin: 0 0 1rem; display: flex; align-items: center; gap: .55rem; }
.pf-card h2::after { content: ''; flex: 1; height: 1px; background: var(--pf-line); }

.pf-figure { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--pf-line); background: #fff; }
.pf-figure img { width: 100%; height: clamp(200px, 32vw, 380px); object-fit: cover; display: block; }
.pf-figure figcaption { padding: .6rem 1rem; font-size: .78rem; color: var(--pf-muted); display: flex; align-items: center; gap: .5rem; }

/* Carte unique : image + résumé + public ciblé + activités */
.pf-dossier { padding: 1.75rem; display: grid; gap: 2rem; box-shadow: 0 8px 28px rgba(6,63,14,.07); }
.pf-dossier > * { margin: 0; min-width: 0; }
.pf-dossier .pf-figure { border: 0; border-radius: 14px; box-shadow: 0 8px 22px rgba(6,63,14,.14); }
.pf-dossier .pf-figure figcaption { background: #f6f9f7; border-top: 1px solid var(--pf-line); padding: .7rem 1.1rem; }

/* En-tête de section : pastille d'icône + titre + filet */
.pf-dossier .pf-sec h2 { font-size: .85rem; margin: 0 0 1.1rem; gap: .7rem; color: var(--pf-ink); }
.pf-dossier .pf-sec h2 i { width: 2.1rem; height: 2.1rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 1rem; color: #fff; background: linear-gradient(135deg, var(--pf-green), #2fa34a); box-shadow: 0 5px 12px rgba(9,135,27,.25); }

/* Résumé des résultats : encadré mis en valeur */
.pf-dossier .pf-lead { padding: 1.2rem 1.4rem; border: 0; border-left: 5px solid var(--pf-orange); border-radius: 0 12px 12px 0; background: linear-gradient(90deg, var(--pf-green-soft), #f7fbf8); font-size: 1.08rem; line-height: 1.75; }

/* Public ciblé : panneau discret */
.pf-dossier .pf-text { padding: 1.1rem 1.3rem; border: 1px solid var(--pf-line); border-radius: 12px; background: #fafcfb; }

/* Activités menées : liste simple, seule la numérotation est mise en forme */
.pf-dossier .pf-steps li { align-items: center; }
.pf-dossier .pf-steps li span { padding-top: 0; }
.pf-dossier .pf-steps li::before { background: linear-gradient(135deg, var(--pf-green), #2fa34a); color: #fff; box-shadow: 0 4px 10px rgba(9,135,27,.22); }
.pf-dossier .pf-steps li:nth-child(even)::before { background: linear-gradient(135deg, var(--pf-orange), #ff9500); box-shadow: 0 4px 10px rgba(255,92,0,.22); }

@media (max-width: 575.98px) {
  .pf-dossier { padding: 1rem; gap: 1.5rem; }
  .pf-dossier .pf-lead { padding: .95rem 1rem; font-size: 1rem; }
  .pf-dossier .pf-text { padding: .9rem 1rem; }
  .pf-dossier .pf-steps li { gap: .75rem; }
  .pf-dossier .pf-sec h2 i { width: 1.9rem; height: 1.9rem; }
}

.pf-lead { font-size: 1.12rem; line-height: 1.8; margin: 0; padding-left: 1.1rem; border-left: 4px solid var(--pf-green); }
.pf-text { line-height: 1.8; margin: 0; }

/* Activités numérotées */
.pf-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.pf-steps li { counter-increment: step; position: relative; display: flex; gap: 1rem; align-items: flex-start; padding: .85rem 0; }
.pf-steps li + li { border-top: 1px dashed var(--pf-line); }
.pf-steps li::before { content: counter(step, decimal-leading-zero); flex: 0 0 auto; width: 2.3rem; height: 2.3rem; border-radius: 10px; background: var(--pf-green-soft); color: var(--pf-green); font-weight: 800; font-size: .85rem; display: flex; align-items: center; justify-content: center; }
.pf-steps li span { padding-top: .35rem; line-height: 1.55; }

/* Mini-carte */
#pfMap { height: 280px; border-radius: 10px; border: 1px solid var(--pf-line); z-index: 0; }
.pf-mapnote { font-size: .78rem; color: var(--pf-muted); margin: .6rem 0 0; }

/* ---- Actions et partage, sous la fiche ---- */
.pf-aside { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; padding-top: .5rem; }
.pf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; width: 100%; }
.pf-actions .pf-btn { flex: 1 1 240px; max-width: 320px; }
.pf-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: .8rem 1rem; border-radius: 10px; font-weight: 700; font-size: .9rem; text-decoration: none; border: 1.5px solid var(--pf-green); cursor: pointer; transition: all .2s ease; }
.pf-btn.primary { background: var(--pf-green); color: #fff; }
.pf-btn.primary:hover { background: #076816; color: #fff; }
.pf-btn.ghost { background: #fff; color: var(--pf-green); }
.pf-btn.ghost:hover { background: var(--pf-green-soft); }

/* Projets du même domaine (liste sobre) */
.pf-related a { display: grid; grid-template-columns: 90px 1fr auto; gap: 1rem; align-items: center; padding: .9rem 0; text-decoration: none; color: inherit; border-top: 1px solid var(--pf-line); }
.pf-related a:first-of-type { border-top: none; }
.pf-related a:hover .t { color: var(--pf-green); }
.pf-related .y { font-weight: 800; color: var(--pf-green); font-size: .9rem; }
.pf-related .t { font-weight: 700; line-height: 1.4; transition: color .2s; }
.pf-related .z { display: block; font-size: .8rem; color: var(--pf-muted); font-weight: 400; margin-top: .15rem; }
@media (max-width: 600px) { .pf-related a { grid-template-columns: 1fr auto; } .pf-related .y { grid-column: 1 / -1; } }

/* Entête d'impression (masqué à l'écran) */
.pf-print-head { display: none; }

@media print {
  @page { size: A4; margin: 14mm; }
  body.fiche-page { background: #fff !important; }
  .navbar, footer, .offer-hero, .pf-back, .pf-actions, .pf-share, #pfMapCard, .pf-related, .pf-figure figcaption, #progress-bar { display: none !important; }
  .pf-print-head { display: flex !important; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--pf-green); padding-bottom: 8px; margin-bottom: 14px; }
  .pf-print-head img { height: 46px; }
  .pf-print-head div { text-align: right; font-size: 11px; color: #444; }
  .pf-top { border: none; padding-top: 0; }
  .pf-print-title { display: block !important; font-size: 20px; font-weight: 800; line-height: 1.3; margin: 0 auto 10px; }
  .pf-grid { display: block; }
  .pf-aside { position: static; margin-top: 14px; }
  .pf-card, .pf-id, .pf-figure, .pf-kpis { break-inside: avoid; }
  .pf-id header, .pf-steps li::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pf-body { padding: 10px 0; }
  .pf-figure img { height: 220px; }
}

/* Fiche centrée : lien retour et avis d'aperçu alignés sur la colonne de contenu */
.pf-body .pf-back, .pf-body > .container > .alert { max-width: 900px; margin-left: auto; margin-right: auto; }
@media (max-width: 575.98px) {
  .pf-actions .pf-btn { flex-basis: 100%; max-width: none; }
  .pf-grid { gap: 1.25rem; }
}
