/*
  LEO directory stylesheet
  ------------------------------------------------------------------
  The member directory's own UI — search bar, filter chips, sort,
  card grid, empty state, industry-browse and the profile modal.
  layout.css deliberately leaves `.searchbar`, `.cards`, `.card`,
  `.filters`, `.dirgrid`, `.empty`, `.panel`, `.modal`, `.overlay`,
  `.deet` to this file (see that file's header comment) — every
  selector below is transcribed from reference/leo-v3-round-table.html's
  own `.dirgrid`/`.searchbar`/`.card`/modal rules, with literal
  colour/radius/spacing values swapped for the matching design token.

  `.chip`, `.chipwrap` and `.qf-search` base rules already live in
  layout.css (shared with the home page's quickfind box) — only the
  directory-specific extensions to them (chip counts, the pressed
  state, the `.filters` layout context) are added here.

  Loaded via a `<link>` this component (directory.mjs) emits itself,
  same pattern roundtable.css uses — see that file's header and
  directory.mjs's "Why inline?" comment.
  ------------------------------------------------------------------
*/

/* ==========================================================
   1. LAYOUT
   ========================================================== */
.dirgrid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--space-12);
  align-items: start;
}

@media (max-width: 900px) {
  .dirgrid {
    grid-template-columns: 1fr;
    gap: var(--space-9);
  }
}

.filters {
  position: sticky;
  top: var(--space-18);
  background: var(--surface);
  border-radius: var(--r);
  padding: var(--space-10) var(--space-9);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .filters {
    position: static;
  }
}

.filters h2 {
  font-size: 1rem;
  margin-bottom: var(--space-6);
}

.filters .chipwrap {
  justify-content: flex-start;
  margin-top: 0;
  gap: var(--space-3);
}

.filters .chip {
  font-size: var(--text-xs);
  padding: 8px 14px;
}

/* ==========================================================
   2. SEARCH BAR
   Own instance (not `.qf-search`, which is the home hero's) because it
   sits above the sticky sidebar/grid rather than centred in a panel.
   ========================================================== */
.searchbar {
  position: relative;
  margin-bottom: var(--space-9);
}

.searchbar input {
  width: 100%;
  padding: var(--space-9) 52px;
  font-size: var(--text-base);
  font-family: inherit;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.searchbar input:focus-visible {
  border-color: var(--accent);
}

.searchbar .ico {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.clearbtn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-tint);
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--r-circle);
  display: none;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  color: var(--text);
}

.clearbtn.show {
  display: grid;
}

/* ==========================================================
   3. CHIPS — counts + pressed state
   ========================================================== */
.chip .ct {
  /* was 11.5px static — below the 12px responsive-text floor. No 12px
     token exists in tokens.css; --text-xs (13.5px) is the smallest
     token that clears it and is already used for this file's other
     meta/label copy (.count, .filters .chip). */
  font-size: var(--text-xs);
  opacity: 0.6;
  margin-left: 6px;
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* ==========================================================
   4. TOOLROW + RESULTS COUNT
   ========================================================== */
.toolrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-7);
  flex-wrap: wrap;
  margin: 0 0 var(--space-8);
}

.count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 0;
}

.count b {
  color: var(--text);
}

.sortsel {
  font: inherit;
  font-size: 14px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
}

/* ==========================================================
   5. CARD GRID
   ========================================================== */
.cards {
  display: grid;
  /* Floor lowered from 276px to 240px: at a 320px viewport with
     --wrap-pad:26px on each side, content width is 268px — 276px
     overflowed it. 240px leaves comfortable margin and matches the
     rest of the site's pattern of sizing the auto-fill floor itself
     to fit the narrowest supported viewport rather than adding a
     dedicated narrow-viewport media query (see .table-fallback-list,
     .seats, .datestrip in layout.css, none of which override their
     minmax() floor below 900px). */
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-7);
}

.card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: var(--r);
  padding: var(--space-10);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  box-shadow: var(--shadow);
  transition: transform var(--duration-base), box-shadow var(--duration-base), border-color var(--duration-base);
}

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

.card-link {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  text-decoration: none;
  color: var(--text);
}

