/* Image Modal Styles */

.image-modal-container {
  margin: 1rem 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.image-modal-container:hover {
  transform: scale(1.02);
}

/* Responsive image sizing */
.image-modal-container img {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

.image-modal-container:hover img {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Desktop alignment */
@media (min-width: 768px) {
  .image-align-left {
    float: left;
    margin: 0 2rem 1rem 0;
    min-width: 300px;
    width: 20vw;
  }

  .image-align-right {
    float: right;
    margin: 0 0 1rem 2rem;
    min-width: 300px;
    width: 20vw;
  }

  .image-align-left img,
  .image-align-right img,
  .image-align-left video,
  .image-align-right video {
    width: 100%;
    height: auto;
    max-width: 80vw;
  }
}

/* Mobile sizing */
@media (max-width: 767px) {
  .image-modal-container {
    clear: both;
    float: none;
    max-width: 80vw;
    margin: 1rem auto;
    display: block;
  }

  .image-modal-container img,
  .image-modal-container video {
    width: 100%;
    height: auto;
    max-width: 80vw;
  }
}

.image-caption {
  font-size: 0.9rem;
  color: #666;
  text-align: center !important;
  margin: 0.75rem 0 0 0;
  font-style: italic;
  clear: both;
  width: 100%;
}

/* Modal styles */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal.active {
  opacity: 1;
  visibility: visible;
}

.image-modal-overlay {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
  padding: 0.75rem;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.image-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.image-modal-image {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-modal-caption {
  color: white;
  text-align: center;
  margin-top: 1rem;
  font-size: 1rem;
  max-width: 80%;
}

/* Clear floats after image containers */
.image-modal-container::after {
  content: "";
  display: table;
  clear: both;
}

/* Ensure parent containers clear floats */
.post-content::after {
  content: "";
  display: table;
  clear: both;
}
