/* ============================================================
   AP Score Calculator — Global Stylesheet
   Aesthetic: Refined Academic / Editorial Clean
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --navy:       #0d1b2a;
  --navy-mid:   #162436;
  --teal:       #00b4a6;
  --teal-light: #00d4c4;
  --gold:       #e8b94a;
  --cream:      #faf8f4;
  --white:      #ffffff;
  --muted:      #6b7a8d;
  --border:     #e2e8f0;
  --shadow:     0 4px 24px rgba(13,27,42,0.10);
  --radius:     14px;
  --font-head:  'Playfair Display', Georgia, serif;
  --font-body:  'DM Sans', sans-serif;
  --max-w:      1100px;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--navy);
  line-height: 1.7;
}

a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal-light); }

img { max-width: 100%; display: block; }

/* ── Utilities ─────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

.badge {
  display: inline-block;
  background: var(--teal);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn:hover { background: var(--teal-light); color: var(--white); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,180,166,0.3); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--teal);
  color: var(--teal);
}
.btn-outline:hover { background: var(--teal); color: var(--white); }

/* ── Nav ────────────────────────────────────────────────────── */
.site-nav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  max-width: var(--max-w);
  margin: 0 auto;
  height: 64px;
}

.nav-logo {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}
.nav-logo span { color: var(--teal); }

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: rgba(255,255,255,0.78);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-decoration: none;
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--teal); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--white); font-size: 1.5rem; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 80px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,180,166,0.14) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow { margin-bottom: 18px; }

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.18;
  margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--teal); }

.hero-sub {
  max-width: 620px;
  margin: 0 auto 36px;
  color: rgba(255,255,255,0.72);
  font-size: 1.08rem;
}

/* ── Tab Bar ────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 28px 24px 0;
}

.tab-btn {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.7);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn:hover, .tab-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

/* ── Calculator Card ────────────────────────────────────────── */
.calc-section {
  padding: 0 24px 80px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
}

.calc-card {
  max-width: 820px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  overflow: hidden;
  display: none;
  animation: fadeUp .35s ease both;
}
.calc-card.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.calc-header {
  background: linear-gradient(90deg, var(--teal) 0%, #00907e 100%);
  padding: 28px 36px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.calc-icon { font-size: 2rem; }
.calc-header h2 { font-family: var(--font-head); font-size: 1.5rem; color: var(--white); margin: 0; }
.calc-header p  { color: rgba(255,255,255,0.82); font-size: 0.9rem; margin: 4px 0 0; }

.calc-body { padding: 36px; }

/* Section groups */
.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.questions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 0.88rem; font-weight: 500; color: var(--navy); }
.field-group small  { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.field-group input[type="number"],
.field-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--navy);
  background: #f8fafc;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.field-group input:focus, .field-group select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,180,166,0.12);
  background: var(--white);
}

.calc-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* Result Box */
.result-box {
  margin-top: 28px;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: none;
  animation: fadeUp .3s ease both;
}
.result-box.show { display: block; }

.result-score {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.score-big {
  font-family: var(--font-head);
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--teal);
}

.score-details h3 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 4px; }
.score-details p  { color: var(--muted); font-size: 0.9rem; }

.score-bar-wrap { margin-top: 20px; }
.score-bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 8px;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  border-radius: 100px;
  transition: width 0.7s cubic-bezier(.4,0,.2,1);
  width: 0;
}

