/* Instructors page styles extracted from template */
@keyframes instructors_spin {
  to {
    transform: rotate(360deg);
  }
}

.et_pb_section.instructors-section .et_pb_row {
  display: flex !important;
  align-items: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 30px;
  position: relative;
}
.et_pb_section.instructors-section .et_pb_column {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
.et_pb_section.instructors-section .et_pb_column_1_4 {
  flex: 0 0 28% !important;
  position: relative;
  align-self: stretch;
}
.et_pb_section.instructors-section .et_pb_column_3_4 {
  flex: 0 0 auto !important;
  max-width: 100% !important;
}
#main-content,
.et_pb_section.instructors-section {
  overflow: visible !important;
  padding-top: 0;
}
.filters-sidebar {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 25px;
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 110px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-height: calc(100vh - 130px) !important;
  overflow-y: auto;
  z-index: 99;
  align-self: flex-start;
}
.admin-bar .filters-sidebar {
  top: 142px !important;
}
.filter-group {
  margin-bottom: 25px;
}
.filter-group h4 {
  color: #555;
  font-size: 16px;
  margin: 0 0 15px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.filter-group h4::after {
  content: "\25BC";
  font-size: 12px;
  color: #888;
  transition: transform 0.2s ease;
}
.filter-group.collapsed h4::after {
  transform: rotate(-90deg);
}
.filter-options {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.filter-group.collapsed .filter-options {
  max-height: 0;
}
.filter-checkbox {
  display: block;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  transition: color 0.3s ease;
}
.filter-checkbox:hover {
  color: #2ea3f2;
}
.filter-checkbox input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.1);
}
.clear-filters-btn {
  width: 100%;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 15px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}
.clear-filters-btn:hover {
  background: #5a6268;
  transform: translateY(-1px);
}
.search-container {
  margin-bottom: 25px;
}
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #fff;
  transition: all 0.3s ease;
  box-sizing: border-box;
}
.search-input:focus {
  outline: none;
  border-color: #2ea3f2;
  box-shadow: 0 0 0 3px rgba(46, 163, 242, 0.1);
}
.search-input::placeholder {
  color: #999;
  font-style: italic;
}
.clear-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.clear-search-btn:hover {
  background: #f0f0f0;
  color: #333;
}
.clear-search-btn svg {
  width: 14px;
  height: 14px;
}
.results-count {
  text-align: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 14px;
  color: #666;
}
.results-count span {
  font-weight: 600;
  color: #e4768b;
}
.instructors-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile-first */
  gap: 20px;
  margin: 0;
  padding: 0;
  align-items: stretch;
}
.instructor-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 320px;
  display: flex;
  flex-direction: column;
}
.instructor-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-3px);
}
.instructor-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}
.instructor-link:hover {
  text-decoration: none;
  color: inherit;
}
.instructor-header {
  padding: 0;
  text-align: center;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.instructor-photo {
  padding: 20px 20px 0 20px;
}
.instructor-image,
.instructor-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid #7a9a7e;
  margin: 0 auto;
}
.instructor-image {
  object-fit: cover;
}
.instructor-placeholder {
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-text {
  color: #999;
  font-size: 12px;
}
.instructor-basic-info {
  flex: 1;
  padding: 25px 25px 20px 25px;
}
.instructor-name {
  color: #333;
  font-size: 20px;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}
.instructor-title {
  font-weight: 600;
  margin: 0 0 8px 0;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.5px;
  font-style: italic;
}
.instructor-email {
  margin: 0;
}
.instructor-email a {
  color: #2ea3f2;
  text-decoration: none;
  font-size: 14px;
}
.instructor-email a:hover {
  text-decoration: underline;
}
.view-profile-section {
  margin-top: auto;
  padding: 25px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  flex-shrink: 0;
}
.instructor-bio-excerpt {
  margin: 15px 0 20px 0;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  /* Clamp to ~3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 4.5em; /* fallback */
}
.instructor-bio-excerpt p {
  margin: 0 0 10px 0;
}
.instructor-tags {
  margin: 15px 0 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-badge {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
}
.tag-badge.tag-house {
  background-color: #7a9a7e;
}
.tag-badge.tag-subject {
  background-color: #6c757d;
}
.tag-badge.tag-course {
  background-color: #17a2b8;
}
.instructor-course-badge {
  width: 100%;
  display: inline-block;
  background-color: #17a2b8;
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin: 10px 0 12px 0;
}
.tag-badge.tag-grade {
  background-color: #d4a574;
}
.view-profile-link {
  display: inline-block;
  background-color: #7a9a7e;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.view-profile-link:hover {
  color: #7a9a7e;
  border: 1px solid #7a9a7e;
  background-color: #fff;
}
.contact-section {
  background: #f9f9f9;
  padding: 40px 0;
  text-align: center;
  margin-top: 60px;
}
.contact-section h2 {
  color: #333;
  margin-bottom: 20px;
}
.contact-section p {
  color: #666;
  font-size: 16px;
}
.contact-section a {
  color: #2ea3f2;
  text-decoration: none;
}
.contact-section a:hover {
  text-decoration: underline;
}
/* Sort controls */
.sort-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

@media (max-width: 767px) {
  .sort-controls {
    margin: 12px;
  }
}

.sort-controls label {
  font-size: 13px;
  color: #666;
}
.sort-dropdown {
  position: relative;
}
.sort-toggle {
  padding: 6px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}
.sort-menu {
  position: absolute;
  top: 100%;
  right: 0;
  width: 210px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-top: 6px;
  padding: 6px;
  list-style: none;
  display: none;
  z-index: 10000;
}
.sort-menu[aria-hidden="false"] {
  display: block;
}
.sort-menu li {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.sort-menu li.active,
.sort-menu li.active:hover {
  background: #2ea3f2;
  color: #fff;
}
.sort-menu li:hover {
  background: #f0f0f0;
}
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
/* Desktop and up: keep two columns as well */
@media (min-width: 1024px) {
  .instructors-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    align-items: stretch;
  }
}
@media (max-width: 767px) {
  .instructors-section .et_pb_column_1_4 {
    display: none !important;
  }
  .instructors-section .et_pb_row {
    width: 100%;
    gap: 0 !important;
    justify-content: center !important;
  }
  .instructors-section .et_pb_column_3_4 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    text-align: center;
  }
  .filters-sidebar {
    position: static !important;
    margin-bottom: 30px;
    max-height: none !important;
    top: auto !important;
  }
  .instructors-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
    max-width: 400px;
    margin: 0 auto;
    align-items: stretch;
  }
  .instructor-card {
    max-width: 350px;
    width: 100%;
    margin: 0 auto;
    min-height: 350px;
  }
  .instructors-section .et_pb_column_3_4 {
    text-align: center;
  }
  .instructor-image,
  .instructor-placeholder {
    width: 100px;
    height: 100px;
  }
  .instructor-name {
    font-size: 18px;
  }
}
.mobile-filter-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #2ea3f2;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
.mobile-filter-toggle {
  width: 100%;
  background: #6b8e6f;
  color: #fff;
  border: none;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.3s ease;
}
.toggle-icon {
  font-size: 12px;
  transition: transform 0.3s ease;
}
.mobile-filter-toggle.active .toggle-icon {
  transform: rotate(180deg);
}
.mobile-filter-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #fff;
}
.mobile-filter-content.active {
  max-height: 80vh;
  overflow-y: auto;
}
.mobile-filter-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}
.mobile-filter-close:hover {
  background: #e0e0e0;
}
.mobile-filter-body {
  padding: 20px;
}
.mobile-filter-body .filter-group {
  margin-bottom: 25px;
}
.mobile-filter-body .filter-group h4 {
  color: #333;
  font-size: 16px;
  margin: 0 0 15px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mobile-filter-body .filter-checkbox {
  display: block;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 15px;
  color: #666;
  transition: color 0.3s ease;
  padding: 8px 0;
}
.mobile-filter-body .filter-checkbox:hover {
  color: #2ea3f2;
}
.mobile-filter-body .filter-checkbox input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
}
.mobile-filter-body .search-container {
  margin-bottom: 20px;
}
.mobile-filter-body .search-input {
  font-size: 16px;
  padding: 14px 40px 14px 40px;
}
.mobile-filter-body .clear-search-btn {
  right: 10px;
  padding: 6px;
}
.mobile-filter-actions {
  border-top: 1px solid #e0e0e0;
  padding-top: 20px;
  margin-top: 20px;
}
.mobile-clear-filters {
  width: 100%;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}
