/* SciHelp v3 refinements: seamless waves and code-driven interactive sections. */

.site-topbar {
  overflow: hidden;
}

.site-topbar__marquee {
  width: 100%;
  min-height: 38px;
  overflow: hidden;
}

.site-topbar__marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  min-height: 38px;
  white-space: nowrap;
  animation: scihelp-announcement 36s linear infinite;
}

.site-topbar__marquee-set {
  display: flex;
  flex: none;
  align-items: center;
  gap: clamp(48px, 7vw, 110px);
  padding-right: clamp(48px, 7vw, 110px);
}

.site-topbar__marquee-set span {
  position: relative;
  font-weight: 850;
  letter-spacing: .05em;
}

.site-topbar__marquee-set span::before {
  position: absolute;
  left: calc(-1 * clamp(31px, 4vw, 64px));
  content: "✦";
  color: var(--sh-sun);
}

@keyframes scihelp-announcement {
  to { transform: translateX(-50%); }
}

/* The wave sits over the previous colour instead of leaving a cream margin. */
.scihelp-wave-top,
.scihelp-paper-top,
.scihelp-home-help,
.scihelp-home-reviews,
.scihelp-front-page .site-main > .scihelp-section:nth-child(3),
.scihelp-front-page .site-main > .scihelp-section:nth-child(6) {
  margin-top: 0 !important;
}

.scihelp-wave-top::before,
.scihelp-paper-top::before,
.scihelp-home-help::before,
.scihelp-home-reviews::before {
  z-index: 3;
}

.scihelp-section {
  overflow: visible;
}

.scihelp-home-help,
.scihelp-home-about,
.scihelp-home-courses,
.scihelp-home-reviews,
.scihelp-home-pricing,
.scihelp-home-contact {
  padding-top: clamp(105px, 10vw, 145px);
}

/* Keep the following section's raised wave clear of the final content row. */
.scihelp-home-stats {
  padding-bottom: clamp(130px, 12vw, 180px);
}

.scihelp-home-courses {
  padding-bottom: clamp(140px, 13vw, 190px);
}

.scihelp-home-help--text-only .scihelp-grid-3 {
  gap: 24px;
}

.scihelp-home-help--text-only .scihelp-card {
  min-height: 190px;
  padding: clamp(23px, 2.6vw, 30px);
}

.scihelp-home-help--text-only .scihelp-card::before {
  display: none;
}

.scihelp-home-help--text-only .scihelp-card h3 {
  margin-bottom: 10px;
}

.scihelp-home-help--text-only .scihelp-card p:last-child {
  line-height: 1.56;
}

.scihelp-home-help .hero-actions,
.scihelp-home-reviews .hero-actions,
.scihelp-reviews-page-section .hero-actions,
.scihelp-reviews-page-section .wp-block-buttons {
  margin-top: 58px;
}

.scihelp-section .scihelp-grid-2 + .hero-actions,
.scihelp-section .scihelp-grid-3 + .hero-actions,
.scihelp-section .scihelp-grid-4 + .hero-actions {
  margin-top: 52px;
}

.scihelp-home-pricing .scihelp-single-cta {
  justify-content: center;
  margin-top: 36px;
}

.scihelp-home-pricing .scihelp-single-cta .wp-block-button__link {
  min-width: min(100%, 245px);
  background: var(--sh-forest);
  border-color: var(--sh-forest);
  box-shadow: 0 7px 0 #0a2420;
}

.scihelp-home-pricing .scihelp-single-cta .wp-block-button__link:hover {
  background: var(--sh-berry);
  border-color: var(--sh-berry);
  box-shadow: 0 11px 0 #8d3037;
}

.scihelp-course-marquees {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-top: 38px;
  margin-left: -50vw;
  padding: 12px 0 30px;
  display: grid;
  gap: clamp(22px, 2.2vw, 30px);
  overflow: hidden;
}

.scihelp-course-row {
  width: 100%;
  padding: 2px 0 8px;
  overflow: hidden;
}

.scihelp-course-track {
  display: flex;
  width: max-content;
  animation: scihelp-courses-left 52s linear infinite;
  will-change: transform;
}

.scihelp-course-row--right .scihelp-course-track {
  animation-name: scihelp-courses-right;
}

.scihelp-course-row:nth-child(3) .scihelp-course-track {
  animation-duration: 57s;
}

.scihelp-course-row:nth-child(4) .scihelp-course-track {
  animation-duration: 48s;
}

