/* Member list card: the directory list card, shared by /directory/ and the 13 town pages (/towns/<slug>/).
   Moved here unchanged from public/directory/index.html (2026-11-23) so there is one copy. Markup:
   /js/member-list-card.js (MLCMemberListCard.render). Load after main.css and before a page's own styles. */

    /* List view */
    .directory-list .member-list-item {
      display: flex;
      align-items: stretch;
      gap: 0;
      padding: 0;
      height: 96px;
      background: var(--white);
      /* One 1px navy border on every card (Kamden 2026-11-22: square corners and navy outlines site-wide; was lake blue) */
      border: 1px solid var(--navy);
      border-radius: var(--radius-md);
      margin-bottom: 8px;
      transition: all 180ms var(--ease-out);
      text-decoration: none;
      color: inherit;
      cursor: pointer;
      overflow: hidden;
    }

    .member-list-item:hover {
      border-color: var(--navy);
      box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
    }

    /* Featured / Community Sponsor halo */
    /* Uniform borders (Kamden 2026-11-21): featured is the same 1px border as every card, in gold, no halo */
    .member-list-item.is-featured {
      border-color: var(--gold);
    }

    .member-list-item.is-featured:hover {
      border-color: var(--gold);
    }

    .member-list-logo {
      width: 95px;   /* square logo area: 94px inside + 1px divider, so a square logo fills it with no hairline (Kamden 2026-11-21) */
      flex-shrink: 0;
      overflow: hidden;
      background: var(--white);
      display: flex;
      align-items: center;
      justify-content: center;
      border-right: 1px solid var(--border-light);
      padding: 0;
    }

    .member-list-logo img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    .member-list-logo .placeholder {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      background: var(--cream);
      border-radius: 0;
    }

    .member-list-logo .placeholder img {
      width: 50%;
      height: 50%;
      object-fit: contain;
    }

    .member-list-logo .placeholder span {
      font-family: var(--font-body);
      font-size: 0.55rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--gold);
    }

    /* ── Content area: 2-col grid, 3 rows pinned top/center/bottom ── */
    .member-list-content {
      flex: 1;
      min-width: 0;
      display: grid;
      grid-template-columns: 1fr auto;
      grid-template-rows: auto auto auto;
      align-content: space-between;
      padding: 10px 12px;
      position: relative;
    }

    /* Row 1 — name (top-left) + pill (top-right) */
    .member-list-header {
      grid-column: 1 / -1;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      min-height: 0;
    }

    .member-list-name {
      display: flex;
      align-items: center;
      gap: 5px;
      min-width: 0;
      flex: 1;
    }
    .member-list-name-text {
      font-family: var(--font-display);
      font-size: 1.4rem;   /* 22.4px (Kamden 2026-11-21, locked) */
      font-weight: 600;
      color: var(--navy);
      line-height: 1.1;    /* name sits higher: card top to capitals matches town to card bottom */
      padding-bottom: 4px; /* room for g, y, p, j tails, which overflow: hidden would otherwise cut */
      margin-bottom: -4px; /* ...without moving anything else */
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .member-list-badges {
      display: flex;
      align-items: center;
      gap: 5px;
      flex-shrink: 0;
    }

    /* Row 2 — description (spans both columns, centered by space-between) */
    .member-list-desc {
      grid-column: 1 / -1;
      margin-top: 5px;   /* evenly between name and town (Kamden 2026-11-21, locked) */
      font-family: var(--font-body);
      font-size: 0.95rem;
      color: var(--text-secondary);
      line-height: 1.3;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .member-list-desc.is-placeholder {
      color: var(--text-muted);
      font-style: italic;
    }

    /* Row 3 — town (bottom-left) */
    .member-list-town {
      grid-column: 1;
      align-self: end;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .member-list-town:empty { display: none; }

    .member-list-town svg {
      flex-shrink: 0;
      color: var(--navy);
      width: 11px;
      height: 11px;
    }

    .member-list-town span {
      font-family: var(--font-body);
      font-size: 0.95rem;
      font-weight: 500;
      color: var(--text-secondary);
      line-height: 1.25;
    }

    /* Industry pill — top-right via header flex */
    .member-list-industry {
      font-family: var(--font-body);
      font-size: 0.6rem;
      font-weight: 600;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      color: var(--cat-color, var(--text-muted));
      background: var(--cat-bg, #f0f0f0);
      padding: 3px 8px;
      border-radius: 0;
      white-space: nowrap;
      flex-shrink: 0;
      margin-top: 1px;
    }

    /* Featured businesses get gold industry pill */
    .member-list-item.is-featured .member-list-industry {
      color: #fff;
      background: var(--gold, #d4943a);
      box-shadow: 0 1px 4px rgba(212, 148, 58, 0.3);
    }

    .featured-pill {
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }

    .featured-star {
      color: var(--gold);
      flex-shrink: 0;
      display: block;
    }

    /* Open Now dot */
    .open-now-dot-sm {
      display: block;
      width: 8px;
      height: 8px;
      background: var(--success, #2f7d5c);
      border-radius: 50%;
      box-shadow: 0 0 4px rgba(47, 125, 92, 0.4);
    }

    /* Arrow — bottom-right (grid item) */
    .member-list-arrow {
      grid-column: 2;
      grid-row: 3;
      align-self: end;
      justify-self: end;
      width: 18px;   /* square arrow box, 18px (Kamden 2026-11-22; was a 22px circle) */
      height: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 0;
      border: 1px solid var(--navy);
      color: var(--navy);
      text-decoration: none;
      transition: all 180ms var(--ease-out);
      background: var(--white);
    }

    .member-list-arrow:hover {
      background: var(--navy);
      color: var(--white);
      border-color: var(--navy);
    }

    /* Mobile list cards */
    @media (max-width: 640px) {
      .directory-list .member-list-item {
        height: 80px;
      }
      .member-list-logo {
        width: 79px;   /* square: 78px inside + 1px divider */
        padding: 0;
      }
      .member-list-content {
        padding: 6px 10px 6px 7px;   /* 7px from the logo (Kamden 2026-11-21, locked) */
        display: flex;
        align-items: center;
      }
      .member-list-name {
        position: relative;
        top: -1px;   /* Playfair capitals sit 1px low in their box; this puts the letters on the card's center line */
      }
      .member-list-industry {
        position: absolute;
        top: 6px;
        right: 8px;
        font-size: 0.5rem;
        padding: 2px 6px;
      }
      .member-list-header {
        padding-right: 0;   /* the pill sits in the top corner, above the name line, so the name uses the full width (Kamden 2026-11-24: names cut off too early; was 72px) */
        flex: 1;
        min-width: 0;   /* a long name ends in "..." inside the card */
      }
      .member-list-name-text {
        font-size: 1.125rem;   /* 18px (Kamden 2026-11-21, locked) */
        line-height: 1.25;     /* phones keep the measured centering; the 4px tail room above still applies */
      }
      .member-list-desc {
        display: none !important;
      }
      .member-list-town {
        position: absolute;
        bottom: 6px;
        left: 7px;   /* lines up with the name, 7px from the logo */
      }
      .member-list-town span {
        font-size: 0.8rem;
      }
      .member-list-arrow {
        display: none !important;
      }
    }
