/* ============================================================
   Our Work page (portfolio.php only). Loaded after styles.css.
   ============================================================ */

/* ---------- Filters ---------- */
.work-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 40px; }
.work-filter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 1px solid var(--gray-300); border-radius: 999px; background: #fff; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--gray-700); transition: background .15s, color .15s, border-color .15s;
}
.work-filter span { font-size: 14px; font-weight: 700; color: var(--gray-500); }
.work-filter:hover { border-color: var(--accent); color: var(--accent); }
.work-filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.work-filter.active span { color: rgba(255,255,255,.8); }

/* ---------- Grid ---------- */
.work-item.is-hidden { display: none; }
.work-item.is-in { animation: workIn .35s ease both; }
@keyframes workIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.work-tile {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  border-radius: 16px; overflow: hidden; background: var(--gray-200);
  box-shadow: 0 10px 30px rgba(17,17,17,.08); transition: transform .25s ease, box-shadow .25s ease;
}
.work-tile img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .5s ease; }
.work-tile:hover, .work-tile:focus-visible { transform: translateY(-4px); box-shadow: 0 22px 50px rgba(110,26,55,.2); }
.work-tile:hover img, .work-tile:focus-visible img { transform: scale(1.04); }
.work-tile-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px; text-align: left;
  background: linear-gradient(to top, rgba(17,6,11,.88), rgba(17,6,11,0));
  opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease;
}
.work-tile:hover .work-tile-info, .work-tile:focus-visible .work-tile-info { opacity: 1; transform: none; }
.work-tile-cat { display: block; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-soft); }
.work-tile-client { display: block; font-size: 16px; font-weight: 700; color: #fff; line-height: 1.3; }
@media (hover: none) { .work-tile-info { opacity: 1; transform: none; } }

.work-web-link { margin-top: 64px; text-align: center; }
.work-web-link p { font-size: 18px; color: var(--gray-600); margin-bottom: 18px; }

/* ---------- Lightbox ---------- */
.work-modal .modal-dialog { max-width: min(560px, calc(100vw - 32px)); }
.work-modal .modal-content { position: relative; background: #141215; border: 0; border-radius: 20px; overflow: hidden; }
.work-modal-stage { position: relative; background: #000; }
.work-modal-stage img { display: block; width: 100%; height: auto; max-height: 76vh; object-fit: contain; }
.work-modal-caption { padding: 18px 24px 22px; }
.work-modal-caption h2 { color: #fff; font-size: 24px; margin: 4px 0 2px; }
.work-modal-caption p { color: var(--on-dark-muted); font-size: 16px; margin: 0; }
.work-modal-close, .work-modal-nav {
  position: absolute; z-index: 2; width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20,18,21,.72); color: #fff; font-size: 18px; transition: background .15s;
}
.work-modal-close:hover, .work-modal-nav:hover { background: var(--accent); }
.work-modal-close { top: 12px; right: 12px; }
.work-modal-nav { top: 50%; margin-top: -24px; }
.work-modal-prev { left: 12px; }
.work-modal-next { right: 12px; }
.work-modal + .modal-backdrop, .modal-backdrop.show { opacity: .85; }

@media (prefers-reduced-motion: reduce) {
  .work-item.is-in { animation: none; }
}
