/* assets/css/style.css */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%; /* 16px base */
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fafafa;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Links ---------- */
a {
  color: #2a7ae2;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover,
a:focus {
  color: #1a56b0;
  text-decoration: underline;
}

/* ---------- Header & Navigation ---------- */
header {
  background-color: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.site-branding a {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  text-decoration: none;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

nav a {
  font-weight: 500;
  color: #555;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

nav a:hover,
nav a:focus {
  color: #111;
  border-bottom-color: #2a7ae2;
  text-decoration: none;
}

/* ---------- Main Content ---------- */
main {
  flex: 1;
  max-width: 780px;
  width: 90%;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

main h1, main h2, main h3 {
  color: #222;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

main h1 { font-size: 2rem; }
main h2 { font-size: 1.5rem; margin-top: 1.5rem; }
main h3 { font-size: 1.25rem; margin-top: 1.25rem; }

main p {
  margin-bottom: 1rem;
}

/*
main code {
  background: #f4f4f4;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
}*/


/* Inline */
code {
  background: #f3f3f3;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Block */
pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 1.2em 1.5em;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  tab-size: 4;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 1px solid #333;
  position: relative;
}

pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

main img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 0px;
}

main ul,
main ol {
  margin-bottom: 1rem;      /* matches your paragraph spacing */
  padding-left: 2rem;       /* restores bullet/number indentation */
}

blockquote {
  margin: 1.5rem 0;                 /* same vertical rhythm as paragraphs */
  padding: 1rem 1.5rem;
  border-left: 4px solid #2a7ae2;   /* accent colour matching your links */
  background: #f7f9fc;              /* very light blue-grey background */
  color: #4a4a4a;
  border-radius: 0 6px 6px 0;       /* rounds the right corners slightly */
}

blockquote p {
  margin-bottom: 0.5rem;            /* override main p spacing inside blockquote */
}

blockquote p:last-child {
  margin-bottom: 0;                 /* no extra space after the last paragraph */
}

blockquote blockquote {
  margin-left: 1rem;
  border-left-color: #aaa;
  background: transparent;
}

hr {
  border: none;
  height: 1px;
  background-color: #e8e8e8;          /* soft, near-white grey */
  margin: 2rem 0;
}

/* ---------- Tables ---------- */
main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border-radius: 6px;
  overflow: hidden;              /* keeps the radius clean */
}

main th,
main td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
}

main th {
  background: #2a7ae2;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

main td {
  color: #333;
}

main tbody tr:nth-child(even) {
  background: #fafafa;
}

main tbody tr:hover {
  background: #f0f7ff;
}

/* Responsive scroll for small screens */
@media (max-width: 600px) {
  main table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;        /* optional – keep cells from wrapping */
    border-radius: 6px;
  }
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  background-color: #fff;
  border-top: 1px solid #e0e0e0;
  color: #666;
  font-size: 0.9rem;
}

footer strong {
  color: #333;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  nav ul {
    justify-content: center;
    gap: 1rem;
  }

  main {
    margin: 1.25rem auto;
    padding: 1.25rem;
  }
}

/* MathJax display equations: horizontal scroll on small screens */
@media (max-width: 600px) {
  mjx-container[display="true"] {
    max-width: 100%;                 /* constrain box to column width */
    overflow-x: auto;                /* scrollbar appears only if needed */
    overflow-y: hidden;              /* prevent double scrollbars */
    -webkit-overflow-scrolling: touch;  /* smooth scrolling on iOS */
  }
}
