:root {
  --plyr-color-main: #FF0000;
}

/* 1. FILTER BUTTONS */
.gallery-filter {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 8px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
  font-family: var(--heading-font);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent-color); /* Your theme color */
  color: white;
  border-color: var(--accent-color);
}

/* 2. BENTO GRID LAYOUT */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 280px;
  gap: 20px;
  grid-auto-flow: dense; /* The magic 'tetris' packer */
}

/* 3. BENTO ITEM CARD */
.bento-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #eee;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.5s forwards;
}

.bento-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.bento-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

/* Hover Zoom */
.bento-item:hover img {
  transform: scale(1.05);
}

/* 4. BLACK TRANSPARENT OVERLAY */
.bento-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  color: white;
  pointer-events: none;
  z-index: 2;
}

.bento-content h4 {
  margin: 0;
  font-size: 1.1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  color: #fff;
}

.bento-content span {
  font-size: 0.85rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 5. VIDEO PLAY BUTTON */
.play-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 68px; height: 48px;
  background: #FF0000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  border: none;
  pointer-events: none;
  z-index: 3;
  transition: transform 0.3s;
}
.bento-item:hover .play-icon {
  transform: translate(-50%, -50%) scale(1.1);
  background: #CC0000;
}

/* 6. AUTOMATIC SIZING (The 'Pinterest' Pattern) */
@media (min-width: 768px) {
  /* Every 5th item is WIDE */
  .bento-item:nth-child(5n) { grid-column: span 2; }
  /* Every 9th item is TALL */
  .bento-item:nth-child(9n) { grid-row: span 2; }
  /* Every 13th item is BIG (2x2) */
  .bento-item:nth-child(13n) { grid-column: span 2; grid-row: span 2; }
}

/* Mobile Fix */
@media (max-width: 767px) {
  .bento-grid { grid-template-columns: 1fr; }
}

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.hidden { display: none; }