/*
 * Charmaine's board composition on Bootstrap: the tile grid, the status
 * row above the name, the four states, the stale floor and the type
 * scale. Colours come from theme.css; nothing here invents a new one.
 */

.advice { margin-bottom: 28px; }

.advice h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.advice p {
  margin: 10px 0 0;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  color: var(--bs-secondary-color);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bs-tertiary-color);
}

.live.is-live .live-dot { background: var(--jamb-vacant-ink); }
.live.is-down .live-dot { background: var(--jamb-occupied-ink); }

.floors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.floors.stale {
  opacity: 0.6;
  outline: 2px dashed var(--bs-border-color);
  outline-offset: 4px;
}

.floor.best { border-color: var(--jamb-vacant-ink); }
.floor.closed {
  border-color: var(--jamb-occupied-ink);
  border-style: dashed;
}
.floor.closed h2,
.floor.closed .free-count { color: var(--jamb-occupied-ink); }

.floor-unavailable-label {
  padding: 2px 8px;
  border-radius: var(--bs-border-radius-pill);
  background: var(--jamb-occupied-bg);
  color: var(--jamb-occupied-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.floor h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.free-count { font-size: 1.05rem; }

.cubicles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cubicle {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  min-height: 104px;
  padding: 10px;
  border-radius: 10px;
  transition: background-color 180ms ease, color 180ms ease;
}

.cubicle-status {
  grid-row: 1;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: break-word;
}

.cubicle-name {
  grid-row: 3;
  font-size: 0.8rem;
  font-weight: 600;
  color: inherit;
}

.status-VACANT { background-color: var(--jamb-vacant-bg); color: var(--jamb-vacant-ink); }
.status-OCCUPIED { background-color: var(--jamb-occupied-bg); color: var(--jamb-occupied-ink); }

.status-NEEDS_ATTENTION {
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 3px,
      rgba(0, 0, 0, 0.16) 3px 6px
    ),
    var(--jamb-attention-bg);
  color: var(--jamb-attention-ink);
}

.status-OFFLINE { border: 2px dashed var(--bs-border-color); background: transparent; color: var(--jamb-offline-ink); }

.explainer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.explainer .chevron { flex: none; }
.explainer[open] .chevron { transform: rotate(180deg); }

.explainer p { margin: 10px 0 0; color: var(--bs-secondary-color); }

@media (max-width: 575.98px) {
  .advice { margin-bottom: 20px; }

  .floors {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .floor .card-body { padding: 1rem; }

  .floor-head {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }

  .free-count {
    white-space: normal !important;
    text-align: right;
  }

  .cubicles {
    grid-template-columns: minmax(0, 1fr);
  }

  .cubicle { min-width: 0; }

  .cubicle-name { overflow-wrap: anywhere; }
}

@media (max-width: 359.98px) {
  .floor-head { gap: 4px 8px !important; }

  .free-count { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .cubicle {
    transition: none;
  }
}
