/* asset/css/librarystaff.css - styles for the Librarians page (librarystaff.php) */

.staff-page { background: #f8f9fa; }

/* ---------- Header ---------- */
.staff-header { max-width: 640px; margin: 0 auto 2rem; text-align: center; }
.staff-header h1 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; color: #111; margin-bottom: .5rem; }
.staff-header p { color: #6c757d; margin: 0; }

/* ---------- Photos ---------- */
.photo-figure { margin: 0 auto 2.5rem; }
.photo-img {
  display: block;
  width: 100%;
  object-fit: cover;
  object-position: center 30%; /* keeps faces in frame */
  border-radius: 1rem;
  background: #e9ecef;
}
.photo-figure figcaption { text-align: center; color: #6c757d; font-size: .875rem; margin-top: .6rem; }
.staff-hero { max-width: 960px; }
.staff-hero .photo-img { height: 400px; }
.dept-photo { max-width: 860px; margin-bottom: 1.75rem; }
.dept-photo-img { height: 300px; }

/* ---------- Search + department buttons ---------- */
.staff-toolbar { max-width: 760px; margin: 0 auto 1.5rem; }
.search-box { position: relative; max-width: 640px; margin: 0 auto; }
.search-box .bi-search {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: #8a949e; pointer-events: none;
}
.search-box input {
  height: 3rem; padding-left: 2.75rem; padding-right: 6.5rem;
  border-radius: 50rem; border: 1px solid #dee2e6; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.search-box input:focus { box-shadow: 0 0 0 .2rem rgba(0,0,0,.06); }
.search-box .btn {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  border-radius: 50rem; padding: .45rem 1.1rem;
}
.dept-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1rem; }
.dept-pills .btn { border-radius: 50rem; padding: .35rem 1rem; font-size: .9rem; }

.results-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem;
  color: #6c757d; font-size: .9rem; margin-bottom: 1.5rem;
}
.results-line a { text-decoration: none; }

/* ---------- Department tiles (shown before a department is selected) ---------- */
.dept-tile {
  display: flex; flex-direction: column; height: 100%;
  background: #fff; border: 1px solid #e9ecef; border-radius: 1rem;
  overflow: hidden; text-decoration: none; color: inherit;
}
.dept-tile-media {
  height: 170px; background: #e9ecef;
  display: flex; align-items: center; justify-content: center;
  color: #adb5bd; font-size: 3rem;
}
.dept-tile-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.dept-tile-body { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; }
.dept-tile-name { font-weight: 600; color: #111; margin: 0; font-size: 1.05rem; }
.dept-tile-count { font-size: .85rem; color: #6c757d; margin: 0; }
.dept-tile .bi-chevron-right { color: #adb5bd; }

/* ---------- Sections ---------- */
.dept-section {
  margin-bottom: 3rem;
  content-visibility: auto;           /* browser skips painting off-screen sections */
  contain-intrinsic-size: auto 700px;
}
.section-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.section-bar { width: 6px; height: 1.75rem; border-radius: 4px; }
.section-head h2 { font-size: 1.35rem; font-weight: 700; margin: 0; color: #111; }
.section-count {
  font-size: .8rem; font-weight: 600; color: #495057;
  background: #e9ecef; border-radius: 50rem; padding: .15rem .65rem;
}

/* ---------- Staff cards ---------- */
.staff-card {
  height: 100%;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 1.5rem 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 1rem;
  contain: layout paint;              /* repaints stay inside the card */
}
.staff-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #dee2e6;
  margin-bottom: .9rem;
  flex-shrink: 0;
}
.staff-initials {
  display: flex; align-items: center; justify-content: center;
  background: #e9ecef; color: #495057; font-size: 1.75rem; font-weight: 600;
}
.staff-name { font-size: 1.05rem; font-weight: 600; margin: 0 0 .2rem; color: #111; overflow-wrap: anywhere; }
.staff-role { font-size: .9rem; color: #6c757d; margin: 0 0 .75rem; }
.staff-chip {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; color: #495057;
  background: #f1f3f5; border-radius: 50rem; padding: .25rem .7rem;
}

/* Hover effects only on devices with a real pointer (no jank while touch scrolling) */
@media (hover: hover) {
  .staff-card, .dept-tile { transition: transform .2s ease, border-color .2s ease; }
  .staff-card:hover, .dept-tile:hover { transform: translateY(-3px); border-color: #ced4da; }
}

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: #6c757d; }
.empty-state .bi-search { font-size: 2.5rem; display: block; margin-bottom: .75rem; color: #adb5bd; }
.empty-state h2 { font-size: 1.2rem; color: #212529; }

@media (max-width: 768px) {
  .staff-hero .photo-img { height: 220px; }
  .dept-photo-img { height: 190px; }
  .dept-tile-media { height: 140px; }
  .staff-card { padding: 1.25rem .75rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}