.scihelp-course-marquees:hover .scihelp-course-track,
.scihelp-course-marquees:focus-within .scihelp-course-track {
  animation-play-state: paused;
}

.scihelp-tutoring-expertise {
  padding-bottom: clamp(92px, 9vw, 130px);
}

.scihelp-tutoring-expertise .scihelp-course-marquees {
  margin-top: 34px;
}

.scihelp-tutoring-expertise .hero-actions {
  justify-content: center;
  margin-top: 48px;
}

.scihelp-course-set {
  display: flex;
  flex: none;
  align-items: center;
  gap: 13px;
  padding-right: 13px;
}

.scihelp-course-pill {
  display: inline-flex;
  align-items: center;
  min-height: 45px;
  padding: 9px 17px;
  color: var(--sh-forest);
  font-size: .88rem;
  font-weight: 850;
  white-space: nowrap;
  background: var(--sh-sun);
  border: 2px solid var(--sh-forest);
  border-radius: 999px;
  box-shadow: 4px 5px 0 var(--sh-forest);
}

.scihelp-course-row:nth-child(2) .scihelp-course-pill {
  background: var(--sh-orange);
}

.scihelp-course-row:nth-child(3) .scihelp-course-pill {
  background: var(--sh-cream);
}

.scihelp-course-row:nth-child(4) .scihelp-course-pill {
  background: var(--sh-leaf);
}

@keyframes scihelp-courses-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes scihelp-courses-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* One card system serves the home slider and the complete Reviews page. */
.scihelp-review-slider {
  --review-visible: 4;
  --review-gap: 22px;
  width: 100%;
}

.scihelp-review-track {
  display: flex;
  align-items: flex-start;
  gap: var(--review-gap);
  padding: 12px 8px 26px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.scihelp-review-track::-webkit-scrollbar {
  display: none;
}

.scihelp-review-track .scihelp-review-card {
  flex: 0 0 calc((100% - (var(--review-visible) - 1) * var(--review-gap)) / var(--review-visible));
  scroll-snap-align: start;
}

.scihelp-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 34px 26px;
}

.scihelp-review-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 365px;
  padding: 28px 24px;
  color: var(--sh-ink);
  background: var(--sh-cream);
  border: 3px solid var(--sh-forest);
  border-radius: 26px;
  box-shadow: 6px 8px 0 var(--sh-forest);
}

.scihelp-review-card.is-collapsible {
  height: 365px;
}

.scihelp-review-card.is-expanded {
  height: auto;
  min-height: 365px;
  transform: none !important;
  z-index: 4;
}

.scihelp-review-card:nth-child(n) {
  transform: none;
}

.scihelp-review-card:hover {
  transform: translateY(-5px) rotate(-.5deg);
}

.scihelp-review-card h3 {
  margin: 0 0 13px;
  color: var(--sh-berry);
}

.scihelp-review-stars {
  margin-bottom: 15px;
  color: var(--sh-berry);
  font-size: 1.25rem;
  letter-spacing: .1em;
}

.scihelp-review-copy {
  margin: 0;
  line-height: 1.55;
}

.scihelp-review-card.is-collapsible .scihelp-review-copy {
  max-height: 10.8em;
  overflow: hidden;
}

.scihelp-review-card.is-expanded .scihelp-review-copy {
  max-height: none;
  overflow: visible;
}

.scihelp-review-toggle {
  align-self: flex-start;
  padding: 4px 0;
  margin-top: auto;
  color: var(--sh-forest);
  font: 850 .88rem/1.3 var(--sh-body);
  text-decoration: underline;
  text-underline-offset: 4px;
  background: none;
  border: 0;
  cursor: pointer;
}

.scihelp-review-toggle:hover {
  color: var(--sh-berry);
}

.scihelp-review-toggle[hidden] {
  display: none;
}

.scihelp-review-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  gap: 18px;
}

.scihelp-review-arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--sh-forest);
  font: 900 1.45rem/1 var(--sh-body);
  background: var(--sh-sun);
  border: 2px solid var(--sh-forest);
  border-radius: 50%;
  box-shadow: 3px 4px 0 var(--sh-forest);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.scihelp-review-arrow:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 4px 7px 0 var(--sh-forest);
}

.scihelp-review-arrow:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.scihelp-review-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 300px;
  gap: 8px;
}

