
/* Styles for the images and slide numbers */

@import url('https://fonts.googleapis.com/css?family=Merriweather');

/* Main slide figure container */
.slide-figure {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 3em;
    position: relative;
    width: 100%;
    max-width: 100%;
}

/* Margin note styling */
.slide-figure .marginnote {
    flex: 0 2 30%;
    margin-right: 100px;
    float: none;
    position: relative;
}

/* Image container styling */
.slide-figure .image-container {
    flex: 0 0 55%; /* Don't shrink, don't grow, stay at 55% */
    position: sticky;
    top: 5rem;
    height: fit-content;
    align-self: flex-start;
    display: flex;
    flex-direction: column; /* Stack image and slide number vertically */
}

/* Image sizing within container */
.slide-figure .image-container img {
    width: 100%;
    max-width: 100%;
    border: 1px solid #ccc;
    display: block;
}

/* Slide number styling - keep it with the image */
.slide-number {
    font-size: 0.8em;
    margin-top: 5px;
    text-align: right;
    color: gray !important;
}

.marginnote p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-top: 0.25em;
}

.subtitle {
    font-size: 1em;
    color: gray;
    padding-bottom: 100px; /* Increased margin to add extra vertical space */
}

/* Default styling for larger screens */
.subtitle span {
    display: inline;
    white-space: nowrap; /* Prevent line breaks within each name */
    margin: 0;
}

emph {
    font-style: italic;
}

/* Separator between slides */
.slide-block-separator {
    height: 50px;
    clear: both;
}

/* Run me styling */
.run-me img {
    border: 3px solid green !important;
}

/* Style for the clickable "Run this slide" link */
.run-me .run-link {
    position: absolute;
    top: 0px;
    right: -3px;
    background: none !important;
    background-color: green !important;
    color: white !important;
    padding: 5px 10px;
    font-size: 1.1em;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    background-repeat: no-repeat;
}

/* Anchor link styling */
.slide-figure .anchor-link {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none !important;
    color: gray !important;
    font-size: 1.4em;
    text-decoration: none !important;
    display: none;
    text-shadow: none !important;
    box-shadow: none !important;
    background-repeat: no-repeat;
}

/* GitHub-style SVG icon */
.anchor-link svg.octicon {
    fill: gray;
    vertical-align: middle;
}

.slide-figure:hover .anchor-link {
    display: inline-block;
}

.anchor-link svg.octicon:hover {
    fill: black;
}

/* KaTeX styling */
.katex {
    font-size: 1em !important;
}

/* Back to top link */
.back-to-top {
    display: block;
    text-align: center;
    margin: 20px 0;
    font-size: 1.3em;
    color: var(--text-color);
    text-decoration: none;
}

/* Theme colors */
:root {
    --bg-color: #fffff8;
    --text-color: #111;
}

.dark-mode {
    --bg-color: #151515 !important;
    --text-color: #ddd !important;
}

/* Theme application */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme toggle button */
#themeToggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 1em;
    transition: color 0.3s ease;
    margin-right: 50px;
}

#themeToggle svg {
    fill: var(--text-color);
    transition: fill 0.3s ease;
    transform: translateY(20px);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .slide-figure {
        max-width: 100%;
        display: block;
    }
    
    .slide-figure .image-container {
        display: block;
        top: 0;
        width: 100%;
    }
    
    .slide-figure .marginnote {
        display: block;
        width: 100%; /* Full width for smaller screens */
        margin-left: 0;
        margin-top: 10px; /* Add space above margin note */
        float: none; /* Remove float */
        clear: none; /* Remove clear */
        width: 100%; /* Let the width adjust naturally */
    }

    .subtitle span {
        display: block;
        margin-top: 0.15em;
    }
}
