/* Fiche d'une offre : chargée par cette seule page et, à sa première ouverture, par le panneau latéral des listes ; hors du
   budget des pages publiques. Aucune règle ne vise une classe des listes qui accueillent ce panneau. */

/* Fil d'Ariane (P-FIC-18) : une ligne, titre tronqué, séparateur en CSS (miroir en arabe). */
.crumbs ol { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; min-width: 0; }
.crumbs li { white-space: nowrap; flex: 0 0 auto; }
.crumbs a { display: inline-flex; align-items: center; min-height: 24px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-inline-end: 6px; color: var(--muted); }
[dir=rtl] .crumbs li + li::before { content: "‹"; }
.crumbs li[aria-current] { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.crumbs li[aria-current] span { overflow: hidden; text-overflow: ellipsis; }
.crumbs ~ .msg { margin: 0 0 14px; }

/* Blocs : l'article n'est plus une carte, ce sont ses parties qui le sont. */
.detail.card { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.fiche-tete, .fiche-corps > section, .fiche-cote > section { padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-wrap: anywhere; }
.detail section, .fiche-cote section { margin: 0; }
.fiche-corps, .fiche-cote { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.fiche-corps, .fiche-cote, .detail .safety-note { margin-block-start: 14px; }
.detail h2, .fiche-cote h2 { margin: 0 0 8px; font-size: 18px; }
.fiche-corps p, .fiche-cote p { margin: 0 0 8px; }
.fiche-corps p:last-child, .fiche-cote p:last-child { margin-bottom: 0; }

/* En-tête : titre, employeur et pays, puces, faits, actions. */
.fiche-tete .msg { margin: 0 0 14px; }
.fiche-tete h1 { margin: 0 0 4px; font-size: 28px; line-height: 1.2; }
[dir=rtl] .fiche-tete h1, [dir=rtl] .similaires b { text-align: right; }   /* titre latin d'une page en arabe : calé sur le bord de lecture */
.fiche-origine { margin: 2px 0 0; }
.fiche-qui { margin: 4px 0 0; font-size: 16px; }
.fiche-qui strong { font-weight: 600; }
.fiche-puces { gap: 6px; margin-top: 12px; }
.fiche-puces .badge { display: inline-flex; align-items: center; padding: 3px 10px; font-size: 12.5px; font-weight: 400; }
.fiche-puces .badge.grey { color: var(--text); }
.detail a.risk-badge { min-height: 24px; }

/* Faits essentiels : rangs à filets, les cases de chaque rang se partagent toute la largeur, donc aucun trou. */
.detail dl.kv { display: flex; flex-wrap: wrap; gap: 0; margin: 16px 0 0; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.detail dl.kv > div { flex: 1 1 170px; min-width: 0; padding: 10px 12px; margin-inline-end: -1px; margin-block-end: -1px; border-inline-end: 1px solid var(--border); border-block-end: 1px solid var(--border); }
.detail dl.kv dt { font-size: 12.5px; }
.detail dl.kv dd { margin: 2px 0 0; font-weight: 600; }
.detail dl.kv dd a { font-weight: 500; }
.detail dl.kv > .fait-double { flex-basis: 340px; }
.detail dl.kv > .fait-large { flex-basis: 100%; }

/* Actions : Candidater et Sélectionner d'abord, le reste en retrait. */
.fiche-actions, .fiche-actions .actions, .fiche-actions .share, .track-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin: 0; }
.fiche-actions { margin-top: 16px; }
.fiche-actions .btn, .actions-end .btn { min-height: 44px; padding: 8px 16px; justify-content: center; text-align: center; font-size: 15px; }
.fiche-actions form, .actions-end form { display: flex; margin: 0; }
.fiche-actions .track-box > .small { align-self: center; padding-inline: 4px; }
.fiche-aide { margin: 12px 0 0; }

/* Encadré de prudence. */
.detail .safety-note { padding: 14px 16px; border-inline-start-color: #e0a100; font-size: 14px; }
.detail .safety-note h2 { margin: 0; font-size: 16px; font-family: inherit; letter-spacing: 0; color: var(--warn); }

/* Contenu de l'annonce. */
.description { overflow-wrap: anywhere; font-size: 15px; line-height: 1.6; }
.description table { display: block; overflow-x: auto; }
.description img { max-width: 100%; height: auto; }
.description :is(h1, h2, h3, h4) { margin: 16px 0 6px; font-size: 16px; font-family: inherit; letter-spacing: 0; }
.description > h2 { margin: 0 0 8px; font-size: 18px; font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -.02em; }
[dir=rtl] .description > h2 { font-family: inherit; letter-spacing: 0; }
.description div > :first-child { margin-top: 0; }
.description ul, .description ol { margin: 8px 0; padding-inline-start: 22px; }
.fiche-lieux { line-height: 2; }
.track-box-visitor p { margin: 0; }
.fiche-corps > .track-box-visitor { display: block; color: var(--muted); }
.actions-end { margin: 0; }
.actions-end .btn-primary { padding-inline: 22px; }

/* Provenance et signalement. */
.fiche-plus { margin-top: 10px; }
.fiche-plus > summary, .report > summary { display: list-item; min-height: 24px; line-height: 24px; color: var(--muted); cursor: pointer; }
.fiche-plus p { margin: 4px 0 0; }
.report { margin-top: 10px; }
.report form { display: grid; gap: 6px; max-width: 30rem; margin-top: 10px; }
.report form label { margin: 0; font-size: 13px; color: var(--muted); }
.report form .btn { justify-self: start; margin-top: 4px; }
.report select, .report input:not([type=hidden]) { margin-bottom: 4px; }
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Mini-carte : Leaflet est chargée après cette feuille, d'où les sélecteurs renforcés. Sans JavaScript ou dans le panneau
   latéral, il ne reste que le lien vers les offres de la ville. */
.mini-carte { height: 200px; margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); isolation: isolate; overflow: hidden; }
.mini-carte.leaflet-container { font: inherit; background: var(--surface-2); cursor: default; }
html:not(.js) .mini-carte, html:not(.js) .carte-credits, .drawer-panel .mini-carte, .drawer-panel .carte-credits { display: none; }
.carte-credits { margin: 6px 0 10px; }
.fiche-lien-ville a { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; font-weight: 500; }
/* Leaflet place .offre-pt avec un translate3d : jamais de transform ni de scale sur lui, la pastille est le span intérieur. */
.offre-pt span { display: block; width: 100%; height: 100%; border: 3px solid #fff; border-radius: 50%; background: var(--green-800); box-shadow: 0 1px 5px rgba(0, 0, 0, .45); }
[data-theme=dark] .mini-carte .leaflet-tile-pane { filter: brightness(.82); }

/* Colonne latérale. */
.similaires { display: grid; margin: 0; padding: 0; list-style: none; }
.similaires li + li { border-block-start: 1px solid var(--border); }
.similaires a { display: block; padding: 10px 0; color: var(--text); text-decoration: none; }
.similaires li:first-child a { padding-block-start: 2px; }
.similaires a:hover b { color: var(--link); text-decoration: underline; }
.similaires b { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.similaires span { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.fiche-toutes { margin: 6px 0 0; }
.fiche-toutes a { display: inline-flex; align-items: center; min-height: 24px; }
.fiche-cote .btn { margin-top: 4px; }

/* Deux colonnes : l'encadré de prudence, avant la description dans le document, remonte en haut de la colonne latérale. Les
   grilles imbriquées alignent l'article (en-tête, corps) et la colonne (prudence, reste) sur les mêmes rangs. */
@media (min-width: 901px) {
  @supports (grid-template-rows: subgrid) {
    .fiche { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto 1fr; gap: 14px 20px; align-items: start; }
    .fiche > .detail { display: grid; grid-column: 1 / -1; grid-row: 1 / -1; grid-template-columns: subgrid; grid-template-rows: subgrid; align-items: start; }
    .fiche .fiche-corps, .fiche .fiche-cote, .fiche .safety-note { margin-block-start: 0; }
    .fiche-tete { grid-column: 1; grid-row: 1 / span 2; align-self: stretch; }
    .detail .safety-note { grid-column: 2; grid-row: 1; }
    .fiche-corps { grid-column: 1; grid-row: 3; }
    .fiche-cote { grid-column: 2; grid-row: 2 / -1; }
  }
}
/* Avec la barre latérale du personnel (240 px), les deux colonnes ne tiennent qu'à partir de 1180 px. */
@media (min-width: 901px) and (max-width: 1179px) {
  .shell .fiche, .shell .fiche > .detail { display: block; }
  .shell .fiche .fiche-corps, .shell .fiche .fiche-cote, .shell .fiche .safety-note { margin-block-start: 14px; }
}
@media (max-width: 860px) {
  .fiche-plus > summary, .report > summary { min-height: 44px; line-height: 44px; }
  .fiche-plus, .report { margin-top: 0; }
  .crumbs a { min-height: 44px; }
  .similaires a { padding-block: 12px; }
}
/* Sur téléphone, les actions répétées se collent en bas d'écran dès que celles du haut sont sorties de l'écran (classe posée
   par site.js ; sans JavaScript, simple bloc après les modalités de candidature), au-dessus de la barre basse des candidats. */
@media (max-width: 700px) {
  .fiche-tete, .fiche-corps > section, .fiche-cote > section { padding: 16px; }
  .fiche-tete h1 { font-size: 23px; }
  .crumbs ol { margin-bottom: 8px; }
  .detail dl.kv, .fiche-actions { margin-top: 12px; }
  .fiche-aide { margin-top: 10px; }
  .detail .safety-note { padding: 12px 14px; }
  /* Faits en lignes « libellé, valeur » : rien à laisser en blanc, et la description remonte. */
  .detail dl.kv > div, .detail dl.kv > .fait-double, .detail dl.kv > .fait-large { display: grid; flex-basis: 100%; grid-template-columns: 96px minmax(0, 1fr); gap: 0 10px; padding: 6px 12px; }
  .detail dl.kv dt { font-size: 13px; line-height: 21px; }
  .detail dl.kv dd { margin: 0; }
  .fiche-actions .btn, .actions-end .btn { padding-inline: 12px; }
  .fiche-actions .actions { width: 100%; }
  .fiche-actions .actions > *, .track-box, .track-box > * { flex: 1 1 auto; }
  .fiche-actions form .btn { flex: 1; }
  .fiche-actions .actions > .btn-primary, .fiche-actions .actions > form:first-child { flex-basis: 100%; }
  .fiche-actions .share { width: 100%; }
  .fiche-actions .share .btn { flex: 1 1 auto; }
  .fiche-actions .share #share-status:empty { position: absolute; }   /* pas d'espace fantôme ; display: none retirerait la région annoncée */
  .actions-end { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: nowrap; background: var(--surface); margin-inline: -16px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 14px rgba(0, 0, 0, .12); }
  body:has(.bottom-nav) .actions-end { bottom: calc(57px + env(safe-area-inset-bottom, 0px)); }
  .actions-end > * { flex: 1 1 0; }
  .actions-end form .btn { flex: 1; }
  .actions-end.is-hidden { display: none; }
  .drawer-panel .actions-end { position: static; box-shadow: none; margin-inline: 0; padding: 0; }
  .js body:has(.actions-end:not(.is-hidden)) .messages { inset-block-end: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .js body:has(.bottom-nav):has(.actions-end:not(.is-hidden)) .messages { inset-block-end: calc(141px + env(safe-area-inset-bottom, 0px)); }
}
