/*
Theme Name: GradeCalc
Theme URI: https://usegradecalc.com/
Author: Shahid
Description: Free US grade calculator for quizzes, weighted averages, final exams, and GPA. EZ Grader, weighted grade, final exam, and GPA tools for US high school and college students and teachers.
Version: 1.2.1
Requires at least: 6.0
Tested up to: 6.7
Text Domain: gradecalc
*/
/* NOTE: Theme URI above is the live domain (usegradecalc.com). */

:root {
  --bg: #eef1ff;
  --ink: #1a1740;
  --muted: #5c5784;
  --card: #ffffff;
  --surface: #f3f1ff;
  --line: #d8d4f2;
  --accent: #5b4dff;
  --accent-soft: #e4e0ff;
  --warn: #c2410c;
  --fail: #be123c;
  --shadow: 0 18px 40px rgba(49, 36, 120, 0.1);
  --header: rgba(238, 241, 255, 0.86);
  --result-start: #312e81;
  --result-end: #7c3aed;
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 88px;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Outfit, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #ddd6fe 0, transparent 34%),
    radial-gradient(circle at 90% 0, #fde68a 0, transparent 24%),
    var(--bg);
  min-height: 100vh;
}

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin-inline: auto;
}

body.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: var(--header);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
}

.nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.nav-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link.is-active,
.nav-link:hover {
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  padding: 48px 0 28px;
  min-height: 240px;
}

.hero-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  animation: drift 9s ease-in-out infinite;
}

.orb-a {
  width: 180px;
  height: 180px;
  left: -40px;
  top: -30px;
  background: radial-gradient(circle, rgba(91, 77, 255, 0.35), transparent 68%);
}

.orb-b {
  width: 140px;
  height: 140px;
  right: 18%;
  bottom: -20px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.45), transparent 70%);
  animation-delay: -3s;
}

.orb-c {
  width: 90px;
  height: 90px;
  right: 42%;
  top: 10px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.28), transparent 70%);
  animation-delay: -5s;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy > * {
  animation: rise 0.8s ease both;
}

.hero-copy .eyebrow {
  animation-delay: 0.05s;
}

.hero-copy h1 {
  animation-delay: 0.16s;
}

.hero-copy .lede {
  animation-delay: 0.32s;
}

.hero-float {
  position: relative;
  z-index: 1;
  width: 150px;
  height: 170px;
}

.float-chip {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 12px 28px rgba(49, 36, 120, 0.18);
  animation: bob 4.6s ease-in-out infinite;
}

