@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.videos-main {
  padding: var(--space-16) var(--space-8);
  min-height: calc(
    var(--viewport-height) - var(--content-top-offset) -
      var(--content-bottom-offset)
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.videos-main::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: var(--videos-hero-overlay-height);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--youtube-red) 10%, transparent),
    color-mix(in srgb, var(--clr-yellow-400) 10%, transparent),
    color-mix(in srgb, var(--share-blue) 10%, transparent)
  );
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
  pointer-events: none;
  opacity: 0.3;
}
h1 {
  font-size: var(--space-12);
  margin-bottom: var(--space-2);
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--youtube-red),
    var(--clr-yellow-400),
    var(--clr-blue-400)
  );
  background-size: 200% 200%;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
  z-index: var(--z-base);
}
.lead {
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  font-size: var(--size-r-1-2);
}
.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-md);
  margin-top: var(--space-12);
}
.video-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow:
    var(--videos-card-shadow-base),
    0 0 0 var(--size-1) var(--card-border);
  transition:
    transform 0.4s,
    box-shadow 0.4s,
    border-color 0.4s,
    background-color 0.4s;
  border: var(--size-1) solid var(--card-border);
  overflow: hidden;
  position: relative;
}
.video-card::before {
  content: '';
  position: absolute;
  inset: calc(var(--space-1) * -1);
  background: linear-gradient(
    135deg,
    var(--youtube-red),
    var(--clr-yellow-400),
    var(--clr-blue-400)
  );
  border-radius: var(--radius-xl);
  opacity: 0;
  z-index: var(--z-behind);
  transition: opacity 0.4s;
}
.video-card:hover {
  transform: translateY(calc(var(--size-12) * -1)) scale(1.02);
  box-shadow:
    var(--videos-card-shadow-hover),
    0 0 var(--size-40) color-mix(in srgb, var(--youtube-red) 45%, transparent);
}
.video-card:hover::before {
  opacity: 0.6;
}
.video-card h2 {
  font-size: var(--size-r-1-5);
  margin: 0 0 var(--size-r-1) 0;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-primary);
}
.embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--size-6);
}
.embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-desc {
  margin-top: var(--size-r-0-75);
  color: var(--text-secondary);
}
.gmb-note {
  margin-top: var(--space-12);
  padding: var(--space-8);
  background: var(--bg-primary);
  border-left: var(--size-4) solid var(--accent);
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
}
.video-error {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  background: var(--bg-primary);
  border-left: var(--size-4) solid
    color-mix(in srgb, var(--clr-red-500) 80%, white);
  color: color-mix(in srgb, var(--clr-red-500) 70%, white);
  border-radius: var(--radius-xl);
}
.video-note {
  margin: var(--space-8) 0;
  padding: var(--size-r-1-25);
  background: var(--bg-primary);
  border-left: var(--size-4) solid var(--clr-yellow-400);
  color: var(--text-secondary);
  border-radius: var(--radius-xl);
}
.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  background-size: cover;
  background-position: center center;
  background-color: var(--surface-toast-bg);
  border-radius: var(--radius-xl);
  cursor: pointer;
  outline: none;
  transition: transform 0.3s ease;
}

.video-thumb img {
  transition: opacity 0.3s ease;
}

.video-thumb img[data-loaded='error'] {
  opacity: 0;
}
.video-thumb:focus {
  box-shadow: 0 0 0 var(--size-4)
    color-mix(in srgb, var(--youtube-red) 30%, transparent);
  transform: translateY(calc(var(--size-2) * -1));
}
.video-thumb:hover {
  transform: scale(1.05);
}
.video-thumb .play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--videos-play-button-size);
  height: var(--videos-play-button-size);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--youtube-red) 90%, transparent),
    color-mix(in srgb, var(--clr-red-600) 80%, transparent)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 var(--size-10) var(--size-30)
      color-mix(in srgb, var(--youtube-red) 50%, transparent),
    0 0 var(--size-40) color-mix(in srgb, var(--youtube-red) 30%, transparent);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  animation: pulse 2s ease-in-out infinite;
}

