/**
 * MACU Employee Directory — front-end styles.
 *
 * Visual parity with the legacy `wp-block-macu-employee-directory` block
 * that this plugin replaces. The legacy plugin is being deleted; once
 * it is gone, the only block of this shape on the site will be ours,
 * so we deliberately do NOT touch `.wp-block-macu-employee-directory`
 * selectors — only the new block's `.macu-employee-directory-root` family
 * is styled here.
 *
 * Design tokens are fixed:
 *  - text color #000 / outer #f6f6f6
 *  - accent (filter button, link) rgb(170, 24, 44) — the WP palette's
 *    `--wp--preset--color--primary` on evangelnet.macu.edu
 *  - phone separator #adadad
 *  - card border #cfcfcf
 *  - default-photo asset: assets/img/employee-member-default-photo.png
 *
 * @package macu-employee-directory
 */

.macu-employee-directory-root {
  color: rgb(0, 0, 0);
  box-sizing: border-box;
}

.macu-employee-directory-root *,
.macu-employee-directory-root *::before,
.macu-employee-directory-root *::after {
  box-sizing: inherit;
}

/* ---------------------------------------------------------------- *
 * Outer light-gray backdrop (legacy: #employee-directory-outer-container)
 * ---------------------------------------------------------------- */
.macu-employee-directory-root > .employee-directory-outer {
  background-color: rgb(246, 246, 246);
  padding: 30px;
}

/* ---------------------------------------------------------------- *
 * Inner flex column (legacy: .employee-directory-search-and-faculty-container)
 * ---------------------------------------------------------------- */
.employee-directory-search-and-faculty-container {
  display: flex;
  flex-flow: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  max-width: 1900px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------------------------------------------------------------- *
 * Search input (legacy: .employee-directory-text-search-container)
 * ---------------------------------------------------------------- */
.employee-directory-text-search-container {
  display: flex;
  justify-content: center;
  flex-basis: 100%;
}

.employee-directory-text-search-container #employee-directory-text-search {
  width: 300px;
  max-width: 95%;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 0;
  padding: 1rem 1.2rem;
}

/* ---------------------------------------------------------------- *
 * "Filter Departments" trigger button
 * ---------------------------------------------------------------- */
.macu-employee-directory-root #department-filter-link-container {
  display: flex;
  flex-basis: 100%;
  justify-content: center;
}

.macu-employee-directory-root #department-filter-link-container #department-filter-link {
  width: 300px;
  max-width: 95%;
  text-align: center;
  padding: 1rem 1.2rem;
  background-color: rgb(170, 24, 44);
  color: rgb(255, 255, 255);
  text-decoration: none;
  cursor: pointer;
}

.macu-employee-directory-root #department-filter-link-container #department-filter-link:hover {
  opacity: 0.9;
}

/* ---------------------------------------------------------------- *
 * Department checkbox list — hidden by default; JS adds `.shown` to reveal.
 * The outer container animates its height via grid-template-rows
 * (0fr -> 1fr); the inner .macu-employee-directory-departments wrapper
 * holds the columns. Columns mirror macu.edu/staff-directory.
 * ---------------------------------------------------------------- */
.macu-employee-directory-root #employee-directory-department-search-container {
  flex-basis: 100%;
  max-width: 1810px;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  transition:
    grid-template-rows 320ms ease-in-out,
    opacity 240ms ease-in-out;
}

.macu-employee-directory-root #employee-directory-department-search-container.shown {
  grid-template-rows: 1fr;
  opacity: 1;
}

.macu-employee-directory-root
  #employee-directory-department-search-container
  .macu-employee-directory-departments {
  min-height: 0;
  overflow: hidden;
  padding-top: 16px;
  padding-bottom: 16px;
  -moz-column-count: 3;
       column-count: 3;
  -moz-column-gap: 32px;
       column-gap: 32px;
}

@media (max-width: 1160px) {
  .macu-employee-directory-root
    #employee-directory-department-search-container
    .macu-employee-directory-departments {
    -moz-column-count: 2;
         column-count: 2;
  }
}

