/* Restore the published card interaction while retaining local typography. */
.classes-section {
  padding: 6rem 4rem;
  background-color: var(--white);
}

.classes-grid {
  gap: 2rem;
}

.class-card {
  cursor: pointer;
}

.class-title-overlay {
  bottom: 2rem;
  left: 2rem;
}

.class-hover-overlay.class-details {
  display: flex;
  padding: 2rem;
  color: var(--white);
}

/* Do not let a sticky touch hover reveal an inactive card. */
.class-card:hover .class-hover-overlay {
  opacity: 0;
}

.class-card.active .class-hover-overlay {
  opacity: 1;
}

.class-card.active .class-img {
  transform: scale(1.05);
  filter: blur(6px);
  opacity: 0.6;
}

.class-card.active .class-title-overlay {
  top: 2rem;
  bottom: auto;
}

@media (hover: hover) {
  .class-card:hover .class-hover-overlay {
    opacity: 1;
  }

  .class-card:hover .class-img {
    transform: scale(1.05);
    filter: blur(6px);
    opacity: 0.6;
  }

  .class-card:hover .class-title-overlay {
    top: 2rem;
    bottom: auto;
  }
}

.class-card-toggle {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.class-card-toggle:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: -6px;
}

@media (max-width: 768px) {
  .classes-section {
    padding: 3rem 1rem;
  }

  .class-title-overlay,
  .class-card.active .class-title-overlay {
    top: 1rem;
    bottom: auto;
    left: 1rem;
  }

  .class-hover-overlay.class-details {
    padding: 1rem;
  }
}

/* With scripting disabled, descriptions remain available without a control. */
html:not(.js) .class-hover-overlay {
  opacity: 1;
}

html:not(.js) .class-card-toggle {
  display: none;
}

html:not(.js) .class-title-overlay {
  top: 2rem;
  bottom: auto;
}

@media (prefers-reduced-motion: reduce) {
  .class-img,
  .class-hover-overlay,
  .class-title-overlay {
    transition: none;
  }
}