.av {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: var(--r-circle);
  display: grid;
  place-items: center;
  color: var(--white);
  font-family: var(--font-heading-alt);
  font-weight: var(--weight-semibold);
  font-size: 16px;
  letter-spacing: -0.02em;
}

.card-heading {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-name {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: 1.14rem;
  letter-spacing: -0.025em;
}

.card .role,
.modal-hd .role {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 3px;
}

.card-tag {
  margin: 0;
}

.tag {
  font-family: var(--font-heading-alt);
  /* was 10.5px static — below the 12px responsive-text floor; see
     .chip .ct above for why --text-xs (13.5px) is the replacement. */
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  display: inline-block;
}

.card-bio {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: var(--leading-normal);
}

.card-contact {
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-xs);
  border-top: 1px solid var(--border-soft);
  padding-top: var(--space-5);
  margin-top: auto;
}

.card-contact li {
  display: flex;
  gap: var(--space-4);
  align-items: baseline;
}

.card-contact .dt {
  font-family: var(--font-heading-alt);
  /* was 10px static — below the 12px responsive-text floor; see
     .chip .ct above for why --text-xs (13.5px) is the replacement. */
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 3.6em;
}

.card-contact a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--link-underline);
}

.card-view {
  font-size: 13px;
  line-height: 1.3;
  font-weight: var(--weight-semibold);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
  text-decoration: none;
}

/* ==========================================================
   6. EMPTY STATE
   ========================================================== */
.empty {
  text-align: center;
  padding: 60px var(--space-10);
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.empty h2 {
  font-size: 1.35rem;
  margin-bottom: var(--space-5);
}

.empty p {
  color: var(--text-secondary);
  max-width: 44ch;
  margin: 0 auto var(--space-9);
}

/* ==========================================================
   7. MODAL
   ========================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--scrim);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-9);
  opacity: 0;
  transition: opacity var(--duration-slow);
}

.overlay.open {
  display: flex;
  opacity: 1;
}

.modal {
  position: relative;
  width: min(600px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: var(--r-modal);
  background: var(--surface);
  box-shadow: var(--shadow-modal);
  transform: translateY(14px) scale(0.985);
  transition: transform var(--duration-slower) var(--ease-standard);
}

.overlay.open .modal {
  transform: none;
}

.modal-hd {
  padding: 38px var(--space-13) 28px;
  text-align: center;
  background: var(--accent-soft);
  border-radius: var(--r-modal) var(--r-modal) 0 0;
  position: relative;
}

.modal-hd .av {
  width: 78px;
  height: 78px;
  font-size: 24px;
  margin: 0 auto var(--space-7);
}

.modal-hd h2 {
  font-size: 1.75rem;
}

.modal-hd .tag {
  display: inline-block;
  margin-top: var(--space-5);
  background: var(--surface);
}

.closebtn {
  position: absolute;
  top: var(--space-7);
  right: var(--space-7);
  width: 38px;
  height: 38px;
  border-radius: var(--r-circle);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  transition: transform var(--duration-base);
}

.closebtn:hover {
  transform: rotate(90deg);
}

.modal-bd {
  padding: var(--space-11) var(--space-13) 34px;
}

.modal-bd .bio {
  color: var(--text-secondary);
  margin-bottom: var(--space-10);
  text-align: center;
}

.deets {
  margin: 0 0 var(--space-10);
  display: grid;
  gap: 1px;
  background: var(--border-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}

.deet {
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-6) var(--space-8);
  margin: 0;
  flex-wrap: wrap;
}

.deet dt {
  font-family: var(--font-heading-alt);
  /* was 10px static — below the 12px responsive-text floor; see
     .chip .ct above for why --text-xs (13.5px) is the replacement. */
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.deet dd {
  margin: 0;
  font-size: 15.5px;
  font-weight: var(--weight-medium);
}

.deet dd a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--link-underline);
}

.deet.urlrow {
  display: block;
}

.deet.urlrow dd {
  margin-top: var(--space-3);
}

.deet.urlrow code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
}

.modal-acts {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 620px) {
  .modal-hd,
  .modal-bd {
    padding-left: var(--space-9);
    padding-right: var(--space-9);
  }
}
