:root {
  --brand-red: #dc2626;
  /* tailwind red-600 */
  --brand-red-dark: #b91c1c;
  /* tailwind red-700 */
}

/* Mobile-first: Prevent horizontal scroll */
body {
  overflow-x: hidden;
  width: 100%;
}

/* Prevent layout shift when scrollbar appears */
html {
  overflow-y: scroll;
  /* Always show scrollbar gutter */
  scrollbar-gutter: stable;
}

/* Sticky footer - ensure footer always at bottom */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}

/* Shared navigation styling to reduce repeated utility classes */
.nav-link {
  display: inline-block;
  font-weight: 500;
  line-height: 1.25rem;
  transition: color .18s ease;
  /* Larger touch targets for mobile */
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--brand-red);
}

.nav-link:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--brand-red);
  color: #fff;
  padding: .55rem 1.05rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
  transition: background .18s ease, box-shadow .18s ease, transform .15s ease;
  /* Better touch target */
  min-height: 44px;
}

.nav-cta:hover {
  background: var(--brand-red-dark);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}

.nav-cta:active {
  transform: scale(0.98);
}

.nav-cta:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 3px;
}

/* Larger block variant for mobile menu */
.nav-cta-block {
  width: 100%;
  justify-content: center;
  padding: .8rem 1.2rem;
  font-size: 1rem;
}

/* Utility to hide with JS toggle (fallback keeps hidden if JS fails) */
.js-hidden {
  display: none;
}

/* Smooth disclosure animation for mobile nav */
#mobileNav {
  transition: max-height .35s ease, opacity .25s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

#mobileNav.open {
  max-height: 560px;
  opacity: 1;
}

/* Mobile menu button - better touch target */
#menuButton {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Small UI helpers for hero badges, stats and micro-animations */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem .6rem;
  border-radius: 9999px;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
  transition: transform .18s ease, opacity .18s ease
}

.pill:hover {
  transform: translateY(-3px)
}

.stat {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #f8fafc;
  color: #0f172a
}

.fade-in {
  animation: fadeUp .48s ease both
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* Simple tooltip using CSS */
.tooltip {
  position: relative;
  display: inline-block
}

.tooltip .tip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + .5rem);
  background: #111;
  color: #fff;
  padding: .35rem .5rem;
  border-radius: .375rem;
  font-size: .75rem;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .12s ease
}

.tooltip:hover .tip,
.tooltip:focus-within .tip {
  opacity: 1;
  pointer-events: auto
}

/* Speech-bubble CTA */
.bubble-cta {
  border-radius: 9999px;
  padding: .5rem .9rem;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  box-shadow: 0 6px 18px rgba(239, 68, 68, .12);
  transition: transform .14s ease
}

.bubble-cta:hover {
  transform: translateY(-3px) scale(1.02)
}

/* WhatsApp floating button */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: #25d366;
  border-radius: 50px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, .3);
  transition: all .3s ease
}

.whatsapp-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, .4)
}

@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px
  }
}

/* Tall background wrapper for hero + two scrolls */
/* UPDATED: Center positioning for better car visibility */
.bg-hero-stack {
  position: relative;
  background-image: url('../images/BACKGROUND-IMG.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center
}

/* Adds extra scroll so the background is visible beyond the hero */
.hero-scroll-extension {
  height: 200vh
}

/* Smooth transition to plain white after background section */
.bg-hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
  pointer-events: none
}

/* Subtle readable card for hero text on image */
.backdrop-card {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 16px;
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, .15);
  padding: 1.9rem 2.2rem 2.2rem;
  position: relative;
  max-width: 860px
}

/* Primary CTA style (bold, modern, with arrow) */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  padding: .95rem 1.35rem;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: .2px;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(239, 68, 68, .25), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(239, 68, 68, .35), inset 0 1px 0 rgba(255, 255, 255, .28)
}

.cta-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .14)
}

