/* =============================================================
   PRAXIS TUITION — Global Stylesheet
   Tailwind handles most styling. This file covers:
   - Smooth scroll
   - Navbar transparency / scroll state
   - Active nav link underline
   - Hero backgrounds (brand red)
   - Fade-in animations
   - Page hero banners for inner pages
   - Misc utilities

   BRAND PALETTE (extracted from praxis.sg Instagram)
   --praxis-red:    #C8391A  — dominant red, hero backgrounds & CTAs
   --praxis-cream:  #F5EDE0  — warm parchment, light section backgrounds
   --praxis-dark:   #3D1010  — near-black maroon, text on cream
   --praxis-white:  #FFFFFF  — text on red backgrounds
   ============================================================= */

/* ---- Base ---- */
html {
  scroll-behavior: smooth;
}

/* ---- Navbar ---- */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: #C8391A;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

/* Mobile menu */
#navbar.menu-open {
  background: #C8391A; 
  box-shadow: none;
}

/* Mobile dropdown smooth slide */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity    0.25s ease;
}
#mobile-menu.menu-open {
  max-height: 320px;
  opacity: 1;
}

/* ---- Hamburger → × morph ---- */
.hamburger-line {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  transform-box: view-box;
  transform-origin: center;
}
#navbar.menu-open .hamburger-top { transform: rotate(45deg)  translateY(6px);  }
#navbar.menu-open .hamburger-mid { transform: scaleX(0); opacity: 0;           }
#navbar.menu-open .hamburger-bot { transform: rotate(-45deg) translateY(-6px); }

/* Nav link — slide-in underline on hover, always-on for active page */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: #F2A99A;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-link:hover::after,
.nav-active::after {
  transform: scaleX(1);
}

/* Mobile dropdown — underline scoped to text width via inner span */
.mobile-nav-text {
  position: relative;
  display: inline-block;
}
.mobile-nav-text::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #F2A99A;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.mobile-nav-link:hover .mobile-nav-text::after,
.mobile-nav-link.nav-active .mobile-nav-text::after {
  transform: scaleX(1);
}

/* Typography */
h1, h2, h3, h4, h5, h6,
#navbar *,
button,
label,
select {
  font-family: "Times New Roman", Times, Georgia, serif;
}

