/* =========================================================================
   PARTNERS & VENDORS DIRECTORY  (/partners/)
   -------------------------------------------------------------------------
   Loaded by template.cfm only when thisDoc is "partners". Every rule is
   scoped under .eg-dir (or an .eg-* component used only here), so nothing
   leaks into the rest of the site.

   Colours come from the :root tokens in style.css - --accent, --ink,
   --muted, --ink-muted - so a palette change there carries through.
   The search field is the sitewide .eg-search; only its scale changes here.
   ========================================================================= */

.eg-dir {
  --dir-line: rgba(255, 255, 255, 0.08);
  --dir-line-strong: rgba(255, 255, 255, 0.14);
  --dir-surface: #0f1419;
  --dir-media: #050608;
  --dir-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  color: var(--ink);
  /* Clears the fixed top bar, then gives the header room to breathe. */
  padding: calc(4rem + clamp(1.5rem, 5vw, 4rem)) 0 clamp(3rem, 8vw, 6rem);
  /* One faint warm wash at the top - the only decoration on the page. */
  background:
    radial-gradient(900px 360px at 50% -120px, rgba(var(--accent-rgb), 0.09), transparent 70%),
    var(--bg);
}

/* Fomantic gives h1-h3 its own font and margins; take both back. */
.eg-dir h1,
.eg-dir h2,
.eg-dir h3 {
  font-family: inherit;
  margin: 0;
}

.eg-dir [hidden] {
  display: none !important;
}

.eg-dir__sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.eg-dir__wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .eg-dir__wrap { padding: 0 32px; }
}

/* ---------- Header ---------- */

