/* =========================
   CSS VARIABLES
   ========================= */
:root {
  --primary-blue: #2747a08f;
  --primary: #1E3A8A;
  --accent: #2563EB;

  --text-primary: #111827;
  --text-secondary: #6B7280;

  --border-light: #E5E7EB;
  --bg-light: #F9FAFB;
}

/* =========================
   RESET & BASE
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================
   SITE HEADER
   ========================= */
.site-header {
  background-color: var(--primary-blue);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

/* =========================
   NAVIGATION
   ========================= */
.main-nav {
  display: flex;
  gap: 1.2rem;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.main-nav a:hover {
  text-decoration: underline;
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #fff;
  cursor: pointer;
}

/* =========================
   BREADCRUMBS
   ========================= */
.breadcrumbs {
  margin: 1rem auto;
  max-width: 1200px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  background-color: #f1f5f9;
  border-radius: 6px;
}

.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span {
  margin: 0 0.25rem;
  color: #94a3b8;
}


/* =========================
   MAIN CONTENT
   ========================= */
.main-content {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* =========================
   HERO SECTION
   ========================= */
.hero {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 3rem;
  margin-bottom: 3rem;
}

.hero h2 {
  font-size: 2.2rem;
  color: var(--primary-blue);
  margin-bottom: 1rem;
}

.hero p {
  max-width: 700px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* =========================
   GRADES SECTION
   ========================= */
.grades h3 {
  margin-bottom: 1.5rem;
}

.grade-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.grade-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;

  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border-light);

  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-blue);
  text-decoration: none;

  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grade-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

/* =========================
   TABLES
   ========================= */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: #ffffff;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid #ddd;
  padding: 0.75rem;
  text-align: center;
}

th {
  background-color: var(--primary);
  color: #ffffff;
}

/* =========================
   INFO BOXES
   ========================= */
.formula-box {
  background-color: #f0f7ff;
  border-left: 5px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-family: monospace;
}

.note-box {
  background-color: #fffbea;
  border-left: 5px solid #facc15;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

/* =========================
   FOOTER
   ========================= */
.site-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-light);
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;

  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-nav a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--text-secondary);
}

.footer-nav a:hover {
  color: var(--text-primary);
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    background-color: var(--primary);
    width: 100%;
    margin-top: 0.5rem;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  .hero {
    padding: 2rem 1.5rem;
  }

  .hero h2 {
    font-size: 1.6rem;
  }
}

/* =========================
   DOWNLOAD NOTES SECTION
   ========================= */

.download-notes {
  background: linear-gradient(135deg, #f8fafc, #eef3ff);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 2rem 2.5rem;
  margin: 4rem 0;

  display: flex;
  flex-direction: column;
  gap: 1rem;

  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
}

/* Heading */
.download-notes h2 {
  font-size: 1.4rem;
  color: var(--primary-blue);
}

/* Description text */
.download-notes p {
  max-width: 620px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Download button */
.download-btn {
  align-self: flex-start;

  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  padding: 0.75rem 1.5rem;
  margin-top: 0.5rem;

  background-color: var(--primary-blue);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;

  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.3);

  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Hover & focus */
.download-btn:hover,
.download-btn:focus {
  background-color: #1e40af;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(30, 58, 138, 0.35);
  outline: none;
}

/* Active click */
.download-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.25);
}

/* Mobile */
@media (max-width: 768px) {
  .download-notes {
    padding: 1.6rem;
  }

  .download-notes h2 {
    font-size: 1.25rem;
  }

  .download-btn {
    width: 100%;
    justify-content: center;
  }
}

/* =========================
   STUDY IMAGES (FIXED)
   ========================= */

.study-figure {
  margin: 2.5rem auto;
  max-width: 520px;          /* smaller than text width */
  text-align: center;
}

.study-figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: #fff;
}

.study-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Mobile */
@media (max-width: 768px) {
  .study-figure {
    max-width: 100%;
  }
}

/* ===============================
   MAIN CONTENT WRAPPER
================================ */

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ===============================
   PAGE TITLE
================================ */

.main-content h1 {
  font-size: 2rem;
  margin-bottom: 1.2rem;
  color: #111;
}

/* ===============================
   NOTE / INFO BOX
================================ */

.note-box {
  background-color: #f1f5ff;
  border-left: 4px solid var(--primary-blue);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
  color: #333;
}

/* ===============================
   SUBJECT GRID
================================ */

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}

/* ===============================
   SUBJECT CARD
================================ */

.subject-card {
  background-color: #bfdcf0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.4rem 1rem;
  text-align: center;

  text-decoration: none;
  color: #111;
  font-weight: 500;
  font-size: 1rem;

  transition: transform 0.18s ease, box-shadow 0.18s ease,
              border-color 0.18s ease;
}

.subject-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-blue);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  color: var(--primary-blue);
}

/* ===============================
   MOBILE OPTIMIZATION
================================ */

@media (max-width: 600px) {
  .hero {
    padding: 2.2rem 1.4rem;
  }

  .hero h2 {
    font-size: 1.6rem;
  }

  .main-content h1 {
    font-size: 1.6rem;
  }
}

/* ===============================
   PAST PAPERS WRAPPER
================================ */

.past-papers-wrapper {
  margin-top: 3rem;
  padding: 2.5rem 2rem;

  background-color: #e6e9eb;
  border: 1px solid var(--border-light);
  border-radius: 14px;
}

