li {
  font-size: 18px;
  line-height: 22px;
}

/* ===============================
   MATHJAX STYLING (DARK THEME)
=============================== */

/* Inline math */
/* ===============================
   MATHJAX STYLING (COHERENT)
   (MathJax v3 SVG output)
=============================== */

/* Global MathJax container baseline */
mjx-container {
  color: var(--fg);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.2;
}

/* Keep inline math aligned and sized like text */
mjx-container[display="false"] {
  display: inline-block;
  vertical-align: -0.15em;
  /* aligns with baseline better */
  margin: 0 0.12em;
  /* breathing room in sentences */
  font-size: 1em;
  /* same as surrounding text */
}

/* Display math: make it feel like your code/callout blocks */
mjx-container[jax="SVG"][display="true"] {
  display: block;
  margin: 1.0em 0;
  padding: 0.85em 1.0em;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent SVG from doing weird min-width behavior */
mjx-container[jax="SVG"]>svg {
  overflow: visible;
  min-width: 0 !important;
  max-width: 100%;
}

/* Make long equations scroll nicely instead of overflowing */
mjx-container[jax="SVG"][display="true"]>svg {
  width: max-content;
  max-width: 100%;
}

/* Slightly refine symbol contrast (but don’t fight MathJax too hard) */
mjx-mi,
mjx-mo,
mjx-mn {
  color: var(--fg);
}

/* Operators readability */
mjx-mo {
  opacity: 0.95;
}

/* Sub/superscripts: less tiny, more readable */
mjx-script {
  font-size: 0.82em;
  opacity: 0.92;
}

/* Fractions: a touch more spacing */
mjx-frac {
  padding: 0 0.08em;
}

/* Matrices/cases: keep compact and aligned */
mjx-mtable {
  padding: 0.15em 0.25em;
}

/* Headings: don’t let math become huge inside titles */
h1 mjx-container,
h2 mjx-container,
h3 mjx-container {
  font-size: 0.95em;
}

/* Make math inside your flashcard view match the card typography */
#card mjx-container {
  font-size: 1em;
}

/* Optional: remove MathJax context-menu / assistive artifacts visually (keeps accessibility) */
mjx-assistive-mml {
  opacity: 0;
}

#page-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 12px;
}

/* Title */

.meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  justify-content: space-between;
}

#fc-buttons button {
  flex: auto;
}

.page-date {
  font-size: 1.0rem;
  color: var(--fg);
  font-weight: bold;
}

hr {
  margin-bottom: 30px;
}

#begrepp-btn {
  padding: 8px 8px;
  font-size: 0.9rem;
  font-weight: 600;

  border-radius: 6px;
  cursor: pointer;
  color: var(--bg1);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#begrepp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

:root {

  --bg: #140d2a;
  --bg2: #0d081d;
  --fg: #dad8d8;
  --border: #44475a;
  --comment: #6272a4;
  --accent: #bd93f9;
  --accent2: #50fa7b;
  --danger: #ff5555;

  --accent3: #8be9fd;
  --accent4: #ffb86c;
  --accent5: #ff79c6;
  --accent6: #f1fa8c;

  --radius: 8px;
  --radius-lg: 8px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);

  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Fira Code", "JetBrains Mono", Monaco, Consolas, "Ubuntu Mono", monospace;
  box-sizing: border-box;
  color: var(--fg);

}

body {
  min-height: 100vh;
}

body {
  letter-spacing: 0.15px;
}

h1,
h2,
h3 {
  letter-spacing: -0.5px;
}

p,
li {
  text-wrap: pretty;
}

*::-webkit-scrollbar {
  width: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--bg2);
}

*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

#navbar {
  padding: 20px;
  backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(180deg, rgba(3, 2, 6, 0.85), rgba(9, 5, 21, 0.85));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

  margin-bottom: 20px;
}

#navbar-title {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--fg);
  cursor: pointer;
}

#content {
  max-width: 900px;
  margin: 0 auto;
}

#page {
  margin: 0 auto;
  max-width: 800px;
  padding: 12px;
}

#page-title {
  margin-top: 0;
  padding-top: 0;
  margin: 0px;
  padding: 0px;
  display: flex;
  justify-content: space-between;

  font-size: 3.4rem;
  margin: 0px;
  color: var(--fg);
  padding: 0px;
}



#page-title p {
  color: var(--accent3);
  margin: 0px;
  padding: 0px;
  font-style: italic;
}

#title {
  color: var(--fg);
}

#back-btn {
  color: var(--accent);
  font-weight: bold;
  font-size: 1.2rem;
  display: inline;
  cursor: pointer;
  margin-bottom: 20px;
}

#back-btn:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
#navbar-title {

  font-family: "Fira Code", "JetBrains Mono", Monaco, Consolas, "Ubuntu Mono", monospace;
}


h1 {
  color: var(--accent);
  font-size: 24px;
}

h2 {
  color: var(--accent4);
  margin-top: 18px;
  margin-bottom: 8px;
}

h3 {
  font-size: 12px;
  color: var(--accent2);
}

strong {
  color: var(--danger);
}

em {
  color: var(--comment);
}

pre {
  background: var(--bg2) !important;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius);
  overflow-x: auto;
}

.menu-item {
  display: block;
  padding: 24px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  margin-bottom: 8px;
  cursor: pointer;
  color: var(--fg);
  text-decoration: none;

  transition: 0.15s ease;

  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

.menu-item:hover {
  background: var(--border);
}

.img-row {
  display: flex;
  gap: 20px;
  margin: 14px 0;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.col-text {
  text-align: left;
}

.img-row .col-img img {
  max-width: 200px;
  border-radius: var(--radius);
}

.img-center {
  display: block;
  margin: auto;
  max-width: 40%;
}

blockquote {

  border-left: 4px solid var(--accent);
  padding-left: 10px;
  margin: 0px;
}

blockquote p {
  margin: 0;
}

blockquote ol {
  list-style: none;
  padding: 0px;
}

blockquote li {
  line-height: 1.8;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
}

table th,
table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
}

table th {
  background: var(--bg2);
  color: var(--accent4);
  font-weight: bold;
}

table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.callout {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 12px 12px;
}

.callout-title {
  background-color: var(--accent);
  padding: 6px;
  color: var(--bg);
  font-size: 18px;
  font-weight: bold;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.callout-body {
  font-size: 18px;
  padding: 0px 16px;
}

.callout {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

#trainer-container {
  width: min(90%, 500px);
  margin: auto;
  padding: 20px;
  text-align: center;
}

#card {
  background: var(--bg2);
  padding: 30px;
  border-radius: var(--radius-lg);

  border: 4px solid var(--border);
  justify-content: center;
  padding: 80px;
  align-items: center;
  font-size: 28px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#card:hover {
  background: var(--accent);
  color: #000;
}

#fc-buttons {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
}

button:hover {
  background: var(--accent);
  color: #000;
}


@media (max-width: 768px) {

  .meta-row {
    flex-wrap: wrap;

    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  #page-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta-right {
    align-items: flex-start;
  }

  #content {}


  #card {
    font-size: 18px;
    padding: 20px;
    min-height: 110px;
  }

  button {
    font-size: 14px;
  }


  .img-row {
    flex-direction: column;
    padding-left: 0;
    border-left: none;
  }

  .img-row .col-img img {
    max-width: 100%;
  }
}
