/* Easy A with Abby: blog styles. Tokens and nav match the homepage. */
:root {
  --cream:      #f5f0e8;
  --parchment:  #ede4d0;
  --sand:       #c9b99a;
  --clay:       #a0845c;
  --bark:       #6b4f35;
  --fern:       #4e6148;
  --warm-dark:  #2e2218;
  --terracotta: #b5673e;
  --blush:      #d9b99b;
  --accent:     #b5673e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  background: var(--cream);
  color: var(--warm-dark);
  font-family: 'Nunito', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { padding-top: 72px; flex: 1; }

/* ── NAV (same as homepage) ── */
body > nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(245,240,232,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sand);
}
.nav-logo {
  font-family: 'Caveat', cursive;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--bark);
  text-decoration: none;
  white-space: nowrap;
}
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bark);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.is-current { color: var(--fern); }
.nav-links a.is-current { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav-dropdown { position: relative; }
.nav-cta-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bark);
  color: var(--cream);
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.3;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.nav-cta-btn:hover { background: var(--fern); transform: translateY(-1px); }
.cta-chevron { font-size: 0.75rem; display: inline-block; transition: transform 0.2s; }
.nav-cta-btn.is-open .cta-chevron { transform: rotate(180deg); }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--cream);
  border: 1.5px solid var(--sand);
  border-radius: 12px;
  list-style: none;
  padding: 0.4rem 0;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(107,79,53,0.14);
  overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-menu li a { display: block; padding: 0.6rem 1.1rem; }
.dropdown-menu li a:hover { background: var(--parchment); color: var(--fern); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--bark); border-radius: 2px; }

/* ── BLOG INDEX ── */
.blog-hero {
  text-align: center;
  padding: 4.5rem 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  top: -140px; right: -80px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(178,192,164,0.28) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--clay);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.hero-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  color: var(--bark);
  line-height: 0.95;
}
.hero-title span { color: var(--terracotta); }
.hero-sub {
  font-family: 'Lora', serif;
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  color: var(--clay);
  max-width: 520px;
  line-height: 1.65;
  margin: 1.1rem auto 0;
}

.blog-list { max-width: 1100px; margin: 0 auto; padding: 1rem 1.5rem 5rem; }

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.filter-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bark);
  background: transparent;
  border: 1.5px solid var(--sand);
  border-radius: 50px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.filter-btn:hover:not(:disabled) { border-color: var(--accent, var(--bark)); color: var(--accent, var(--bark)); }
.filter-btn.is-active { background: var(--accent, var(--bark)); border-color: var(--accent, var(--bark)); color: var(--cream); }
.filter-btn.is-active:hover { color: var(--cream); }
.filter-btn[data-filter="all"] { --accent: var(--bark); }
.filter-btn:disabled { opacity: 0.4; cursor: default; }
.filter-btn:focus-visible { outline: 2px solid var(--fern); outline-offset: 2px; }

.filter-status { text-align: center; font-size: 0.85rem; color: var(--clay); min-height: 1.4em; margin-bottom: 1.25rem; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 340px));
  justify-content: center;
  gap: 1.5rem;
}
.post-card[hidden] { display: none; }
.post-card {
  background: #fbf8f2;
  border: 1.5px solid var(--parchment);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(107,79,53,0.12); }
.post-card-link { display: flex; flex-direction: column; height: 100%; padding: 1.5rem 1.5rem 1.35rem; color: inherit; text-decoration: none; }
.post-card-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.78rem; color: var(--clay); margin-bottom: 0.85rem; }
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}
.post-card-title { font-family: 'Lora', serif; font-size: 1.25rem; font-weight: 600; line-height: 1.35; color: var(--warm-dark); margin-bottom: 0.6rem; }
.post-card-excerpt { font-size: 0.93rem; line-height: 1.6; color: #5a4a3a; flex: 1; }
.post-card-more { margin-top: 1.1rem; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--clay); }
.empty-title { font-family: 'Lora', serif; font-size: 1.2rem; color: var(--bark); margin-bottom: 0.5rem; }
.empty a { color: var(--terracotta); font-weight: 600; }

/* ── POST ── */
.post-hero { max-width: 760px; margin: 0 auto; padding: 3.5rem 1.5rem 2rem; }
.crumbs { display: flex; gap: 0.5rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sand); margin-bottom: 1.1rem; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.post-title {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.85rem);
  line-height: 1.18;
  color: var(--warm-dark);
  letter-spacing: -0.01em;
}
.byline { display: flex; align-items: center; gap: 0.85rem; margin-top: 1.5rem; }
.byline img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--parchment); }
.byline-name { display: block; font-weight: 700; color: var(--bark); text-decoration: none; }
.byline-name:hover { color: var(--accent); }
.byline-meta { font-size: 0.85rem; color: var(--clay); }

