/* ==========================================================================
   Blog Stylesheet for Ben McDonough
   Optimized for readability, LaTeX/Pandoc elements, and MathJax compatibility
   ========================================================================== */
:root {
    --bg-color: #282C34;      /* Deep dark background */
    --card-bg: #363B44;       /* Primary card background */
    --text-main: #D7D7D7;     /* Main reading text */
    --text-muted: #565f89;    /* Muted info text */
    --accent: #4366a3;  /* Hover state blue */
    --border-color: #555768;

    /* Academic/Theorem Accent Colors */
    --theorem-bg: rgba(0, 0, 0, 0.15);
    --def-accent: #c792ea;
    --proof-accent: #c3e88d;
}

/* --- Base Typography & Body --- */
body {
    font-family: 'Avenir', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.8; /* Perfect for reading paragraphs */
    font-size: 1.1rem;
    max-width: 850px; /* Restricts line length for readability */
    margin: 0 auto;
    padding: 20px 30px;
}

h1, h2, h3, h4 {
    line-height: 1.3;
    color: #ffffff;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.2rem;
    /*border-bottom: 2px solid var(--border-color);*/
    padding-bottom: 10px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* --- Header & Navigation --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    /*border-bottom: 1px solid var(--border-color);*/
    padding-bottom: 15px;
    margin-bottom: 40px;
}

header h1 {
    font-size: 1.5rem;
    border: none;
    padding: 0;
    margin: 0;
}

nav a {
    color: var(--text-main);
    margin-left: 20px;
    font-weight: bold;
}

nav a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* --- Main Content Card --- */
.card {
    background-color: var(--card-bg);
    padding: 50px;
    border-radius: 12px;
    /*box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);*/
}

/* --- Pandoc Custom Environments --- */
/* Formats the div.defn, div.lem, div.prop, and div.proof generated by Pandoc */
.defn, .lem, .prop, .cor {
    background-color: var(--theorem-bg);
    border-left: 4px solid var(--def-accent);
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 0 6px 6px 0;
}

.proof {
    background-color: transparent;
    border-left: 4px solid var(--proof-accent);
    padding: 15px 20px;
    margin: 25px 0;
    font-style: italic;
    color: var(--text-main);
}

.proof p {
    margin: 0;
}

/* --- MathJax Hard Reset --- */
/* Absolutely prevents global CSS from ruining equations */
mjx-container {
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
}

mjx-container[display="true"] {
    margin: 2em 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
}

/* --- Footer --- */
footer {
    margin-top: 50px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer hr {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin-bottom: 20px;
}

.pic {
  flex-shrink: 0; /* Prevents images from getting crushed by long text */
  display: flex;
  justify-content: center; /* Aligns horizontally */
  align-items: center;
  margin-top: 10px;
  margin-bottom: 10px;
}

.figure {
  max-width: 250px;
  max-height: 250px;
  height: auto;
  border-radius: 8px;
}

