/* Modern layout and accessibility layer for the ChinaGoforit video library. */
:root {
  --brand-blue: #234f78;
  --brand-gold: #9a6500;
  --page-bg: #f4f6f8;
  --card-text: #243342;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--card-text);
  background: var(--page-bg);
  font-size: 16px;
}

.hero {
  padding: 18px 24px 0;
  background: #fff;
}

.hero-banner {
  display: block;
  width: min(100%, 1050px);
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
}

main.second.clearfix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.second > header {
  grid-column: 1 / -1;
  margin-bottom: 10px;
}

.second h1 {
  color: var(--brand-gold);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
}

.video {
  float: none;
  width: auto;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dfe4e8;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(22, 45, 68, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.video:hover,
.video:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(22, 45, 68, 0.16);
}

.video figure,
.video figure a {
  position: relative;
}

.video figure a::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: rgba(15, 54, 88, 0.82);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -45%);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.video figure a:hover::after,
.video figure a:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.video img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 220ms ease, opacity 220ms ease;
}

.video:hover img {
  transform: scale(1.025);
}

.videoTitle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 12px;
  color: var(--card-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

a:focus-visible {
  outline: 3px solid #f3b61f;
  outline-offset: 3px;
}

footer {
  padding: 26px 16px;
  color: #fff;
  background: var(--brand-blue);
}

footer p {
  width: auto;
  margin: 0;
  padding: 0;
}

.scroll-top {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
}

@media (max-width: 1024px) {
  main.second.clearfix {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hero {
    padding: 10px 10px 0;
  }

  .hero-banner {
    border-radius: 6px;
  }

  main.second.clearfix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 30px 14px 48px;
  }
}

@media (max-width: 480px) {
  main.second.clearfix {
    grid-template-columns: 1fr;
  }

  .video {
    width: 100%;
  }

  .videoTitle {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    transition: none !important;
  }
}
