/* Career fair page (js/fair.js) — the header, the sector grid and the
   employer list. Token-driven throughout, so light and dark both come from
   css/base.css; nothing here defines a colour of its own.

   The sector grid is the page: it is the only thing on screen sized to be
   read across the room, because scanning 161 employers down to one sector is
   what the page is for. Everything else stays quiet underneath it. */

/* ---------- header ---------- */
.fair-head { margin: 0 0 var(--sp-5); }
.fair-name { font-size: var(--fs-xl); margin-bottom: var(--sp-1); }
.fair-when { color: var(--text-muted); font-size: var(--fs-sm); }
.fair-summary {
  margin-top: var(--sp-2);
  max-width: 70ch;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh);
}

/* The four totals read as one line of figures, not four cards — the sector
   boxes below are the things meant to be clicked. */
.fair-totals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  margin-top: var(--sp-3);
}
.fair-stat { display: flex; align-items: baseline; gap: var(--sp-2); }
.fair-stat-n { font-size: var(--fs-xl); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
/* .fair-stat-l takes its type, case and colour from the shared eyebrow rule
   in css/base.css. */

/* Secondary by design: the in-app page is the destination now, and the fair's
   own site is the footnote. */
.fair-official {
  display: inline-block;
  margin-top: var(--sp-3);
  color: var(--accent);
  font-size: var(--fs-sm);
  text-decoration: none;
}
.fair-official:hover { text-decoration: underline; }

/* ---------- the sector grid ---------- */
.fair-sectors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--sp-3);
  margin: 0 0 var(--sp-6);
}

.fair-sector {
  display: flex;
  flex-direction: column;
  gap: var(--sp-0);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.fair-sector:hover { background: var(--surface-2); border-color: var(--accent); }
.fair-sector:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The active box carries the accent fill; the inset ring thickens its edge
   without moving the grid by a pixel. */
.fair-sector.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.fair-sector.active .fair-sector-n { color: var(--accent); }

/* .fair-sector-label takes its type, case and colour from the shared eyebrow
   rule in css/base.css. */
/* Boxes in a row stretch to one height; pushing the count and its sub-line
   to the bottom lines the counts up however many lines a label wraps to
   (issue #16 F-75). */
.fair-sector-n { margin-top: auto; }
.fair-sector-n { font-size: 1.75rem; font-weight: 700; line-height: var(--lh-tight); font-variant-numeric: tabular-nums; }
.fair-sector-sub { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- sub-tag row (between the sectors and the filter bar) ----------
   Only rendered once a sector is selected. Sub-tag pills reuse .fair-toggle
   verbatim (plus this .fair-subtag hook for layout) so they read as the same
   control, not a new one — clicking a sector just reveals more of the same
   pill-button toggle language already used for "Internships & co-ops only". */
.fair-subtags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-6);
}
.fair-subtags:empty { display: none; }

/* ---------- the filter bar above the list ---------- */
.fair-listbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin: 0 0 var(--sp-1);
}
.fair-listbar .spacer { flex: 1; }

.fair-count {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--label-tracking);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fair-toggle {
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.fair-toggle:hover { background: var(--surface-2); color: var(--text); }
.fair-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fair-toggle.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.fair-clear {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.fair-clear:hover { text-decoration: underline; }
/* A button with a display rule of its own would ignore the hidden attribute. */
.fair-clear[hidden] { display: none; }

/* ---------- the employer list ---------- */
.fair-emps { border-top: 1px solid var(--border); }

.fair-emp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3);
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.fair-emp:hover { background: var(--surface-2); }
.fair-emp:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.fair-emp-main { min-width: 0; }
.fair-emp-name { font-size: var(--fs-md); font-weight: 600; }

/* One line of "about", however long the fair's copy is. */
.fair-emp-about {
  margin-top: var(--sp-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
@media (max-width: 760px) {
  .fair-emp-about {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.fair-emp-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}

.fair-badge {
  padding: 1px var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* Internships and co-ops are what the reader came for, so they are the only
   filled badges — the rest stay outlines. */
.fair-badge-internship,
.fair-badge-coop {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}
.fair-badge-f1 { border-color: var(--success); color: var(--success); }

.fair-emp-sector {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--text-muted);
}

.fair-emp-go { flex-shrink: 0; color: var(--text-muted); font-size: var(--fs-md); }
.fair-emp:hover .fair-emp-go { color: var(--accent); }

.fair-loading { color: var(--text-muted); font-size: var(--fs-sm); padding: var(--sp-2) 0; }
.fair-actions { display: flex; justify-content: center; gap: var(--sp-2); }

@media (max-width: 560px) {
  .fair-sectors { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .fair-sector-n { font-size: var(--fs-2xl); }
}