.video-thumb:hover .play-button {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow:
    0 var(--size-15) var(--size-40)
      color-mix(in srgb, var(--youtube-red) 70%, transparent),
    0 0 var(--size-60) color-mix(in srgb, var(--youtube-red) 50%, transparent);
  animation: none;
}

.video-thumb .play-button svg {
  width: var(--videos-play-icon-size);
  height: var(--videos-play-icon-size);
  fill: var(--clr-white);
  filter: var(--videos-icon-drop-shadow);
}
.video-meta {
  margin-top: var(--size-r-1);
}
.video-info .pub-date {
  color: var(--text-secondary);
  font-size: var(--size-r-1);
  font-weight: 500;
}
.video-actions a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}
.video-actions a:hover {
  color: var(--clr-white);
  text-decoration: underline;
}
.video-actions .page-link {
  display: inline-block;
  margin-left: var(--size-r-0-75);
  padding: var(--size-r-0-3) var(--size-r-0-6);
  border-radius: var(--size-6);
  background: color-mix(in srgb, var(--clr-white) 2%, transparent);
  color: var(--text-secondary);
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.video-actions .page-link:hover {
  background: var(--accent);
  color: var(--clr-white);
}

/* Responsive grid tweaks */
@media (min-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-md);
  }
  .video-card {
    min-height: var(--size-400);
  }
}

@media (min-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-md);
  }

  .lead {
    margin-bottom: var(--size-r-0-75);
  }

  .video-card {
    min-height: var(--size-450);
  }
}

@media (min-width: 1400px) {
  .container {
    width: min(100%, var(--container-width));
  }
}
.videos-header-actions {
  margin-bottom: var(--space-12);
  position: relative;
  z-index: var(--z-base);
}

.btn-subscribe,
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-xs);
  background: linear-gradient(135deg, var(--youtube-red), var(--clr-red-600));
  color: var(--clr-white);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--size-r-1-125);
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 var(--size-8) var(--size-24)
      color-mix(in srgb, var(--youtube-red) 35%, transparent),
    var(--videos-button-inset-shadow);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-subscribe::before,
.btn-share::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--clr-white) 30%, transparent);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s ease,
    height 0.6s ease;
}

.btn-subscribe:hover::before,
.btn-share:hover::before {
  width: var(--size-300);
  height: var(--size-300);
}

.btn-subscribe:hover,
.btn-share:hover {
  transform: translateY(calc(var(--size-4) * -1)) scale(1.05);
  box-shadow:
    0 var(--size-12) var(--size-32)
      color-mix(in srgb, var(--youtube-red) 50%, transparent),
    0 0 var(--size-20) color-mix(in srgb, var(--youtube-red) 30%, transparent);
}

.btn-subscribe:active,
.btn-share:active {
  transform: translateY(calc(var(--size-2) * -1)) scale(1.02);
}

.btn-share {
  background: linear-gradient(135deg, var(--share-blue), var(--clr-blue-400));
  box-shadow:
    0 var(--size-8) var(--size-24)
      color-mix(in srgb, var(--share-blue) 35%, transparent),
    var(--videos-button-inset-shadow);
}

.btn-share:hover {
  box-shadow:
    0 var(--size-12) var(--size-32)
      color-mix(in srgb, var(--share-blue) 50%, transparent),
    0 0 var(--size-20) color-mix(in srgb, var(--share-blue) 30%, transparent);
}

.btn-subscribe svg,
.btn-share svg {
  width: var(--size-24);
  height: var(--size-24);
  fill: var(--clr-white);
  position: relative;
  z-index: var(--z-base);
}
.lead.small {
  color: var(--text-secondary);
  font-size: var(--size-r-1);
  margin: 0;
}
/* Mobile adjustments for header height */
@media (width <= 900px) {
  .videos-main {
    min-height: calc(var(--viewport-height) - var(--menu-height));
  }
}