.post-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 220px minmax(0, 720px);
  gap: 3rem;
  justify-content: center;
}
.toc { position: sticky; top: 100px; align-self: start; padding-top: 0.4rem; }
.toc-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--clay); margin-bottom: 0.75rem; }
.toc ol { list-style: none; border-left: 2px solid var(--parchment); }
.toc li a { display: block; padding: 0.35rem 0 0.35rem 0.9rem; font-size: 0.85rem; line-height: 1.4; color: var(--bark); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc li a:hover { color: var(--accent); border-left-color: var(--accent); }

.prose { font-size: 1.08rem; line-height: 1.8; color: #3a2c20; padding-bottom: 1rem; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.3;
  color: var(--warm-dark);
  margin-top: 2.75rem;
}
.prose h2::before { content: ''; display: block; width: 36px; height: 3px; background: var(--accent); border-radius: 2px; margin-bottom: 0.9rem; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { font-family: 'Lora', serif; font-size: 1.2rem; color: var(--bark); margin-top: 2rem; }
.prose a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }
.prose strong { color: var(--warm-dark); }
.prose ol, .prose ul { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.6rem; }
.prose li::marker { color: var(--accent); font-weight: 700; }

.table-wrap { overflow-x: auto; border: 1.5px solid var(--parchment); border-radius: 12px; background: #fbf8f2; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; }
.prose th { text-align: left; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cream); background: var(--accent); padding: 0.7rem 0.9rem; white-space: nowrap; }
.prose td { padding: 0.7rem 0.9rem; border-top: 1px solid var(--parchment); vertical-align: top; }

/* FAQ heading gets its question/answer rhythm from the paragraphs; questions are bold */
.prose h2#frequently-asked-questions ~ p strong:first-child { display: block; font-family: 'Lora', serif; font-size: 1.08rem; color: var(--bark); }

.tutor-card {
  max-width: 1000px;
  margin: 3rem auto 0;
  padding: 2rem;
  display: flex;
  gap: 1.75rem;
  align-items: center;
  background: var(--parchment);
  border-radius: 18px;
  border-left: 6px solid var(--accent);
}
.tutor-card:last-child { margin-bottom: 5rem; }
.tutor-card img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid var(--cream); }
.tutor-card-eyebrow { font-family: 'Caveat', cursive; font-size: 1.4rem; color: var(--terracotta); line-height: 1; }
.tutor-card-title { font-family: 'Lora', serif; font-size: 1.35rem; font-weight: 600; color: var(--warm-dark); margin-top: 0.3rem; }
.tutor-card-body { color: #5a4a3a; margin-top: 0.35rem; line-height: 1.6; }
.tutor-card-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.btn { display: inline-block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.7rem 1.3rem; border-radius: 50px; text-decoration: none; transition: background 0.2s, color 0.2s, transform 0.15s; }
.btn-solid { background: var(--bark); color: var(--cream); }
.btn-solid:hover { background: var(--fern); transform: translateY(-1px); }
.btn-ghost { border: 1.5px solid var(--bark); color: var(--bark); }
.btn-ghost:hover { background: var(--bark); color: var(--cream); }

.related { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem 5rem; }
.related-heading { font-family: 'Caveat', cursive; font-size: 2.4rem; color: var(--bark); margin-bottom: 1.25rem; }
.related .post-card-title { font-size: 1.12rem; }
.related-all { margin-top: 1.5rem; }
.related-all a { color: var(--accent); font-weight: 700; text-decoration: none; }
.related-all a:hover { text-decoration: underline; }

/* ── FOOTER (same as homepage) ── */
footer { background: var(--bark); color: rgba(245,240,232,0.7); text-align: center; padding: 3rem 2rem; font-size: 0.875rem; }
footer .footer-brand { font-family: 'Caveat', cursive; font-size: 2rem; color: var(--cream); display: block; margin-bottom: 0.5rem; }
footer a { color: var(--blush); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-fine { margin-top: 0.75rem; font-size: 0.78rem; opacity: 0.55; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  body > nav { padding: 0.85rem 1.25rem; flex-wrap: wrap; }
  .nav-links { display: none; flex-direction: column; width: 100%; gap: 0; margin-top: 0.75rem; border-top: 1px solid var(--sand); padding-top: 0.5rem; }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.65rem 0; font-size: 0.95rem; }
  .nav-links a.is-current { text-decoration: none; }
  .nav-cta-btn { width: 100%; border-radius: 8px; justify-content: center; margin-top: 0.5rem; }
  .dropdown-menu { position: static; box-shadow: none; border: none; border-top: 1px solid var(--sand); border-radius: 0; padding: 0; }
  .nav-toggle { display: flex; }
  main { padding-top: 64px; }

  .post-layout { grid-template-columns: minmax(0, 720px); }
  .toc { display: none; }
}

@media (max-width: 640px) {
  .blog-hero { padding: 3rem 1rem 1.5rem; }
  .blog-list, .related { padding-left: 1rem; padding-right: 1rem; }
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .filters { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.4rem; margin: 0 -1rem 0.75rem; padding-left: 1rem; padding-right: 1rem; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; }
  .post-hero { padding: 2.25rem 1rem 1.5rem; }
  .post-layout { padding: 0 1rem; }
  .prose { font-size: 1.02rem; }
  /* Tables become one card per row on phones */
  .table-wrap { overflow: visible; border: none; background: none; }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100%; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose tr { background: #fbf8f2; border: 1.5px solid var(--parchment); border-left: 4px solid var(--accent); border-radius: 12px; padding: 0.6rem 0.9rem; }
  .prose tr + tr { margin-top: 0.75rem; }
  .prose td { border-top: none; padding: 0.3rem 0; display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; }
  .prose td::before { content: attr(data-label); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); padding-top: 0.15rem; }
  .prose h2 { font-size: 1.4rem; }
  .tutor-card { flex-direction: column; text-align: center; margin: 2.5rem 1rem 0; padding: 1.75rem 1.25rem; border-left: none; border-top: 6px solid var(--accent); }
  .tutor-card-actions { justify-content: center; }
  .btn { width: 100%; text-align: center; }
  footer p { line-height: 2; }
}

/* ── FIGURES: Rubik's cube (scrambled to solved) ── */
.cube-figure { margin: 2rem 0 0.5rem; }
.cube-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 0.5rem;
  max-width: 560px;
  margin: 0 auto;
}
.cube-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cube-svg { width: 100%; max-width: 170px; height: auto; display: block; }
.cube-cap { margin-top: 0.85rem; font-family: 'Lora', serif; font-weight: 600; font-size: 1rem; color: var(--warm-dark); line-height: 1.3; }
.cube-sub { font-size: 0.85rem; color: var(--clay); line-height: 1.4; margin-top: 0.15rem; max-width: 190px; }
.cube-arrow { display: flex; flex-direction: column; align-items: center; width: 130px; margin-top: 2.4rem; }
.cube-arrow-label { font-family: 'Caveat', cursive; font-size: 1.3rem; line-height: 1.05; color: var(--terracotta); text-align: center; margin-bottom: 0.2rem; }
.cube-arrow-svg { width: 110px; height: auto; display: block; }

