/* Faculty directory (/faculty?deptno=n, every department): the HOD leads, the members follow as portrait cards.
   URLs, role conditions and data are unchanged. Prefix fc-. Motion: each portrait is unveiled once as its row
   reaches the screen (js/faculty-cards.js adds the classes, so without script everything is simply visible). */
.fc-page {
  --fc-navy: var(--kc-navy, #0d2847);
  --fc-blue: var(--kc-blue, #285690);
  --fc-blue-dark: var(--kc-blue-dark, #1e4475);
  --fc-gold: var(--kc-gold, #e0a526);
  --fc-ink: var(--kc-ink, #1b2a3d);
  --fc-muted: var(--kc-muted, #5d6b80);
  --fc-line: var(--kc-line, #e3e8f0);
  --fc-soft: var(--kc-soft, #f3f6fb);
  --fc-tag-bg: var(--kc-chip-news-bg, #fdf1d6);
  --fc-tag-ink: var(--kc-chip-news-ink, #7a4f00);
  --fc-danger: var(--kc-danger, #b42318);
  --fc-danger-deep: var(--kc-danger-deep, #8f1c13);
  --fc-ease: var(--kc-ease, cubic-bezier(.2, .7, .2, 1));
  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  color: var(--fc-ink);
  font-family: Inter, 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.fc-page *, .fc-page *::before, .fc-page *::after { box-sizing: border-box; }
.fc-page ::selection { background: var(--fc-gold); color: var(--fc-navy); }

.fc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.fc-page h2.fc-dept { margin: 0; color: var(--fc-navy); font-family: Lora, Georgia, 'Times New Roman', serif; font-size: clamp(24px, 2vw, 30px); font-weight: 600; line-height: 1.2; text-wrap: balance; }
.fc-count { margin: 4px 0 0; color: var(--fc-muted); font-variant-numeric: tabular-nums; }
.fc-page a.fc-add {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--fc-blue); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background-color .2s var(--fc-ease);
}
.fc-page a.fc-add:hover { background: var(--fc-blue-dark); }

.fc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.fc-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--fc-line); border-radius: 14px; background: #fff;
  box-shadow: 0 10px 28px rgba(13, 40, 71, .08);
  transition: transform .3s var(--fc-ease), box-shadow .3s var(--fc-ease), border-color .3s var(--fc-ease);
}
.fc-photo { position: relative; margin: 0; aspect-ratio: 1 / 1; overflow: hidden; background: var(--fc-soft); box-shadow: inset 0 -1px 0 var(--fc-line); }
.fc-page .fc-photo img { display: block; width: 100%; height: 100% !important; max-width: none; object-fit: cover; object-position: center 18%; transition: transform .6s var(--fc-ease); }

.fc-body { position: relative; display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; padding: 18px 20px 16px; }
/* the system's hover mark: a gold rule drawn from the left, here on the edge of the portrait */
.fc-body::before { content: ""; position: absolute; top: -1px; right: 0; left: 0; height: 3px; background: var(--fc-gold); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--fc-ease); }
.fc-page h3.fc-name { margin: 0; color: var(--fc-navy); font-family: Lora, Georgia, 'Times New Roman', serif; font-size: 19px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.fc-role { margin: 3px 0 0; color: var(--fc-muted); font-size: 14px; }
.fc-tag { display: inline-block; margin-bottom: 8px; padding: 2px 8px; border-radius: 4px; background: var(--fc-tag-bg); color: var(--fc-tag-ink); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }

.fc-contact { display: grid; gap: 6px; margin: 14px 0 16px; padding: 12px 0 0; border-top: 1px solid var(--fc-line); list-style: none; font-size: 14px; }
.fc-contact li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: baseline; margin: 0; }
.fc-contact i { color: var(--fc-blue); font-size: 13px; text-align: center; }
.fc-contact a { position: relative; z-index: 1; color: var(--fc-ink); overflow-wrap: anywhere; text-decoration: none; font-variant-numeric: tabular-nums; }
.fc-contact a:hover { color: var(--fc-blue); text-decoration: underline; text-underline-offset: 3px; }
.fc-none { color: var(--fc-muted); }

.fc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.fc-page a.fc-link { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; color: var(--fc-blue); font-size: 14px; font-weight: 600; text-decoration: none; }
.fc-link i { font-size: 12px; transition: transform .3s var(--fc-ease); }
/* the whole card opens the profile; phone, e-mail and Delete sit above this layer */
.fc-link::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.fc-page a.fc-del {
  position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--fc-danger); color: #fff; font-size: 11.5px; font-weight: 600; text-decoration: none; transition: background-color .2s var(--fc-ease);
}
.fc-page a.fc-del:hover { background: var(--fc-danger-deep); }
.fc-sr, .fc-role > strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.fc-page a:focus-visible { outline: 2px solid var(--fc-gold); outline-offset: 2px; }
.fc-page a.fc-link:focus-visible { outline: 0; }
.fc-link:focus-visible::after { outline: 2px solid var(--fc-gold); outline-offset: -3px; }

/* The Head of Department leads the list */
.fc-lead { grid-column: 1 / -1; flex-direction: row; }
.fc-lead::before { content: ""; position: absolute; z-index: 1; top: 0; right: 0; left: 0; height: 4px; background: var(--fc-gold); }
.fc-lead .fc-photo { flex: 0 0 248px; aspect-ratio: auto; min-height: 248px; }
.fc-lead .fc-photo img { position: absolute; inset: 0; }
.fc-lead .fc-body { justify-content: center; padding: 28px 32px; }
.fc-lead .fc-body::before { display: none; }
.fc-page .fc-lead h3.fc-name { font-size: clamp(22px, 2vw, 26px); }
.fc-lead .fc-role { font-size: 15px; }
.fc-lead .fc-contact { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 14.5px; }
.fc-lead .fc-foot { margin-top: 0; justify-content: flex-start; gap: 24px; }

@media (hover: hover) {
  .fc-card:hover { transform: translateY(-4px); border-color: #cfd8e6; box-shadow: 0 18px 40px rgba(13, 40, 71, .16); }
  .fc-card:hover .fc-photo img { transform: scale(1.05); }
  .fc-card:hover .fc-body::before { transform: scaleX(1); }
  .fc-card:hover .fc-link i { transform: translateX(4px); }
}

/* Entrance, once per card. "backwards" only, so the hover transform is free again afterwards. */
.fc-anim .fc-card:not(.is-in) { opacity: 0; }
.fc-anim .fc-card.is-in { animation: fc-rise .6s var(--fc-ease) backwards; animation-delay: calc(var(--fc-i, 0) * 70ms); }
.fc-anim .fc-card.is-in .fc-photo { animation: fc-unveil .8s var(--fc-ease) backwards; animation-delay: calc(var(--fc-i, 0) * 70ms + 80ms); }
.fc-anim .fc-card.is-in .fc-photo img { animation: fc-settle 1s var(--fc-ease) backwards; animation-delay: calc(var(--fc-i, 0) * 70ms + 80ms); }
@keyframes fc-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fc-unveil { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes fc-settle { from { transform: scale(1.12); } }

@media (max-width: 767.98px) {
  .fc-page { padding: 24px 16px 40px; }
  .fc-grid { gap: 16px; }
  .fc-lead .fc-body { padding: 20px; }
  .fc-lead .fc-contact { display: grid; gap: 6px; }
}
/* Phones: a compact row, so a department stays a short list */
@media (max-width: 559.98px) {
  .fc-grid { grid-template-columns: minmax(0, 1fr); }
  .fc-card, .fc-lead { flex-direction: row; }
  .fc-photo, .fc-lead .fc-photo { flex: 0 0 104px; aspect-ratio: auto; min-height: 132px; }
  .fc-photo img { position: absolute; inset: 0; }
  .fc-body, .fc-lead .fc-body { justify-content: flex-start; padding: 14px 14px 12px; }
  .fc-body::before { display: none; }
  .fc-page h3.fc-name, .fc-page .fc-lead h3.fc-name { font-size: 17px; }
  .fc-role, .fc-lead .fc-role { font-size: 13.5px; }
  .fc-contact, .fc-lead .fc-contact { margin: 10px 0 10px; padding-top: 8px; font-size: 13.5px; }
  .fc-page a.fc-link { min-height: 32px; }
  .fc-page a.fc-del { min-height: 32px; padding: 0 12px; }
  .fc-page a.fc-add { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .fc-anim .fc-card:not(.is-in) { opacity: 1; }
  .fc-anim .fc-card, .fc-anim .fc-photo, .fc-anim .fc-photo img { animation: none !important; }
  .fc-card, .fc-photo img, .fc-link i, .fc-body::before { transition-property: background-color, border-color, box-shadow, opacity; }
  .fc-card:hover, .fc-card:hover .fc-photo img, .fc-card:hover .fc-link i { transform: none; }
}
@media print {
  .fc-anim .fc-card:not(.is-in) { opacity: 1; }
  .fc-card { box-shadow: none; break-inside: avoid; }
}