.score-breakdown {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
.breakdown-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.breakdown-item .val { font-size: 1.4rem; font-weight: 700; color: var(--navy); }
.breakdown-item .lbl { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* Scale guide */
.scale-guide {
  margin-top: 22px;
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.scale-guide table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.scale-guide th { background: var(--navy); color: var(--white); padding: 10px 14px; text-align: left; }
.scale-guide td { padding: 9px 14px; border-bottom: 1px solid var(--border); }
.scale-guide tr:last-child td { border: none; }
.scale-guide tr:nth-child(even) td { background: #f8fafc; }
.score-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.85rem;
}
.s1 { background: #fee2e2; color: #991b1b; }
.s2 { background: #fef3c7; color: #92400e; }
.s3 { background: #d1fae5; color: #065f46; }
.s4 { background: #bfdbfe; color: #1e40af; }
.s5 { background: #ede9fe; color: #5b21b6; }

/* ── Info Strip ─────────────────────────────────────────────── */
.info-strip {
  background: var(--navy);
  color: rgba(255,255,255,0.9);
  padding: 40px 24px;
}
.info-strip-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.info-item { display: flex; gap: 16px; align-items: flex-start; }
.info-icon { font-size: 1.8rem; flex-shrink: 0; }
.info-item h3 { font-size: 1rem; font-weight: 600; color: var(--white); margin-bottom: 4px; }
.info-item p  { font-size: 0.87rem; color: rgba(255,255,255,0.6); line-height: 1.55; }

/* ── Subject Cards ──────────────────────────────────────────── */
.subjects-section { padding: 80px 24px; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head h2 { font-family: var(--font-head); font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 10px; }
.section-head p  { color: var(--muted); max-width: 500px; margin: 0 auto; }

.subjects-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}

.subject-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.subject-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.subject-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: var(--teal); }
.subject-card:hover::before { transform: scaleX(1); }

.subject-card .card-icon { font-size: 2.4rem; margin-bottom: 14px; }
.subject-card h3 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 8px; }
.subject-card p  { font-size: 0.88rem; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }

.card-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.meta-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(0,180,166,0.1);
  color: var(--teal);
}

/* ── Blog Section ───────────────────────────────────────────── */
.blog-section {
  padding: 80px 24px;
  background: var(--white);
  border-top: 1px solid var(--border);
}
.blog-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}
.blog-card {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}
.blog-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.blog-thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}
.blog-content { padding: 24px; }
.blog-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 0.8rem; color: var(--muted); }
.blog-card h3 { font-family: var(--font-head); font-size: 1.1rem; line-height: 1.35; margin-bottom: 10px; }
.blog-card p  { font-size: 0.87rem; color: var(--muted); line-height: 1.6; }
.read-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 14px; font-weight: 600; font-size: 0.87rem; color: var(--teal); }

/* ── FAQ ────────────────────────────────────────────────────── */
.faq-section { padding: 80px 24px; }
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}
.faq-q:hover { background: var(--cream); }
.faq-q .icon { font-size: 1.1rem; flex-shrink: 0; transition: transform var(--transition); color: var(--teal); }
.faq-item.open .faq-q .icon { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 22px 18px; font-size: 0.9rem; color: var(--muted); line-height: 1.7; }
.faq-item.open .faq-a { display: block; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 60px 24px 32px;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand .nav-logo { font-size: 1.2rem; display: block; margin-bottom: 12px; }
.footer-brand p { font-size: 0.87rem; line-height: 1.7; max-width: 280px; }
.footer-col h4 { font-size: 0.82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--white); margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: 0.87rem; color: rgba(255,255,255,0.55); transition: color var(--transition); }
.footer-col a:hover { color: var(--teal); }
.footer-bottom { max-width: var(--max-w); margin: 0 auto; padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 0.82rem; }
.footer-bottom .gold { color: var(--gold); }

/* ── Blog Post Page ─────────────────────────────────────────── */
.post-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 70px 24px 60px;
}
.post-meta { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.post-meta span { font-size: 0.82rem; color: rgba(255,255,255,0.55); }
.post-hero h1 { font-family: var(--font-head); font-size: clamp(1.6rem, 4vw, 2.8rem); color: var(--white); max-width: 760px; line-height: 1.22; }

.post-layout {
  max-width: 980px;
  margin: 60px auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 60px;
  align-items: start;
}
.post-content { font-size: 1.02rem; line-height: 1.8; color: #2d3748; }
.post-content h2 { font-family: var(--font-head); font-size: 1.6rem; margin: 40px 0 14px; color: var(--navy); }
.post-content h3 { font-family: var(--font-head); font-size: 1.25rem; margin: 28px 0 10px; color: var(--navy); }
.post-content p  { margin-bottom: 18px; }
.post-content ul, .post-content ol { padding-left: 22px; margin-bottom: 18px; }
.post-content li { margin-bottom: 6px; }
.post-content a  { color: var(--teal); font-weight: 500; }
.post-content blockquote {
  border-left: 4px solid var(--teal);
  padding: 14px 22px;
  background: rgba(0,180,166,0.06);
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
  color: var(--navy-mid);
  font-style: italic;
}
.post-content .callout {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 28px 0;
}
.post-content .callout strong { color: var(--teal); }

.post-sidebar { position: sticky; top: 84px; }
.sidebar-widget {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.sidebar-widget h4 { font-family: var(--font-head); font-size: 1rem; margin-bottom: 14px; color: var(--navy); }
.sidebar-widget ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.sidebar-widget a { font-size: 0.88rem; color: var(--muted); transition: color var(--transition); }
.sidebar-widget a:hover { color: var(--teal); }
.toc-link.active { color: var(--teal); font-weight: 600; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy-mid); padding: 16px 24px 24px; gap: 16px; }
  .nav-toggle { display: block; }

  .questions-grid { grid-template-columns: 1fr; }
  .calc-body { padding: 22px; }
  .calc-header { padding: 20px 22px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { position: static; }
}

/* ── Score disclaimer ────────────────────────────────────────── */
.score-disclaimer {
  margin: 16px 0 0;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--teal) 8%, transparent);
  border-left: 3px solid var(--teal);
  border-radius: 0 6px 6px 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
