/* ============================================
   Video Module Styles
   Base styles for video functionality
   Can be inherited by child themes
   ============================================ */

/* Video Detail Page - Play Button Container */
.gh-video-container {
  margin: 4rem 0 2rem;
  position: relative;
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.gh-video-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.gh-video-thumbnail {
  width: 100%;
  height: auto;
  display: block;
}

.gh-video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gh-video-play-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Video Tags Filter */
.gh-video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-light-gray);
}

.gh-video-tag {
  display: inline-block;
  padding: 6px 16px;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--color-primary-text);
  background-color: var(--color-lighter-gray);
  border: none;
  border-radius: 20px;
  text-transform: capitalize;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gh-video-tag:hover {
  background-color: var(--color-light-gray);
  opacity: 1;
}

.gh-video-tag.active {
  background-color: var(--ghost-accent-color);
  color: var(--color-white);
}

/* Video Grid Styles */
.gh-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 400px);
  gap: 32px;
  margin-bottom: 48px;
  justify-content: center;
}

.gh-video-card {
  width: 100%;
  max-width: 400px;
}

.gh-video-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.gh-video-card-link:hover {
  opacity: 1;
}

.gh-video-card-link:hover .gh-video-card-title {
  color: var(--ghost-accent-color);
}

.gh-video-card-link:hover .gh-video-card-play {
  transform: translate(-50%, -50%) scale(1.1);
}

.gh-video-card-image {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background-color: var(--color-light-gray);
}

.gh-video-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gh-video-card-link:hover .gh-video-card-image img {
  transform: scale(1.05);
}

.gh-video-card-no-image {
  background: linear-gradient(
    135deg,
    var(--color-darker-gray) 0%,
    var(--color-secondary-text) 100%
  );
}

.gh-video-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.gh-video-card-content {
  padding: 16px 0;
}

.gh-video-card-title {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-video-card-date {
  font-size: 1.2rem;
  color: var(--color-secondary-text);
  text-transform: uppercase;
}

/* Video pagination */
.gh-pagination {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-light-gray);
}

.gh-pagination-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gh-pagination-prev,
.gh-pagination-next {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--color-darker-gray);
}

.gh-pagination-prev:hover,
.gh-pagination-next:hover {
  color: var(--ghost-accent-color);
}

.gh-pagination-position {
  font-size: 1.3rem;
  color: var(--color-secondary-text);
}

/* Two-column layout for video-related posts */
body[class*='tag-video'] .gh-main {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
}

.gh-video-layout {
  display: flex;
  gap: 3rem;
  max-width: 1200px;
  width: 100%;
  align-items: flex-start;
}

.gh-video-layout .gh-article {
  flex: 1;
  min-width: 0;
}

.gh-video-layout .gh-related-sidebar {
  width: 400px;
  flex-shrink: 0;
  display: block;
}

.gh-video-layout .gh-related-sidebar .gh-read-next {
  position: sticky;
  top: 2rem;
}

.gh-video-layout .gh-read-next.gh-canvas {
  max-width: 400px;
  padding: 0;
}

/* Comments should not be affected by video layout */
.gh-comments.gh-read-next.gh-canvas {
  max-width: none;
  width: 100%;
  margin-top: 3rem;
}

.gh-related-sidebar {
  display: none;
}

.gh-main:not(:has([class*='tag-video'])) .gh-related-sidebar {
  display: none;
}

.gh-main:has([class*='tag-video']) .gh-article-sidebar {
  display: none;
}

/* Responsive styles */
@media (max-width: 767px) {
  .gh-video-tags {
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
  }

  .gh-video-tag {
    padding: 5px 12px;
    font-size: 1.3rem;
  }

  .gh-video-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .gh-video-card {
    max-width: none;
    width: 90vw;
  }

  .gh-video-card-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 900px) {
  .gh-video-layout {
    flex-direction: column;
  }

  .gh-video-layout .gh-related-sidebar {
    width: 100%;
  }

  .gh-video-layout .gh-related-sidebar .gh-read-next {
    position: static;
  }
}

main.gh-main > article.tag-video > header.gh-canvas > figure.gh-article-image > img {
  display: none;
}