@media (max-width: 750px) {
  .macu-employee-directory-root
    #employee-directory-department-search-container
    .macu-employee-directory-departments {
    -moz-column-count: 1;
         column-count: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .macu-employee-directory-root #employee-directory-department-search-container {
    transition: none;
  }
}

.macu-employee-directory-root
  .macu-employee-directory-departments
  .employee-directory-department {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0;
  width: 20.2em;
  margin-left: auto;
  margin-right: auto;
  -webkit-column-break-inside: avoid;
            break-inside: avoid;
}

.macu-employee-directory-root
  .macu-employee-directory-departments
  .employee-directory-department:hover {
  border-color: rgb(207, 207, 207);
}

/* ---------------------------------------------------------------- *
 * Card grid (legacy: .employee-directory-container)
 * ---------------------------------------------------------------- */
.employee-directory-container {
  display: flex;
  flex-flow: wrap;
  justify-content: center;
  gap: 0;
  flex-basis: 100%;
}

/* ---------------------------------------------------------------- *
 * Individual employee card (legacy: .macu-employee-directory-entry)
 * ---------------------------------------------------------------- */
.macu-employee-directory-entry {
  flex: 0 1 50%;
  min-width: 280px;
  max-width: 450px;
  position: relative;
  padding: 2em;
  border: 1px solid rgb(207, 207, 207);
  background-color: rgb(255, 255, 255);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.macu-employee-directory-entry .employee-member-photo {
  width: 120px;
  height: 160px;
  object-fit: cover;
  display: block;
}

.macu-employee-directory-entry .employee-member-name,
.macu-employee-directory-entry .employee-member-title,
.macu-employee-directory-entry .employee-member-departments,
.macu-employee-directory-entry .employee-member-contact-info {
  margin: 0 0 0.25em;
}

.macu-employee-directory-entry .employee-member-name {
  font-size: 1.7em;
  font-weight: 400;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.02em;
}

.macu-employee-directory-entry .employee-member-name .dashicons-external {
  font-size: 0.6em;
  margin-left: 5px;
  text-decoration: none;
  color: #2271b1;
}

.macu-employee-directory-entry > p {
  margin: 5px 0;
}

.macu-employee-directory-entry .employee-member-contact-info {
  margin: 0 0 0.25em;
}

.macu-employee-directory-entry .employee-member-phone.separated {
  margin-right: 12px;
  padding-right: 12px;
  border-right: 2px solid rgb(173, 173, 173);
}

.macu-employee-directory-entry .employee-member-email a {
  color: rgb(170, 24, 44);
  text-decoration: underline;
}

/* ---------------------------------------------------------------- *
 * Template node — never displayed. JS clones it, strips the class,
 * and replaces its inner text.
 * ---------------------------------------------------------------- */
.macu-employee-directory-template {
  display: none !important;
}

/* ---------------------------------------------------------------- *
 * Pagination (legacy: #employee-directory-pagination + div.paginationjs)
 * ---------------------------------------------------------------- */
#employee-directory-pagination {
  margin: 40px 0 30px;
  flex-basis: 100%;
  display: flex;
  justify-content: center;
}

.macu-employee-directory-root div.paginationjs {
  width: auto;
  display: flex;
  justify-content: center;
}

.macu-employee-directory-root div.paginationjs .paginationjs-pages {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.macu-employee-directory-root div.paginationjs .paginationjs-pages li > a {
  min-width: 34px;
  height: 42px;
  line-height: 42px;
  font-size: 24px;
  text-align: center;
  padding: 0 12px;
  display: inline-block;
  color: rgb(0, 0, 0);
  text-decoration: none;
}

.macu-employee-directory-root div.paginationjs .paginationjs-pages li.active > a {
  height: 44px;
  line-height: 44px;
}

/* ---------------------------------------------------------------- *
 * Mobile breakpoints (mirror legacy)
 * ---------------------------------------------------------------- */
@media (max-width: 600px) {
  .employee-directory-search-and-faculty-container {
    gap: 16px;
  }

  .macu-employee-directory-root
    #employee-directory-department-search-container
    .macu-employee-directory-departments {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .macu-employee-directory-entry {
    flex-basis: 100%;
    padding: 1.5em;
  }
}
