/* Teachers catalog: grid layout and cards */

.teachers-catalog-hero {
  background-size: cover;
  background-position: center;
}

.teachers-catalog-hero .breadcrumbs-custom-title {
  font-size: 1.75rem;
}

@media (min-width: 768px) {
  .teachers-catalog-hero {
    min-height: 280px;
  }
}

/* Grid: 4 cols desktop, 2–3 tablet, 1 mobile */
.teachers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 576px) {
  .teachers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .teachers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 992px) {
  .teachers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .teachers-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Card */
.teacher-card {
  margin: 0;
}

.teacher-card-inner {
  background: var(--card-bg, #fff);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.teacher-card-inner:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.teacher-card-photo-wrap {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  line-height: 0;
}

.teacher-card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 270 / 273;
  object-fit: cover;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.teacher-card-photo-wrap:hover .teacher-card-image {
  transform: scale(1.03);
}

.teacher-card-body {
  padding: 1rem 1.25rem;
}

.teacher-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: #333;
  line-height: 1.3;
}

.teacher-card-subject {
  font-size: 0.9rem;
  margin: 0;
  color: #666;
  line-height: 1.4;
}

.teachers-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
}

/* Modal */
.teacher-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.teacher-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.teacher-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  cursor: pointer;
}

.teacher-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.teacher-modal.is-open .teacher-modal-content {
  transform: scale(1);
}

.teacher-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
  z-index: 1;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.teacher-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.teacher-modal-image {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}

.teacher-modal-caption {
  margin: 0.75rem 0 0 0;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: #333;
}
