/* ================================
   Videos page (migrated site)
   ================================ */

/* ---------- Category navigation ---------- */

.video-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
  justify-content: flex-start;
}

/* Safety reset (in case global styles touch lists) */
.video-categories ul,
.video-categories li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.video-categories button {
  appearance: none;
  background: #f3f3f3;
  border: 1px solid #ccc;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;

  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.2;
  color: #222;
}

.video-categories button:hover {
  background: #e9e9e9;
}

.video-categories button.active {
  background: #222;
  color: #fff;
  border-color: #222;
}

/* ---------- Video grid ---------- */

#video-grid {
  display: block;
}

.video-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.video-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.video-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.video-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.video-card h3 {
  font-size: 0.95rem;
  margin: 0.5rem 0.5rem 0.25rem;
  color: #111;
}

.video-card p {
  font-size: 0.8rem;
  margin: 0 0.5rem 0.5rem;
  color: #666;
}

/* ---------- Fullscreen Modal (video-first) ---------- */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
}

.modal.open {
  display: flex;
}

/* Full viewport container */
.modal-content {
  width: 100vw;
  height: 100vh;
  background: #000;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Title + meta (minimal vertical footprint) */
.modal-content h2,
.modal-content p {
  color: #fff;
  margin: 0.5rem 1rem 0;
  font-size: 0.9rem;
  line-height: 1.3;
}

/* Close button */
#modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 2;
}

#modal-close:hover {
  color: #ddd;
}

/* Video gets ALL remaining space */
.video-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* Video always fully visible, no scrollbars */
.video-wrapper iframe {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  border: 0;
}

/* ---------- Mobile tweaks ---------- */

@media (max-width: 600px) {
  .video-categories {
    gap: 0.4rem;
    justify-content: flex-start;
  }

  .video-categories button {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  /* Reduce title footprint on small screens */
  .modal-content h2,
  .modal-content p {
    font-size: 0.8rem;
  }
}

/* ---------- Category sections ---------- */

.video-category-section {
  margin-bottom: 3rem;
}

.video-category-title {
  margin: 2rem 0 1rem;
  font-size: 1.4rem;
  font-weight: 600;
}

/* ---------- Video card enhancements ---------- */

.video-thumb {
  position: relative;
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}
