/**
 * Post Modal Styles
 */

/* Modal Container */
.cs-post-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
}

/* Modal Overlay */
.cs-post-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

/* Modal Container */
.cs-post-modal__container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  margin: 5vh auto;
  background-color: #fff;
  border-radius: var(--cs-thumbnail-border-radius);
  overflow-y: auto;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
  animation: cs-modal-in 0.3s ease-out;
}

/* Modal Close Button */
.cs-post-modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.2s;
}

.cs-post-modal__close:hover {
  background-color: #000;
}

/* Modal Content */
.cs-post-modal__content {
  padding: 30px;
  position: relative;
}

/* Loading Spinner */
.cs-post-modal__loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.cs-post-modal__spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-top-color: #000;
  border-radius: 50%;
  animation: cs-spinner 0.8s linear infinite;
}

/* Error Message */
.cs-post-modal__error {
  padding: 30px;
  text-align: center;
  font-size: 18px;
  color: #ff3b30;
}

/* Body Class when Modal is Open */
body.cs-modal-open {
  overflow: hidden;
}

/* Post Title Button Styles */
.cs-entry__title .cs-post-modal-trigger,
h2.cs-entry__title button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
  width: 100%;
  text-align: left;
}

.cs-entry__discover-more > button.cs-button {
  z-index: 7;
}

/* Post Modal Trigger Styles */
button.cs-post-modal-trigger,
button.cs-post-modal-trigger:hover {
  cursor: pointer;
  box-shadow: none;
}

.cs-entry__inner > button.cs-post-modal-trigger:before,
.cs-entry__outer > button.cs-post-modal-trigger:before,
.cs-entry__title > button.cs-post-modal-trigger:before {
  display: none;
}

/* Overlay Link Button Styles */
button.cs-overlay-link,
button.cs-entry-prev-next__link {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

/* Animations */
@keyframes cs-modal-in {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cs-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .cs-post-modal__container {
    width: 95%;
    margin: 2.5vh auto;
    max-height: 95vh;
  }

  .cs-post-modal__content {
    padding: 15px;
  }
}
