/* List Post */
#list-post .thumbnail-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

#list-post .thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  overflow: hidden;
  object-fit: cover;
  cursor: pointer;
}

/* Article */
p.article-text-hat {
  font-size: .85rem;
  margin-bottom: .5rem;
  font-weight: 600;
}

.article-credit p {
  font-size: .85rem;
  margin-right: .5rem;
  margin-bottom: 0;
}

.article-credit p .icon {
  margin-right: .5rem;
}

#article-top {margin-bottom: 1.5rem;}

#article-cover{margin-bottom: 1rem}

#article-content figcaption,
#article-cover figcaption {
  font-size: .85rem;
  margin: .5rem 0;
}

#article-content figcaption::before,
#article-cover figcaption::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  padding-right: .5rem;
  color: var(--c-base-gray);
  -webkit-font-smoothing: antialiased;
  content: "\f030";
}

/* Gallery */
#post-gallery {
  padding: 0 1rem;
}

#post-gallery > .post-gallery-title {
  display: flex;
  align-items: center;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--c-gray);
}

#post-gallery > .post-gallery-title .icon {
  padding-right: .5rem;
}

#post-gallery > .post-gallery-title h4 {
  margin-bottom: 0;
}

/* Gallery Thumbnail */
#thumbnail-carousel-wrapper .carousel-control-prev {
  left: -2rem;
}

#thumbnail-carousel-wrapper .carousel-control-next {
  right: -2rem;
}

#thumbnail-carousel-wrapper .thumbnail-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  background: var(--c-lighter-gray);
}

#thumbnail-carousel-wrapper .thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  overflow: hidden;
  object-fit: cover;
  background-color: #fff;
  border: 1px solid var(--c-light-gray);
  cursor: pointer;
}

/* Gallery Modal Image */
#image-modal-wrapper .modal-dialog {
  width: auto;
  max-width: 90vw;
  max-height: 90vh;
  margin: auto;
  display: flex;
  align-items: center;
}

#image-modal-wrapper .modal-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
}

#image-modal-wrapper .modal-header {
  flex-shrink: 0;
  padding: 1rem;
}

#image-modal-wrapper .modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  gap: 0.75rem;
  flex: 1 1 auto;
  overflow: hidden;
}

#image-modal-wrapper .modal-image-container {
  flex: 1 1 auto;
  width: 100%;
  max-height: calc(90vh - 200px); /* Leaves space for header + caption */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

#image-modal-wrapper .modal-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

#image-modal-wrapper .photo-caption,
#image-modal-wrapper .text-center {
  flex-shrink: 0;
  margin: 0.25rem 0 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.4;
}

@media (max-width: 768px) {
  #image-modal-wrapper .modal-dialog {
    max-width: 95vw;
    max-height: 85vh;
  }

  #image-modal-wrapper .modal-body {
    padding: 0.5rem;
  }

  #image-modal-wrapper .modal-image-container {
    max-height: 60vh;
    aspect-ratio: auto; /* Let small screens be more flexible */
  }

  #image-modal-wrapper .photo-caption,
  #image-modal-wrapper .text-center {
    font-size: 0.9rem;
  }
}

