@import url('https://fonts.googleapis.com/css2?family=Lora:wght@500;700&family=Arial&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Fluid spacing tokens. Blade templates reference these directly from inline
   styles (e.g. `padding:var(--sec-y) var(--pad)`), which is how the many
   inline-styled sections scale down without needing a class on each one. */
:root {
  --pad: 48px;    /* horizontal gutter for full-bleed sections */
  --sec-y: 72px;  /* vertical rhythm for major sections */
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: oklch(22% 0.02 258);
  background: oklch(99% 0.004 258);
  /* Guards against a stray wide child (long unbroken string, oversized table)
     forcing a horizontal scrollbar on small screens. */
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

.container { max-width: 1280px; margin: 0 auto; }

/* ---------- Responsive grid utilities ----------
   Used in place of inline grid-template-columns so column counts can collapse
   at breakpoints. Each steps down to fewer columns, then to a single column. */
.grid { display: grid; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Asymmetric two-column layouts (content + rail). */
.grid-split      { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.grid-split-wide { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; }

/* Gallery: auto-fit tiles reflow at any width without extra breakpoints. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr; } }

/* Footer: 4 columns → 2 on tablet → 1 on phone. */
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* Two-column form. Children opt into full width with inline `grid-column:span 2`;
   when this collapses to one column those spans must be neutralised, otherwise
   the span would generate a phantom second column. */
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) {
  .form-2col { grid-template-columns: 1fr; }
  .form-2col > * { grid-column: 1 / -1 !important; }
}

/* Touch targets: anything tappable should clear ~44px on coarse pointers. */
@media (pointer: coarse) {
  .btn, .btn-course, button, [type="submit"] { min-height: 44px; }
}

@keyframes admissionsBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-weight: 700;
  border-radius: 4px;
  font-size: 15px;
  padding: 14px 28px;
}
.btn-gold { background: oklch(72% 0.13 85); color: oklch(20% 0.04 85); }
.btn-outline { border: 1px solid white; color: white; background: transparent; }

.field {
  padding: 13px 14px;
  border: 1px solid oklch(88% 0.01 258);
  border-radius: 5px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  width: 100%;
}

.alert-success {
  background: oklch(95% 0.05 145);
  border: 1px solid oklch(75% 0.12 145);
  color: oklch(30% 0.08 145);
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: oklch(95% 0.06 25);
  border: 1px solid oklch(75% 0.15 25);
  color: oklch(30% 0.1 25);
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

.field-error { color: oklch(55% 0.18 25); font-size: 12.5px; margin-top: -12px; }

/* ---------- Scroll reveal animations ----------
   Elements start slightly offset + transparent and slide into place when
   scrolled into view (JS adds .is-visible). Scoped to .js so content stays
   visible if JavaScript is unavailable, and disabled for reduced-motion. */
.js .reveal {
  opacity: 0;
  transform: translateX(-36px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22, .61, .36, 1);
  will-change: opacity, transform;
}
.js .reveal.reveal-up    { transform: translateY(34px); }
.js .reveal.reveal-right { transform: translateX(36px); }
.js .reveal.reveal-zoom  { transform: scale(.92); }
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- Our Courses cards ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.course-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid oklch(90% 0.01 258);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(20, 30, 50, 0.14);
  border-color: oklch(80% 0.04 258);
}
.course-card-media {
  position: relative;
  height: 160px;
  overflow: hidden;
}
.course-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.course-card:hover .course-card-media img { transform: scale(1.08); }
.course-fee-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: oklch(72% 0.13 85);
  color: oklch(20% 0.04 85);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 20px;
}
.course-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.course-card-title {
  font-family: Lora, serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 8px;
}
.course-card-desc {
  color: oklch(45% 0.02 258);
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: oklch(45% 0.02 258);
  border-top: 1px solid oklch(94% 0.008 258);
  padding-top: 12px;
  margin-top: auto;
}
.course-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.btn-course {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 11px 12px;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .18s ease, filter .18s ease, transform .18s ease;
}
.btn-details { background: oklch(28% 0.08 258); color: #fff; }
.btn-details:hover { background: oklch(22% 0.08 258); }
.btn-enroll { background: oklch(72% 0.13 85); color: oklch(20% 0.04 85); }
.btn-enroll:hover { filter: brightness(1.06); }
.btn-consult { background: oklch(60% 0.16 150); color: #fff; display: none; }
.btn-consult:hover { filter: brightness(1.06); }

/* ---------- Course details modal ---------- */
.course-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  overflow-y: auto;
}
.course-modal.open { display: block; }
.course-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 30, 0.62);
}
.course-modal-dialog {
  position: relative;
  z-index: 1;
  width: calc(100% - 32px);
  max-width: 460px;
  margin: 6vh auto;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  animation: modalPop .22s ease;
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.course-modal-x {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
}
.course-modal-x:hover { opacity: 1; }
.course-modal-head { background: oklch(28% 0.08 258); padding: 24px 26px; }
.course-modal-form { padding: 22px 26px 26px; }
.modal-field { display: block; margin-bottom: 14px; }
.modal-field > span {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: oklch(35% 0.02 258);
}

/* ---------- Site header / mobile navigation ---------- */
.topbar {
  background: oklch(28% 0.08 258);
  color: white;
  font-size: 13px;
  padding: 6px var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.topbar-contact { display: flex; gap: 24px; flex-shrink: 0; white-space: nowrap; }
.topbar-cta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

/* Blinking red "Admission Open" badge, styled like a promo ribbon. */
.admission-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 4px 14px 4px 10px;
  border-radius: 4px 12px 4px 12px;
  background: linear-gradient(135deg, oklch(60% 0.23 27), oklch(52% 0.24 27));
  color: white;
  box-shadow: 0 2px 10px oklch(55% 0.22 27 / 0.5), inset 0 1px 0 oklch(100% 0 0 / 0.25);
  animation: admissionsBlink 1.2s ease-in-out infinite;
}
.admission-badge:hover { filter: brightness(1.06); }
.admission-badge-mega {
  font-size: 17px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px oklch(30% 0.1 27 / 0.6));
}
.admission-badge-text { display: flex; flex-direction: column; line-height: 1.05; }
.admission-badge-text b {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.admission-badge-text small {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.92;
}

/* Student + Staff login buttons pinned to the very top strip. */
.topbar-logins { display: flex; gap: 8px; }
.topbar-login {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 4px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
  color: white; border: 1px solid oklch(100% 0 0 / 0.45);
  background: oklch(100% 0 0 / 0.08);
  transition: background .15s ease, border-color .15s ease;
}
.topbar-login:hover { background: oklch(100% 0 0 / 0.2); border-color: white; }
.topbar-login-staff { background: oklch(72% 0.13 85); color: oklch(20% 0.04 85); border-color: transparent; }
.topbar-login-staff:hover { background: oklch(78% 0.13 85); border-color: transparent; }

@media (max-width: 620px) {
  .topbar-note { display: none; }
  .topbar-contact { gap: 14px; }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--pad);
  border-bottom: 1px solid oklch(90% 0.01 258);
  position: sticky;
  top: 0;
  background: white;
  z-index: 20;
}
.site-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-brand img { width: 52px; height: 52px; border-radius: 8px; object-fit: contain; background: white; flex-shrink: 0; }
.site-brand-name {
  font-family: Lora, serif; font-weight: 700; font-size: 22px;
  color: oklch(22% 0.02 258); letter-spacing: 0.3px;
}
.site-brand-tag { font-size: 12px; color: oklch(45% 0.02 258); letter-spacing: 1px; }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  padding: 10px 18px; border-radius: 4px; font-size: 14.5px;
  white-space: nowrap; flex-shrink: 0; font-weight: 500;
  color: oklch(30% 0.02 258);
}
.site-nav a.active { font-weight: 700; color: white; background: oklch(28% 0.08 258); }

