@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap');

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400; /* Regular weight */
}
a {
    color: darkred;
}
a:hover {
    color: #8B0000; /* A darker red */
}


/* The size of the diagrams (1.5 times the pdf size) is set by tikz2html (svg_scale in html_config.json).
   Don't use a transform for scaling, or a negative z-index: then the diagrams overlap the text around them,
   or are covered by it, and the links inside them can't be clicked. */
.svg-diagram {
    display: block;               /* Treat as a block-level element */
    margin: 20px auto;            /* Centered, with some vertical space */
    max-width: 100%;              /* Shrink on small screens */
    height: auto;
    background-color: white;      /* Useful for dark mode to ensure the diagram remains visible */
}

.inline-diagram {
    background-color: white;
}

.figure .inline-diagram {
    padding: 20px;
}


/* Styling for the 'proof.' at start of proof environment */
.proof .cmti-10x-x-109 {
    text-decoration: underline;
    /*background-color: darkred;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;*/
/*    float: right;*/
}

/* Initially hide the content of the proof div */
.proof-content {
    display: none;
}

.proof {
    border: 1px solid #ccc;
    padding: 15px;
    margin-bottom: 10px;
}

/* When the proof is collapsed, reduce the empty space */
.proof.collapsed {
    padding-bottom: 0;   /* Remove padding at the bottom */
    margin-bottom: 10px; /* Reduce the margin below the button */
}

.toggle-btn {
    display: block;
    margin-top: 10px;
    padding: 5px 10px;
    cursor: pointer;
    background-color: darkred;
    color: white;
    border: none;
}

/* Adjust the button position when collapsed */
.proof.collapsed .toggle-btn {
    margin-top: -20px; /* Adjust the margin above the button to move it up */
}

/* Global toggle button styling */
.global-toggle-btn {
    position: fixed;  /* Keep it fixed in the viewport */
    bottom: 20px;        /* Distance from the top */
    right: 20px;       /* Distance from the left */
    padding: 10px 15px; /* Padding for the button */
    cursor: pointer;  /* Cursor change to indicate clickable */
    z-index: 1000;    /* Ensure it appears above other content */
    background-color: darkred;
    color: white;
    border: none;
}

/* Hamburger Menu Button */
.hamburger-menu {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
}

.hamburger-menu div {
    height: 4px;
    background-color: darkred;
}

/* Navigation Menu */
.menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    height: 100%;
    background-color: #333;
    color: white;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
}

.menu-container.active {
    transform: translateX(0);
}

.menu-container ul {
    list-style-type: none;
    padding: 50px 0 0 0; /* Add padding to push the list down */
    margin: 0;
}

/* Links to the previous/next chapter and the contents, at the top of the menu. They stay visible when the list
   of sections is scrolled. The top padding leaves room for the hamburger button. */
.menu-nav {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    gap: 6px;
    padding: 50px 10px 10px 10px;
    background-color: #333;
    border-bottom: 1px solid #555;
}

.menu-nav a, .menu-nav span {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    border-radius: 4px;
    background-color: #444;
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    white-space: nowrap;
}

.menu-nav a:hover {
    background-color: darkred;
}

.menu-nav .disabled {
    color: #888;
    background-color: transparent;
}

.menu-nav + ul {
    padding-top: 8px; /* The navigation already leaves room for the hamburger button */
}

.menu-container li {
    padding: 5px;
    border-bottom: 1px solid #444;
}

.menu-container li a {
    color: white;
    text-decoration: none;
}

.menu-container li a:hover {
    text-decoration: underline;
}

.menu-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #ddd;
}

.hamburger-wrapper {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
}

/* Subsection styling in menu*/
.subsection {
    padding-left: 20px;
}

.menu-container li.subsection {
    padding-left: 20px; /* Add indentation for subsections */
    font-size: 0.8em;    /* Optionally, make subsections slightly smaller */
}


@media (prefers-color-scheme: dark) {
  a {
    color: #FA8072;
  }
  a:hover {
    color: #FF6A5A;
  }
  /*.toggle-btn {
    background-color: #FA8072;
  }*/
  .hamburger-menu div {
    background-color: #FA8072;
  }
  p {
    color: #DDD;
  }
}