/* fade-in animations */
/* Hide the content initially */
.toc {
    opacity: 0;            /* Start fully transparent */
    transform: translateY(20px); /* Start slightly below */
    animation: fadeIn 1s ease-out forwards; /* Animate to full opacity */
}



/* TABLE OF CONTENTS */
#toc {
    width: fit-content; /* Make it scale with the container */
    position: fixed;
    top: 150px;
    left: 170px;
    z-index: 3;
    transition: 
        left 0.5s ease,
        height 0.1s ease-out, /* Smooth height change */
        top 0.5s ease-out;
}

.scrollable {
    width: 90%; /* to make the toc width smaller */
    scroll-behavior: smooth;
    overflow: auto; /* Keeps scrolling enabled */
    overscroll-behavior: contain;
    scrollbar-color: transparent transparent; /* Hides in Firefox */
    padding-top: 2px;
    padding-left: 12px;
    padding-right: 12px;
    transition: height 0.1s ease-out;
}
/* Blurred effect at the top when not scrolled to the top */
.scrollable::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px; /* Adjust height of the blur */
    background: linear-gradient(to bottom, rgba(72, 10, 24, 1.0), transparent);
    pointer-events: none; /* Prevents interaction */
    opacity: 0;
    transition: opacity 0.3s ease;
}
/* Blurred effect at the bottom when not scrolled to the bottom */
.scrollable::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px; /* Adjust height of the blur */
    background: linear-gradient(to top, rgba(72, 10, 24, 1.0), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
/* Class to show the blur */
.scrollable.scrolled:not(.at-top)::before {
    opacity: 1;
}
.scrollable.scrolled:not(.at-bottom)::after {
    opacity: 1;
}

.link {
    width: 100%;
    height: fit-content;
    border: 2px solid var(--dark-plum); /* Add black borders */
    background-color: transparent; /* Transparent background */
    text-align: center; /* Center text inside the box */
    font-size: 26px; /* Adjust font size as needed */
    max-lines: 1; /* doesn't work... */
    background-color: rgba(255, 255, 255, 0.02);
    transition: 
        width 0.5s ease,
        background-color 0.5s ease, 
        transform 0.5s ease, 
        z-index 0.5s ease,

        font-size 0.5s ease; 
    z-index: 3;
}
.link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1); /* Enlarge the paragraph */
    z-index: 5;
}
.link a {
    display: block;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 20px;
    padding-right: 20px;
    transition: 
        transform 0.5s ease, 

        /*font-size 0.5s ease,*/ 
        padding 0.5s ease;
    z-index: 10;

    white-space: nowrap;
  overflow: hidden;
}
.link:hover a {
    transform: scale(1.1); /* Enlarge the paragraph */
}

.link.active {
    background-color: rgba(255, 255, 255, 0.1);
}



/* Main Section Styling */
.main-content {
    padding-left: 240px;
    transition: 
        margin-left 0.5s ease,
        padding-left 0.5s ease,
        margin-right 0.5s ease,
        padding-right 0.5s ease;
}





/* TUTORIAL */
.tutorial {
    width: 100%;
    height: fit-content;
    padding-top: 70px;
    padding-bottom: 70px;
    transition: 
        flex-direction 0.5s ease, 
        padding-bottom 0.5s ease, 
        padding-top 0.5s ease, 
        padding-left 0.5s ease; /* Smoothly animate height and padding */
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.05);

    scroll-margin-top: 100px; /* scroll higher than the default anchor */
  }

.tutorial-grid {
    padding: 36px;
    display: grid; /* Set up a grid container */
    grid-template-columns: 1fr;
    grid-row-gap: 50px; /* Row spacing */
}

.tutorial-pair {
    display: flex;
    align-items: flex-start;
    gap: 20px; /* Space between text and image */
    position: relative;
    transition: 
        flex-direction 0.5s ease,
        margin-top 0.5s ease;

    scroll-margin-top: 200px; /* scroll higher than the default anchor */
}

.tutorial-pair img {
    width: 275px; 
    height: 430px; 
    border-radius: 15px 15px 15px 15px;
}

.tutorial-pair video {
    width: 275px; 
    height: auto; /* auto - Maintain aspect ratio */
    border-radius: 15px 15px 15px 15px;
    background-color: #000;
}

.tutorial p {
    margin-left: 36px;
    margin-right: 30px;
    height: fit-content;
    font-size: 30px;
    transition: 
        width 0.5s ease;
}
.tutorial-pair p {
    margin-top: 0px;
    margin-bottom: 0px;
    margin-left: 0px;
    margin-right: 0px;
    flex: 1; /* Allows text to take remaining space */
    font-size: 24px;


    /*text-align: justify;*/
}

.tutorial-pair:nth-child(odd) {
    flex-direction: row; /* Image on the right */
    align-items: flex-start; /* Align text to top */
}

.tutorial-pair:nth-child(even) {
    flex-direction: row-reverse; /* Image on the left */
    align-items: flex-end; /* Align text to bottom */
}











/* SCREEN SIZE VARIANTS */
/* where right side is gone */
@media (max-width: 1200px) {

}



/* where the tutorials unstagger */
@media (max-width: 1040px) {

    .tutorial-grid {
        padding: 36px;
        grid-row-gap: 70px; /* Row spacing */
    }

    .tutorial-pair {
        flex-direction: column;
    }

    .tutorial-pair p {
        text-align: justify;
    }

    .tutorial-pair:nth-child(odd) {
        flex-direction: column; 
        align-items: flex-start; 
    }

    .tutorial-pair:nth-child(even) {
        flex-direction: column;
        align-items: flex-start; 
    }
}



/* 768 */
/* where both sides are gone */
@media (max-width: 865px) {
    #toc {
        left: 0px;
    }
}



/* when the ToC shrinks */
@media (max-width: 685px) {

    .main-content {
        padding-left: 70px;
    }

    .link {
        width: 70px;
    }

    .link:hover {
        width: fit-content;
        /*background-color: rgba(88, 35, 47, 1);*/
        background-color: rgba(97, 47, 59, 1);
        /*background-color: rgba(106, 59, 70, 1);*/
    }

    .link a {
        color: transparent;
        font-size: 0px;
        text-shadow: none;
    }

    .link a::after {
        content: attr(data-short);
        color: var(--text-color);
        font-size: 26px;
        opacity: 1;
      }

    .link:hover a {
        transform: scale(1.1); /* Enlarge the paragraph */

        color: var(--text-color);      /* show full title */
        font-size: 26px;
    }

    .link:hover a::after {
        opacity: 0; /* hide the single-letter version */
        font-size: 0px;
    }
}



/* for mobile */
/* 360px for my android */
/*@media (pointer: coarse)*/
@media (max-width: 450px)
{
    .tutorial {
        padding-top: 0px;
    }

    .tutorial-pair img {
        width: 200px; 
        height: 313px; /* auto - Maintain aspect ratio */
    }

    .tutorial-pair video {
        width: 200px; 
        height: auto; /* auto - Maintain aspect ratio */
    }

    .tutorial p {
        font-size: 26px;
    }


    .tutorial-pair p {
        font-size: 20px;

        /*text-align: justify;*/
    }
}