/* jobs — CSS spécifique, chargé APRÈS fokus-base.css (tokens uniquement). */

/* Les bascules de vue et d'états se font par l'attribut hidden : il doit
   l'emporter sur les display posés par le socle et par ce fichier. */
[hidden] { display: none !important; }

/* Fond transparent : la page s'affiche dans une iframe du site WordPress et
   doit laisser voir le fond de la page hôte. Les cartes et la fiche portent
   leur propre fond. */
html, body { background: transparent; }

/* La page vit dans une iframe du site FOKUS. Largeur calée sur trois
   colonnes de cartes confortables ; la grille se replie d'elle-même si
   l'iframe est plus étroite. */
.container { max-width: 1180px; padding: 1.25rem 1rem 2rem; }

/* ── Filtres (cumulables : contrat ET localisation) ─────────────────────── */
/* Barre collante en haut de la zone de défilement. Elle porte son propre
   fond translucide : le fond de page étant transparent, les cartes
   passeraient sinon à travers les listes déroulantes. */
/* Cadre piloté par la page hôte : plus de défilement interne, donc plus rien
   à quoi `sticky` puisse s'accrocher. La barre est alors déplacée par script
   (cf. positionneBarre dans app.js). */
body.barre-pilotee .barre-filtres {
  position: relative;
  top: auto;
  will-change: transform;
}

.barre-filtres {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin: -1.25rem -1rem 1.25rem;
  padding: 1rem;
  background: rgba(255, 255, 255, .90);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.filtres {
  display: flex;
  flex: 1 1 520px;   /* prend la largeur restante, sinon les listes s'empilent */
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}
.filtres .form-group { margin-bottom: 0; flex: 1 1 180px; max-width: 240px; }
.filtres .form-group--recherche { flex: 2 1 240px; max-width: 320px; }
.filtres .form-group--metier { flex: 1.4 1 220px; max-width: 270px; }
.barre-filtres__etat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .15rem;
  margin-left: auto;
}

/* Mobile : recherche sur toute la largeur, listes deux par deux, et la barre
   n'est plus maintenue en haut. À cette taille elle occupe près de la moitié
   de l'écran, la garder collée masquerait les offres. */
@media (max-width: 660px) {
  .filtres { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; flex-basis: 100%; }
  .filtres .form-group { max-width: none; }
  .filtres .form-group--recherche { grid-column: 1 / -1; max-width: none; }
  .barre-filtres, body.barre-pilotee .barre-filtres { position: relative; transform: none !important; }
  .barre-filtres__etat { flex-direction: row; align-items: center; width: 100%;
                         justify-content: space-between; margin-left: 0; }
}
.filtres label { font-size: .8125rem; font-weight: 600; }
#compteur { color: var(--text-muted); font-size: .875rem; }

/* Titre réservé aux lecteurs d'écran. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Cartes d'offres : .card du socle + bandeau visuel (règle R5) ───────── */
.grille-offres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 1000px) { .grille-offres { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 660px) { .grille-offres { grid-template-columns: 1fr; } }

/* La carte EST le visuel : image pleine, titre et informations dessus,
   aucun encadré blanc (demande métier du 24/09/2026). */
.offre-card {
  position: relative;
  display: block;
  width: 100%;
  height: 235px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: var(--nav-bg);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}
.offre-card:hover, .offre-card:focus-visible {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.offre-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.offre-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.offre-card:hover img { transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) {
  .offre-card img, .offre-card { transition: none; }
  .offre-card:hover img { transform: none; }
}

/* Voile : lisibilité du titre blanc sur n'importe quelle photo. */
.offre-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 18, 43, .10) 0%,
                                      rgba(0, 18, 43, .58) 45%,
                                      rgba(0, 18, 43, .90) 100%);
}

.offre-card__corps {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1rem 1.1rem;
  color: #fff;
}
.offre-card h2 {
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.offre-card .badge {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .40);
}
/* Salaire mis en avant : texte sombre sur teal, combinaison validée par la
   charte (7,23 : 1), contrairement au blanc sur teal. */
.offre-card .badge--salaire,
.hero .badge--salaire {
  background: var(--primary);
  color: var(--nav-bg);
  border-color: transparent;
  font-weight: 700;
}
.offre-card .badge + .badge,
.fiche__badges .badge + .badge { margin-left: .4rem; }

/* ── Fiche ──────────────────────────────────────────────────────────────── */
/* Seul le « ← Toutes les offres » au-dessus de la carte est espacé : le
   « Retour à la liste » du pied hériterait de la marge et se décalerait. */
#vue-fiche > .retour { margin-bottom: .75rem; }

/* La fiche reste étroite même quand la liste s'élargit : au-delà, les lignes
   de description deviennent trop longues à lire. */
.fiche { display: block; max-width: 900px; }

.hero {
  position: relative;
  height: 230px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--nav-bg);   /* repli si le visuel ne charge pas */
}
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Voile de marque : lisibilité du texte blanc quelle que soit la photo. */
.hero__voile {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(0, 18, 43, .92) 0%,
                                      rgba(0, 122, 128, .80) 55%,
                                      rgba(0, 168, 176, .55) 100%);
}
.hero__contenu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .7rem;
  padding: 1.5rem 1.75rem;
  color: #fff;
}
.hero__famille {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .88;
}
.hero h1 { color: #fff; font-size: 1.5rem; max-width: 75%; }
.hero__bas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.hero .fiche__badges { margin: 0; }
.hero .badge {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .38);
}
.btn--sur-photo { background: #fff; color: var(--primary-strong); border-color: #fff; }
.btn--sur-photo:hover { background: var(--primary-light); color: var(--primary-strong); }

.fiche__corps {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.5rem 1.75rem;
}
@media (max-width: 680px) {
  .hero { height: 200px; }
  .hero h1 { font-size: 1.25rem; max-width: 100%; }
  .hero__contenu, .fiche__corps { padding: 1.1rem 1.15rem; }
}

.fiche__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 2.5rem;
  margin: 0 0 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.fiche__meta dt { font-size: .8125rem; color: var(--text-muted); }
.fiche__meta dd { font-weight: 600; }

/* Description : HTML nettoyé par le collecteur, structure portée par les
   balises (le collecteur normalise les deux gabarits jobposting). */
.fiche__description { line-height: 1.6; }
.fiche__description p { margin-bottom: .8rem; }
.fiche__description p:last-child { margin-bottom: 0; }
.fiche__description h2 {
  margin: 1.5rem 0 .4rem;
  color: var(--primary-strong);
  font-size: 1.1rem;
}
.fiche__description h2:first-child { margin-top: 0; }
.fiche__description ul, .fiche__description ol { margin: 0 0 .8rem 1.25rem; }
.fiche__description li { margin-bottom: .2rem; }
.fiche__description hr { border: none; margin: .5rem 0; }

.fiche__pied {
  display: flex;
  align-items: center; /* sans quoi le lien s'étire à la hauteur de la ligne */
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
