/* ==========================================================================
   KALIUM VISUALS THEATER & CINEMA GALLERY DESIGN SYSTEM
   Award-Winning Video Editor & Motion Designer Portfolio Standard
   ========================================================================== */

/* --- ROOT VARIABLES --- */
:root {
  --vis-bg: #070708;
  --vis-surface: #0D0D11;
  --vis-surface-hover: #141418;
  --vis-border: rgba(255, 255, 255, 0.08);
  --vis-border-hover: rgba(255, 255, 255, 0.20);
  --vis-accent: #D6241D;
  --vis-text: #FAFAFA;
  --vis-text-muted: rgba(255, 255, 255, 0.55);
}

/* --- HERO CONTRAST & PAVILION --- */
.hero-contrast-veil {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 8, 0.65);
  z-index: 2;
  pointer-events: none;
}

/* --- FEATURED COMMERCIAL & MOTION STAGE --- */
.featured-commercial-stage {
  margin-bottom: 2.5rem;
}

.fcs-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 8px;
}

.fcs-title {
  font-family: var(--k-font-display, 'Nohemi', sans-serif);
  font-weight: 900;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #FAFAFA;
  margin: 0;
}

.fcs-sub {
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  font-size: 0.85rem;
  color: var(--vis-text-muted);
  margin-top: 4px;
}

/* Featured Commercials Grid: 2 Columns on Desktop */
.fcs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.featured-media-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--vis-surface);
  border: 1px solid var(--vis-border);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.featured-media-card:hover {
  border-color: var(--vis-border-hover);
  transform: translateY(-3px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.7);
}

.featured-media-card.aspect-16-9 {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.featured-media-card.aspect-9-16 {
  aspect-ratio: 9 / 16;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.featured-media-card.aspect-4-5 {
  aspect-ratio: 4 / 5;
  width: 100%;
}

.featured-media-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  display: block;
}

.featured-media-card video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  display: block;
}

.featured-media-card .fmc-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.featured-media-card.is-hovering .fmc-poster-img {
  opacity: 0;
}

.fmc-play-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 8, 0) 40%, rgba(7, 7, 8, 0.92) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  z-index: 3;
  transition: background 0.25s ease;
}

.featured-media-card:hover .fmc-play-overlay {
  background: linear-gradient(180deg, rgba(7, 7, 8, 0) 25%, rgba(7, 7, 8, 0.96) 100%);
}

.fmc-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FAFAFA;
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  width: fit-content;
  backdrop-filter: blur(8px);
}

.fmc-meta-title {
  color: #FAFAFA;
  font-family: var(--k-font-display, 'Nohemi', sans-serif);
  font-weight: 900;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.fmc-meta-sub {
  color: var(--vis-text-muted);
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  font-size: 0.8rem;
  line-height: 1.3;
}

/* Play Indicator Cue */
.fmc-hover-cue {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(7, 7, 8, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FAFAFA;
  font-size: 11px;
  opacity: 0.85;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  z-index: 4;
}

.featured-media-card:hover .fmc-hover-cue {
  background: #FFFFFF;
  color: #070708;
  border-color: #FFFFFF;
  transform: scale(1.1);
  opacity: 1;
}

/* --- VERTICAL SHORTFORM REELS GRID (True 9:16 Aspect) --- */
#visualsVideoGrid.video-grid {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

#visualsVideoGrid .media-card {
  position: relative;
  border-radius: 20px;
  background: var(--vis-surface);
  border: 1px solid var(--vis-border);
  aspect-ratio: 9 / 16 !important;
  height: auto !important;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

#visualsVideoGrid .media-card:hover {
  border-color: var(--vis-border-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

#visualsVideoGrid .media-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#visualsVideoGrid .media-card:hover img {
  transform: scale(1.04);
}

#visualsVideoGrid .media-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 7, 8, 0) 50%, rgba(7, 7, 8, 0.94) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.1rem;
  z-index: 3;
}

#visualsVideoGrid .media-label {
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.3;
  color: #FAFAFA;
}

.media-badge-tag {
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--vis-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* Mobile Hidden Toggle */
#visualsVideoGrid.is-collapsed .mobile-hidden-edit {
  display: none !important;
}

.load-more-edits-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.load-more-edits-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FAFAFA;
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-more-edits-btn:hover {
  background: #FFFFFF;
  color: #070708;
  border-color: #FFFFFF;
}

/* --- CINEMA THEATER MODAL (Full Viewport Master Lightbox) --- */
#kaliumCinemaTheater {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 8, 0.96);
  backdrop-filter: blur(28px);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(16px, 2.5vw, 32px);
  transition: opacity 0.25s ease;
  color: #FAFAFA;
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  overflow: hidden;
  box-sizing: border-box;
}

#kaliumCinemaTheater.is-open {
  opacity: 1;
  pointer-events: auto;
}

.theater-top-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  z-index: 10;
  padding-bottom: 8px;
}

.theater-brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theater-brand-cluster img {
  height: 22px;
  width: auto;
}

.theater-brand-title {
  font-family: var(--k-font-display, 'Nohemi', sans-serif);
  font-weight: 900;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #FFFFFF;
}

.theater-status-chip {
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--vis-text-muted);
}

.theater-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FAFAFA;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap !important;
  transition: all 0.2s ease;
}

.theater-close-btn:hover {
  background: #FFFFFF;
  color: #070708;
  border-color: #FFFFFF;
}

.theater-stage-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
  padding: 1rem 0;
}

.theater-media-frame {
  position: relative;
  height: 100%;
  max-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9);
}

.theater-media-frame video,
.theater-media-frame img {
  max-height: calc(100vh - 200px);
  max-width: 90vw;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.theater-bottom-dock {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  z-index: 10;
}

.theater-transport-bar {
  background: rgba(13, 13, 17, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(16px);
}

.theater-dock-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FAFAFA;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--k-font-body, 'Neue Montreal', sans-serif);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theater-dock-btn:hover {
  background: #FFFFFF;
  color: #070708;
  border-color: #FFFFFF;
}

.theater-scrub-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
}

.theater-scrub-fill {
  height: 100%;
  background: #D6241D;
  border-radius: 999px;
  width: 0%;
}

.theater-dock-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--vis-text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

.theater-dock-title {
  font-family: var(--k-font-display, 'Nohemi', sans-serif);
  font-weight: 900;
  color: #FFFFFF;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 1024px) {
  .fcs-grid {
    grid-template-columns: 1fr;
  }
  #visualsVideoGrid.video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  #visualsVideoGrid.video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  .featured-media-card {
    border-radius: 16px;
  }
}
