
/* --------------------------------- General  ------------------------------------ */

:root {
    --vp-font-family-base: "Chinese Quotes", "Inter var", "Inter", ui-sans-serif, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --vp-font-family-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace
}

body {
    font-family: var(--vp-font-family-base);
    font-style: normal;
    font-weight: 270;
    background-color: #fffff4; /* #FBFBEF is warmer*/
    color: #343131;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-size: 17px;
    line-height: 1.57;
    position: relative;
}

#navbar {
    display: flex;
    justify-content: center;
    position: relative;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: #222222;
}

#navbar ul {
    list-style: none;
    margin: 0;
    padding: 10px;
    display: flex;
    margin-left: 20px;
    margin-top: 5px;
}

#navbar ul li {
    margin: 0 10px;
}

#navbar ul li a {
    text-decoration: none;
    color: #dcdcdc;
    font-family: 'proxima-nova-condensed', sans-serif;
    font-weight: 200;
}

.logo-and-title {
    display: flex;
    margin-left: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
    color: #ffffff;
}

.logo-and-title h1 {
    margin: 0 0 0 10px;
    font-family: 'proxima-nova-condensed', sans-serif;
    font-weight: 250;
    font-size: 1.35em;
}

/* center main body and adds margins left and right */
.content-container {
    max-width: 690px;
    margin: 0 auto; /* centers container */
    padding: 40px; /* padding inside the container */
    width: 100%; /* it doesn't exceed viewport width */
    text-align: left;
}

a {
    color: rgb(0, 102, 255);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.bold {
    font-weight: 600;
}

.italic {
    font-style: italic;
}


/* --------------------------------- Index  ------------------------------------ */

.intro {
    margin: 10px 0 40px 0;
}

.intro h1 {
    font-size: 1.8em;
    margin: 0 0 12px 0;
}

.intro-links {
    font-size: 0.95em;
    color: #666;
    margin-top: 12px;
}

.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 10px 0;
    border-bottom: 1px solid #e8e4da;
}

.post-list li:last-child {
    border-bottom: none;
}

.post-copy {
    min-width: 0;
}

.post-summary {
    margin: 6px 0 0 0;
    color: #666;
    font-size: 0.95em;
    line-height: 1.45;
}

.post-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.post-date {
    color: #999;
    font-size: 0.88em;
    white-space: nowrap;
}

.post-length {
    color: #b0aaa0;
    font-size: 0.76em;
    white-space: nowrap;
}

/* --------------------------------- About  ------------------------------------ */

.timeline {
    margin: 28px 0;
}

.timeline-year {
    font-size: 0.88em;
    color: #999;
    margin-top: 28px;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.timeline-year:first-child {
    margin-top: 0;
}

.timeline-entry {
    margin-bottom: 16px;
    padding-left: 16px;
    border-left: 2px solid #e0dcd2;
}

.timeline-role {
    font-weight: 560;
}

.timeline-entry p {
    margin: 4px 0 0 0;
    color: #555;
    font-size: 0.95em;
}

.personal-photo {
    display: inline;
    max-width: 35%;
    height: auto;
    border-radius: 10px;
    margin: 40px 0;
}

.image-with-caption {
    text-align: center;
    margin-bottom: 40px;
}

.caption {
    font-size: 0.85em;
    color: #666;
    margin-top: -35px;
}

/* ----------------------------- Blog posts ------------------------------------ */
.content-container.entry h1 {
    font-size: 2.75em;
    margin: 20px 0;
    line-height: 1.1;
}

/* Section title */
.content-container.entry h2 {
    font-size: 1.88em;
    line-height: 1.1;
    font-weight: 650;
    margin: 37px 0 20px 0;
}

/* Subsection title */
.content-container.entry h3 {
    font-size: 1.4em;
    line-height: 1.1;
    font-weight: 500;
    color: rgb(107, 107, 107);
    margin: 23px 0 5px 0;
}

.content-container.entry .header-date-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.content-container.entry :not(pre) > code {
    background-color: #f5f2ea;
    border: 1px solid #e7decc;
    padding: 0 4px;
    border-radius: 4px;
    font-family: var(--vp-font-family-mono);
    font-size: 0.82em;
    font-weight: 500;
    line-height: 1.2;
    color: #3d4250;
}

.content-container.entry pre:not(.bibtex) {
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #ddd4be;
    background-color: #f7f3e8;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.content-container.entry pre:not(.bibtex) code {
    display: block;
    background: transparent;
    border: 0;
    padding: 0;
    border-radius: 0;
    color: #2f3441;
    font-size: 0.84em;
    line-height: 1.55;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}

.content-container.entry pre:not(.bibtex) code.hljs {
    color: #1f2430;
}

.content-container.entry .table-wrapper {
    margin: 22px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background-color: rgba(142, 105, 32, 0.08);
    border-radius: 10px;
    padding: 16px;
}

.content-container.entry .table-block {
    margin: 22px 0;
}

.content-container.entry .table-block .table-wrapper {
    margin: 0;
}

.content-container.entry table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95em;
    line-height: 1.45;
    background-color: transparent;
    border: 1px solid rgba(142, 105, 32, 0.12);
    border-radius: 10px;
    overflow: hidden;
}