/* Hamburger: hidden on desktop, revealed at the nav breakpoint below. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid oklch(88% 0.01 258);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%;
  background: oklch(28% 0.08 258); border-radius: 2px;
  transition: transform .22s ease, opacity .18s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-header { flex-wrap: wrap; }
  /* Nav drops to a full-width stacked panel below the brand row. */
  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 2px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid oklch(92% 0.01 258);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 13px 14px; font-size: 15px; }
}

/* ---------- Section / hero scaling ---------- */
@media (max-width: 1024px) {
  :root { --pad: 32px; --sec-y: 60px; }
}

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2, .grid-split, .grid-split-wide { grid-template-columns: 1fr; }
  .grid-split, .grid-split-wide { gap: 32px; }
  .why-choose-grid { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .why-choose h2 { font-size: 30px !important; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }

  /* Hero: let content set the height instead of a fixed 520px, so longer
     headings at narrow widths aren't clipped. */
  .hero { height: auto !important; min-height: 420px; }
  .hero-content { position: static !important; height: auto !important; padding: 56px var(--pad) !important; }
  .hero-img { position: absolute; inset: 0; height: 100% !important; }
  .hero h1 { font-size: 34px !important; }
  .hero p { font-size: 15.5px !important; }
}

@media (max-width: 640px) {
  :root { --pad: 20px; --sec-y: 48px; }

  .course-grid { grid-template-columns: 1fr; }
  /* On phones, swap Enroll for a tap-to-call Free Consultation button */
  .btn-enroll { display: none; }
  .btn-consult { display: inline-flex; }

  .topbar { justify-content: center; text-align: center; font-size: 12px; }
  .topbar-contact { flex-direction: column; gap: 4px; }
  /* Let the login/apply buttons wrap instead of pushing the page wider than
     the screen (which shifted the whole home hero sideways). */
  .topbar-cta, .topbar-logins { flex-wrap: wrap; justify-content: center; flex-shrink: 1; min-width: 0; gap: 8px; }
  /* Brand shrinks (its tagline wraps) so the hamburger stays on the same row. */
  .site-brand { flex: 1 1 0; }
  .site-brand img { width: 42px; height: 42px; }
  .site-brand-name { font-size: 17px; }
  .site-brand-tag { font-size: 10.5px; letter-spacing: .5px; }

  .hero h1 { font-size: 27px !important; }
  .hero-actions { flex-wrap: wrap; }
  .hero-actions .btn { flex: 1 1 auto; text-align: center; }

  /* Section headings step down together rather than one-off overrides. */
  .page-hero h1 { font-size: 27px !important; }
  h2 { font-size: 25px !important; }
  .btn { padding: 13px 20px; }
}

@media (max-width: 520px) {
  .why-choose-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}
