/* CSSM Diretor Frontend Styles */

/* Director Photo */
.cssm-diretor-foto {
  text-align: center;
  margin: 20px 0;
}

/* Made photo smaller with max-width 280px and added hover animation */
.cssm-diretor-foto img {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cssm-diretor-foto img:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(41, 87, 164, 0.25);
}

.cssm-diretor-nome {
  margin-top: 15px;
  font-size: 18px;
  font-weight: 600;
  color: #2957a4;
}

/* Director Biography */
/* Added text-align: justify to biography */
.cssm-diretor-biografia {
  line-height: 1.8;
  color: #333;
  font-size: 16px;
  text-align: justify;
}

.cssm-diretor-biografia p {
  margin-bottom: 15px;
  text-align: justify;
}

/* Contact Button */
/* Updated button to match site design with red color, rounded corners, and hover effects */
.cssm-diretor-contato-btn {
  background-color: #ed3237;
  color: #ffffff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 150px;
  height: 42px;
  border-radius: 24px;
  padding: 0 12px;
  font-weight: 600;
  font-size: clamp(12px, 1.8vw, 14px);
  text-decoration: none;
  text-align: center;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: background-color 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease-in-out,
    color 0.4s ease;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  border: none;
  cursor: pointer;
}

.cssm-diretor-contato-btn:hover {
  background-color: #ed3237;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  color: #fff;
}

.cssm-diretor-contato-btn:focus-visible {
  outline: 2px solid rgba(237, 50, 55, 0.8);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(237, 50, 55, 0.25);
}

/* Modal */
#cssm-diretor-modal.cssm-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  width: 100vw;
  height: 100vh;
  padding: 24px;
  box-sizing: border-box;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease;
}

#cssm-diretor-modal.cssm-modal.active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Made modal smaller and added rounded corners */
#cssm-diretor-modal .cssm-diretor-modal-content {
  background-color: #fff;
  margin: 0;
  padding: 35px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  inset: auto !important;
  transform: none !important;
  float: none !important;
  animation: slideIn 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#cssm-diretor-modal .cssm-modal-close {
  color: #999;
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

#cssm-diretor-modal .cssm-modal-close:hover {
  color: #ed3237;
}

#cssm-diretor-modal .cssm-modal-content h2 {
  color: #2957a4;
  margin-bottom: 25px;
  font-size: 22px;
  font-weight: 600;
}

/* Contact Form */
#cssm-diretor-modal .cssm-contato-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#cssm-diretor-modal .cssm-form-group {
  display: flex;
  flex-direction: column;
}

#cssm-diretor-modal .cssm-form-group label {
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  font-size: 14px;
}

#cssm-diretor-modal .cssm-form-group input,
#cssm-diretor-modal .cssm-form-group textarea {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s, box-shadow 0.3s;
}

#cssm-diretor-modal .cssm-form-group input:focus,
#cssm-diretor-modal .cssm-form-group textarea:focus {
  border-color: #2957a4;
  outline: none;
  box-shadow: 0 0 0 3px rgba(41, 87, 164, 0.1);
}

#cssm-diretor-modal .cssm-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Updated submit button to match contact button style exactly, keeping width 100% */
#cssm-diretor-modal .cssm-submit-btn {
  background-color: #ed3237 !important;
  color: #ffffff !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100%;
  height: 42px;
  border-radius: 24px !important;
  padding: 0 24px !important;
  font-weight: 600 !important;
  font-size: clamp(12px, 1.8vw, 14px);
  text-decoration: none !important;
  text-align: center !important;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: background-color 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease-in-out,
    color 0.4s ease !important;
  border: none !important;
  cursor: pointer !important;
  margin-top: 8px;
}

#cssm-diretor-modal .cssm-submit-btn:hover {
  background-color: #9a0b16 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25) !important;
  color: #fff !important;
}

#cssm-diretor-modal .cssm-submit-btn:focus-visible {
  outline: 2px solid rgba(237, 50, 55, 0.8);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(237, 50, 55, 0.25);
}

#cssm-diretor-modal .cssm-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Success Animation */
#cssm-diretor-modal .cssm-success-animation {
  text-align: center;
  padding: 40px 20px;
}

#cssm-diretor-modal .cssm-checkmark {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
}

#cssm-diretor-modal .cssm-checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: #4caf50;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

#cssm-diretor-modal .cssm-checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: #4caf50;
  stroke-width: 3;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

#cssm-diretor-modal .cssm-success-animation p {
  font-size: 18px;
  font-weight: 600;
  color: #4caf50;
}

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

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

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  #cssm-diretor-modal.cssm-modal {
    padding: 16px;
  }

  #cssm-diretor-modal .cssm-diretor-modal-content {
    width: 95%;
    padding: 25px 20px;
    max-height: calc(100vh - 32px);
  }

  .cssm-diretor-contato-btn,
  #cssm-diretor-modal .cssm-submit-btn {
    width: 100%;
  }
}

/* Combined Director Shortcode */
/* New styles for the combined photo + biography shortcode */
.cssm-diretor-completo {
  margin: 40px auto;
  padding: 0 20px;
}

.cssm-diretor-header {
  text-align: center;
  margin-bottom: 40px;
}

.cssm-diretor-titulo {
  color: #2957a4;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  margin: 0 0 20px 0;
  line-height: 1.3;
}

.cssm-diretor-header .cssm-diretor-contato-btn {
  margin: 0 auto;
}

.cssm-diretor-conteudo {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.cssm-diretor-foto-wrapper {
  flex: 0 0 280px;
  text-align: center;
}

.cssm-diretor-foto-wrapper img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cssm-diretor-foto-wrapper img:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 24px rgba(41, 87, 164, 0.3);
}

.cssm-diretor-legenda {
  margin-top: 15px;
  font-size: 16px;
  font-weight: 600;
  color: #2957a4;
  line-height: 1.4;
}

.cssm-diretor-biografia-wrapper {
  flex: 1;
  line-height: 1.8;
  color: #333;
  font-size: 16px;
}

.cssm-diretor-biografia-wrapper p {
  margin-bottom: 15px;
  text-align: justify;
}

/* Responsive for mobile */
@media (max-width: 768px) {
  .cssm-diretor-completo {
    padding: 0 15px;
    margin: 30px auto;
  }

  .cssm-diretor-header {
    margin-bottom: 30px;
  }

  .cssm-diretor-titulo {
    font-size: 24px;
    margin-bottom: 15px;
  }

  .cssm-diretor-conteudo {
    flex-direction: column;
    gap: 30px;
  }

  .cssm-diretor-foto-wrapper {
    flex: 0 0 auto;
    max-width: 240px;
    margin: 0 auto;
  }

  .cssm-diretor-biografia-wrapper {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .cssm-diretor-foto-wrapper {
    max-width: 200px;
  }

  .cssm-diretor-biografia-wrapper {
    font-size: 14px;
  }
}