/* ---- Title Styling ---- */
/* h1, h2 */
.page-label,
.subpage-label,
.subpage-label-light {
  font-size: 3rem;
  line-height: 1.25; 
  font-weight: 500; 
  letter-spacing: -0.05em; 
}
.page-label {
  color: #DEC4A8;
}
.subpage-label { color: #A32D12; }
.subpage-label-light { color: #ECD9C4; }


.section-label,
.section-label-light {
  font-weight: 600;
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.section-label       { color: #D95030; } /* brand-500 */
.section-label-light { color: #FFFFFF; } /* accent / cream-200 */

/* ---- Icon box (12×12, brand-100 bg, rounded-xl) ---- */
.icon-box {
  width: 3rem;
  height: 3rem;
  background-color: #FADADD; /* brand-100 */
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- Hero backgrounds ---- */

/* Home page — deep red to brand red, subtle warmth */
.hero-home {
  background: linear-gradient(160deg, #3D1007 0%, #C8391A 55%, #D95030 100%);
}

/* Inner pages — slightly flatter for editorial feel */
.hero-inner {
  background: linear-gradient(160deg, #3D1007 0%, #C8391A 75%);
}

/* ---- Fade-in scroll animation ---- */
.fade-in {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.15s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Diagonal slash slide-in ---- */
/* Control direction per-element via --slide-from:
     left   →  --slide-from: translateX(-100%)   (default)
     right  →  --slide-from: translateX(100%)
     top    →  --slide-from: translateY(-100%)
     bottom →  --slide-from: translateY(100%)
     diagonal → --slide-from: translate(-100%, -100%)  etc. */
.slash-overlay {
  transform: var(--slide-from, translateX(-100%));
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.slash-overlay.visible {
  transform: translate(0, 0);
}

/* ---- Resource cards ---- */
.resource-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px #d94f3020;
}

/* ---- Typewriter cursor ---- */
.typewriter-cursor {
  display: inline-block;
  color: #F5EDE0;           /* cream — matches text-cream-200 */
  font-weight: 300;
  margin-left: 1px;
  animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.typewriter-cursor.typing {
  animation: none;
  opacity: 1;
}

#typewriter-text {
  -webkit-font-smoothing: antialiased;
}

/* Testimonial scroll */
.testimonial-marquee-outer {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.testimonial-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: testimonial-scroll 64s linear infinite;
}

.testimonial-card {
  width: 26rem;
  flex-shrink: 0;
  background: #F5EDE0;
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid #ECD9C4;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}

.testimonial-card > div:last-child {
  margin-top: auto;
}

@media (hover: hover) {
  .testimonial-card:hover {
    transform: translateY(-1%) scale(1.02);
    box-shadow: 0 5px 20px #d94f3020;
  }
}

.testimonial-quote-wrap {
  position: relative;
  max-height: 7rem;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.testimonial-quote-wrap::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5rem;
  background: linear-gradient(to bottom, transparent, #F5EDE0);
  pointer-events: none;
}

.testimonial-read-more {
  font-size: 0.75rem;
  font-weight: 600;
  color: #C8391A;
  margin-bottom: 1rem;
}

@keyframes testimonial-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---- Testimonials page grid cards (non-expandable) ---- */
.testimonials-grid-card {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}

@media (hover: hover) {
  .testimonials-grid-card:hover {
    transform: translateY(-3%) scale(1.02);
    box-shadow: 0 14px 30px #d94f3020;
  }
}

/* ---- Testimonials cards ---- */
.tgc-front {
  background: #ECD9C4;
  border-radius: 1rem;
  padding: 2rem;
  cursor: pointer;
  height: 100%;
  box-sizing: border-box;
  box-shadow: 5px 5px 10px #5c17089e;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease, opacity 0.3s ease;
}

.tgc-front.tgc-shrunk {
  transform: scale(0.7);
  opacity: 0;
  pointer-events: none;
}

.tgc-front.tgc-static {
  cursor: default;
}

@media (hover: hover) {
  .tgc-front:not(.tgc-static):hover {
    transform: translate(5px, 5px);
    box-shadow: 2px 2px 4px #5C1808;
  }
}

.tgc-read-hint {
  font-size: 0.75rem;
  font-weight: 600;
  color: #A32D12;
  margin-bottom: 1.5rem;
  transition: color 0.15s ease;
}

.tgc-front:not(.tgc-static):hover .tgc-read-hint {
  color: #E8795E;
}

#tgc-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(1px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#tgc-modal.show {
  opacity: 1;
  pointer-events: auto;
}

#tgc-modal-inner {
  position: relative;
  background: #F5EDE0;
  border-radius: 1.25rem;
  padding: 2.5rem;
  padding-top: 3rem;
  max-width: 36rem;
  width: calc(100% - 2.5rem);
  max-height: calc(100dvh - 4rem);
  overflow-y: auto;
  box-sizing: border-box;
  box-shadow: 0 24px 64px rgba(61, 16, 7, 0.25);
  transform: scale(0.4);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.25, 0.64, 1), opacity 0.15s ease;
}

#tgc-modal.show #tgc-modal-inner {
  transform: scale(1);
  opacity: 1;
}

#tgc-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.4rem;
  line-height: 1;
  color: #A32D12;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.55;
  transition: opacity 0.15s;
}

#tgc-modal-close:hover { opacity: 1; }

/* ---- Class structure stacked cards ---- */
.stacked-card,
.stacked-card-dark {
  position: relative;
  isolation: isolate;
}

.stacked-card::before,
.stacked-card::after,
.stacked-card-dark::before,
.stacked-card-dark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  z-index: -1;
}

.stacked-card::before,
.stacked-card::after {
  background: #ECD9C4;
}
.stacked-card-dark::before,
.stacked-card-dark::after {
  background: #DEC4A8;
}

.stacked-card::before,
.stacked-card-dark::before {
  opacity: 0.7;
  transform: translate(7px, -7px);
}

.stacked-card::after,
.stacked-card-dark::after {
  opacity: 0.45;
  transform: translate(14px, -14px);
}

/* ---- about.html styling ---- */

/*Vision photo*/
.vision-photo {
  overflow: hidden;  
  box-shadow: 7px 7px 10px #5C1808;
}

/*Tutor cards*/
.tutor-card-stack {
  position: relative;
  border-radius: 1rem;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  margin-bottom: 0.75rem;
}

.tutor-info-icon {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
  width: 1.5rem;
  height: 1.5rem;
  background: rgba(61, 16, 7, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F5EDE0;
  transition: background 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .tutor-card-stack:hover .tutor-info-icon {
    background: rgba(200, 57, 26, 0.9);
    transform: scale(1.15);
  }
}

.tutor-photo-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 1rem;
  overflow: hidden;
}

.tutor-info-wrap {
  display: none;
}

/* ---- Tutor info modal ---- */
#tutor-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#tutor-modal.show {
  opacity: 1;
  pointer-events: auto;
}

#tutor-modal-inner {
  position: relative;
  background: #ECD9C4;
  border-radius: 1.25rem;
  padding: 2rem 2rem 1.75rem;
  max-width: 32rem;
  width: calc(100% - 2.5rem);
  box-shadow: 0 24px 64px rgba(61, 16, 7, 0.25);
  transform: scale(0.4);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.25, 0.64, 1), opacity 0.15s ease;
}

#tutor-modal.show #tutor-modal-inner {
  transform: scale(1);
  opacity: 1;
}

#tutor-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.4rem;
  line-height: 1;
  color: #A32D12;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.55;
  transition: opacity 0.15s;
}
#tutor-modal-close:hover { opacity: 1; }

