/* float-image.css — narrative floating images for person pages */

.float-image {
  margin: 0.5em 0;
  padding: 0;
  width: 40%;
  max-width: 360px;
  min-width: 200px;
}

/* Odd images float right, even float left */
.float-image:nth-of-type(odd) {
  float: right;
  margin: 0.25em 0 0.75em 1.5em;
}

.float-image:nth-of-type(even) {
  float: left;
  margin: 0.25em 1.5em 0.75em 0;
}

.float-image-frame {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.float-image-frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.7) brightness(0.9);
  transition: filter 0.3s ease;
}

.float-image-frame:hover img {
  filter: saturate(0.85) brightness(0.95);
}

/* Caption: hidden overlay on desktop, revealed on hover */
.float-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6em 0.75em;
  background: rgba(0, 0, 0, 0.75);
  color: #ccc;
  font-size: 0.8rem;
  line-height: 1.3;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.float-image-frame:hover .float-image-caption {
  transform: translateY(0);
}

/* Clear floats after article content */
#article-content::after {
  content: "";
  display: table;
  clear: both;
}

/* Mobile: no float, full width, caption always visible */
@media (max-width: 720px) {
  .float-image {
    float: none !important;
    width: 100%;
    max-width: 100%;
    margin: 1em 0 !important;
  }

  .float-image-caption {
    position: static;
    transform: none;
    background: rgba(0, 0, 0, 0.5);
  }
}
