/* ============================================================
   🧱 LAYOUT: SECCIÓ D’OFERTES
   ------------------------------------------------------------
   Defineix l’estructura general de la pàgina d’ofertes,
   incloent filtres, distribució de targetes i controls de vista.
   ============================================================ */


/* === 1️⃣ VISTA LLISTA (una oferta per fila) === */
.job-listings.list-view {
  display: flex !important;
  flex-direction: column;
}

.job-listings.list-view .job-item {
  width: 100%;
}


/* === 2️⃣ VISTA GRAELLA (targetes múltiples per fila) === */
#ofertes-publicades.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  align-items: start;
}


/* === 3️⃣ SELECTOR: “Ofertes per pàgina” === */
.per-page-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 2rem 0 auto;
}

/* === 4️⃣ DISTRIBUCIÓ GENERAL === */
.ofertes-layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  overflow: visible;
}

/* === 5️⃣ WRAPPER → LÍMIT REAL DEL STICKY === */
.filters-wrapper {
  position: relative;
  flex: 0 0 250px; /* ample fix de la columna esquerra */
}

/* === 6️⃣ FILTRES (element sticky) === */
.filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;

  background-color: var(--color-surface);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow);

  position: sticky;
  top: 24px;
}

/* === 7️⃣ LLISTAT D’OFERTES (columna dreta) === */
.job-listings {
  flex: 1; /* ocupa tot l'espai restant */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;

  width: 100%;
  padding-bottom: 40px;
  box-sizing: border-box;
}



/* === 7️⃣ TARGETA BASE (estructura i estètica lleugera) === */
.job-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  height: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: visible;

  padding: 1.6rem;
  background-color: var(--color-surface);
  border-radius: 12px;
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}


/* 🔹 Interacció hover */
.job-item:hover {
  transform: translateY(-4px);
  border-color: var(--color-daurat);
  box-shadow: var(--shadow);
  background-color: var(--color-surface-2);
}

/* =====================================================
   🌙 DARK MODE — MODAL FILTRES MÒBIL
   ===================================================== */

[data-theme="dark"] #modal-filtres {
  background: #111827;
  color: #e5e7eb;
}

/* Camps dins del modal */
[data-theme="dark"] #modal-filtres input,
[data-theme="dark"] #modal-filtres select {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,.15);
}

/* Placeholder */
[data-theme="dark"] #modal-filtres input::placeholder {
  color: #9ca3af;
}

/* Labels i textos secundaris */
[data-theme="dark"] #modal-filtres label,
[data-theme="dark"] #modal-filtres small {
  color: #9ca3af;
}

/* Range slider text */
[data-theme="dark"] #modal-filtres span {
  color: #9ca3af;
}

/* =====================================================
   🌙 DARK MODE — CONTENIDOR INTERIOR REAL
   ===================================================== */

[data-theme="dark"] #modal-filtres .filters,
[data-theme="dark"] #modal-filtres .modal-content,
[data-theme="dark"] #modal-filtres > div {
  background: #111827 !important;
  color: #e5e7eb;
}

[data-theme="dark"] .tancar-filtres {
  color: #e5e7eb;
  opacity: .85;
}

[data-theme="dark"] .tancar-filtres:hover {
  opacity: 1;
}




