/* VideoPlayGrid Claude Styles */

/* Grid Container */
/* Grid Container */
.video-play-grid {
  /* Removed column-count for Masonry */
  padding: 20px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  /* Include padding in width */
}

/* Grid Items */
.grid-item {
  display: block;
  float: left;
  /* Ensure horizontal layout */
  width: 20%;
  /* 5 columns by default */
  padding: 0 10px;
  /* Gap handling for Masonry */
  margin-bottom: 20px;
  /* break-inside: avoid; - Not needed for Masonry */
  /* background: #fff; - Moved to inner content */
  /* border-radius: 12px; - Moved to inner content */
  /* box-shadow: ... - Moved to inner content */
  /* overflow: hidden; - Moved to inner content */
  /* transition: ... - Moved to inner content */
  /* cursor: pointer; - Moved to inner content */
  box-sizing: border-box;
}

.grid-item-inner {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.grid-item-inner:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.grid-item-content {
  position: relative;
}

/* Images */
.grid-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Text Content */
.grid-item-text {
  padding: 15px;
}

.grid-item h2 {
  margin: 0 0 10px 0;
  font-size: 1.2em;
  font-weight: 600;
  line-height: 1.3;
  color: #333;
}

.grid-item .post-date {
  margin: 0 0 10px 0;
  font-size: 0.85em;
  color: #666;
  font-weight: 500;
}

.grid-item .post-excerpt {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.5;
  color: #555;
}

/* Video Popup Overlay */
#video-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-content {
  position: relative;
  width: 87%;
  height: 87%;
  max-width: 1200px;
  max-height: 675px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

/* Close Button */
.close-video {
  position: absolute;
  top: -40px;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100000;
}

.close-video:hover {
  background: #fff;
  transform: scale(1.1);
}

/* Video Container */
.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

/* Video Iframe */
#video-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Navigation Buttons */
.prev-video,
.next-video {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100000;
}

.prev-video {
  left: 20px;
}

.next-video {
  right: 20px;
}

.prev-video:hover,
.next-video:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

/* Responsive Design */

/* 4 columns for smaller tablets */
@media (max-width: 991px) {
  .grid-item {
    width: 25%;
  }

  .popup-content {
    width: 90%;
    height: 90%;
  }

  .prev-video,
  .next-video {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .prev-video {
    left: 15px;
  }

  .next-video {
    right: 15px;
  }
}

/* 3 columns for small tablets */
@media (max-width: 768px) {
  .grid-item {
    width: 33.333%;
  }

  .grid-item-text {
    padding: 12px;
  }

  .grid-item h2 {
    font-size: 1.1em;
  }

  .popup-content {
    width: 95%;
    height: 85%;
  }

  .prev-video,
  .next-video {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .prev-video {
    left: 10px;
  }

  .next-video {
    right: 10px;
  }

  .close-video {
    width: 35px;
    height: 35px;
    font-size: 20px;
    top: -35px;
  }
}

/* 2 columns for mobile landscape */
@media (max-width: 576px) {
  .grid-item {
    width: 50%;
  }

  .grid-item {
    margin-bottom: 15px;
  }

  .grid-item-text {
    padding: 10px;
  }

  .grid-item h2 {
    font-size: 1em;
    margin-bottom: 8px;
  }

  .grid-item .post-date {
    font-size: 0.8em;
    margin-bottom: 8px;
  }

  .grid-item .post-excerpt {
    font-size: 0.85em;
  }
}

/* 1 column for mobile portrait */
@media (max-width: 400px) {
  .grid-item {
    width: 100%;
  }

  .popup-content {
    width: 98%;
    height: 80%;
  }

  .prev-video,
  .next-video {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .prev-video {
    left: 5px;
  }

  .next-video {
    right: 5px;
  }

  .close-video {
    width: 30px;
    height: 30px;
    font-size: 18px;
    top: -30px;
  }
}

/* Print styles */
@media print {
  #video-popup {
    display: none !important;
  }
}