/*
  Topper's Academy Website Styles
  Premium academic styling inspired by Stonehill-like structure
*/

:root {
  --primary: #0a2e73;
  --primary-dark: #072153;
  --accent: #c79b2a;
  --white: #ffffff;
  --text: #1f2a3d;
  --muted: #667085;
  --bg: #f7f9fc;
  --border: #e5e9f2;
  --container: 1180px;
  --radius: 14px;
  --shadow: 0 10px 35px rgba(10, 46, 115, 0.08);
  --header-height: 88px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.section {
  padding: 4.25rem 0;
}

.section-alt {
  background: var(--bg);
}

.section-title {
  margin: 0 0 0.75rem;
  font-family: 'Merriweather', serif;
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  color: var(--primary-dark);
}

.section-subtitle {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 760px;
}

/* Header + Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid rgba(10, 46, 115, 0.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.nav-wrap {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
}

.brand img {
  width: 150px;
  height: 60px;
  object-fit: cover;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 6px;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-meta {
  display: grid;
  line-height: 1.1;
}

.brand-meta strong {
  color: var(--primary-dark);
  font-size: 1rem;
  font-weight: 700;
}

.brand-meta span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.nav-toggle {
  border: 0;
  background: transparent;
  font-size: 1.7rem;
  color: var(--primary);
  display: none;
  cursor: pointer;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 1.15rem 0.72rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.25s ease;
}

.nav-link:hover,
.nav-item.active > .nav-link {
  color: var(--primary);
}

.dropdown > .nav-link::after {
  content: '▾';
  font-size: 0.7rem;
  transform: translateY(1px);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  list-style: none;
  margin: 0;
  padding: 0.55rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.35s ease;
}

.dropdown-menu a {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.dropdown-menu a:hover,
.dropdown-menu li.active a {
  background: #edf3ff;
  color: var(--primary);
}

@media (hover: hover) and (pointer: fine) {
  .dropdown:hover .dropdown-menu,
  .dropdown:focus-within .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    max-height: 360px;
    pointer-events: auto;
  }
}

/* Hero */
.hero {
  position: relative;
  background: linear-gradient(to right, rgba(7, 33, 83, 0.92), rgba(10, 46, 115, 0.76));
  color: var(--white);
  min-height: 72vh;
  display: grid;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr);
  gap: 2rem;
  align-items: center;
}

.hero-content {
  padding: 5rem 0;
  max-width: 100%;
}

.hero-visual {
  justify-self: end;
  width: 100%;
  max-width: 430px;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  object-fit: cover;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.9rem, 4.6vw, 3.3rem);
  font-family: 'Merriweather', serif;
  line-height: 1.25;
}

.hero p {
  margin: 0;
  max-width: 640px;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
}

.badge {
  display: inline-flex;
  align-items: center;
  background: rgba(199, 155, 42, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff8e3;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-row {
  margin-top: 1.8rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.76rem 1.25rem;
  border: 2px solid transparent;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #1e1e1e;
}

.btn-outline {
  border-color: rgba(255, 255, 255, 0.75);
  color: var(--white);
}

/* Layout helpers */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.programs-grid {
  align-items: stretch;
}

.programs-grid .card {
  height: 100%;
  display: flex;
}

.programs-grid .card-body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 1.15rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.card p,
.card li {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

.list {
  margin: 0;
  padding-left: 1.1rem;
}

.banner {
  background: linear-gradient(120deg, var(--primary), #123f96);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
}

.info-tile {
  background: #fff;
  border-left: 4px solid var(--accent);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topper-card img {
  width: 100%;
  aspect-ratio: 3/3.5;
  object-fit: cover;
}

.topper-card .meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-weight: 600;
  color: var(--primary);
}

.cta-block {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
  text-align: center;
  border-radius: var(--radius);
  padding: 2rem 1rem;
}

.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.9rem;
  color: var(--primary-dark);
  font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid #d7deea;
  border-radius: 10px;
  padding: 0.72rem 0.78rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.form-field textarea {
  resize: vertical;
  min-height: 110px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #8cadff;
  box-shadow: 0 0 0 3px rgba(61, 109, 220, 0.14);
}

.form-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.form-submit {
  border: 0;
  cursor: pointer;
}

/* Footer */
.site-footer {
  background: #081a3f;
  color: #dbe4ff;
  margin-top: 2rem;
}

.footer-top {
  padding: 3rem 0 2rem;
}

.footer-title {
  color: var(--white);
  margin: 0 0 0.8rem;
  font-family: 'Merriweather', serif;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-list li {
  margin-bottom: 0.45rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem 0;
  font-size: 0.92rem;
  text-align: center;
}

/* Scroll to top */
.scroll-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #1e1e1e;
  cursor: pointer;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.scroll-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.contact-fab-wrap {
  position: fixed;
  right: 1rem;
  bottom: 4.3rem;
  z-index: 1200;
  display: grid;
  gap: 0.55rem;
}

.contact-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.contact-fab:hover {
  transform: translateY(-2px);
}

.contact-fab svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.contact-fab-call {
  background: var(--primary);
}

.contact-fab-whatsapp {
  background: #25D366;
}

/* Responsive rules */
@media (max-width: 1080px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .site-nav.open {
    max-height: 90vh;
    overflow-y: auto;
  }

  .nav-menu {
    display: block;
    padding: 0.5rem 0 1rem;
  }

  .nav-link {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
  }

  .dropdown-menu {
    position: static;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 0.35rem 0.8rem;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    max-height: 0;
    transition: max-height 0.3s ease;
    background: transparent;
  }

  .dropdown.open .dropdown-menu {
    max-height: 250px;
  }

  .dropdown-menu a {
    padding: 0.55rem 0.75rem;
  }
}

@media (max-width: 860px) {
  .grid-3,
  .grid-2,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .hero-content {
    padding: 3.6rem 0 0;
  }

  .hero-visual {
    justify-self: start;
    max-width: 100%;
    margin-bottom: 2.2rem;
  }

  .section {
    padding: 3.2rem 0;
  }

  :root {
    --header-height: 78px;
  }

  .contact-fab-wrap {
    right: 0.8rem;
    bottom: 4rem;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}
