/* Sticky cards – core curriculum (horizontal scroll, sticky to left) */
.sticky-cards-section {
  max-width: none;
  width: 100%;
  padding: var(--spacing-2xl) 0 var(--spacing-px-60);
  padding-left: 0;
  padding-right: 0;
}

/* Certificates: less gap above cards (intro is the previous section) */
#certificates-cards.sticky-cards-section {
  padding-top: var(--spacing-lg);
}

/* Project types: smaller gap below cards before next section (section is .sticky-cards-section like dual enrollment) */
#project-types.section.sticky-cards-section {
  padding-bottom: var(--spacing-md);
}
/* Tighten gap above Types of Projects (when it follows The Project Cycle) */
#project-cycle + #project-types.section {
  padding-top: var(--spacing-lg);
}
/* Tighten gap between Types of Projects and Sample Student Projects */
#project-types + #sample-student-projects.section {
  padding-top: var(--spacing-lg);
}

/* Viewport = content height (JS sets to tallest card); arrows float on right */
.sticky-cards-viewport {
  position: relative;
  width: 100%;
  overflow: visible;
}

.sticky-cards-wrapper {
  flex-shrink: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 2rem var(--spacing-3xl);
  padding-right: 2rem; /* JS sets exact value so last card can reach left with no extra gap */
  gap: 20px;
  font-family: 'Work Sans', sans-serif;
  box-sizing: border-box;
}

.sticky-cards-wrapper::-webkit-scrollbar {
  display: none;
}

/* Cell is the flex item that scrolls; card fills cell (no stacking, no vertical movement) */
/* Mobile first: wider cards on small screens */
.sticky-card-cell {
  flex: 0 0 auto;
  width: 78vw;
  min-width: 78vw;
  height: 100%;
  align-self: stretch;
  display: flex;
}

@media (min-width: 768px) {
  /* Tablet: ~2.5 cards visible */
  .sticky-card-cell {
    width: 38vw;
    min-width: 38vw;
  }
}

@media (min-width: 1024px) {
  /* Desktop: ~2.2 cards visible */
  .sticky-card-cell {
    width: 45vw;
    min-width: 45vw;
  }
}

.sticky-card {
  position: relative; /* in flow = no vertical movement */
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border-secondary);
  border-radius: 10px;
  box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);
  padding: 40px;
  box-sizing: border-box;
  color: var(--color-text-primary);
  overflow: hidden;
}

.sticky-card > a {
  margin-top: auto;
  align-self: flex-start;
}

.sticky-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.sticky-card-bg svg,
.sticky-card-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.sticky-card > h2,
.sticky-card > p,
.sticky-card > a,
.sticky-card > div:not(.sticky-card-bg) {
  position: relative;
  z-index: 1;
}

/* Mobile only: row height = tallest card */
@media (max-width: 767px) {
  .sticky-card-cell {
    height: auto;
    min-height: 0;
    align-self: stretch;
  }

  .sticky-card {
    flex: 0 0 auto;
    min-height: auto;
  }
}

.sticky-card h2 {
  padding: 0;
  margin: 0 0 var(--spacing-lg);
  font-family: 'Poppins', sans-serif;
}

.sticky-card span {
  display: block;
  font-size: 14px;
  color: var(--color-accent);
}

.sticky-card p {
  margin: 0;
  color: var(--color-text-primary);
  line-height: 1.5;
}

/* Arrow nav stacked vertically, floated on far right of viewport */
.sticky-cards-arrows {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 200;
  pointer-events: none;
  background: none;
  border: none;
  box-shadow: none;
}

/* Tablet/phone: override global nav styles so arrows stay visible and in-section (position: absolute, not fixed) */
@media (max-width: 1024px) {
  .sticky-cards-section nav.sticky-cards-arrows {
    position: absolute !important;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%) !important;
    -webkit-transform: translateY(-50%) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    isolation: auto !important;
    overflow: visible !important;
  }
  .sticky-cards-section nav.sticky-cards-arrows .sticky-cards-arrow {
    pointer-events: auto;
  }
}

.sticky-cards-arrows .sticky-cards-arrow {
  pointer-events: auto;
  width: 3rem;
  min-width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: rgba(26, 26, 26, 0.9);
  color: var(--color-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  outline: none;
  box-shadow: none;
}

.sticky-cards-arrows .sticky-cards-arrow:focus {
  outline: none;
}

.sticky-cards-arrows .sticky-cards-arrow:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.sticky-cards-arrows .sticky-cards-arrow:hover {
  background: var(--color-accent);
  color: var(--color-text-primary);
}

.sticky-cards-arrows .sticky-cards-arrow i {
  font-size: 1.5rem;
}