.mobile-clear-filters:hover {
  background: #5a6268;
  transform: translateY(-1px);
}
.mobile-filter-count {
  text-align: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 14px;
  color: #666;
}
.mobile-filter-count span {
  font-weight: 600;
  color: #2ea3f2;
}
@media (max-width: 768px) {
  .filters-sidebar {
    display: none !important;
  }
  .mobile-filter-bar {
    display: block;
  }
  .instructors-section {
    padding-bottom: 80px;
  }
  .mobile-filter-bar {
    z-index: 9999;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .instructors-section .et_pb_column_1_4 {
    display: none !important; /* hide desktop sidebar column on tablet */
  }
  .instructors-section .et_pb_row {
    display: block !important; /* prevent Divi's flex two-column layout */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    gap: 0 !important;
  }
  .filters-sidebar {
    display: none !important;
  }
  .mobile-filter-bar {
    display: block;
  }
  .instructors-section {
    padding-bottom: 80px;
  }
  .instructor-card {
    max-width: 350px;
    width: 100%;
  }
  .instructors-section .et_pb_column_3_4 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding-left: 20px;
    padding-right: 20px;
  }
  /* Keep inner grid consistent even if Divi injects wrappers */
  .instructors-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* two cards on tablet */
    gap: 20px !important;
  }
}
