/* Phase 4 - mobile Businesses / Schools / Clubs directory rows.
   Desktop (640px+) unchanged. Requires body.mv-mobile-shell-on. */

@media (max-width: 639px) {
  body.mv-mobile-shell-on .page-surface-wrapper:has(.sl-page) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0.5rem !important;
  }

  body.mv-mobile-shell-on .page-surface:has(.sl-page) {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* —— Shared flatter directory surface —— */
  body.mv-mobile-shell-on .mv-biz-v0,
  body.mv-mobile-shell-on .sl-page {
    --mv-dir-border: color-mix(in oklab, var(--mv-shell-border, rgba(31, 42, 36, 0.12)) 100%, transparent);
    --mv-dir-muted: var(--mv-shell-muted, #5b6b62);
    --mv-dir-fg: var(--mv-shell-fg, #1f2a24);
    --mv-dir-accent: var(--mv-shell-green, #0c6b34);
  }

  body.mv-mobile-shell-on .mv-biz-v0-hero {
    padding: 1rem 0.85rem 0.75rem;
  }

  body.mv-mobile-shell-on .mv-biz-v0-hero-inner {
    gap: 0.75rem;
  }

  body.mv-mobile-shell-on .mv-biz-v0-hero-title {
    font-size: 1.45rem;
    line-height: 1.2;
  }

  body.mv-mobile-shell-on .mv-biz-v0-hero-lead,
  body.mv-mobile-shell-on .mv-biz-v0-stats,
  body.mv-mobile-shell-on .mv-biz-v0-hero-media-wrap {
    display: none !important;
  }

  body.mv-mobile-shell-on .mv-biz-v0-directory {
    padding: 0 0 1rem;
  }

  body.mv-mobile-shell-on .mv-biz-v0-search-panel {
    margin: 0 0.85rem 0.75rem;
    border-radius: 0.85rem;
    box-shadow: none;
  }

  body.mv-mobile-shell-on .mv-biz-v0-grid {
    margin-top: 0.35rem;
    gap: 0;
    padding: 0;
  }

  /* —— Business / Club row cards —— */
  body.mv-mobile-shell-on .mv-biz-v0-card {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem 0.85rem;
    margin: 0;
    padding: 0.85rem;
    border: 0;
    border-bottom: 1px solid var(--mv-dir-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  body.mv-mobile-shell-on .mv-biz-v0-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
    border-bottom-color: var(--mv-dir-border);
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-media {
    width: 4.5rem;
    height: 4.5rem;
    aspect-ratio: 1;
    border-radius: 0.85rem;
    overflow: hidden;
    background: color-mix(in oklab, var(--mv-dir-accent) 8%, #fff);
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-photo {
    object-fit: cover;
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-monogram {
    font-size: 1.1rem;
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-category {
    position: static;
    display: inline-flex;
    margin-top: 0.2rem;
    margin-bottom: 0.15rem;
    width: fit-content;
    padding: 0.1rem 0.45rem;
    border-radius: 0.4rem;
    border: 0;
    background: color-mix(in oklab, var(--mv-dir-accent) 10%, transparent);
    color: var(--mv-dir-accent);
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: none;
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-body {
    padding: 0;
    min-width: 0;
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-title {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--mv-dir-fg);
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-title a {
    color: inherit;
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-location {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--mv-dir-muted);
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-desc {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    -webkit-line-clamp: 2;
    color: var(--mv-dir-muted);
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-footer {
    margin-top: 0.45rem;
    padding-top: 0;
    border-top: 0;
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-actions {
    display: none;
  }

  body.mv-mobile-shell-on .mv-biz-v0-view-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    min-height: 2.25rem;
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--mv-dir-accent);
    background: transparent;
  }

  /* Category chip lives in media on desktop; on mobile show under title area */
  body.mv-mobile-shell-on .mv-biz-v0-card-media .mv-biz-v0-card-category {
    display: none;
  }

  body.mv-mobile-shell-on .mv-biz-v0-card-body .mv-biz-v0-card-category-inline {
    display: inline-flex;
  }

  /* —— Schools row cards —— */
  body.mv-mobile-shell-on .sl-page {
    background: transparent;
    min-height: 0;
  }

  body.mv-mobile-shell-on .sl-page > .container {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    padding-top: 0.85rem !important;
    padding-bottom: 1rem !important;
  }

  body.mv-mobile-shell-on .sl-page .sl-dir-hero {
    margin-bottom: 0.85rem !important;
  }

  body.mv-mobile-shell-on .sl-page .sl-dir-hero h1 {
    font-size: 1.45rem !important;
    line-height: 1.2;
  }

  body.mv-mobile-shell-on .sl-page .sl-dir-hero .sl-subtitle {
    font-size: 0.875rem !important;
    line-height: 1.4;
  }

  body.mv-mobile-shell-on .sl-page > .container > .sl-card.card.shadow-md,
  body.mv-mobile-shell-on .sl-page details.sl-card {
    box-shadow: none !important;
    border: 1px solid var(--mv-dir-border) !important;
    border-radius: 0.85rem !important;
  }

  body.mv-mobile-shell-on .sl-page .grid.grid-cols-1 {
    gap: 0 !important;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card {
    display: grid !important;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.75rem 0.85rem;
    margin: 0;
    padding: 0.85rem;
    border: 0 !important;
    border-bottom: 1px solid var(--mv-dir-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card > figure,
  body.mv-mobile-shell-on .sl-page article.sl-card > .sl-media-placeholder {
    width: 4.5rem !important;
    height: 4.5rem !important;
    min-height: 4.5rem !important;
    margin: 0;
    padding: 0.35rem;
    border-radius: 0.85rem;
    overflow: hidden;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card > figure {
    background: color-mix(in oklab, var(--mv-dir-accent) 8%, #fff);
  }

  body.mv-mobile-shell-on .sl-page article.sl-card .card-body {
    padding: 0 !important;
    min-width: 0;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card .card-title {
    font-size: 1rem !important;
    margin-bottom: 0.2rem !important;
    line-height: 1.25;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card .card-title a {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card .sl-muted.flex {
    margin-bottom: 0.35rem !important;
    font-size: 0.75rem;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card p.sl-muted {
    margin-bottom: 0.35rem !important;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8125rem;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card .flex.flex-wrap.gap-1 {
    margin-bottom: 0.35rem !important;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card .card-actions {
    justify-content: flex-start !important;
    margin-top: 0.25rem !important;
  }

  body.mv-mobile-shell-on .sl-page article.sl-card .card-actions .btn {
    min-height: 2.25rem;
    height: auto;
    padding-inline: 0;
    background: transparent;
    border: 0;
    color: var(--mv-dir-accent);
    font-weight: 650;
    box-shadow: none;
  }
}

/* Inline category helper (hidden on desktop; shown on mobile via rules above) */
.mv-biz-v0-card-body .mv-biz-v0-card-category-inline {
  display: none;
}

@media (min-width: 640px) {
  .mv-biz-v0-card-body .mv-biz-v0-card-category-inline {
    display: none !important;
  }
}