.content-container.entry thead th {
    background-color: transparent;
    color: #343131;
    font-weight: 600;
}

.content-container.entry th,
.content-container.entry td {
    padding: 10px 14px;
    background-color: transparent;
    border-bottom: 1px solid rgba(142, 105, 32, 0.12);
    vertical-align: top;
    text-align: left;
}

.content-container.entry tbody tr:nth-child(even) {
    background-color: rgba(142, 105, 32, 0.035);
}

.content-container.entry tbody tr:last-child td {
    border-bottom: 0;
}

.content-container.entry .hljs-comment,
.content-container.entry .hljs-quote {
    color: #6b6f7a;
    font-style: italic;
}

.content-container.entry .hljs-keyword,
.content-container.entry .hljs-selector-tag,
.content-container.entry .hljs-literal,
.content-container.entry .hljs-doctag {
    color: #5a3ea0;
    font-weight: 550;
}

.content-container.entry .hljs-title,
.content-container.entry .hljs-title.function_,
.content-container.entry .hljs-function .hljs-title {
    color: #0f4f78;
}

.content-container.entry .hljs-string,
.content-container.entry .hljs-regexp,
.content-container.entry .hljs-meta .hljs-string {
    color: #1f6a52;
}

.content-container.entry .hljs-number,
.content-container.entry .hljs-symbol,
.content-container.entry .hljs-bullet {
    color: #8b531f;
}

.content-container.entry .hljs-type,
.content-container.entry .hljs-class .hljs-title,
.content-container.entry .hljs-attr,
.content-container.entry .hljs-attribute {
    color: #8b2f57;
}

.content-container.entry .hljs-variable,
.content-container.entry .hljs-template-variable,
.content-container.entry .hljs-params {
    color: #3d3a54;
}

.content-container.entry .hljs-meta,
.content-container.entry .hljs-built_in {
    color: #42538a;
}

.content-container.entry .blog-header {
    padding: 30px;
}

.content-container.entry .header-date {
    font-size: 0.95em;
    color: #888888;
    margin-top: 5px;
}

.content-container.entry .header-date span {
    display: block;
}

.content-container.entry .social-links a {
    margin: 0 10px;
}

.content-container.entry hr {
    border: 0;
    height: 1px;
    background: #333;
    margin-top: 20px;
}

.content-container.entry .tagline {
    text-align: left;
    font-style: italic;
    color: #666;
    margin-top: 10px;
}

.content-container.entry section {
    margin-bottom: 20px;
    text-align: justify;
}

.fas.fa-link {
    /* favicon link size */
    font-size: 0.95em;
    margin-left: -15px;
    color: #333;
}

.fa-brands.fa-x-twitter {
    /* favicon link size */
    font-size: 1.35em;
    margin-left: -15px;
    color: #111;
}

.content-container.entry .social-links a {
    text-decoration: none; /* remove underline */
}

.bibtex-container {
    margin-top: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 5px solid #333;
    border-radius: 5px;
    font-family: monospace;
    position: relative;
}

.bibtex {
    white-space: pre-wrap; /* Preserve line breaks */
    word-wrap: break-word; /* Break long words */
    font-size: 0.9em;
    color: #555; /* Greyish color for the text */
}

.bibtex-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ffffff; /* Green background */
    border: 1px solid #9b9b9b;
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
}

.bibtex-copy-btn:hover {
    background-color: #9f9f9f; /* Darker green on hover */
}

/* ----------------------------- Entries - post navigation ------------------------------ */

.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0dcd2;
    font-size: 0.95em;
}

.post-nav a {
    max-width: 45%;
}

.post-nav-label {
    display: block;
    font-size: 0.8em;
    color: #999;
    margin-bottom: 2px;
}

.post-nav-next {
    text-align: right;
    margin-left: auto;
}

/* ----------------------------- Entries - citations ------------------------------------ */

.cite-link {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.cite-link:hover {
    text-decoration-style: solid;
}

.cite-popup {
    position: absolute;
    display: none;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.82em;
    line-height: 1.45;
    max-width: 340px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
}

.cite-popup.visible {
    display: block;
}

.cite-popup-link {
    display: inline-block;
    margin-top: 6px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ----------------------------- Entries - sidenotes ------------------------------------ */

.sidenote {
    float: right;
    clear: right;
    margin-right: -230px;
    width: 190px;
    margin-top: 4px;
    margin-bottom: 14px;
    font-size: 0.82em;
    line-height: 1.4;
    color: #666;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.sidenote-number {
    font-size: 0.75em;
    color: #888;
    vertical-align: super;
    line-height: 0;
}

/* ----------------------------- Entries - sidebar TOC ------------------------------------ */

#progress-container {
    position: fixed;
    top: 100px;
    left: 24px;
    width: 170px;
    z-index: 10;
}

#progress-container .toc-section {
    margin-bottom: 2px;
}

