/* ABOUTME: Custom styles for the Agora reader that enhance Standard Ebooks CSS for web */
/* ABOUTME: Improves typography, spacing, and footnote handling for optimal reading experience */

/* Better typography for web reading */
body {
  /* High-quality serif stack optimized for screen reading */
  font-family: Georgia, 'Times New Roman', serif !important;
  font-size: 18px !important;
  line-height: 1.75 !important;
  color: #1a1a1a !important;

  /* Improve font rendering for crisp, readable text */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Remove first-line indent and use paragraph spacing instead (better for web) */
section p,
article p,
main p,
p {
  text-indent: 0 !important;
  margin-bottom: 1.25em !important;
  margin-top: 0 !important;
  line-height: 1.75 !important;
}

/* Optimal line length for readability (45-75 characters) */
section,
article,
main {
  max-width: 65ch !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Make headings more readable on web */
h2 {
  font-size: 1.5em !important;
  margin: 2em 0 1.5em 0 !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

/* Style footnote links as superscript reference numbers */
/* Use attribute selector without namespace for better browser support */
a[id^="noteref-"] {
  font-size: 0.75em;
  vertical-align: super;
  color: #0066cc;
  text-decoration: none;
  font-weight: normal;
  line-height: 0;
  padding: 0 0.15em;
  cursor: pointer;
  transition: color 0.2s ease;
}

a[id^="noteref-"]:hover {
  color: #0052a3;
  text-decoration: underline;
}

/* Alternative: hide them completely for cleaner reading */
/* Uncomment this block to remove footnotes entirely */
/*
a[id^="noteref-"] {
  display: none;
}
*/

/* Mobile: slightly smaller font, maintain comfortable spacing */
@media (max-width: 640px) {
  body {
    font-size: 17px !important;
    line-height: 1.7 !important;
  }

  section p,
  article p,
  main p,
  p {
    margin-bottom: 1em !important;
    line-height: 1.7 !important;
  }

  h2 {
    font-size: 1.4em !important;
    margin: 1.5em 0 1em 0 !important;
  }
}
