/**
 * Leadership Fellows Module Styles
 *
 * Filter bar, circular headshot grid, and load more button
 */

:root {
  --dropdown-arrow-white: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
  --dropdown-arrow-black: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
}

/* Container */
.leadership-fellows-container {
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* Filter Row — mobile (staff-style primary select) */
.leadership-fellows-filter-row {
  margin-bottom: 28px;
  background-color: #ffffff;
  padding: 0 20px;
}

.leadership-fellows-filter-inner {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
}

.leadership-fellows-filter-label {
  display: none;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.leadership-fellows-filter-dropdown {
  display: block;
  width: 100%;
  max-width: 400px;
  position: relative;
}

.leadership-fellows-filter-dropdown::before {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 1em;
  height: 1em;
  background-color: #ffffff;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  z-index: 1;
  pointer-events: none;
}

.leadership-fellows-filter-select {
  width: 100%;
  padding: 16px 40px 14px 20px;
  background-color: var(--primary-color);
  border: 2px solid var(--primary-color);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    background-image 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
  letter-spacing: 0.5px;
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--dropdown-arrow-white);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}

.leadership-fellows-filter-select:focus,
.leadership-fellows-filter-select:active {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: #ffffff;
}

/* Visually hidden utility */
.leadership-fellows-container .visually-hidden,
.leadership-fellows-filter-live.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Grid — mobile-first: 1 column */
.leadership-fellows-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2em 1.5em;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Cards */
.leadership-fellow-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: default;
  margin: 0;
}

.leadership-fellow-card.hidden,
.leadership-fellow-card.initial-hidden {
  display: none;
}

.leadership-fellow-card-image-wrap {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1em;
  background-color: #f0f0f0;
}

.leadership-fellow-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.leadership-fellow-card.has-default-image .leadership-fellow-card-image {
  object-fit: contain;
  padding: 1.5em;
  background-color: #ffffff;
}

.leadership-fellow-card-name {
  margin: 0 0 0.35em;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--secondary-color);
  line-height: 1.3;
}

.leadership-fellow-card-organization {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  color: var(--secondary-color);
  line-height: 1.4;
}

/* Load More */
.leadership-fellows-load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
}

.leadership-fellows-load-more-btn {
  width: 100%;
  max-width: 400px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.leadership-fellows-load-more-btn::after {
  font-family: var(--font-etmodules);
  content: '\4c' !important;
  position: absolute;
  right: 1em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.leadership-fellows-load-more-btn.hidden {
  display: none;
}

/* 480–767: 2 columns */
@media screen and (min-width: 480px) {
  .leadership-fellows-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2em 1.25em;
  }

  .leadership-fellow-card-image-wrap {
    max-width: 180px;
  }
}

/* 768–979: 3 columns */
@media screen and (min-width: 768px) {
  .leadership-fellows-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2em 1em;
    padding: 0 38px;
  }

  .leadership-fellow-card-image-wrap {
    max-width: 160px;
  }
}

/* Desktop ≥981: filter bar + 6 columns */
@media screen and (min-width: 981px) {
  .leadership-fellows-filter-row {
    background-color: var(--secondary-color);
    margin-bottom: 5em;
    padding: 0;
  }

  .leadership-fellows-filter-inner {
    width: 80%;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    min-height: 80px;
    padding-top: 0;
  }

  .leadership-fellows-filter-label {
    display: flex;
    align-items: center;
    padding: 0 30px 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
  }

  .leadership-fellows-filter-dropdown {
    flex: 1;
    max-width: none;
  }

  .leadership-fellows-filter-dropdown::before {
    display: none;
  }

  .leadership-fellows-filter-select {
    height: 100%;
    width: max-content;
    max-width: none;
    padding: 0 2.5em 0 1em;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    background-color: var(--secondary-color);
    border: none;
    background-image: var(--dropdown-arrow-white);
    background-position: right 0.5em center;
    background-size: 28px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .leadership-fellows-filter-select:hover,
  .leadership-fellows-filter-select:focus {
    background-color: var(--tertiary-color);
    color: var(--secondary-color);
    background-image: var(--dropdown-arrow-black);
    outline: 2px solid var(--tertiary-color);
    outline-offset: 2px;
  }

  .leadership-fellows-filter-select option {
    background-color: var(--secondary-color);
    color: #ffffff;
  }

  .leadership-fellows-grid {
    grid-template-columns: repeat(var(--fellows-per-row, 6), 1fr);
    gap: 2.5em 1em;
    padding: 0 50px;
  }

  .leadership-fellow-card-image-wrap {
    max-width: 140px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .leadership-fellows-filter-select,
  .leadership-fellows-load-more-btn {
    transition: none;
  }
}