.cta-btn:hover .cta-arrow {
  background: rgba(255, 255, 255, .22)
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem
}

/* Hero upscale (desktop) to mimic 150% zoom visual weight */
@media (min-width:1024px) {
  .hero-scale.backdrop-card {
    padding: 2.7rem 3rem 3rem;
    max-width: 920px
  }

  .hero-scale h1 {
    font-size: clamp(3.25rem, 3.4vw + .8rem, 4.7rem);
    line-height: 1.05
  }

  .hero-scale h1 .text-red-600 {
    font-size: 1.05rem
  }

  .hero-scale .hero-lead {
    font-size: clamp(1.3rem, 1.15vw + .9rem, 1.65rem)
  }

  .hero-scale .cta-btn {
    padding: 1.1rem 1.65rem;
    font-size: 1.05rem
  }

  .hero-scale .cta-arrow {
    width: 34px;
    height: 34px
  }

  .hero-scale .cta-secondary {
    padding: 1rem 1.35rem;
    font-size: .98rem
  }

  .hero-scale .badge-row span {
    font-size: .95rem;
    padding: .6rem 1rem
  }
}

/* Section offsets to position content lower over the background image (desktop/tablet only) */
@media (min-width: 768px) {
  .offset-about {
    margin-top: 13vh
  }

  .offset-why {
    margin-top: 10vh
  }
}

/* Stacked CTA refinements */
.cta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .85rem;
  margin-top: 1.1rem
}

.cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: rgba(15, 23, 42, .06);
  color: #0f172a;
  padding: .85rem 1.15rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s ease, transform .15s ease, box-shadow .2s ease
}

.cta-secondary:hover {
  background: rgba(15, 23, 42, .12);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .08)
}

.cta-secondary svg {
  opacity: .75
}

.backdrop-card {
  max-width: 640px
}

/* Past Pupils carousel uniform card styling */
.pupil-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 6px 18px -4px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: box-shadow .25s ease, transform .25s ease;
  margin: 0 .5rem
}

.pupil-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, .18), 0 4px 10px rgba(15, 23, 42, .08)
}

.pupil-card iframe {
  width: 100%;
  height: 300px;
  border: 0;
  border-radius: 14px
}

/* Hide scrollbar for carousel but keep functionality */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

/* Polished Content Card - Static by default (Mobile friendly) */
.content-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  border: 1px solid #f1f5f9;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Mobile: Reduce padding */
@media (max-width: 768px) {
  .content-card {
    padding: 1.5rem;
  }
}

/* Only interactive cards should jump/glow */
.interactive-card {
  cursor: pointer;
  border-color: #e2e8f0;
}

/* Disable hover effects on touch devices */
@media (hover: hover) and (pointer: fine) {
  .interactive-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
  }

  .map-container-rotate:hover {
    transform: rotate(1deg) scale(1.01);
  }
}

/* Active state for touch */
.interactive-card:active {
  transform: scale(0.98);
}

/* Map Interaction - Rotate like EDT Booklet */
.map-container-rotate {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Typography polish for subpages */
.prose-lg p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

.prose-lg ul,
.prose-lg ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose-lg li {
  margin-bottom: 0.5rem;
}

.prose-lg h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.33;
}

.prose-lg h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 1.25rem;
}

/* Mobile/Tablet Optimizations */
@media (max-width: 768px) {

  /* Ensure proper spacing on mobile */
  .px-6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Better text sizing on mobile */
  .text-5xl {
    font-size: 2.5rem !important;
  }

  .text-4xl {
    font-size: 2rem !important;
  }

  .text-3xl {
    font-size: 1.75rem !important;
  }

  /* Ensure buttons are touch-friendly */
  button,
  .btn,
  a.btn,
  .cta-btn,
  .cta-secondary {
    min-height: 44px;
    min-width: 44px;
  }

  /* Fix any overflow issues */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Ensure grid doesn't cause horizontal scroll */
  .grid {
    width: 100%;
  }
}