/* Read More Feature CSS */

/* Content visibility control */
.content-preview-container {
  position: relative;
  margin: 20px 0;
  display: block; /* Show container by default */
}

.content-preview {
  max-height: 300px; /* Show limited height */
  overflow: hidden;
  position: relative;
  transition: max-height 0.5s ease;
  border-radius: 8px;
  padding: 20px;
  background: #fafafa;
  border: 1px solid #e9ecef;
}

.content-preview::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(
    transparent,
    rgba(255, 255, 255, 0.8) 20%,
    #ffffff 100%
  );
  pointer-events: none;
  z-index: 1;
}

.content-full {
  max-height: none;
  overflow: visible;
  display: block !important; /* Show when revealed */
  background: transparent;
  border: none;
  padding: 0;
}

.content-full::after {
  display: none;
}

/* Ensure content shows preview by default */
.content-preview-container.content-preview {
  display: block !important;
}

/* Ensure content is fully shown when revealed */
.content-preview-container.content-full {
  display: block !important;
}

/* Read More Button */
.read-more-btn {
  background: linear-gradient(135deg, #4d359d 0%, #684770 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(77, 53, 157, 0.3);
  margin: 30px auto 20px auto;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
}

.read-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(77, 53, 157, 0.4);
  background: linear-gradient(135deg, #684770 0%, #4d359d 100%);
}

.read-more-btn:active {
  transform: translateY(0);
}

/* Email Form Modal */
.email-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.email-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.email-modal-content {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.email-modal-header {
  margin-bottom: 30px;
}

.email-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #4d359d;
  margin-bottom: 10px;
  font-family: "Heebo", sans-serif;
}

.email-modal-subtitle {
  font-size: 16px;
  color: #666;
  line-height: 1.5;
  font-family: "Open Sans", sans-serif;
}

.email-form {
  margin-bottom: 30px;
}

.email-input-group {
  margin-bottom: 20px;
  text-align: left;
}

.email-input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.email-input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  font-family: "Open Sans", sans-serif;
}

.email-input:focus {
  outline: none;
  border-color: #4d359d;
  box-shadow: 0 0 0 3px rgba(77, 53, 157, 0.1);
  transform: translateY(-1px);
}

.email-input.error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.email-error-message {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 5px;
  display: none;
  font-family: "Open Sans", sans-serif;
}

.email-error-message.show {
  display: block;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.email-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.email-submit-btn {
  background: linear-gradient(135deg, #4d359d 0%, #684770 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(77, 53, 157, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 120px;
}

.email-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(77, 53, 157, 0.4);
}

.email-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.email-cancel-btn {
  background: #f8f9fa;
  color: #6c757d;
  border: 2px solid #e1e5e9;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 120px;
}

.email-cancel-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-1px);
}

/* Close button */
.email-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.email-modal-close:hover {
  color: #4d359d;
  background: #f8f9fa;
}

/* Loading state */
.email-submit-btn.loading {
  position: relative;
  color: transparent;
}

.email-submit-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .email-modal-content {
    padding: 30px 20px;
    margin: 20px;
    width: calc(100% - 40px);
  }

  .email-modal-title {
    font-size: 20px;
  }

  .email-buttons {
    flex-direction: column;
  }

  .email-submit-btn,
  .email-cancel-btn {
    width: 100%;
  }

  .read-more-btn {
    padding: 15px 30px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .email-modal-content {
    padding: 25px 15px;
  }

  .email-modal-title {
    font-size: 18px;
  }

  .email-input {
    padding: 12px;
    font-size: 14px;
  }
}

/* Accessibility improvements */
.email-modal:focus-within {
  outline: none;
}

.email-input:focus-visible {
  outline: 2px solid #4d359d;
  outline-offset: 2px;
}

.read-more-btn:focus-visible {
  outline: 2px solid #4d359d;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .email-modal-content {
    border: 2px solid #000;
  }

  .email-input {
    border: 2px solid #000;
  }

  .read-more-btn {
    border: 2px solid #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .content-preview,
  .email-modal-content,
  .read-more-btn,
  .email-input {
    transition: none;
  }

  .email-modal.show,
  .email-modal-content {
    animation: none;
  }
}
