:root {
    --header-height: 3.5rem;
    --first-color: hsl(220, 68%, 54%);
    --first-color-lighten: hsl(220, 68%, 97%);
    --title-color: hsl(220, 48%, 28%);
    --text-color: hsl(220, 12%, 45%);
    --body-color: hsl(220, 100%, 99%);
    --body-font: "Poppins", sans-serif;
    --normal-font-size: .938rem;
    --small-font-size: .813rem;
    --smaller-font-size: .75rem;
    --font-medium: 500;
    --font-semi-bold: 600;
    --z-tooltip: 10;
    --z-fixed: 100;

    --nubmerOfItems: 6;
    --timeduration: 15s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--body-color);
    color: var(--text-color);
    font-family: var(--body-font);
    font-size: var(--normal-font-size);
}

.research-hero {
    background-image: url("https://www.imf.org/-/media/Images/IMF/About/Factsheets/2022/sdgs-header-01.ashx?h=1379&w=5534&la=en");
    background-repeat: no-repeat;
    height: auto;
    aspect-ratio: 20 / 6;
    width: 100%;
    background-position: center;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.research-hero h1 {
    color: #ffffff;
    font-size: 34px;
    text-align: center;
    padding: 10px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    margin: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 20px;
}

.toc-section {
    padding: 60px 0;
}

.toc-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.toc-content-wrapper {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.toc-main-content {
    flex: 3;
}

.toc-content-section {
    margin-bottom: 40px;
}

.toc-main-content__title {
    font-size: 2.5rem;
    margin-bottom: 25px;
    line-height: 1.3;
    font-weight: 600;
    color: #212529;
}

.toc-main-content__subtitle {
    font-size: 1.8rem;
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: 600;
    color: #212529;
    border-top: 1px solid #e9ecef;
    padding-top: 30px;
}

.toc-main-content__text {
    margin-bottom: 1.5em;
    font-size: 1rem;
    color: #495057;
}

.toc-main-gallery__image {
    width: auto;
    height: 400px;
    display: block;
    border-radius: 4px;
    object-fit: cover;
    justify-self: center;
}

.toc-sidebar {
    flex: 1;
    background-color: #f8f9fa;
    padding: 25px 20px 25px 25px;
    border-radius: 6px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.toc-sidebar__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #343a40;
}


.toc-sidebar__nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid #e9ecef;
}

.toc-sidebar__nav-item {
    margin: 0;
}

.toc-sidebar__nav-link {
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    display: block;
    padding: 8px 15px 8px 20px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease, border-left-color 0.2s ease;
}


.toc-sidebar__nav-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
}


.toc-sidebar__nav-list .active {
    font-weight: 600;
    border-left: 2px solid #0056b3;
    color: #0056b3;
    background-color: #e7f1ff;
}


.toc-results-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.toc-results-gallery__image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    object-fit: cover;
    /* aspect-ratio: 4 / 3; */
    background-color: #eee;
}


#main-Formulas {
    padding: 20px;
    background: #fff;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#main-Formulas h1 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

#main-Formulas p {
    margin-bottom: 15px;
}

.formula {
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: hsl(220, 68%, 97%);
    overflow-x: auto;
    display: flex;
    align-items: center;
    min-width: 35%;
    flex: 1 2 30%;

    justify-content: center;
}

.formula p {
    margin: 0;
}


.katex-display {
    margin: 0.5em 0;
}

#main-Formulas-col {
    display: flex;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-around;
    grid-area: 50px;
}

.toc-content-gallery{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.toc-main-content__image{
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    object-fit: cover;
    background-color: #eee;
}

@media (max-width: 992px) {
    .toc-content-wrapper {
        flex-direction: column;
        gap: 40px;
    }
    .toc-sidebar{
        display: none;
    }
    .toc-main-content,
    .toc-sidebar {
        flex-basis: auto;
        flex-grow: 0;
        width: 100%;
    }

    .toc-sidebar {
        position: relative;
        top: auto;
        max-height: none;
        overflow-y: visible;
    }

    .toc-main-content__title {
        font-size: 2.1rem;
    }

    .toc-main-content__subtitle {
        font-size: 1.6rem;
        padding-top: 25px;
    }


}

@media (max-width: 768px) {
    .toc-results-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .toc-main-content__title {
        font-size: 1.8rem;
    }

    .toc-main-content__text {
        font-size: 0.95rem;
    }

    .toc-sidebar {
        padding: 20px 15px 20px 20px;
    }

    .toc-results-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .formula{
        min-width: 100%;
        flex: 1 1 100%;
    }

    .toc-content-gallery{
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media screen and (max-width: 1118px) {
    .research-hero {
        height: auto;
        aspect-ratio: 20 / 6;
        width: 100%;

    }
}