/**
 * Featured Workers, Creators & Artists — Directory Styles (v3.6.0)
 *
 * Design system: Minimal — airy whitespace, restrained contrast, no decorative
 * colours. Premium card with soft shadow + hover lift animation.
 *
 * Breakpoints:
 *   ≥ 960 px  → 3 columns
 *   ≥ 600 px  → 2 columns
 *   < 600 px  → 1 column
 */

/* ── CSS custom properties ─────────────────────────────────────────────── */
.mlfw-wrap {
  --mlfw-radius       : 20px;
  --mlfw-shadow       : 0 10px 30px rgba(15, 23, 42, 0.08);
  --mlfw-shadow-hover : 0 18px 44px rgba(15, 23, 42, 0.14);
  --mlfw-gap          : 26px;
  --mlfw-btn-bg       : #000;
  --mlfw-btn-fg       : #fff;
  --mlfw-btn-radius   : 8px;
  --mlfw-color-body   : #374151;
  --mlfw-color-muted  : #6b7280;
  --mlfw-color-bg     : #fff;
  --mlfw-transition   : 0.22s ease;
  --mlfw-banner-ratio : 58%;

  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 16px 52px;
  font-family: inherit;
}

/* ── Search bar ────────────────────────────────────────────────────────── */
.mlfw-search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}

.mlfw-search-bar__input,
.mlfw-search-bar__select {
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--mlfw-color-body);
  background: var(--mlfw-color-bg);
  outline: none;
  transition: border-color var(--mlfw-transition);
  box-sizing: border-box;
}

.mlfw-search-bar__input {
  flex: 1 1 260px;
  max-width: 420px;
}

.mlfw-search-bar__select {
  flex: 0 1 200px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%236b7280' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 38px;
}

.mlfw-search-bar__input:focus,
.mlfw-search-bar__select:focus {
  border-color: #9ca3af;
}

/* ── Result count ──────────────────────────────────────────────────────── */
.mlfw-count {
  text-align: center;
  font-size: 0.875rem;
  color: var(--mlfw-color-muted);
  margin: 0 0 20px;
}

/* ── Card grid ─────────────────────────────────────────────────────────── */
.mlfw-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--mlfw-gap);
  justify-items: center;
}

@media (max-width: 1024px) {
  .mlfw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 599px) {
  .mlfw-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Empty state ───────────────────────────────────────────────────────── */
.mlfw-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--mlfw-color-muted);
  font-size: 0.9375rem;
  padding: 40px 0;
}

/* ── Card ──────────────────────────────────────────────────────────────── */
.mlfw-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: var(--mlfw-radius);
  box-shadow: var(--mlfw-shadow);
  overflow: hidden;
  transition:
    transform var(--mlfw-transition),
    box-shadow var(--mlfw-transition);
  will-change: transform;
}

.mlfw-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--mlfw-shadow-hover);
}

/* ── Card banner ───────────────────────────────────────────────────────── */
.mlfw-card__banner {
  position: relative;
  width: 100%;
  padding-top: var(--mlfw-banner-ratio);
  overflow: hidden;
  background: #f3f4f6;
  border-radius: var(--mlfw-radius) var(--mlfw-radius) 0 0;
}

.mlfw-card__banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.mlfw-card:hover .mlfw-card__banner img {
  transform: scale(1.04);
}

.mlfw-card__banner-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

/* ── Card body ─────────────────────────────────────────────────────────── */
.mlfw-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 24px;
  text-align: center;
  gap: 4px;
}

.mlfw-card__category {
  font-size: 0.8125rem;
  color: var(--mlfw-color-muted);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.mlfw-card__name {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--mlfw-color-body);
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

/* No public CTA button: the banner is the primary navigation target. */

/* ── Sentinel (IntersectionObserver target) ────────────────────────────── */
.mlfw-sentinel {
  width: 100%;
  height: 1px;
  margin-top: 20px;
}

/* ── Loading spinner ───────────────────────────────────────────────────── */
.mlfw-spinner {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 24px 0;
}

.mlfw-spinner__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca3af;
  animation: mlfw-pulse 1.2s ease-in-out infinite;
}

.mlfw-spinner__dot:nth-child(2) { animation-delay: 0.2s; }
.mlfw-spinner__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes mlfw-pulse {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1.0); opacity: 1;   }
}

/* ── Banner Image Clickable Enhancement (v4.1.3) ────────────────────────── */
.mlfw-card__banner-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
}

.mlfw-card__banner-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0) 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.mlfw-card__banner-link:hover::before {
  opacity: 1;
}

.mlfw-card__banner-link img {
  transition: transform 0.3s ease;
}

.mlfw-card__banner-link:hover img {
  transform: scale(1.03);
}

.mlfw-card__banner-link:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: -3px;
}


/* Modern public-place cards: no public CTA; media/title navigate naturally. */
.ml-places-directory-card, .ml-places-sc-card {
  border-radius: 20px !important;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.07);
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
  background: linear-gradient(180deg,#fff 0%,#fbfdff 100%);
  transition: transform .22s ease, box-shadow .22s ease;
}
.ml-places-directory-card:hover, .ml-places-sc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(15,23,42,.13);
}
.ml-places-directory-card__media, .ml-places-sc-card__media { display:block; overflow:hidden; }
.ml-places-directory-card__media img, .ml-places-sc-card__media img { transition:transform .35s ease; }
.ml-places-directory-card:hover .ml-places-directory-card__media img, .ml-places-sc-card:hover .ml-places-sc-card__media img { transform:scale(1.035); }
