/* Directory results — one state visible, shared content width via .b-directory-main__inner */

[hidden] {
  display: none !important;
}

html.b-editorial body.page-app .b-directory-results {
  margin-top: 28px;
  min-height: 420px;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

/* Only the active state is laid out (hidden wins via [hidden] above) */
html.b-editorial body.page-app .b-directory-results > .b-results-loading:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

html.b-editorial body.page-app .b-directory-results > .b-results-empty:not([hidden]) {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

html.b-editorial body.page-app .b-directory-results > .b-farm-list:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}

html.b-editorial body.page-app .b-directory-results .b-farm-list > .b-farm-card,
html.b-editorial body.page-app .b-directory-results .b-farm-list > .b-farm-card--directory,
html.b-editorial body.page-app .b-directory-results .b-farm-list > .b-results-error {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

html.b-editorial body.page-app .b-directory-results .b-results-loading > .b-farm-card-skeleton {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
}

/* Empty state */
.b-empty-card {
  width: 100%;
  max-width: none;
  min-height: 300px;
  border: 1.5px solid #000;
  background: #fff;
  padding: clamp(28px, 4vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.b-empty-card__eyebrow {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #555;
}

.b-empty-card__title {
  margin: 0;
  font-family: var(--b-font-display, "Roboto Condensed", "Arial Narrow", sans-serif);
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  color: #000;
}

.b-empty-card__copy {
  max-width: 560px;
  margin: 18px 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: #555;
}

.b-empty-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

html.b-editorial body.page-app .b-empty-card__actions .b-btn {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html.b-editorial body.page-app .b-empty-card__actions .b-btn--secondary {
  border: 1.5px solid #000;
  background: #fff;
  color: #000;
}

html.b-editorial body.page-app .b-empty-card__actions .b-btn--secondary:hover {
  background: var(--b-gray-100);
  color: #000;
}

html.b-editorial body.page-app .b-empty-card__actions .b-btn--primary {
  border: 1.5px solid #000;
  background: #000;
  color: #fff;
}

html.b-editorial body.page-app .b-empty-card__actions .b-btn--primary:hover {
  background: #fff;
  color: #000;
}

/* Skeleton cards */
.b-farm-card-skeleton {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  border: 1.5px solid #000;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.b-farm-card-skeleton__media {
  min-height: 360px;
  border-right: 1.5px solid #000;
  background: #e8e8e8;
}

.b-farm-card-skeleton__content {
  min-width: 0;
  padding: clamp(24px, 2.2vw, 36px);
  display: flex;
  flex-direction: column;
}

.b-skeleton {
  position: relative;
  overflow: hidden;
  background: #e8e8e8;
}

.b-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.75) 50%,
    transparent 100%
  );
  animation: b-skeleton-shimmer 1.4s infinite;
}

@keyframes b-skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .b-skeleton::after {
    animation: none;
  }
}

.b-skeleton--title {
  width: min(620px, 90%);
  height: clamp(58px, 6vw, 92px);
}

.b-skeleton--location {
  width: 220px;
  height: 18px;
  margin-top: 18px;
}

.b-skeleton-row {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  overflow: hidden;
}

.b-skeleton--chip {
  width: 150px;
  height: 36px;
  flex-shrink: 0;
}

.b-skeleton-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  margin-top: 24px;
}

.b-skeleton-kpi {
  min-height: 104px;
  padding: 18px;
  border-right: 1px solid #d8d8d8;
}

.b-skeleton-kpi:last-child {
  border-right: 0;
}

.b-skeleton--icon {
  width: 24px;
  height: 24px;
  margin-bottom: 16px;
}

.b-skeleton--value {
  width: 70%;
  height: 24px;
}

.b-skeleton--pill {
  width: 110px;
  height: 38px;
  border-radius: 999px;
  flex-shrink: 0;
}

.b-skeleton-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
}

.b-skeleton--button {
  height: 52px;
}

@media (max-width: 1023px) {
  html.b-editorial body.page-app .b-directory-main {
    padding: 32px var(--b-space-page, 22px) 80px;
  }

  html.b-editorial body.page-app .b-directory-main__inner,
  html.b-editorial body.page-app .b-directory-main__inner > .b-directory-hero,
  html.b-editorial body.page-app .b-directory-main__inner > .b-directory-search,
  html.b-editorial body.page-app .b-directory-main__inner > .b-directory-results,
  html.b-editorial body.page-app .b-directory-results > .b-farm-list,
  html.b-editorial body.page-app .b-directory-results > .b-results-empty,
  html.b-editorial body.page-app .b-directory-results > .b-results-loading {
    width: 100%;
    max-width: none;
  }

  html.b-editorial body.page-app .b-directory-results {
    min-height: 360px;
  }

  .b-farm-card-skeleton {
    display: block;
    min-height: 0;
  }

  .b-farm-card-skeleton__media {
    min-height: 0;
    aspect-ratio: 16 / 10;
    border-right: 0;
    border-bottom: 1.5px solid #000;
  }

  .b-farm-card-skeleton__content {
    padding: 22px;
  }

  .b-skeleton--title {
    height: 54px;
    width: 88%;
  }

  .b-skeleton-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .b-skeleton-kpi {
    min-height: 48px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .b-skeleton-kpi .b-skeleton--icon {
    width: 16px;
    height: 16px;
    margin: 0;
  }

  .b-skeleton-kpi .b-skeleton--value {
    width: 54px;
    height: 14px;
  }

  .b-farm-card-skeleton .b-skeleton-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
  }

  .b-farm-card-skeleton .b-skeleton-actions .b-skeleton--button:first-child {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 48px;
  }

  .b-farm-card-skeleton .b-skeleton-actions .b-skeleton--button:last-child {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
  }

  .b-empty-card {
    min-height: 240px;
    padding: 28px 22px;
  }

  .b-empty-card__actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