/* ---- FAQ accordion ---- */

/* Smooth dropdown via max-height instead of display:none */
.faq-answer {
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity    0.35s ease;
  max-height: 400px;
  opacity: 1;
}
.faq-answer.hidden {
  display: block !important;
  max-height: 0 !important;
  opacity: 0;
}

/* + icon — scale + drop-shadow directly on the shape, rotate when open */
.faq-icon {
  flex-shrink: 0;
  transition: transform 0.25s ease, filter 0.2s ease;
}
.faq-question:hover .faq-icon {
  transform: scale(1.2);
  filter: drop-shadow(0 3px 6px rgba(200, 57, 26, 0.45));
}
.faq-icon.open {
  transform: rotate(45deg);
}
.faq-question:hover .faq-icon.open {
  transform: rotate(45deg) scale(1.2);
}

/* ---- Service cards ---- */
.service-card {
  transition: box-shadow 0.2s ease;
}
.service-card:hover {
  box-shadow: 0 8px 32px rgba(200, 57, 26, 0.12);
}

/* ---- Resource inline carousel ---- */
#rc-stage {
  position: relative;
  display: grid;
  grid-template-columns: 14% 1fr 14%;
  align-items: stretch;
  overflow: hidden;
}

/* Gradient fades blending peek images into the cream background */
#rc-stage::before,
#rc-stage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20%;
  z-index: 2;
  pointer-events: none;
}
#rc-stage::before {
  left: 0;
  background: linear-gradient(to right, #F5EDE0 30%, transparent 100%);
}
#rc-stage::after {
  right: 0;
  background: linear-gradient(to left, #F5EDE0 30%, transparent 100%);
}

/* Peek panels */
.rc-peek {
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.rc-peek:hover { opacity: 0.78; }
.rc-peek.rc-hidden { opacity: 0; pointer-events: none; }

#rc-peek-prev { justify-content: flex-end; }
#rc-peek-next { justify-content: flex-start; }

.rc-peek img {
  height: 65%;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 0.5rem;
}

/* Main image */
#rc-main-cell {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.5rem;
  height: 48vh;
}

@media (min-width: 1024px) {
  #rc-main-cell {
    height: 60vh;
  }
}

#rc-main-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: none;
  transition: box-shadow 0.6s ease;
}

#resource-carousel.visible #rc-main-img {
  box-shadow: 14px 14px 10px rgba(61, 16, 7, 0.18);
}

/* Navigation arrows */
#rc-prev-btn,
#rc-next-btn {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  box-shadow: 0 2px 12px rgba(61, 16, 7, 0.15);
  color: #C8391A;
  font-size: 1.8rem;
  display: flex;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
#rc-prev-btn:hover,
#rc-next-btn:hover {
  box-shadow: 0 4px 20px rgba(61, 16, 7, 0.22);
  transform: scale(1.08);
}
#rc-prev-btn { left: 0.75rem; }
#rc-next-btn { right: 0.75rem; }
#rc-prev-btn:disabled,
#rc-next-btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

/* Caption */
#rc-caption {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  text-align: center;
}

#rc-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.rc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(200, 57, 26, 0.25);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.rc-dot.rc-dot-active {
  background: #C8391A;
  transform: scale(1.35);
}

@media (max-width: 768px) {
  #rc-stage {
    grid-template-columns: 1fr;
  }
  #rc-peek-prev,
  #rc-peek-next {
    display: none;
  }
  #rc-stage::before,
  #rc-stage::after {
    display: none;
  }
}

/* ---- PDF viewer modal ---- */
#pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(20, 6, 3, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
#pdf-modal.show {
  opacity: 1;
  pointer-events: auto;
}
#pdf-modal-inner {
  position: relative;
  width: min(92vw, 920px);
  height: 88vh;
  background: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}
#pdf-modal.show #pdf-modal-inner {
  transform: scale(1);
}
#pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
#pdf-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  z-index: 1;
  font-size: 1.4rem;
  line-height: 1;
  color: #A32D12;
  background: #fff;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  opacity: 0.6;
  transition: opacity 0.15s;
}
#pdf-modal-close:hover { opacity: 1; }

