/*
 * Registre des offres (archive « offre-emploi »). Chargé uniquement sur l'archive.
 * Couleurs : DESIGN.md du thème emploiregion_theme. Thème clair.
 */

.erg-registre {
  --erg-ink: #0F1B2D;
  --erg-muted: #4A5568;
  --erg-bg: #FFFFFF;
  --erg-surface: #F4F6FA;
  --erg-border: #DDE3EE;
  --erg-brand: #1747A6;
  --erg-brand-ink: #0B2F6E;
  --erg-brand-tint: #E8EEF9;
  --erg-accent: #FFB020;
  --erg-accent-tint: #FFF3D6;
  --erg-radius: 14px;
  --erg-radius-sm: 10px;
  background: var(--erg-bg);
  color: var(--erg-ink);
  font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.erg-registre ::selection { background: var(--erg-accent); color: var(--erg-ink); }
.erg-registre *, .erg-registre *::before, .erg-registre *::after { box-sizing: border-box; }
.erg-registre :focus-visible { outline: 3px solid var(--erg-accent); outline-offset: 2px; border-radius: 4px; }

.erg-registre .wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .erg-registre .wrap {
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
  }
}

/* En-tête */
.erg-registre .hero { background: var(--erg-brand); color: #fff; padding-block: 48px 40px; }
.erg-registre .hero__inner { display: grid; gap: 20px; }
@media (min-width: 900px) { .erg-registre .hero__inner { grid-template-columns: 1fr auto; align-items: end; } }
.erg-registre h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
  color: #fff;
}
.erg-registre .hero__lede { margin: 14px 0 0; max-width: 46ch; color: #DCE6F7; font-size: 1.05rem; }
.erg-registre .hero__count {
  display: inline-flex; align-items: baseline; gap: 10px; margin: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--erg-radius);
  padding: 14px 20px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.erg-registre .hero__count strong { font-size: 2.5rem; line-height: 1; font-weight: 800; color: var(--erg-accent); }
.erg-registre .hero__count span { color: #DCE6F7; font-size: 0.95rem; }

/* Recherche et filtres */
.erg-registre .controls { display: grid; gap: 12px; padding-block: 20px 14px; }
.erg-registre .search { position: relative; }
.erg-registre .search label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.erg-registre .search__icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--erg-muted); pointer-events: none;
}
.erg-registre .search input {
  width: 100%; height: 52px;
  padding: 0 16px 0 46px;
  border: 1.5px solid var(--erg-border);
  border-radius: var(--erg-radius-sm);
  background: #fff;
  font: inherit; font-size: 1rem;
  color: var(--erg-ink);
  transition: border-color 0.2s ease;
}
.erg-registre .search input::placeholder { color: #5A6679; }
.erg-registre .search input:hover { border-color: #B9C4D8; }
.erg-registre .search input:focus { outline: none; border-color: var(--erg-brand); box-shadow: 0 0 0 3px var(--erg-accent); }
.erg-registre .search input::-webkit-search-cancel-button { cursor: pointer; }
.erg-registre .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.erg-registre .filters__group { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.erg-registre .chip {
  min-height: 44px; padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--erg-border);
  background: #fff; color: var(--erg-ink);
  font: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.erg-registre .chip:hover { border-color: var(--erg-brand); color: var(--erg-brand); }
.erg-registre .chip__count {
  font-variant-numeric: tabular-nums; font-size: 0.8125rem;
  background: var(--erg-surface); color: var(--erg-muted);
  border-radius: 999px; padding: 1px 8px;
}
.erg-registre .chip[aria-pressed="true"] { background: var(--erg-brand); border-color: var(--erg-brand); color: #fff; }
.erg-registre .chip--ghost { border-style: dashed; color: var(--erg-muted); }
.erg-registre .chip--ghost:hover { color: var(--erg-brand); border-color: var(--erg-brand); }
.erg-registre .chip[aria-pressed="true"] .chip__count { background: rgba(255, 255, 255, 0.2); color: #fff; }
.erg-registre .sort { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--erg-muted); }
.erg-registre .sort select {
  min-height: 44px; padding: 0 36px 0 12px;
  border: 1.5px solid var(--erg-border); border-radius: var(--erg-radius-sm);
  background: #fff; font: inherit; font-weight: 600; color: var(--erg-ink); cursor: pointer;
}
@media (max-width: 719px) {
  .erg-registre .sort { margin-left: 0; width: 100%; }
  .erg-registre .sort select { flex: 1; }
}

/* Résultats : une ligne par offre */
.erg-registre .results { padding-block: 8px 72px; }
.erg-registre .status { margin: 14px 0 6px; font-size: 0.9rem; color: var(--erg-muted); font-variant-numeric: tabular-nums; }
.erg-registre .ledger { list-style: none; margin: 0; padding: 0; }
.erg-registre .row {
  position: relative;
  display: grid; grid-template-columns: 1fr; gap: 8px;
  padding: 18px 12px; margin: 0 -12px;
  border-bottom: 1px solid var(--erg-border);
  border-radius: var(--erg-radius-sm);
  transition: background-color 0.2s ease;
}
.erg-registre .row[hidden] { display: none; }
.erg-registre .row:hover, .erg-registre .row:focus-within { background: var(--erg-surface); }
.erg-registre .row__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.erg-registre .row__new {
  font-size: 0.75rem; font-weight: 700;
  background: var(--erg-accent); color: var(--erg-ink);
  border-radius: 999px; padding: 2px 10px;
}
.erg-registre .row__date { font-size: 0.875rem; color: var(--erg-muted); }
.erg-registre .row__title { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.erg-registre .row__title a { color: var(--erg-ink); text-decoration: none; }
.erg-registre .row__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--erg-radius-sm); }
.erg-registre .row:hover .row__title a { color: var(--erg-brand); }
.erg-registre .row__company { margin: 0; color: var(--erg-muted); font-size: 0.95rem; }
.erg-registre .row__company a { position: relative; z-index: 1; color: var(--erg-brand-ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.erg-registre .row__company a:hover { color: var(--erg-brand); }
.erg-registre .row__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font-size: 0.95rem; }
.erg-registre .row__fact { display: inline-flex; align-items: center; gap: 6px; }
.erg-registre .row__fact svg { width: 16px; height: 16px; color: var(--erg-muted); flex: none; }
.erg-registre .row__salary { font-variant-numeric: tabular-nums; font-weight: 700; }
.erg-registre .tag {
  font-size: 0.8125rem; font-weight: 700;
  border-radius: 999px; padding: 3px 10px;
  background: var(--erg-brand-tint); color: var(--erg-brand-ink);
}
.erg-registre .tag--alt { background: var(--erg-accent-tint); color: #5C4000; }
.erg-registre .tag--neutral { background: var(--erg-surface); color: var(--erg-ink); }
.erg-registre .row__go { display: none; }
.erg-registre .row__go-mobile { color: var(--erg-brand); font-weight: 700; font-size: 0.95rem; }

@media (min-width: 900px) {
  .erg-registre .row {
    grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 20px;
    padding: 20px 14px;
    margin: 0 -14px;
  }
  .erg-registre .row__head { display: block; grid-column: 1; grid-row: 1; }
  .erg-registre .row__title { grid-column: 1; grid-row: 2; }
  .erg-registre .row__company { grid-column: 2; grid-row: 1 / span 2; }
  .erg-registre .row__facts .row__fact { grid-column: 3; grid-row: 1 / span 2; }
  .erg-registre .row__facts .tag { grid-column: 4; grid-row: 1; justify-self: start; }
  .erg-registre .row__facts .row__salary { grid-column: 4; grid-row: 2; justify-self: start; }
  .erg-registre .row__new { margin-right: 8px; }
  .erg-registre .row__facts { display: contents; }
  .erg-registre .row__go-mobile { display: none; }
  .erg-registre .row__go {
    grid-column: 5; grid-row: 1 / span 2;
    display: inline-flex; align-items: center; gap: 6px; justify-self: end;
    color: var(--erg-brand); font-weight: 700; font-size: 0.95rem; white-space: nowrap;
  }
  .erg-registre .row__go svg { width: 18px; height: 18px; transition: transform 0.2s ease; }
  .erg-registre .row:hover .row__go svg, .erg-registre .row:focus-within .row__go svg { transform: translateX(3px); }
}

/* États vides */
.erg-registre .empty {
  text-align: center;
  padding: 56px 16px;
  border: 1.5px dashed var(--erg-border);
  border-radius: var(--erg-radius);
  margin-top: 16px;
}
.erg-registre .empty h2 { margin: 0 0 6px; font-size: 1.25rem; }
.erg-registre .empty p { margin: 0 0 18px; color: var(--erg-muted); }
.erg-registre .empty-site { color: var(--erg-muted); padding: 40px 0; text-align: center; }
.erg-registre .btn {
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--erg-brand); color: #fff;
  font: inherit; font-weight: 700; cursor: pointer;
  transition: background-color 0.2s ease;
}
.erg-registre .btn:hover { background: var(--erg-brand-ink); }

@media (prefers-reduced-motion: reduce) {
  .erg-registre *, .erg-registre *::before, .erg-registre *::after { transition: none !important; }
}
