/* ============================================================
   gallery.css — Shared masonry gallery + lightbox
   Claudia Illanes Portfolio

   Used by Selected Work AND Advertising. A vertical "masonry"
   built with CSS multi-columns: images keep their own aspect
   ratio, flow down responsive columns, never distort each other.
   Add data-captions="1" on .work-masonry to show a small title
   under each image (Advertising).
   ============================================================ */

.work-masonry {
  column-count: 4;
  column-gap: 14px;
}

.work-item {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 14px;
  display: block;
  cursor: pointer;
  position: relative;
  padding: 0;
  border: none;
  background: none;
  width: 100%;
}

.work-item img {
  width: 100%;
  display: block;
  border: 0px solid var(--clr-border-strong);
  transition: opacity var(--ease);
}

.work-item:hover img { opacity: 0.8; }

/* Small title under the image (Advertising only) */
.work-caption {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--clr-text);
  text-align: center;
}

.work-empty {
  color: var(--clr-text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* ─────────────── LIGHTBOX ─────────────── */
.work-lightbox .modal-dialog {
  display: flex;
  width: auto;
  max-width: 96vw;
  padding: 0;
  overflow: hidden;
}

.work-lb-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 12px;
}

.work-lb-img {
  display: block;
  max-height: 86vh;
  max-width: 62vw;
  width: auto;
  height: auto;
  object-fit: contain;
}

.work-lb-info {
  width: 320px;
  flex-shrink: 0;
  padding: 2.2rem 1.7rem;
  border-left: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.work-lb-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.work-lb-desc {
  font-size: 0.85rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--clr-text-sub);
  white-space: pre-wrap;
}

.work-lb-source {
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clr-text);
  border: 1px solid var(--clr-border-strong);
  padding: 0.55rem 0.9rem;
  transition: background var(--ease), color var(--ease);
}

.work-lb-source:hover { background: var(--clr-text); color: #fff; }
.work-lb-source svg { width: 11px; height: 11px; }

/* When a photo has no info at all → just the image + a little margin */
.work-lightbox.no-info .work-lb-info { display: none; }

/* ─────────────── RESPONSIVE ─────────────── */
@media (max-width: 1200px) { .work-masonry { column-count: 3; } }
@media (max-width: 768px)  { .work-masonry { column-count: 2; } }
@media (max-width: 440px)  { .work-masonry { column-count: 1; } }

@media (max-width: 820px) {
  .work-lightbox .modal-dialog { flex-direction: column; max-width: 94vw; }
  .work-lb-img { max-width: 90vw; max-height: 62vh; }
  .work-lb-info {
    width: auto;
    border-left: none;
    border-top: 1px solid var(--clr-border);
    padding: 1.4rem;
  }
}
