/* =========================================================
   Page de détail d'un post / d'une annonce — refonte 2026 (v3.0.960)
   Colonne de lecture étroite (≈ 68 caractères), grand titre serif,
   ligne d'auteur, encadré « En pratique », carte auteur collante à droite
   sur ordinateur, sous l'article sur mobile.
   Partagée par actualite_detail.html et annonce_fil_detail.html.
   ========================================================= */
:root {
  --pd-ink: #0B1F2A;
  --pd-text: #2B3E48;
  --pd-muted: #5F7380;
  --pd-petrol: #073A50;
  --pd-brand: #006289;
  --pd-ice: #9FD6EC;
  --pd-mist: #EDF3F5;
  --pd-hair: #DCE6EA;
  --pd-pink: #E71D72;
  --pd-pink-h: #C5165D;
  --pd-serif: 'Newsreader', Georgia, serif;
}

/* Contenu collé sous la barre du haut (73 px) sur ordinateur, au bord sur mobile */
body main.pd-main { padding-top: 73px !important; }
@media (max-width: 767.98px) {
  body main.pd-main { padding-top: 0 !important; margin-top: 0 !important; }
}

.pd-page {
  background: var(--pd-mist);
  color: var(--pd-ink);
  font-family: "Instrument Sans", system-ui, sans-serif;
  min-height: 100vh;
  padding: 0 0 56px;
}
.pd-shell {
  width: min(1104px, calc(100% - 2rem));
  margin: 0 auto;
}

/* ---------- Fil d'Ariane ---------- */
.pd-crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 0;
  font-size: 14px;
}
.pd-crumb a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-weight: 600;
  color: var(--pd-brand);
  text-decoration: none;
}
.pd-crumb a:hover { color: var(--pd-pink); }
.pd-crumb svg { width: 18px; height: 18px; flex-shrink: 0; }
.pd-crumb__sep { color: #A9BAC2; }
.pd-crumb__here { color: var(--pd-muted); font-weight: 500; }

/* ---------- Bandeau « mode événement » ---------- */
.pd-live {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 14px;
  align-items: center;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #FFF0F6;
  border: 1px solid #F8C9DC;
  color: #5B0F30;
}
.pd-live__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--pd-pink); color: #fff;
}
.pd-live__icon svg { width: 18px; height: 18px; }
.pd-live__title { margin: 0; font-size: 14px; font-weight: 700; }
.pd-live__text { margin: 2px 0 0; font-size: 13px; color: #8A2150; }
.pd-live__back {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 0 14px; border-radius: 999px;
  border: 1px solid #F1A9C7; background: #fff;
  font-size: 13px; font-weight: 700; color: var(--pd-pink-h);
  text-decoration: none;
}
@media (min-width: 640px) {
  .pd-live { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pd-live__back { grid-column: auto; }
}

/* ---------- Grille article + carte auteur ---------- */
.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (min-width: 1024px) {
  .pd-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: stretch; /* l'article s'étire à la hauteur du rail : mêmes fins de colonnes */
  }
  .pd-rail {
    position: sticky;
    top: 97px;
    align-self: start;
  }
}

/* ---------- L'article ---------- */
.pd-article {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--pd-hair);
  border-radius: 18px;
  padding: 24px 20px 20px;
}
@media (min-width: 768px) {
  .pd-article { padding: 40px 48px 28px; }
}
.pd-article > * { max-width: 680px; }

.pd-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}
.pd-type {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pd-brand);
}
.pd-type::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pd-pink);
}
.pd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--pd-hair);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--pd-text);
  text-decoration: none;
}
a.pd-chip:hover { border-color: var(--pd-ice); color: var(--pd-brand); }
.pd-chip--cat { background: #E6F2F7; border-color: #C9E1EB; color: var(--pd-petrol); }
.pd-chip--urgent { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }

.pd-title {
  margin: 0 0 20px;
  font-family: var(--pd-serif) !important;
  font-weight: 500 !important;
  font-size: clamp(1.9rem, 6.2vw, 2.85rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.02em !important;
  color: var(--pd-ink) !important;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.pd-title--masked {
  font-style: italic;
  color: #7C8E97 !important;
  font-size: clamp(1.5rem, 5vw, 2rem) !important;
}

/* Ligne d'auteur */
.pd-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 20px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--pd-hair);
}
.pd-byline__who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
  text-decoration: none;
}
a.pd-byline__who:hover .pd-byline__name { color: var(--pd-pink); }
.pd-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: var(--pd-mist);
  color: var(--pd-brand);
  font-family: var(--pd-serif);
  font-size: 19px;
  font-weight: 500;
}
.pd-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-avatar svg { width: 20px; height: 20px; color: #8FA3AD; }
.pd-avatar--lg { width: 56px; height: 56px; font-size: 23px; }
.pd-avatar--pro { border-radius: 14px; }
.pd-byline__text { min-width: 0; }
.pd-byline__name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--pd-ink);
  overflow-wrap: anywhere;
  transition: color .15s;
}
.pd-byline__meta {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  color: var(--pd-muted);
}
.pd-me {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #EEF4F7;
  font-size: 11px;
  font-weight: 700;
  color: var(--pd-brand);
  vertical-align: 2px;
}
.pd-anon { font-style: italic; font-weight: 500; color: var(--pd-muted); }

