/* =========================================================
   dumaguete.uk — marketplace.css
   The listings block only. Everything below it on the page
   is content.css, so the reading experience matches the
   rest of the site.
   ========================================================= */

.mk-section {
  padding-top: 4px;
  padding-bottom: 28px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.mk-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mk-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.mk-count {
  font-size: 0.8rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------- Filters ---------- */
.mk-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.mk-input {
  flex: 1 1 190px;
  min-width: 0;
  padding: 9px 13px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s var(--ease);
}
.mk-input:focus { border-color: var(--accent); }
.mk-input--sm { flex: 0 0 auto; }
.mk-input[type="number"] { width: 110px; }

/* ---------- Listing cards ---------- */
.mk-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.mk-card {
  display: flex;
  flex-direction: column;
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--shadow-a);
  transition: border-color 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.mk-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}
.mk-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.mk-card__price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  white-space: nowrap;
}
.mk-card__wanted {
  padding: 2px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-alt);
  border-radius: 999px;
  white-space: nowrap;
}
.mk-card__cat {
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-decoration: none;
  white-space: nowrap;
}
.mk-card__cat:hover { color: var(--accent); text-decoration: none; }
.mk-card__title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.mk-card__title:hover { color: var(--accent); text-decoration: none; }
.mk-card__body {
  margin: 8px 0 12px;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.mk-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.mk-card__who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mk-card__who a {
  color: var(--ink-soft);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mk-card__who a:hover { color: var(--accent); text-decoration: none; }
.mk-card__bar {
  display: inline-block;
  flex: 0 0 auto;
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}
.mk-card__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.mk-card__tier {
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink-soft);
  white-space: nowrap;
}
.mk-card__tier--insider,
.mk-card__tier--legend {
  background: var(--accent);
  color: var(--accent-ink);
}
.mk-card__where {
  padding: 1px 8px;
  background: var(--surface-alt);
  border-radius: 999px;
}
.mk-card__when { margin-left: auto; white-space: nowrap; }

/* ---------- Empty + more ---------- */
.mk-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px 0;
  max-width: 56ch;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-faint);
}
.mk-more {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.mk-more:hover { color: var(--accent); background: var(--surface-alt); }

/* ---------- For-sale strip on category pages ---------- */
.cat-sale {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.cat-sale__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.cat-sale__all {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.cat-sale__all:hover { text-decoration: underline; }
.cat-sale__strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  max-width: 100%;
  min-width: 0;
}
.cat-sale__strip::-webkit-scrollbar { display: none; }
.cat-sale__item {
  flex: 0 0 auto;
  width: 190px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s var(--ease);
}
.cat-sale__item:hover { border-color: var(--accent); text-decoration: none; }
.cat-sale__price {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}
.cat-sale__name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 6px;
}
.cat-sale__who {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.cat-sale__bar {
  display: inline-block;
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}
.cat-sale__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

/* ---------- Narrow screens ---------- */
@media (max-width: 560px) {
  .mk-list { grid-template-columns: 1fr; }
  .mk-card__when { margin-left: 0; }
  .mk-input[type="number"] { width: 100%; }
}

/* =========================================================
   Post buttons + in-place composer (same pattern as Jobs)
   ========================================================= */
.jobs-board__actions { display: flex; gap: 8px; margin-bottom: 14px; }
.jobs-post {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
}
.jobs-post--hire { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.jobs-post--seek { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.jobs-post--hire:hover,
.jobs-post--seek:hover { border-color: var(--accent); color: var(--accent); }
.jobs-post:hover { filter: brightness(1.07); }

.jobs-modal { position: fixed; inset: 0; z-index: 400; }
.jobs-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.jobs-modal__panel {
  position: relative;
  margin: 6vh auto;
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: 88vh;
  overflow: auto;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
}
.jobs-modal__head { display: flex; align-items: center; margin-bottom: 8px; }
.jobs-modal__head h3 { margin: 0; font-family: var(--font-display); font-size: 1.1rem; }
.jobs-modal__x { margin-left: auto; border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--ink-faint); cursor: pointer; }
.jobs-modal .cn-field { display: block; margin-bottom: 12px; }
.jobs-modal .cn-field__label { display: block; margin-bottom: 5px; font-size: 0.82rem; color: var(--ink-soft); }
.jobs-modal .cn-field__label em { font-style: normal; color: var(--accent); font-size: 0.76rem; }
.jobs-modal .cn-field__label small { color: var(--ink-faint); font-weight: 400; }
.jobs-modal .cn-field__input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.jobs-modal .cn-field__input:focus { outline: none; border-color: var(--accent); }
.jobs-modal textarea.cn-field__input { resize: vertical; }
.jobs-modal__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jobs-modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.jobs-modal__actions .btn {
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
}
.jobs-modal__actions .btn--primary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.jobs-modal__actions .btn--primary:hover { background: var(--surface-alt); filter: none; }
.jobs-modal__actions .btn--ghost:hover { background: var(--surface-alt); }
.jobs-modal__actions .btn:disabled { opacity: 0.6; cursor: default; }
@media (max-width: 520px) { .jobs-modal__row { grid-template-columns: 1fr; } }

/* Photo uploader (shared pattern, from forum.css) */
.up { margin-top: 4px; }
.up__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.up__btn {
  padding: 7px 14px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.up__btn:hover { color: var(--accent); background: var(--surface-alt); }
.up__hint {
  flex: 1 1 200px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ink-faint);
}
.up__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.up__item {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}
.up__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up__item.is-working {
  display: flex;
  align-items: center;
  justify-content: center;
}
.up__spin {
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.up__x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.up__x:hover { background: rgba(0, 0, 0, 0.75); }
.up__size {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 5px;
  font-size: 0.75rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  text-align: center;
}
.up__err {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--accent);
}


/* Photos on a marketplace card */
.mk-card__photos { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.mk-card__photo {
  width: 72px; height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: block;
}
.mk-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