/* Ensure spacing between years */
.past-papers-wrapper .year-section:not(:last-child) {
  margin-bottom: 4rem;
}

/* Headings inside wrapper */
.past-papers-wrapper h2,
.past-papers-wrapper h3 {
  scroll-margin-top: 100px; /* avoids header overlap */
}

/* ===============================
   TOPIC NAV (BACK LINK)
================================ */

.topic-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-start;
}

.topic-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;

  color: var(--primary-blue);
  background-color: #eef3ff;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;

  transition: background-color 0.15s ease, transform 0.15s ease;
}

.topic-nav a:hover {
  background-color: #dfe8ff;
  transform: translateX(-2px);
}

/* Quadratic Functions - Coordinated & Compact Example Styles */

/* Color Variables */
:root {
  --primary-blue: #3498db;
  --dark-blue: #2980b9;
  --light-blue: #ebf5fb;
  --medium-gray: #95a5a6;
  --dark-gray: #34495e;
  --light-gray: #f8f9fa;
  --border-color: #d5dbdb;
}

/* Example Section Container */
.example-section {
  background: var(--light-gray);
  border-left: 2px solid var(--primary-blue);
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
  border-radius: 0 3px 3px 0;
}

.example-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.example-icon {
  background-color: var(--primary-blue);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
}

.example-title {
  color: var(--dark-gray);
  font-size: 1rem;
  margin: 0;
  font-weight: 600;
}

/* Problem Box */
.problem-box {
  background: white;
  padding: 0.8rem;
  border-radius: 3px;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.4;
}

.problem-label {
  display: inline-block;
  background-color: var(--medium-gray);
  color: white;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Solution Box */
.solution-box {
  background: var(--light-blue);
  color: var(--dark-gray);
  padding: 0.8rem;
  border-radius: 3px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.4;
}

.solution-label {
  display: inline-block;
  background-color: var(--primary-blue);
  color: white;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Step List */
.step-list {
  counter-reset: step-counter;
  margin: 0;
  padding: 0;
}

.step-list li {
  counter-increment: step-counter;
  list-style: none;
  margin-bottom: 0.5rem;
  padding-left: 1.8rem;
  position: relative;
}

.step-list li::before {
  content: counter(step-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Math Formulas */
.math-formula {
  font-family: "SF Mono", Monaco, "Courier New", monospace;
  background: #f8f9fa;
  padding: 3px 6px;
  border-radius: 2px;
  display: inline-block;
  margin: 1px 0;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  color: var(--dark-gray);
}

/* Key Points */
.key-point {
  background: #fff9e6;
  border-left: 2px solid #f39c12;
  padding: 0.6rem;
  margin: 0.6rem 0;
  border-radius: 0 2px 2px 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.key-point strong {
  color: #d35400;
}

/* Method Container */
.method-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.method-box {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.8rem;
  transition: border-color 0.2s ease;
}

.method-box:hover {
  border-color: var(--primary-blue);
}

.method-number {
  display: inline-block;
  background: var(--primary-blue);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  text-align: center;
  line-height: 26px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.method-box h3 {
  color: var(--dark-gray);
  font-size: 0.95rem;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.method-box p {
  font-size: 0.85rem;
  color: var(--dark-gray);
  line-height: 1.4;
  margin-bottom: 0.6rem;
}

/* Application Boxes */
.application-box {
  background: white;
  border: 1px solid var(--border-color);
  padding: 0.8rem;
  border-radius: 4px;
  margin: 0.8rem 0;
}

.application-box h3 {
  color: var(--dark-gray);
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.projectile-app {
  border-top: 2px solid var(--primary-blue);
}

.optimization-app {
  border-top: 2px solid var(--medium-gray);
}

/* Light Variants for Application Boxes */
.problem-light {
  background: #f8fafc;
  border: 1px solid var(--border-color);
}

.label-light {
  background-color: var(--medium-gray);
}

.solution-light {
  background: var(--light-blue);
}

/* Form Boxes */
.formula-box {
  background: white;
  border: 1px solid var(--border-color);
  border-left: 2px solid var(--primary-blue);
  padding: 0.6rem 0.8rem;
  margin: 0.6rem 0;
  border-radius: 0 3px 3px 0;
  font-family: "SF Mono", Monaco, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

.formula-box strong {
  color: var(--dark-gray);
  font-weight: 600;
}

/* Assessment Boxes */
.assessment-box {
  background: var(--light-gray);
  border: 1px solid var(--border-color);
  padding: 0.8rem;
  border-radius: 4px;
  margin: 0.6rem 0;
}

.assessment-box h3 {
  color: var(--dark-gray);
  font-size: 0.95rem;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.assessment-box ul {
  margin: 0.4rem 0;
  padding-left: 1rem;
}

.assessment-box li {
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Compact Headings */
h2 {
  font-size: 1.3rem;
  margin: 1.2rem 0 0.8rem 0;
  color: var(--dark-gray);
}

h3 {
  font-size: 1.1rem;
  margin: 1rem 0 0.6rem 0;
  color: var(--dark-gray);
}

/* Responsive Design */
@media (max-width: 768px) {
  .method-container {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  
  .example-section {
    padding: 0.7rem;
  }
  
  .method-box,
  .application-box {
    padding: 0.7rem;
  }
}

@media (max-width: 480px) {
  .example-section {
    padding: 0.6rem;
  }
  
  .problem-box,
  .solution-box {
    padding: 0.6rem;
  }
  
  .step-list li {
    padding-left: 1.5rem;
  }
}

