/*
Theme Name: MathDom
Theme URI: https://example.com
Author: Custom Build
Description: A clean, playful theme for an educational math website with courses, tests, facts, videos, games, and reviews.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: math-learn-theme
*/

:root {
  --meh-primary: #0ea5e9;
  --meh-primary-dark: #0284c7;
  --meh-ink: #0f2942;
  --meh-bg: #f5f9fc;
  --meh-text: #1e293b;
  --meh-accent: #fbbf24;
  --meh-accent-2: #f97316;
  --meh-radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--meh-bg);
  color: var(--meh-text);
  line-height: 1.6;
}

.site-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5edf5;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .site-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 24px;
}
.site-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--meh-primary);
  margin: 0;
  white-space: nowrap;
}
.site-title span { color: var(--meh-accent-2); }

.header-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border-radius: 999px;
  border: 1px solid #dbe6f0;
  background: #f5f9fc url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center;
  font-size: 14px;
}
.header-search input:focus { outline: 2px solid var(--meh-primary); background-color: #fff; }

/* Nav with dropdowns */
.main-nav { position: relative; }
.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
}
.main-nav li { position: relative; }
.main-nav > ul > li > a {
  text-decoration: none;
  color: var(--meh-ink);
  font-weight: 700;
  font-size: 15px;
  padding: 10px 2px;
  display: inline-block;
}
.main-nav > ul > li > a:hover { color: var(--meh-primary); }

.main-nav li.menu-item-has-children > a::after {
  content: "▾";
  font-size: 11px;
  margin-left: 5px;
  color: #94a3b8;
}

.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 41, 66, 0.16);
  padding: 10px;
  min-width: 220px;
  flex-direction: column;
  gap: 2px;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu {
  display: flex;
}
.main-nav .sub-menu a {
  text-decoration: none;
  color: var(--meh-ink);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 9px;
  display: block;
  white-space: nowrap;
}
.main-nav .sub-menu a:hover { background: #eff8ff; color: var(--meh-primary); }

.login-btn {
  background: var(--meh-ink);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.login-btn:hover { background: #163656; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--meh-primary), #38bdf8);
  border-radius: 0 0 40px 40px;
  padding: 56px 20px 70px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -80px; left: 10%;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: 40px;
  position: relative;
  z-index: 1;
}
.hero-icon { flex-shrink: 0; width: 150px; height: 150px; }
.hero-content { flex: 1; }
.hero h1 { font-size: 40px; font-weight: 900; margin: 0 0 12px; letter-spacing: -0.5px; }
.hero p.tagline { font-size: 17px; opacity: 0.92; max-width: 520px; margin: 0 0 22px; }

.hero-search { max-width: 560px; margin-bottom: 22px; }
.hero-search form { display: flex; }
.hero-search input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 999px 0 0 999px;
  border: none;
  font-size: 15px;
}
.hero-search button {
  border: none;
  background: var(--meh-ink);
  color: #fff;
  padding: 0 22px;
  border-radius: 0 999px 999px 0;
  font-weight: 700;
  cursor: pointer;
}
.hero-search button:hover { background: #163656; }

.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 26px; font-weight: 900; display: block; }
.hero-stat .label { font-size: 13px; opacity: 0.85; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-eyebrow {
  color: var(--meh-primary);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.section h2 { font-size: 28px; margin: 0 0 6px; color: var(--meh-ink); }
.section .section-desc { color: #64748b; margin-bottom: 24px; }

/* ---------- Cards / grid ---------- */
.meh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  margin: 24px 0;
}
.meh-card {
  background: #fff;
  border: 1px solid #e5edf5;
  border-radius: var(--meh-radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(15,41,66,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.meh-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(15,41,66,0.12); }
.meh-card h3 { margin: 10px 0 6px; }
.meh-card h3 a { text-decoration: none; color: var(--meh-ink); }
.meh-card-thumb {
  font-size: 40px;
  text-align: center;
  background: linear-gradient(135deg, #eff8ff, #e0f2fe);
  border-radius: 12px;
  padding: 22px 0;
}
.meh-card-thumb img { width: 100%; border-radius: 12px; display: block; }

.meh-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.meh-btn {
  display: inline-block;
  background: var(--meh-primary);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.meh-btn:hover { background: var(--meh-primary-dark); }

/* ---------- Quiz ---------- */
.meh-quiz { max-width: 700px; margin: 24px 0; }
.meh-quiz-question {
  background: #fff;
  border: 1px solid #e5edf5;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 14px;
}
.meh-quiz-option { display: block; padding: 6px 0; cursor: pointer; }
.meh-quiz-question.meh-correct { border-color: #16a34a; background: #f0fdf4; }
.meh-quiz-question.meh-incorrect { border-color: #dc2626; background: #fef2f2; }
.meh-quiz-score { font-size: 18px; font-weight: 800; margin-top: 12px; }
.meh-quiz-warning { color: #b45309; font-weight: 700; }

/* ---------- Games ---------- */
.meh-game-wrap { margin: 20px 0; }
.meh-game-instructions {
  background: #fff7ed;
  border-left: 4px solid var(--meh-accent-2);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  border-radius: 0 10px 10px 0;
}
.meh-game-frame {
  width: 100%;
  min-height: 500px;
  border: 1px solid #e5edf5;
  border-radius: 14px;
}

/* ---------- Facts ---------- */
.meh-fact-card {
  background: linear-gradient(135deg, #fef9c3, #fef3c7);
  border-radius: var(--meh-radius);
  padding: 20px 24px;
  margin: 16px 0;
}
.meh-fact-icon { font-size: 22px; }
.meh-fact-card h4 { margin: 6px 0; }

/* ---------- Videos ---------- */
.meh-video-wrap iframe { border-radius: 14px; }

/* ---------- Reviews ---------- */
.meh-reviews-section {
  background: var(--meh-ink);
  color: #e2e8f0;
  border-radius: 40px 40px 0 0;
  padding: 56px 0;
}
.meh-reviews-section h2 { color: #fff; }
.meh-reviews-section .section-desc { color: #94a3b8; }
.meh-reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}
.meh-review-card { background: #16324f; border-radius: 16px; padding: 20px; }
.meh-review-stars { color: var(--meh-accent); font-size: 16px; margin-bottom: 8px; }
.meh-review-text { color: #cbd5e1; font-size: 14px; }
.meh-review-name { color: #7dd3fc; font-weight: 700; font-size: 13px; }

.meh-review-form-wrap, .meh-contact-form-wrap {
  background: #fff;
  border-radius: var(--meh-radius);
  padding: 28px;
  max-width: 520px;
  color: var(--meh-text);
}
.meh-review-form-wrap h3 { margin-top: 0; color: var(--meh-ink); }
.meh-review-form input, .meh-review-form textarea, .meh-review-form select,
.meh-contact-form input, .meh-contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #dbe6f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}
.meh-review-thanks { color: #16a34a; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--meh-ink);
  color: #94a3b8;
  text-align: center;
  padding: 24px 0;
  font-size: 14px;
}

/* ---------- Single content ---------- */
.single-content {
  background: #fff;
  padding: 32px;
  border-radius: var(--meh-radius);
  border: 1px solid #e5edf5;
  margin: 30px 0;
}
.entry-title { font-size: 30px; margin-bottom: 10px; color: var(--meh-ink); }

@media (max-width: 900px) {
  .header-search { display: none; }
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-stats { justify-content: center; }
}
@media (max-width: 640px) {
  .main-nav ul { gap: 12px; flex-wrap: wrap; }
  .hero h1 { font-size: 28px; }
}
