/* Global reset + base styles for QMaths Blog */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: #1a1a1a;
  background: #fafbfc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  width: 100%;
  flex: 1;
}

a { color: #1976d2; }
a:hover { color: #0d47a1; }

img { max-width: 100%; height: auto; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  main.page-wrap { padding: .75rem .65rem; }
}

/* Reading progress bar — fixed thin strip at very top of viewport */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #0a4f9c, #1976d2);
  z-index: 200;
  transition: width .1s linear;
  pointer-events: none;
}

/* Print-friendly view — students often print study material */
@media print {
  .topbar, .footer, .sidebar, .share-bar, .related, .reading-progress, .pager,
  .breadcrumb, .toc, .cat-pill, .tags, nav { display: none !important; }
  .post-grid { grid-template-columns: 1fr !important; padding: 0 !important; }
  .post { border: none !important; padding: 0 !important; max-width: 100% !important; }
  .post-head h1 { color: #000 !important; font-size: 1.4rem !important; }
  .body { font-size: 11pt !important; line-height: 1.5 !important; color: #000 !important; }
  .body :global(a)::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .cover, figure.cover { page-break-inside: avoid; max-height: 4in !important; }
  body { background: #fff !important; color: #000 !important; }
}