.eg-dir__eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.eg-dir__title {
  font-size: clamp(2.4rem, 6vw, 4.25rem) !important;
  font-weight: 600 !important;
  line-height: 1.02 !important;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.eg-dir__amp {
  font-weight: 300;
  color: var(--accent);
}

.eg-dir__lede {
  max-width: 44ch;
  margin: 1.1rem 0 0;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Filters ---------- */

.eg-dir__filters {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  max-width: 760px;
}

.eg-dir .ui.icon.input.eg-search.eg-dir__search > input {
  padding: 1.05rem 3rem 1.05rem 1.3rem !important;
  font-family: inherit;
}
.eg-dir__search > input::-webkit-search-cancel-button,
.eg-dir__search > input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.eg-dir__chips {
  display: flex;
  gap: 0.5rem;
  margin: 1rem -16px 0;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Fade the scroll edge so the row reads as "more this way". */
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
.eg-dir__chips::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
  .eg-dir__chips {
    flex-wrap: wrap;
    overflow: visible;
    margin: 1rem 0 0;
    padding: 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.eg-chip {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 0.95rem;
  border: 1px solid var(--dir-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.eg-chip:hover {
  color: var(--ink);
  border-color: rgba(var(--accent-rgb), 0.45);
}
.eg-chip[aria-pressed="true"] {
  color: #f0dfb8;
  border-color: rgba(var(--accent-rgb), 0.75);
  background: rgba(var(--accent-rgb), 0.14);
}

.eg-dir__summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-top: 1.1rem;
  min-height: 1.5rem;
}

.eg-dir__count {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.eg-dir__reset {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.4);
  text-underline-offset: 3px;
  cursor: pointer;
}
.eg-dir__reset:hover { text-decoration-color: var(--accent); }

.eg-dir__alert {
  margin-top: 2rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 12px;
  background: rgba(255, 107, 107, 0.08);
  color: #ffd3d3;
  font-size: 0.9rem;
}

/* ---------- Section heads ---------- */

.eg-dir__partners,
.eg-dir__vendors {
  margin-top: clamp(3.25rem, 7vw, 5.5rem);
}

.eg-dir__sechead {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--dir-line);
}

.eg-dir__h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.6rem) !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em;
  color: var(--ink);
  /* Paging moves focus here; keep it clear of the fixed top bar. */
  scroll-margin-top: 6rem;
}
.eg-dir__h2:focus { outline: none; }
.eg-dir__h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.eg-dir__tally {
  font-size: 0.875rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.eg-dir__empty {
  margin: 0;
  padding: 1.5rem 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---------- Partner cards ---------- */

.eg-dir__pgrid {
  display: grid;
  /* auto-fit, not auto-fill: two partners share the row rather than
     leaving an empty third column. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}

.eg-pcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--dir-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #11171d 0%, var(--dir-surface) 100%);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.35s var(--dir-ease), border-color 0.35s ease;
}
.eg-pcard:hover {
  color: var(--ink);
  opacity: 1;
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.eg-pcard:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 16px;
}

/* The image is absolutely positioned inside a fixed-ratio, clipped box.
   Sizing it with max-height:100% instead let WebKit (Safari, and every
   browser on iOS) render a tall photo at full size: it stretched the box
   and spilled over the card text. Out of flow, it cannot size the box. */
.eg-pcard__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  background: var(--dir-media);
  border-bottom: 1px solid var(--dir-line);
}
.eg-pcard__media img {
  position: absolute;
  top: 10%;
  left: 12%;
  width: 76%;
  height: 80%;
  max-width: none;
  object-fit: contain;
  transition: transform 0.6s var(--dir-ease);
}
.eg-pcard:hover .eg-pcard__media img { transform: scale(1.03); }

/* partners.js classifies each logo once it loads (classifyLogo) and only
   then adds .is-ready, so the image never visibly jumps between layouts. */
.eg-pcard__media.has-logo img {
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.6s var(--dir-ease);
}
.eg-pcard__media.has-logo.is-ready img { opacity: 1; }

/* Photos fill the whole panel, edge to edge. */
.eg-pcard__media.is-photo img {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.eg-pcard:hover .eg-pcard__media.is-photo img { transform: scale(1.04); }

/* Logos on a solid ground: the panel is painted that colour inline, so the
   logo is shown whole and the top of the card is still covered. */
.eg-pcard__media.is-flat { transition: background-color 0.35s ease; }

/* ---------- No-logo placeholder ----------
   Shown when a partner has no logo, or when the logo file fails to load.
   A gold-ringed monogram over faint concentric rings - a quiet nod to a
   gauge face - with the partner's category beneath. --ph-angle is set per
   partner from a hash of the name, so the light falls slightly differently
   on each card. */
.eg-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  background:
    radial-gradient(55% 65% at 50% 44%, rgba(var(--accent-rgb), 0.11), transparent 72%),
    linear-gradient(var(--ph-angle, 135deg), #10151b 0%, #06080a 55%, #040506 100%);
}
.eg-pcard__media.has-logo .eg-ph { display: none; }

/* The rings, faded out toward the edges. */
.eg-ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(
    circle at 50% 44%,
    rgba(var(--accent-rgb), 0.09) 0 1px,
    transparent 1px 16px
  );
  -webkit-mask-image: radial-gradient(closest-side at 50% 44%, #000 30%, transparent 100%);
  mask-image: radial-gradient(closest-side at 50% 44%, #000 30%, transparent 100%);
  transition: transform 0.8s var(--dir-ease);
}
.eg-pcard:hover .eg-ph::before { transform: scale(1.06); }

.eg-ph__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(76px, 24%, 116px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  /* A dark gap, then a fainter inner ring - a bezel, not a flat circle. */
  box-shadow:
    inset 0 0 0 5px #07090c,
    inset 0 0 0 6px rgba(var(--accent-rgb), 0.2),
    0 0 40px rgba(var(--accent-rgb), 0.08);
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.07), transparent 62%), #07090c;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.eg-pcard:hover .eg-ph__ring {
  border-color: rgba(var(--accent-rgb), 0.9);
  box-shadow:
    inset 0 0 0 5px #07090c,
    inset 0 0 0 6px rgba(var(--accent-rgb), 0.3),
    0 0 48px rgba(var(--accent-rgb), 0.16);
}

.eg-ph__mono {
  padding-left: 0.08em; /* balance the trailing letter-spacing */
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--accent);
  background: linear-gradient(180deg, #f0deb0 0%, #caa866 55%, #9a7639 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eg-ph__label {
  position: relative;
  padding-left: 0.3em;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.7);
}

.eg-pcard__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.3rem 1.4rem 1.35rem;
}

.eg-pcard__tags {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.eg-pcard__name {
  font-size: 1.2rem !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.eg-pcard__desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eg-pcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: auto 0 0;
  padding-top: 0.85rem;
  font-size: 0.84rem;
}
.eg-pcard__loc { color: var(--ink-muted); }
.eg-pcard__cta {
  color: var(--ink-muted);
  white-space: nowrap;
  transition: color 0.25s ease;
}
.eg-pcard__cta .icon {
  margin: 0 0 0 0.3rem !important;
  transition: transform 0.3s var(--dir-ease);
}
.eg-pcard:hover .eg-pcard__cta { color: var(--accent); }
.eg-pcard:hover .eg-pcard__cta .icon { transform: translateX(3px); }

/* A lone partner becomes a full-width feature instead of a narrow card
   floating in an empty row. */
@media (min-width: 768px) {
  .eg-pcard:only-child {
    grid-column: 1 / -1;
    flex-direction: row;
  }
  .eg-pcard:only-child .eg-pcard__media {
    flex: 0 0 44%;
    aspect-ratio: auto;
    min-height: 260px;
    border-bottom: 0;
    border-right: 1px solid var(--dir-line);
  }
  .eg-pcard:only-child .eg-pcard__body {
    justify-content: center;
    gap: 0.75rem;
    padding: 2.25rem 2.5rem;
  }
  .eg-pcard:only-child .eg-pcard__name { font-size: 1.75rem !important; }
  .eg-pcard:only-child .eg-pcard__desc { -webkit-line-clamp: 4; font-size: 1rem; }
  .eg-pcard:only-child .eg-pcard__foot { margin-top: 0.75rem; }
}

.eg-dir__more {
  display: flex;
  justify-content: center;
}
.eg-dir__more .eg-dir__btn { margin-top: 1.75rem; }

.eg-dir__btn {
  height: 42px;
  padding: 0 1.4rem;
  border: 1px solid var(--dir-line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.eg-dir__btn:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(255, 255, 255, 0.03);
}
.eg-dir__btn:disabled { opacity: 0.5; cursor: progress; }

/* ---------- Vendor list ---------- */

.eg-dir__vlist {
  list-style: none;
  margin: -0.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  transition: opacity 0.2s ease;
}
@media (min-width: 900px) {
  .eg-dir__vlist {
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
  }
}
.eg-dir__vlist.is-loading { opacity: 0.45; }

.eg-dir__vlist > li { border-bottom: 1px solid var(--dir-line); }

.eg-vrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  padding: 0.85rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.eg-vrow:hover {
  color: var(--ink);
  opacity: 1;
  background: rgba(255, 255, 255, 0.03);
}
.eg-vrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.eg-vrow__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.eg-vrow__name {
  overflow: hidden;
  font-size: 0.97rem;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.eg-vrow__loc {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.eg-vrow__cat {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--dir-line);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
@media (max-width: 420px) {
  .eg-vrow__cat { display: none; }
}

.eg-vrow__go.icon {
  flex: 0 0 auto;
  margin: 0 !important;
  width: auto;
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.25s var(--dir-ease);
}
.eg-vrow:hover .eg-vrow__go,
.eg-vrow:focus-visible .eg-vrow__go {
  opacity: 1;
  transform: none;
}
/* No hover on touch screens: keep the affordance quietly visible. */
@media (hover: none) {
  .eg-vrow__go.icon { opacity: 0.5; transform: none; }
}

/* ---------- Pagination ---------- */

.eg-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.eg-pager__pages {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eg-pager__step,
.eg-pager__num {
  height: 40px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.eg-pager__step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.95rem;
  border: 1px solid var(--dir-line-strong);
  background: transparent;
  color: var(--ink);
}
.eg-pager__step .icon { margin: 0 !important; font-size: 0.75rem; }
.eg-pager__step:hover:not(:disabled) { border-color: rgba(var(--accent-rgb), 0.5); }
.eg-pager__step:disabled { opacity: 0.3; cursor: default; }

.eg-pager__num {
  min-width: 40px;
  padding: 0 0.6rem;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.eg-pager__num:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.eg-pager__num[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  cursor: default;
}

.eg-pager__gap {
  min-width: 20px;
  text-align: center;
  color: var(--ink-muted);
}

/* Phones get "Prev · Page 3 of 42 · Next" - numbers don't fit a thumb. */
.eg-pager__label {
  display: none;
  font-size: 0.875rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .eg-pager { justify-content: space-between; }
  .eg-pager__pages { display: none; }
  .eg-pager__label { display: inline; }
}

/* ---------- Loading skeletons ---------- */

.eg-skel {
  display: block;
  width: 70%;
  height: 0.8rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  animation: eg-dir-pulse 1.6s ease-in-out infinite;
}
.eg-skel--sm { width: 32%; height: 0.65rem; }
.eg-skel--md { width: 55%; }
.eg-skel--lg { width: 60%; height: 1.2rem; }

.eg-pcard--skeleton { pointer-events: none; }
.eg-pcard--skeleton .eg-pcard__body { gap: 0.8rem; }

.eg-vrow--skeleton {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
}

@keyframes eg-dir-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .eg-dir *,
  .eg-dir *::before,
  .eg-dir *::after {
    animation: none !important;
    transition: none !important;
  }
  .eg-pcard:hover { transform: none; }
}
