/**
 * SAM ANGELO PHOTOGRAPHY & FILMS
 * Portfolio, Featured Editorial Grid & Lightbox (Points 18–24)
 */

/* ==========================================================================
   Featured Work Asymmetrical Layout (Points 18–19)
   ========================================================================== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
  align-items: stretch;
}

.featured-item {
  position: relative;
  overflow: hidden;
  background-color: var(--surface);
  cursor: pointer;
  border-radius: var(--radius-xs);
}

.featured-item-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.featured-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.85s var(--ease-editorial), filter 0.6s ease;
  will-change: transform;
}

/* Hover effect on desktop (Point 20) */
@media (hover: hover) and (pointer: fine) {
  .featured-item:hover img {
    transform: scale(1.038);
  }
}

.featured-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(29, 32, 32, 0.05) 0%,
    rgba(29, 32, 32, 0.1) 50%,
    rgba(29, 32, 32, 0.7) 100%
  );
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0.95;
  transition: opacity 0.4s ease;
}

.featured-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.featured-item-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--white);
}

.featured-item-category {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--surface-soft);
}

.featured-item-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 400;
  color: var(--white);
  line-height: 1.15;
}

.featured-item-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(247, 244, 238, 0.7);
  display: flex;
  gap: 1rem;
}

/* Asymmetric Grid Spans */
.featured-item-lead {
  grid-column: span 7;
  aspect-ratio: 4 / 3;
}

.featured-item-tall {
  grid-column: span 5;
  aspect-ratio: 3 / 4;
}

.featured-item-detail-1 {
  grid-column: span 4;
  aspect-ratio: 4 / 5;
}

.featured-item-detail-2 {
  grid-column: span 4;
  aspect-ratio: 4 / 5;
}

.featured-item-film {
  grid-column: span 4;
  aspect-ratio: 4 / 5;
}

.featured-item-wide {
  grid-column: span 12;
  aspect-ratio: 21 / 9;
}

/* ==========================================================================
   Portfolio Category Rail (Point 21)
   ========================================================================== */
.portfolio-rail-wrapper {
  position: relative;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.portfolio-rail {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.5rem 0;
  user-select: none;
  cursor: grab;
}

.portfolio-rail::-webkit-scrollbar {
  display: none;
}

.portfolio-rail:active {
  cursor: grabbing;
}

.rail-category-btn {
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  position: relative;
  padding: 0.6rem 0;
  background: none;
  border: none;
  transition: color var(--duration-quick) ease;
}

.rail-category-btn.active {
  color: var(--ink);
}

.rail-category-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-warm);
}

/* ==========================================================================
   Portfolio Viewer & Directional Mask (Points 22–23)
   ========================================================================== */
.portfolio-viewer {
  position: relative;
  width: 100%;
  margin-top: 1.5rem;
}

.viewer-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 720px;
  background-color: var(--surface);
  overflow: hidden;
  border-radius: var(--radius-xs);
}

.viewer-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.65s var(--ease-editorial),
              transform 0.65s var(--ease-editorial),
              visibility 0.65s var(--ease-editorial);
  will-change: transform, opacity;
}

.viewer-slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.viewer-slide.slide-out-left {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-5%);
}

.viewer-slide.slide-out-right {
  opacity: 0;
  visibility: hidden;
  transform: translateX(5%);
}

/* Ambient luxury blurred background for mixed portrait/landscape ratios */
.viewer-slide-backdrop {
  position: absolute;
  top: -15%;
  left: -15%;
  width: 130%;
  height: 130%;
  background-size: cover;
  background-position: center;
  filter: blur(32px) brightness(0.32) saturate(1.2);
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
}

/* Base image styling */
.viewer-slide-image,
.viewer-slide img {
  position: relative;
  z-index: 2;
  transition: transform 0.4s var(--ease-editorial);
}

/* Wide / Landscape slide: clean edge-to-edge coverage */
.viewer-slide.is-landscape .viewer-slide-image,
.viewer-slide.is-landscape img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Portrait slide: preserve full vertical aspect ratio without cropping faces */
.viewer-slide.is-portrait .viewer-slide-image,
.viewer-slide.is-portrait img {
  max-width: 90%;
  max-height: 94%;
  width: auto;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-xs);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.viewer-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.viewer-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.viewer-item-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--ink);
}

.viewer-item-meta {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.viewer-navigation {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.viewer-counter {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.viewer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background-color: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-xs);
  transition: all var(--duration-quick) ease;
}

.viewer-btn:hover {
  background-color: var(--surface);
  border-color: var(--ink);
}

/* ==========================================================================
   Full-Screen Lightbox (Point 24)
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: rgba(13, 15, 14, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem var(--gutter);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--cinema-ink);
  z-index: 10;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--stone);
}

.lightbox-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cinema-ink);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.5rem;
}

.lightbox-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  overflow: hidden;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: var(--shadow-cinema);
  border-radius: var(--radius-xs);
  transition: transform 0.3s ease;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(21, 24, 23, 0.7);
  border: 1px solid var(--cinema-line);
  color: var(--cinema-ink);
  border-radius: var(--radius-xs);
  transition: background-color var(--duration-quick) ease;
  z-index: 15;
}

.lightbox-nav-btn:hover {
  background-color: rgba(247, 244, 238, 0.15);
}

.lightbox-prev-btn {
  left: 1rem;
}

.lightbox-next-btn {
  right: 1rem;
}

.lightbox-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: var(--cinema-ink);
  padding-top: 1rem;
  border-top: 1px solid var(--cinema-line);
  z-index: 10;
}

.lightbox-caption {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--cinema-ink);
}

.lightbox-subcaption {
  font-size: 0.75rem;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