.scihelp-review-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  background: var(--sh-cream);
  border: 2px solid var(--sh-forest);
  border-radius: 50%;
  cursor: pointer;
}

.scihelp-review-dot[aria-current="true"] {
  width: 28px;
  background: var(--sh-sun);
  border-radius: 999px;
}

.site-brand--footer + p {
  margin-top: 28px;
}

/* About: two parallel timelines inside one shared card. */
.scihelp-about-page .scihelp-section.scihelp-soft .scihelp-grid-2,
.scihelp-dual-timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(24px, 4vw, 62px);
  padding: clamp(24px, 4vw, 52px);
  background: var(--sh-cream);
  border: 3px solid var(--sh-forest);
  border-radius: 30px;
  box-shadow: 9px 11px 0 var(--sh-forest);
}

.scihelp-about-page .scihelp-section.scihelp-soft .scihelp-grid-2 > .scihelp-panel,
.scihelp-dual-timeline > .scihelp-panel {
  height: auto;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none !important;
}

.scihelp-about-page .scihelp-section.scihelp-soft .scihelp-grid-2 > .scihelp-panel:hover,
.scihelp-dual-timeline > .scihelp-panel:hover {
  border: 0;
  box-shadow: none;
  transform: none !important;
}

.scihelp-dual-timeline .scihelp-timeline,
.scihelp-about-page .scihelp-section.scihelp-soft .scihelp-timeline {
  margin-left: 9px;
  padding-left: 23px;
  border-left: 4px solid var(--sh-deep-teal);
}

.scihelp-dual-timeline .scihelp-timeline li,
.scihelp-about-page .scihelp-section.scihelp-soft .scihelp-timeline li {
  padding-left: 14px;
}

.scihelp-dual-timeline .scihelp-timeline li::before,
.scihelp-about-page .scihelp-section.scihelp-soft .scihelp-timeline li::before {
  left: -32px;
}

@media (max-width: 1099px) {
  .scihelp-review-slider { --review-visible: 3; }
  .scihelp-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 799px) {
  .scihelp-review-slider { --review-visible: 2; }
  .scihelp-course-pill { font-size: .82rem; }
  .scihelp-about-page .scihelp-section.scihelp-soft .scihelp-grid-2,
  .scihelp-dual-timeline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 599px) {
  .site-topbar__marquee-track {
    font-size: .72rem;
  }

  .scihelp-home-help,
  .scihelp-home-about,
  .scihelp-home-courses,
  .scihelp-home-reviews,
  .scihelp-home-pricing,
  .scihelp-home-contact {
    padding-top: 92px;
  }

  .scihelp-home-stats {
    padding-bottom: 108px;
  }

  .scihelp-home-courses {
    padding-bottom: 122px;
  }

  .scihelp-course-marquees {
    gap: 20px;
    padding-bottom: 24px;
  }

  .scihelp-review-slider { --review-visible: 1; --review-gap: 26px; }
  .scihelp-review-grid { grid-template-columns: 1fr; gap: 30px; }
  .scihelp-review-card { min-height: 345px; padding: 25px 22px; }
  .scihelp-review-card.is-collapsible { height: 345px; }
  .scihelp-review-card.is-expanded { height: auto; min-height: 345px; }
  .scihelp-review-controls { gap: 12px; }
  .scihelp-review-dots { max-width: 225px; gap: 6px; }
  .scihelp-review-dot { width: 9px; height: 9px; }
  .scihelp-review-dot[aria-current="true"] { width: 20px; }
  .scihelp-home-help .hero-actions,
  .scihelp-home-reviews .hero-actions,
  .scihelp-reviews-page-section .hero-actions,
  .scihelp-reviews-page-section .wp-block-buttons { margin-top: 54px; }
}

@media (max-width: 380px) {
  .scihelp-review-controls { gap: 8px; }
  .scihelp-review-arrow { width: 42px; height: 42px; }
  .scihelp-review-dots { max-width: 170px; gap: 4px; }
  .scihelp-review-dot { width: 7px; height: 7px; }
  .scihelp-review-dot[aria-current="true"] { width: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-topbar__marquee-track,
  .scihelp-course-track {
    animation: none !important;
    transform: none !important;
  }

  .scihelp-course-row {
    overflow-x: auto;
  }

  .scihelp-course-set[aria-hidden="true"] {
    display: none;
  }

  .scihelp-review-track {
    scroll-behavior: auto;
  }
}
