/* ===== Global ===== */
html, body {
  margin: 0;
  padding: 0;
  text-align: center;
  font-family: 'Playfair Display', serif;
  overflow-x: hidden;

  background: linear-gradient(
   rgba(163,209,169,.55) 0%,
      rgba(36, 59, 39, 0.35) 10%,
      rgba(106, 42, 42, 0.55) 50%,
      rgba(38, 108, 71, 0.42) 75%,
      #000 100%
  );
  background-attachment: scroll;
  background-repeat: no-repeat;
  background-size: 100% auto;
  color: #ff101000;
}

/* Header */
.work-header { text-align:center; padding: 2rem 1rem 1rem; }
.our-work-title { margin:0; font-size: clamp(2.5rem, 6vw, 5rem); }

/* Filters */
.work-filters {
  display: flex;
  justify-content: center;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 2rem;
}

.filter-btn {
  background: none;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.15);
  padding: 0.5rem 1.5rem;
  font-size: 1.2rem;
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.5px;
  color: #bbb;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-btn:last-child {
  border-right: none;
}

.filter-btn:hover {
  color: #fff;
}

.filter-btn.is-active {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 600;
}

.filter-btn.alt-sound { color: #8BFF8B; }
.filter-btn.alt-sound.is-active {
  color: #5BFF17;
  text-shadow: 0 0 8px rgba(91,255,23,.35);
}

/* --- Mobile layout for filter buttons --- */
@media (max-width: 720px) {
  .work-filters {
    flex-wrap: wrap;                 /* allow buttons to wrap onto multiple rows */
    gap: 8px 12px;                   /* consistent spacing when wrapping */
    border-bottom: none;             /* remove long underline on small screens */
    padding: 0 12px;                 /* a little side breathing room */
  }
  .filter-btn {
    font-size: 0.95rem;              /* smaller labels */
    padding: 0.45rem 0.9rem;         /* compact hit target */
    border-right: none;              /* no vertical dividers when wrapping */
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;            /* pill buttons look better when wrapped */
  }
  .filter-btn.is-active {
    font-size: 0.98rem;              /* subtle weight without shifting row */
    font-weight: 600;
  }
}

/* Grid layout */
.video-section {
  display: grid;
  gap: 14px;
  padding: 0 24px 48px;
  width: min(98vw, 1680px);
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1200px) { .video-section { width: 100%; padding: 0 24px 40px; } }
@media (max-width: 760px)  { .video-section { grid-template-columns: 1fr; gap: 12px; } }

.video-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.video-wrap.hidden,
.video-wrap.hidden iframe,
.video-wrap.hidden video {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
}




.video-wrap .video-item {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  border-radius: 18px;
  transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  opacity: 0.90;
  transform: scale(1);
  position: relative;
  z-index: 1;
}

.video-wrap.active {
  grid-column: 1 / -1;
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 26px 48px rgba(0, 0, 0, 0.45);
  padding: 22px 22px 28px;
  background: rgba(8, 8, 8, 0.88);
  border-radius: 20px;
  z-index: 8;
}

.video-wrap.active .video-item,
.video-wrap.active iframe.video-item {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 18px rgba(255,255,255,0.16);
  border-radius: 16px;
}



@media (max-width: 720px) {
  .video-wrap.active {
    grid-column: auto;
    padding: 16px;
    transform: translateY(-4px) scale(1.01);
  }
}

.video-wrap .video-caption {
  width: 100%;
  padding: 8px 4px;
  text-align: left;
  position: relative;
  z-index: 2;
}
.video-caption .video-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 4px 0;
  color: #fff;
}
.video-caption .video-desc {
  font-size: 0.85rem;
  color: #bbb;
  margin: 0;
}

/* Hide captions for Sound clips */
.video-wrap[data-category="sound"] .video-caption { display: none !important; }

/* Sound category (vertical) */
.video-wrap[data-category="sound"] {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  justify-self: center;
  width: 100%;
  max-width: min(100%, 360px);
}
.video-wrap[data-category="sound"] .video-item {
  aspect-ratio: 9/16;
  border-radius: 18px;
  width: 100%;
  max-width: 360px;
  height: auto;
  max-height: calc((100vh - 200px) * 0.66);
}
.video-wrap[data-category="sound"] .video-caption { margin-top: 10px; }
.video-wrap[data-category="sound"].active .video-caption { margin-top: 22px; }
.video-wrap[data-category="sound"] .video-caption .video-title {
  color: #8BFF8B;
}

@media (max-width: 760px) {
  .video-wrap[data-category="sound"] {
    align-items: center;
    max-width: 100%;
  }
  .video-wrap[data-category="sound"] .video-item {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }
}

/* Denser grid for sound mode */
.video-section.sound-mode {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  justify-items: center;
  column-gap: 2px;
  padding-left: 8px;
  padding-right: 8px;
}
@media (max-width: 1024px) { .video-section.sound-mode { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .video-section.sound-mode { grid-template-columns: 1fr; } }

/* Fullscreen overlay */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.fullscreen-overlay.active { display: flex; }

.fullscreen-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(96vw, 1200px);
  max-width: 96vw;
  max-height: 90vh;
}

#fullscreenVideo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}

/* Restrict size for sound (vertical) videos */
.fullscreen-overlay[data-category="sound"] #fullscreenVideo {
  width: auto;
  height: 90vh;
  max-height: 90vh;
  max-width: 56vw;
  aspect-ratio: 9/16;
}

#closeFullscreen {
  position: absolute;
  top: -34px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

/* Native controls: hidden until hover */
.video-wrap .video-item[controls]::-webkit-media-controls {
  display: none !important;
}
.video-wrap .video-item[controls]:hover::-webkit-media-controls {
  display: flex !important;
}