.chip-a {
  width: 78px;
  height: 78px;
  left: 0;
  top: 8px;
  font-size: 1.4rem;
  background: linear-gradient(160deg, #5b4dff, #7c3aed);
}

.chip-b {
  width: 86px;
  height: 52px;
  right: 0;
  top: 58px;
  background: linear-gradient(160deg, #f59e0b, #ea580c);
  animation-delay: -1.4s;
}

.chip-c {
  left: 18px;
  bottom: 0;
  padding: 10px 14px;
  background: #1a1740;
  animation-delay: -2.6s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(12px, -16px, 0);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 10px;
}

h1,
h2 {
  font-family: Fraunces, Georgia, serif;
  letter-spacing: -0.03em;
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  max-width: 18ch;
  line-height: 1.08;
}

h2 {
  font-size: 1.45rem;
}

.lede,
.card-copy,
.result-hint,
.site-footer p {
  color: var(--muted);
  line-height: 1.55;
}

.lede {
  max-width: 58ch;
  font-size: 1.08rem;
}

.calculator-shell,
.scale-section {
  padding-bottom: 28px;
}

.tab-panel[hidden] {
  display: none !important;
}

.tab-panel.is-active {
  display: block;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.result-card {
  background: linear-gradient(165deg, var(--result-start), var(--result-end));
  color: #fff;
  border: 0;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-kicker,
.result-hint {
  margin: 0;
}

.result-card .result-hint {
  color: rgba(255, 255, 255, 0.78);
}

.result-fraction {
  margin: 8px 0 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.result-percent {
  margin: 6px 0 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 0.95;
}

.result-letter {
  margin: 8px 0 12px;
  font-size: 1.5rem;
  font-weight: 700;
}

.stepper-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 22px 0 16px;
}

.field span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.field.stacked {
  margin-top: 14px;
}

.stepper,
input[type="number"],
select,
.ghost-btn {
  font: inherit;
}

.stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}

.stepper button,
.ghost-btn,
.remove-btn {
  border: 0;
  background: var(--surface);
  cursor: pointer;
  font-size: 20px;
  color: var(--ink);
}

.stepper input,
.field.stacked input,
.input-table input,
.input-table select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--card);
}

.stepper input {
  border: 0;
  border-radius: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.chart-card {
  margin-top: 18px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.chart-head p,
.scale-section .card-copy {
  margin: 6px 0 0;
}

.chart-table-wrap,
.table-wrap {
  overflow: auto;
}

.chart-table,
.input-table {
  width: 100%;
  border-collapse: collapse;
}

.chart-table th,
.chart-table td,
.input-table th,
.input-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.chart-table tr.is-current {
  background: var(--accent-soft);
  font-weight: 700;
}

.input-table th {
  font-size: 13px;
  color: var(--muted);
}

.remove-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.ghost-btn {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.scale-chip {
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.scale-chip strong {
  display: block;
  font-size: 1.15rem;
}

.site-footer {
  padding: 12px 0 40px;
}

@media (max-width: 800px) {
  .panel-grid,
  .stepper-row,
  .chart-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .result-card {
    order: -1;
    min-height: 180px;
  }

  h1 {
    max-width: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-float {
    width: 100%;
    height: 88px;
  }

  .chip-a {
    left: 0;
    top: 12px;
  }

  .chip-b {
    left: 96px;
    right: auto;
    top: 18px;
  }

  .chip-c {
    left: auto;
    right: 0;
    bottom: auto;
    top: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *,
  .orb,
  .float-chip {
    animation: none;
  }
}

.blog-page {
  padding: 40px 0 56px;
}

.blog-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.blog-card h2 a,
.entry-title a {
  color: inherit;
  text-decoration: none;
}

.blog-date {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-read {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
  color: var(--ink);
}

.entry-content {
  margin-top: 16px;
  line-height: 1.7;
}

.entry-content p,
.entry-content ul,
.entry-content ol {
  margin: 0 0 1em;
}

.blog-pager {
  margin-top: 22px;
}

.blog-pager a {
  color: var(--ink);
  font-weight: 600;
}

/* --- GradeCalc 1.2.0 additions --- */

.weight-warning {
  display: block;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--fail);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
}

.weight-warning[hidden] {
  display: none;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.copy-btn,
.print-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: #ffffff;
  color: var(--ink);
}

.copy-btn:hover,
.print-btn:hover {
  background: var(--accent-soft);
}

.chart-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.gpa-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.gpa-toggle legend {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0;
}

.gpa-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.gpa-toggle input {
  accent-color: var(--accent);
}

/* SEO content sections below the calculators (front page). */
.seo-section {
  padding-bottom: 28px;
}

.seo-section h2 {
  margin-bottom: 10px;
}

.seo-section h3 {
  margin: 18px 0 6px;
  font-size: 1.1rem;
}

.seo-section p,
.seo-section li {
  color: var(--muted);
  line-height: 1.65;
}

.seo-section ul,
.seo-section ol {
  margin: 0 0 1em;
  padding-left: 22px;
}

.faq-item {
  margin-top: 16px;
}

.faq-item h3 {
  margin: 0 0 4px;
}

.faq-item p {
  margin: 0;
}

/* Single-calculator pages (/ez-grader/ etc.). */
.single-calculator {
  padding: 40px 0 48px;
}

.single-calculator .page-intro {
  max-width: 68ch;
}

.related-calculators {
  margin-top: 24px;
}

.related-calculators ul {
  margin: 10px 0 0;
  padding-left: 22px;
  line-height: 1.8;
}

.related-calculators a {
  color: var(--ink);
  font-weight: 600;
}

/* Footer navigation. */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.site-footer .fine-print {
  font-size: 13px;
}

/* 404 page. */
.not-found {
  padding: 48px 0 56px;
  text-align: left;
}

.not-found ul {
  line-height: 1.8;
}

@media print {
  .site-header,
  .site-footer,
  .result-actions,
  .hero-float,
  .hero-orbs,
  .ghost-btn,
  .remove-btn {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  .card,
  .result-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
