/* Subject pages: hover effects, scroll animations, "View All" levels, and the
   below-laptop video carousel. Loaded after subject/style.css. */

/* ---------- Scroll reveal (only active once JS has run) ---------- */
.js-reveal-ready .reveal {
  opacity: 0;
  translate: 0 26px;
  transition: opacity 0.6s ease, translate 0.6s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--reveal-i, 0) * 90ms);
}
.js-reveal-ready .reveal.is-visible { opacity: 1; translate: none; }

/* ---------- Buttons ---------- */
.subject-page .btn,
.subject-page .btn-submit,
.subject-page .quiz-continue {
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.subject-page .btn:hover,
.subject-page .btn-submit:hover,
.subject-page .quiz-continue:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(11, 31, 63, 0.45);
}

/* ---------- Hero ---------- */
.pill-tag { transition: background-color 0.25s ease, transform 0.25s ease, border-color 0.25s ease; }
.pill-tag:hover { transform: translateY(-2px); }
.quiz-card { transition: box-shadow 0.3s ease, transform 0.3s ease; }
.quiz-card:hover { box-shadow: 0 30px 60px -28px rgba(11, 31, 63, 0.45); }
.quiz-option { transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.quiz-option:hover { transform: translateX(4px); box-shadow: inset 0 0 0 1.5px #5babe0; }

/* ---------- "What makes our tutoring different": every card identical, all hover ---------- */
.feature-card {
  background: var(--bg-light);
  border-color: var(--border);
  transition: background-color 0.35s ease, border-color 0.35s ease, transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease;
}
.feature-card h3, .feature-card p { transition: color 0.3s ease; }
.feature-card .feature-icon { transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), background-color 0.3s ease, border-color 0.3s ease; }
.feature-card:hover {
  background: var(--navy);
  border-color: var(--navy);
  transform: translateY(-6px);
  box-shadow: 0 24px 44px -22px rgba(11, 31, 63, 0.55);
}
.feature-card:hover h3, .feature-card:hover p { color: #fff; }
.feature-card:hover .feature-icon { transform: rotate(-8deg) scale(1.08); border-color: transparent; }

/* ---------- Levels carousel ---------- */
.level-card { transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease; }
.level-card .level-photo img { transition: transform 0.6s cubic-bezier(.2,.8,.2,1); }
.level-card:hover { transform: translateY(-6px); box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.45); }
.level-card:hover .level-photo img { transform: scale(1.06); }
.level-tag { transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.level-tag:hover { background: #5babe0; border-color: #5babe0; color: #fff; }
.level-tag:hover a { color: #fff !important; }
.carousel-nav button { transition: transform 0.2s ease, background-color 0.2s ease; }
.carousel-nav button:hover { transform: scale(1.1); }
.levels-view-all { cursor: pointer; border: none; }

/* "View All": show every level card in a grid instead of the carousel */
.levels-grid.is-expanded { grid-template-columns: 1fr; }
.levels-grid.is-expanded > div:first-child { max-width: 720px; }
.levels-grid.is-expanded .level-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  overflow: visible;
  padding-bottom: 8px;
}
.levels-grid.is-expanded .level-card { flex: none; }
.levels-grid.is-expanded .levels-carousel-controls { display: none; }
.levels-grid.is-expanded .level-card { animation: levelIn 0.5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--card-i, 0) * 70ms); }
@keyframes levelIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Testimonial videos ---------- */
.testimonial-fan .fan-photo { transition: transform 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s ease; }
.testimonial-fan .play-btn { transition: transform 0.25s ease, background-color 0.25s ease; }
.testimonial-fan .play-btn:hover { transform: translate(-50%, -50%) scale(1.12); }
.fan-slide { display: contents; }
.fan-arrow { display: none; }

@media (min-width: 1024px) {
  .testimonial-fan .fan-photo:hover { box-shadow: 0 22px 44px rgba(11, 31, 63, 0.4); }
  .testimonial-fan .fan-photo:not(.is-center):hover::after { background: rgba(0, 0, 0, 0.08); }
}

/* Below laptop size: one video per screen with left/right arrows */
@media (max-width: 1023px) {
  .testimonial-fan {
    height: auto;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    margin: 0 -24px;
    padding: 8px 0 16px;
  }
  .testimonial-fan::-webkit-scrollbar { display: none; }
  .fan-slide {
    display: flex;
    flex: 0 0 100%;
    justify-content: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }
  .testimonial-fan .fan-photo,
  .testimonial-fan .fan-photo.is-center {
    position: relative;
    transform: none !important;
    width: min(300px, 74vw);
    height: auto;
    aspect-ratio: 3 / 4;
    z-index: 1;
  }
  .testimonial-fan .fan-photo::after { background: transparent; }
  .testimonial-fan .fan-photo .play-btn { width: 60px; height: 60px; background: rgba(11, 31, 63, 0.55); }

  .fan-carousel { position: relative; }
  .fan-arrow {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--navy);
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 8px 22px rgba(11, 31, 63, 0.25);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  }
  .fan-arrow:hover { background: var(--navy); color: #fff; transform: translateY(-50%) scale(1.06); }
  .fan-arrow:disabled { opacity: 0.35; cursor: default; }
  .fan-arrow--prev { left: 0; }
  .fan-arrow--next { right: 0; }
  .testimonial-dots span { cursor: pointer; transition: width 0.3s ease, background-color 0.3s ease; }
}
@media (max-width: 480px) {
  .fan-arrow { width: 40px; height: 40px; font-size: 22px; }
}

/* ---------- States we serve ---------- */
.city-card img { transition: transform 0.6s cubic-bezier(.2,.8,.2,1); }
.city-card { transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease; }
.city-card:hover { transform: translateY(-6px); box-shadow: 0 26px 44px -22px rgba(11, 31, 63, 0.5); }
.city-card:hover img { transform: scale(1.07); }
.location-chip { transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease; }
.location-chip:hover { background: var(--navy); border-color: var(--navy); color: #fff; transform: translateY(-3px); }

/* ---------- Diagnostic ---------- */
.diagnostic-card { transition: transform 0.35s ease, box-shadow 0.35s ease; }
.diagnostic-card:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -26px rgba(0, 0, 0, 0.55); }
.diagnostic-list li { transition: transform 0.25s ease; }
.diagnostic-list li:hover { transform: translateX(6px); }
.diagnostic-check { transition: transform 0.3s cubic-bezier(.34,1.56,.64,1); }
.diagnostic-list li:hover .diagnostic-check { transform: scale(1.18); }

/* ---------- Consultation form ---------- */
.faq-card { transition: box-shadow 0.3s ease; }
.faq-card:hover { box-shadow: 0 30px 60px -28px rgba(20, 40, 80, 0.35); }
.faq-card input, .faq-card select, .faq-card textarea { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.faq-card input:focus, .faq-card select:focus, .faq-card textarea:focus {
  outline: none;
  border-color: #5babe0;
  box-shadow: 0 0 0 3px rgba(91, 171, 224, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal-ready .reveal { opacity: 1; translate: none; transition: none; }
  .levels-grid.is-expanded .level-card { animation: none; }
}
