/**
 * navigation.css — the ways into a room: the menu page's site/room list,
 * its collapsed all-rooms fallback, and the campus birds-eye building view.
 * Button-shaped pieces (.site-toggle) get their shape from controls.css;
 * this file is the list/card/building layout around them.
 */

/* site card grid — align-items:stretch (grid's own default, made explicit
   here) so every card in a row matches the row's tallest card, rather than
   each sizing to its own content and leaving a ragged bottom edge. */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  align-items: stretch;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.site-card {
  background: var(--surface);
  border: var(--border-divider);
  border-radius: var(--radius-panel);
  padding: var(--space-6);
  transition: border-color var(--transition);
}

/* The resting border is already --line-strong (see --border-divider in
   tokens.css) — hover escalates one step further, to --text-secondary, so
   the hover state still reads as visibly different rather than
   transitioning to the same color it's already at. */
.site-card:hover {
  border-color: var(--text-secondary);
}

.site-card-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: var(--border-divider);
}

.site-name {
  margin-bottom: 0;
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.room-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: var(--surface-muted);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control);
  padding: var(--space-2) var(--space-3);
  transition: var(--transition);
}

.room-link:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.room-link-icon {
  font-size: var(--text-body-lg);
  color: var(--text-secondary);
}

/* A floor/room that isn't finalized yet — same shape as .room-link so it
   still reads as "an entry in this list", just visibly non-interactive
   (muted color, no hover, dashed border echoing .pc[data-status="not-
   applicable"]'s "set aside" treatment elsewhere in the app). */
.room-link-disabled {
  color: var(--text-muted);
  cursor: default;
  border-style: dashed;
}
.room-link-disabled:hover {
  border-color: var(--line);
  background: var(--surface-muted);
}
.room-link-disabled .room-link-icon {
  color: var(--text-muted);
}

/* the old flat site/room list, kept intact (room-scaffold.js's New Room
   flow patches this exact markup) but demoted to a collapsed fallback now
   that the campus view is the primary way in */
.all-rooms-fallback {
  margin-bottom: var(--space-8);
}

.all-rooms-fallback summary {
  cursor: pointer;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--text-muted);
  padding: var(--space-1) 0;
}

.all-rooms-fallback summary:hover {
  color: var(--text);
}

.all-rooms-fallback[open] summary {
  margin-bottom: var(--space-4);
}

/* ── CAMPUS VIEW ──
   Birds-eye building blocks, one level up in scale from a room's own floor
   plan — same visual language as .floor-room/.floor-label (see
   floor-plan.css) rather than inventing a new one. */
.campus-canvas-wrap {
  margin-bottom: var(--space-6);
  border: var(--border-divider);
  border-radius: var(--radius-panel);
  background: var(--surface);
  overflow: hidden;
}

.campus-loading {
  padding: var(--space-8);
  text-align: center;
  font-size: var(--text-body);
  color: var(--text-muted);
}

.campus-svg {
  display: block;
  width: 100%;
  height: auto;
}

.campus-building {
  cursor: pointer;
}

.campus-building-shape {
  fill: var(--surface-muted);
  stroke: var(--text-secondary);
  stroke-width: 2;
  transition: var(--transition);
}

.campus-building:hover .campus-building-shape,
.campus-building:focus-visible .campus-building-shape {
  stroke: var(--focus);
  stroke-width: 2.5;
}

.campus-building:focus-visible {
  outline: none; /* the shape's own stroke change is the focus indicator */
}

.campus-building-label {
  font-family: var(--font-display);
  font-size: var(--text-section-title);
  font-weight: 700;
  fill: var(--text);
}

.campus-building-sub {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  fill: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Small static corner marker, not a full-building fill — overall building
   state at a glance without cluttering the map. Starts "not-inspected"
   (a neutral outline) the instant a building renders, then corrects itself
   once that building's own lazy stats fetch resolves (see campus.js). Reuses
   status.css's own status color tokens; "has-issues" reuses --status-major,
   since an issue here means the same thing a device's own major status
   means on a room's floor plan. */
.campus-building-status {
  stroke-width: 1.5;
  transition: var(--transition);
}
.campus-building-status[data-state="not-inspected"] { fill: var(--surface); stroke: var(--line-strong); }
.campus-building-status[data-state="in-progress"]   { fill: var(--focus); stroke: var(--focus); }
.campus-building-status[data-state="complete"]      { fill: var(--status-working); stroke: var(--status-working-strong); }
.campus-building-status[data-state="has-issues"]    { fill: var(--status-major); stroke: var(--status-major-strong); }

/* Hover/focus-revealed stats popover — positioned in JS (campus.js) from
   the hovered/focused building's own bounding box; .floating-panel
   (workstation.css) supplies the elevated look shared with every other
   transient panel in the system. */
.campus-tooltip {
  position: fixed;
  z-index: 500;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-meta);
  line-height: 1.6;
  color: var(--text);
  max-width: 240px;
  pointer-events: none;
}
