/* Staff Photo Directory
   Design direction: a printed staff roster / yearbook index, not a SaaS
   card grid. Alphabetical letter-grouped rows, a fixed A-Z jump nav, and
   a side drawer for the photo detail rather than a centered modal. */

:root {
  --paper: #F5F6F2;
  --panel: #FFFFFF;
  --ink: #1D2733;
  --ink-soft: #5B6672;
  --line: #DBDFD9;
  --accent: #2C4870;      /* school-id blue */
  --accent-soft: #E7ECF3;
  --gold: #B98A2E;         /* muted gold, roster accent */
  --radius: 3px;

  --font-serif: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(20px, 5vw, 64px) 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.topbar-title h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 4px;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  min-width: 260px;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon { width: 16px; height: 16px; color: var(--ink-soft); flex: none; }

.search-field input {
  border: none;
  outline: none;
  font-size: 14px;
  font-family: var(--font-sans);
  width: 100%;
  background: transparent;
  color: var(--ink);
}

.count {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- Layout ---------- */

.layout {
  display: flex;
  max-width: 900px;
  margin: 0 auto;
  padding: 8px clamp(20px, 5vw, 64px) 80px;
  position: relative;
}

.roster {
  flex: 1;
  min-width: 0;
}

.loading, .empty-state {
  color: var(--ink-soft);
  font-size: 14px;
  padding: 40px 0;
}

.letter-group {
  margin-top: 28px;
}

.letter-heading {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin: 0 0 4px;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 2;
}

.staff-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  background: none;
  border-left: none; border-right: none; border-top: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  transition: background 120ms ease;
}

.staff-row:hover,
.staff-row:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.staff-thumb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line);
  flex: none;
  color: transparent;
}

.staff-thumb.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
}

.staff-name {
  font-size: 15px;
  flex: 1;
}

.staff-name .last { font-weight: 600; }

.staff-hint {
  font-size: 12px;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 120ms ease;
}

.staff-row:hover .staff-hint,
.staff-row:focus-visible .staff-hint {
  opacity: 1;
}

/* ---------- Jump nav ---------- */

.jumpnav {
  position: sticky;
  top: 24px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 20px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  height: fit-content;
}

.jumpnav a, .jumpnav span {
  font-size: 11px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 1px 4px;
}

.jumpnav a:hover { color: var(--accent); }
.jumpnav span { color: #C7CCC4; }

/* ---------- Drawer ---------- */

.drawer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.drawer.open { pointer-events: auto; }

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(29, 39, 51, 0.35);
  opacity: 0;
  transition: opacity 180ms ease;
}

.drawer.open .drawer-scrim { opacity: 1; }

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: var(--panel);
  box-shadow: -8px 0 24px rgba(29, 39, 51, 0.12);
  transform: translateX(100%);
  transition: transform 220ms ease;
  overflow-y: auto;
  padding: 24px;
}

.drawer.open .drawer-panel { transform: translateX(0); }

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 18px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

.drawer-close:hover { background: var(--accent-soft); color: var(--accent); }

.drawer-photo-wrap {
  margin-top: 36px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-body h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin: 20px 0 2px;
}

.drawer-filename {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--ink-soft);
  font-family: monospace;
}

.drawer-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: #23395C; }

.btn-secondary {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-secondary.copied {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.url-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}

.url-field input {
  font-family: monospace;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .jumpnav { display: none; }
  .topbar-controls { width: 100%; }
  .search-field { min-width: 0; flex: 1; }
  .drawer-panel { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer-panel, .drawer-scrim, .staff-row, .staff-hint { transition: none; }
}