/* Bouton icône (partager) */
.pd-icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--pd-hair);
  background: #fff;
  color: var(--pd-petrol);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pd-icon-btn:hover { border-color: var(--pd-ice); color: var(--pd-brand); }
.pd-icon-btn svg { width: 18px; height: 18px; }
@media (max-width: 479.98px) {
  .pd-icon-btn { padding: 0; }
  .pd-icon-btn__label { display: none; }
}

/* Visuel */
.pd-visual {
  margin: 0 0 24px;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--pd-mist);
}
.pd-visual.is-light-media { background: #003b54; }
.pd-visual.is-dark-media { background: #fff; }
.pd-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Texte */
.pd-lead {
  margin: 0 0 18px;
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--pd-ink);
  white-space: pre-line;
}
.pd-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--pd-text);
  overflow-wrap: anywhere;
}
.pd-body--pre { white-space: pre-line; }
.pd-body p { margin: 0 0 1em; }
.pd-body p:last-child { margin-bottom: 0; }
.pd-body a { color: var(--pd-brand); text-decoration: underline; text-underline-offset: 2px; }
.pd-body a:hover { color: var(--pd-pink); }
.pd-body--masked { font-style: italic; color: #7C8E97; font-size: 15px; }

/* Encadré « En pratique » */
.pd-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin: 28px 0 0;
  padding: 18px;
  border-radius: 14px;
  background: var(--pd-mist);
}
@media (min-width: 640px) {
  .pd-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; padding: 20px 22px; }
  .pd-fact--wide { grid-column: 1 / -1; }
}
.pd-fact {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 0;
}
.pd-fact__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  color: var(--pd-brand);
}
.pd-fact__icon svg { width: 18px; height: 18px; }
.pd-fact dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--pd-muted);
}
.pd-fact dd {
  margin: 1px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--pd-ink);
  overflow-wrap: anywhere;
}
.pd-fact dd a { color: var(--pd-brand); text-decoration: none; }
.pd-fact dd a:hover { color: var(--pd-pink); text-decoration: underline; }

/* Pied de l'article */
.pd-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--pd-hair);
}
.pd-report {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px;
  padding: 0 4px;
  border: 0; background: none;
  font: inherit; font-size: 13px; color: #7C8E97;
  cursor: pointer;
}
.pd-report:hover { color: #B91C1C; }
.pd-report svg { width: 15px; height: 15px; }

/* ---------- Carte auteur (droite / dessous) ---------- */
.pd-rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pd-card {
  background: #fff;
  border: 1px solid var(--pd-hair);
  border-radius: 18px;
  padding: 20px;
}
.pd-card__label {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pd-muted);
}
.pd-who {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  color: inherit;
  text-decoration: none;
}
a.pd-who:hover .pd-who__name { color: var(--pd-pink); }
.pd-who__text { min-width: 0; }
.pd-who__name {
  display: block;
  font-family: var(--pd-serif);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--pd-ink);
  overflow-wrap: anywhere;
  transition: color .15s;
}
.pd-who__sub {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--pd-muted);
}
.pd-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
/* 2 ou 3 boutons : toujours sur une seule ligne, même à 360 px */
.pd-actions:has(> .pd-btn ~ .pd-btn):not(:has(> .pd-btn ~ .pd-btn ~ .pd-btn ~ .pd-btn)) { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; }
.pd-actions:has(> .pd-btn ~ .pd-btn):not(:has(> .pd-btn ~ .pd-btn ~ .pd-btn ~ .pd-btn)) > .pd-btn { font-size: 14px; padding: 10px 8px; gap: 6px; min-width: 0; }
.pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 10px 18px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.pd-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.pd-btn--primary { background: var(--pd-pink); color: #fff; }
.pd-btn--primary:hover { background: var(--pd-pink-h); color: #fff; }
.pd-btn--call { background: #047857; color: #fff; }
.pd-btn--call:hover { background: #065F46; color: #fff; }
.pd-btn--ghost { background: #fff; border-color: #B9D3DE; color: var(--pd-petrol); }
.pd-btn--ghost:hover { border-color: var(--pd-brand); color: var(--pd-brand); }
.pd-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px;
  border-radius: 12px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  font-size: 13px; font-weight: 700; color: #065F46;
}
.pd-note svg { width: 15px; height: 15px; }
.pd-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--pd-hair);
  font-size: 14px;
  font-weight: 600;
  color: var(--pd-brand);
  text-decoration: none;
}
.pd-more:hover { color: var(--pd-pink); }
.pd-more svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Lien retour au fil, discret */
.pd-back {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #E3EBEE;
  color: #0D2B3A;
  text-decoration: none;
}
.pd-back:hover { border-color: #006289; color: #0D2B3A; }
.pd-back__icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #EDF3F5; color: #006289;
}
.pd-back__icon svg { width: 18px; height: 18px; }
.pd-back__title { display: block; font-size: 15px; font-weight: 700; }
.pd-back__sub { display: block; font-size: 13px; color: #5B7684; }

/* Petit message « lien copié » */
.pd-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--pd-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.pd-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { .pd-toast { bottom: 32px; } }
@media (prefers-reduced-motion: reduce) { .pd-toast { transition: none; } }