#progress-container .toc-section-link,
#progress-container .toc-subsection-link {
    display: block;
    position: relative;
    line-height: 1.35;
    color: #b0b0b0;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 150ms, border-color 150ms, font-weight 150ms;
}

#progress-container .toc-section-link {
    font-size: 0.78em;
    padding: 4px 0 4px 12px;
}

#progress-container .toc-subsections {
    margin-left: 12px;
}

#progress-container .toc-subsection-link {
    font-size: 0.72em;
    padding: 3px 0 3px 12px;
}

#progress-container .toc-section.subsection-active .toc-section-link {
    color: #7a7a7a;
    font-weight: 390;
}

#progress-container .toc-section-link.active,
#progress-container .toc-subsection-link.active {
    color: #343131;
    font-weight: 450;
}

#progress-container .toc-section-link.active::before,
#progress-container .toc-subsection-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1px;
    bottom: 1px;
    width: 2px;
    border-radius: 999px;
    background: #343131;
}

#progress-container .toc-section-link:hover,
#progress-container .toc-subsection-link:hover {
    color: #555;
    text-decoration: none;
}

.content-container.entry section {
    scroll-margin-top: 60px;
}

#copy-notification {
    position: fixed;
    top: 60px;
    right: 20px;
    background-color: #444;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;
    font-size: 0.85em;
}

/* ------------------------- Entries - plots ------------------------- */

.plot-container {
    /* For plots that are 100% of the content width or ANY height */
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
}

.plot-container.horizontal-125 {
    /* For plots that are 125% of the content width */
    width: 125%;
    /* Set the next value to half of the increased width over 100%. */
    margin-left: calc(-12.5%); 
}

.plot-container.horizontal-150 {
    /* For plots that are 150% of the content width */
    width: 150%;
    /* Set the next value to half of the increased width over 100%. */
    margin-left: calc(-25%); 
}

.plot-background-1 {
    /* Light contrast */
    background-color: rgba(142, 105, 32, 0.08);
    border-radius: 10px;
    padding: 20px;
    display: flex;
}

.plot-background-1-interactive {
    /* Light contrast */
    background-color: rgba(142, 105, 32, 0.08);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    border: 2px solid;
    border-image: linear-gradient(
        to right, 
        red, orange, yellow, green, blue, indigo, violet
    ) 1;
}

.plot-caption {
    color: rgba(131, 131, 131, 1);
    font-size: 0.82em;
    font-weight: 450;
    margin-top: 10px;
}

.code-chunk {
    margin: 18px 0;
}

.code-caption {
    color: rgba(131, 131, 131, 1);
    font-size: 0.82em;
    font-weight: 450;
    margin: 10px 0 0 0;
}

.content-container.entry .code-chunk pre:not(.bibtex) {
    margin: 0;
}

.block-ref {
    font-weight: 500;
}

/* Sidenotes and sidebar TOC: fall back on narrower screens */
@media (max-width: 1200px) {
    .sidenote {
        float: none;
        display: block;
        width: auto;
        margin: 8px 0 8px 20px;
        padding-left: 12px;
        border-left: 2px solid #e0dcd2;
    }

    #progress-container {
        display: none;
    }
}

/* ------------------------- Mobile styles ------------------------- */
@media (max-width: 600px) {
    #navbar {
        justify-content: space-evenly;
    }
    
    #navbar ul {
        list-style: none;
        margin: 0;
        font-size: 0.85em;
    }
    
    .logo-and-title {
        margin: 0;
    }

    .logo-and-title h1 {
        font-size: 1.07em;
        margin: -3px 0 0 10px;
    }

    .content-container {
        width: 87%;
        max-width: 400px;
        padding: 5px;
    }

    .content-container h1 {
        font-size: 1.5em;
    }

    .post-list li {
        flex-direction: column;
        gap: 4px;
    }

    .post-meta {
        align-items: flex-start;
        gap: 2px;
    }

    .post-date {
        font-size: 0.82em;
    }

    .post-length {
        font-size: 0.72em;
    }

    .post-summary {
        margin-top: 4px;
    }

    .personal-photo {
        max-width: 55%;
        margin: 40px 0;
    }

    .content-container.entry .header-top {
        margin-bottom: 0;
    }
    
    .content-container.entry .blog-header {
        padding: 0;
    }
    
    .content-container.entry .meta-info {
        margin-bottom: 0;
    }

    .content-container.entry pre:not(.bibtex) {
        padding: 12px;
        border-radius: 8px;
    }

    .content-container.entry pre:not(.bibtex) code {
        font-size: 0.8em;
    }

}
