
/*
Theme Name: MathLife
Theme URI: https://mathlife.pro
Author: MathLife
Description: Custom education theme for MathLife (math learning for grades 1–8).
Version: 1.3
License: GNU General Public License v2 or later
Text Domain: mathlife
*/

:root {
  --ml-blue: #1e70c8;
  --ml-red: #e63946;
  --ml-black: #1a1a1a;
  --ml-bg: #f7faff;
  --ml-card-bg: #ffffff;
  --ml-gray: #f2f2f2;
  --ml-radius-lg: 16px;
  --ml-radius-md: 12px;
  --ml-radius-sm: 8px;
  --ml-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  background: var(--ml-bg);
  color: var(--ml-black);
  line-height: 1.6;
}

a {
  color: var(--ml-blue);
}

a:hover {
  color: var(--ml-red);
}

/* Layout */

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section--light {
  background: var(--ml-bg);
}

.section--white {
  background: #ffffff;
}

.section--dark {
  background: var(--ml-black);
  color: #ffffff;
}

.section__title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
}

.section__subtitle {
  max-width: 620px;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: #555;
}

/* Header / Nav */

.site-header {
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-logo-icon {
  width: 32px;
  height: 32px;
  position: relative;
}

.site-logo-icon::before,
.site-logo-icon::after {
  content: "";
  position: absolute;
}

.site-logo-icon::before {
  width: 18px;
  height: 18px;
  background: var(--ml-blue);
  border-radius: 6px;
  bottom: 0;
  left: 7px;
}

.site-logo-icon::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ml-red);
  top: 2px;
  left: 11px;
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ml-black);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: #444;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--ml-blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, color 0.15s ease;
}

.btn--primary {
  background: var(--ml-red);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(230, 57, 70, 0.3);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(230, 57, 70, 0.35);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--ml-blue);
  color: var(--ml-blue);
}

.btn--outline:hover {
  background: var(--ml-blue);
  color: #ffffff;
}

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.4rem;
}

/* Hero */

.hero {
  padding: 4rem 0 3rem;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.5fr);
  gap: 3rem;
  align-items: center;
}

.hero__eyebrow {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ml-blue);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero__title {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.hero__title span {
  color: var(--ml-blue);
}

.hero__text {
  max-width: 480px;
  color: #555;
  margin-bottom: 1.5rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.hero__meta {
  font-size: 0.85rem;
  color: #777;
}

.hero__illustration {
  background: linear-gradient(135deg, #ffffff, #e7f3ff);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--ml-shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero__illustration::after {
  content: "1 + 2 = 3";
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  font-weight: 700;
  color: var(--ml-blue);
  opacity: 0.15;
  font-size: 2rem;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #ffffff;
  border: 1px solid var(--ml-gray);
}

/* Grades grid */

.grades-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.grade-card {
  background: var(--ml-card-bg);
  border-radius: var(--ml-radius-lg);
  box-shadow: var(--ml-shadow-soft);
  padding: 1.4rem 1.2rem;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.grade-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.grade-card__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ml-blue);
  margin-bottom: 0.35rem;
}

.grade-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.grade-card__desc {
  font-size: 0.9rem;
  color: #555;
}

.grade-card__badge {
  position: absolute;
  right: 0.9rem;
  top: 0.9rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(30, 112, 200, 0.07);
  color: var(--ml-blue);
}

/* Features */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--ml-card-bg);
  border-radius: var(--ml-radius-lg);
  padding: 1.5rem 1.4rem;
  box-shadow: var(--ml-shadow-soft);
}

.feature-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ml-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.feature-card__title {
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.feature-card__text {
  font-size: 0.9rem;
  color: #555;
}

/* Steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.step-card {
  background: #ffffff;
  border-radius: var(--ml-radius-lg);
  padding: 1.5rem 1.4rem;
  border: 1px solid #e3e7f0;
}

.step-card__num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--ml-red);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.step-card__title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

/* CTA section */

.cta {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta p {
  color: #ddd;
  margin-bottom: 1.2rem;
}

/* Footer */

.section.section--dark {
  background: var(--ml-black);
  color: #ffffff;
}

.site-footer {
  padding: 2rem 0 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #aaa;
}

/* Page / Post content */

.page .section--white,
.single .section--white {
  background: #ffffff;
}

.content-area {
  padding: 3rem 0;
}

.content-inner {
  max-width: 760px;
  margin: 0 auto;
}

.content-inner h1,
.content-inner h2,
.content-inner h3 {
  margin-top: 1.8rem;
}

.post-card {
  background: #ffffff;
  border-radius: var(--ml-radius-lg);
  padding: 1.5rem 1.4rem;
  box-shadow: var(--ml-shadow-soft);
  margin-bottom: 1.5rem;
}

.post-card h2 {
  margin-top: 0;
}

/* Responsive */

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__illustration {
    order: -1;
  }

  .grades-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .features-grid,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .site-header__inner {
    padding-inline: 1rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .hero__title {
    font-size: 2rem;
  }

  .site-nav {
    position: absolute;
    inset: 56px 0 auto 0;
    background: #ffffff;
    flex-direction: column;
    padding: 0.75rem 1.5rem 1rem;
    border-bottom: 1px solid #eee;
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }
}
