/* CSSM Professores - Public Styles */

.cssm-categorias-wrapper {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 40px 0;
}

.cssm-categoria-section {
  width: 100%;
}

.cssm-categoria-title {
  font-size: 32px;
  color: #2957a4;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 3px solid #ed3237;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cssm-professores-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px; /* Reduced gap from 30px to 20px to make blocks more compact */
  padding: 0;
}

.no-professores {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 18px;
}

.no-professores-categoria {
  border: 2px dashed #d5d9e3;
  border-radius: 12px;
  padding: 20px;
  font-size: 14px;
  margin: 0;
}

/* Professor Card */
.professor-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.professor-card:hover {
  transform: translateY(-8px);
  /* Changed shadow color from blue to red #ed3237 */
  box-shadow: 0 8px 24px rgba(237, 50, 55, 0.2);
}

.professor-foto {
  width: 100%;
  padding-top: 100%; /* 1:1 aspect ratio */
  background-size: cover;
  background-position: center;
  background-color: #f0f0f0;
  position: relative;
}

.professor-info {
  padding: 16px; /* Reduced padding from 20px to 16px to make blocks smaller */
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.professor-nome {
  font-size: 18px; /* Reduced font size from 20px to 18px */
  font-weight: 700;
  color: #2957a4;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.professor-sobre {
  font-size: 13px; /* Reduced font size from 14px to 13px and added white-space to preserve line breaks */
  color: #666;
  margin: 0;
  line-height: 1.5;
  text-align: justify;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal */
.cssm-prof-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  animation: fadeIn 0.3s ease;
}

.cssm-prof-modal.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  margin: 5vh auto;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: #ed3237;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #c72a2e;
  transform: rotate(90deg);
}

.modal-body {
  display: grid;
  grid-template-columns: 300px 1fr;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-foto {
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.modal-foto img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modal-info {
  padding: 40px;
}

.modal-info h2 {
  font-size: 32px;
  font-weight: 700;
  color: #2957a4;
  margin: 0 0 30px 0;
  line-height: 1.2;
}

.modal-section {
  margin-bottom: 30px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: #ed3237;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #ed3237;
}

.modal-section p,
.modal-section div {
  font-size: 15px;
  line-height: 1.7;
  color: #333;
  margin: 0;
  text-align: justify;
  white-space: pre-line; /* Added white-space to preserve line breaks in modal */
}

/* Responsive */
@media (max-width: 1200px) {
  .cssm-professores-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px; /* Reduced gap for medium screens */
  }
}

@media (max-width: 900px) {
  .cssm-categoria-title {
    font-size: 26px;
  }

  .cssm-professores-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px; /* Reduced gap for small screens */
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-foto {
    padding: 30px;
  }

  .modal-info {
    padding: 30px;
  }

  .modal-info h2 {
    font-size: 26px;
  }
}

@media (max-width: 600px) {
  .cssm-categorias-wrapper {
    gap: 30px;
    padding: 20px 0;
  }

  .cssm-categoria-title {
    font-size: 22px;
    margin-bottom: 14px;
  }

  .cssm-professores-grid {
    /* Changed from 1 column to 2 columns for mobile */
    grid-template-columns: repeat(2, 1fr);
    gap: 16px; /* Reduced gap for mobile */
    padding: 0;
  }

  .professor-nome {
    font-size: 16px; /* Reduced font size for mobile */
  }

  .professor-sobre {
    font-size: 13px;
  }

  .modal-content {
    width: 95%;
    margin: 2.5vh auto;
    max-height: 95vh;
  }

  .modal-foto {
    padding: 20px;
  }

  .modal-info {
    padding: 20px;
  }

  .modal-info h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  .modal-section {
    margin-bottom: 20px;
  }

  .modal-section h4 {
    font-size: 14px;
  }

  .modal-section p,
  .modal-section div {
    font-size: 14px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
}