/* ── FIGURES: route line (units only, handwritten) ── */
.prose .route {
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: 1.65rem;
  line-height: 1.5;
  color: var(--bark);
  margin: 1.25rem 0;
  padding: 0.4rem 0;
}
.route-step { white-space: nowrap; }
.route-arrow { color: var(--terracotta); margin: 0 0.45rem; }

@media (max-width: 640px) {
  .cube-row { grid-template-columns: 1fr 76px 1fr; gap: 0.25rem; }
  .cube-svg { max-width: 118px; }
  .cube-arrow { width: 76px; margin-top: 1.4rem; }
  .cube-arrow-label { font-size: 1.02rem; }
  .cube-arrow-svg { width: 64px; }
  .cube-cap { font-size: 0.92rem; margin-top: 0.6rem; }
  .cube-sub { font-size: 0.76rem; }

  .prose .route { font-size: 1.4rem; }
}

/* ── FIGURES: chemistry line art (magnets, mechanism, steric) ── */
.chem-figure { margin: 2rem 0 1.75rem; }
.chem-figure figcaption { margin-top: 0.9rem; text-align: center; font-size: 0.88rem; line-height: 1.55; color: var(--clay); max-width: 560px; margin-left: auto; margin-right: auto; }
.chem-svg { display: block; width: 100%; height: auto; }
.chem-magnets .chem-svg { max-width: 480px; margin: 0 auto; }
.mech-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; }
.mech-part, .steric-part { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mech-arrow { font-size: 1.8rem; color: var(--bark); padding-bottom: 1.6rem; }
.mech-cap { margin-top: 0.4rem; font-family: 'Lora', serif; font-weight: 600; font-size: 0.95rem; line-height: 1.35; color: var(--warm-dark); max-width: 260px; }
.steric-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (min-width: 1025px) { .prose .chem-mech, .prose .chem-steric { margin-left: -2.5rem; margin-right: -2.5rem; } }
@media (max-width: 640px) {
  .mech-row { grid-template-columns: 1fr; }
  .mech-arrow { transform: rotate(90deg); padding: 0; justify-self: center; }
  .steric-row { grid-template-columns: 1fr; gap: 1.5rem; }
  .chem-svg { max-width: 320px; margin: 0 auto; }
}

/* ── FIGURES: flywheel ── */
.fly-figure .chem-svg { max-width: 560px; margin: 0 auto; }
@media (max-width: 640px) { .fly-figure .chem-svg { max-width: 100%; } }

/* ── FIGURES: compass and test page ── */
.compass-figure .chem-svg { max-width: 560px; margin: 0 auto; }
.test-figure .chem-svg { max-width: 640px; margin: 0 auto; }
@media (min-width: 1025px) { .prose .test-figure { margin-left: -2.5rem; margin-right: -2.5rem; } }
.test-narrow { display: none; }
@media (max-width: 640px) {
  .test-figure .test-wide { display: none; }
  .test-figure .test-narrow { display: block; max-width: 360px; margin: 0 auto; }
}
