/*-- scss:defaults --*/

// Sass Variables
// https://quarto.org/docs/output-formats/html-themes.html#sass-variables

$theme-black: black;
$theme-green: #54B678;
$theme-white: #F7FFF7;


/* Colors */
$body-bg: $theme-black;
$body-color: $theme-white;
$link-color: $theme-green;

/* Fonts */
$font-family-sans-serif: "Source Sans Pro", -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
$font-size-root: 17px;

/*-- scss:rules --*/
h1, h2, h3, h4, h5, h6 {
    color: $theme-white
}

figcaption {
    color: $theme-green;
}

.navbar * {
    color: $theme-black;
}

/*-- Button links to GitHub Repos --*/
.github_button {
    background-color: $theme-green;
    border: none;
    color: $theme-white;
    padding: 12px 24px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    border-radius: 4px;
}

.page_button {
    background-color: $theme-green;
    border: none;
    color: $theme-white;
    padding: 12px 24px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    border-radius: 4px;
    margin-top: 20px;
}

span.navbar-title {
    transition-duration: 0.5s;

    &:hover {
        color: $theme-green;
        transition-duration: 0.5s
    }
}

span.menu-text {
    transition-duration: 0.5s;

    &:hover {
        color: $theme-green;
        transition-duration: 0.5s
    }
}

.image-caption {
    text-align: center;
    font-size: 0.9em;
    margin-top: 0.5rem;
    color: $theme-green;
}

.icon-caption {
    text-align: center;
    font-size: 0.9em;
    margin-top: 0.5rem;
    color: $theme-white;
    transition: 0.5s ease;
}

/* Just target the links (anything with !important overrides the Quarto template)*/
body .quarto-about-trestles .about-links {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center;
  gap: 12px;
}

/* Resume: force it onto its own full row */
body .quarto-about-trestles .about-link:first-child {
  flex-basis: 100% !important;
  width: auto !important;
  height: auto !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  justify-content: flex-start;
  font-size: 1rem;
}

/* GitHub and LinkedIn: round icon buttons */
body .quarto-about-trestles .about-link:not(:first-child) {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important; /* Turns the perfect square into a circle */
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.4rem;
}

/* Nudging the icon to the right a little bit to realign it */
body .quarto-about-trestles .about-link:not(:first-child) i {
  margin-left: 4px; /* increase or decrease until it looks right */
}

/* Changing the color of the description text to theme-green */
.quarto-listing-default .quarto-post .body .listing-description .no-external{
    color: $theme-green;
}

/* Keeping color consistency within blog posts */
.description {
    color: $theme-green;
}

/* Giving more margins to the categories on the blog */
.quarto-listing-default .quarto-post .body .listing-categories{
    margin-top: 0.5rem;
}

/* Icons for footer navigation bar */
.icon {
    position: relative;
    width: 100%;
}

/* Initial image for footer navigation bar */
.initial_image {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.5s ease, transform 0.5s ease;
    backface-visibility: hidden;
}

/* Backbround image for transitioning for footer navigation bar */
.background_image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.5s ease, transform 0.5s ease;
    backface-visibility: hidden;
}

/* Hover effect for initial image */
.icon:hover .initial_image {
    opacity: 0;
    transform: scale(1.25);
}

/* Hover effect for background image */
.icon:hover .background_image {
    opacity: 1;
    transform: scale(1.25);
}

.icon:hover .icon-caption {
    color: $theme-green
}

@mixin aspect-ratio($width, $height) {
  position: relative;
    
  &:before {
    display: block;
    content: "";
    width: 100%;
    padding-top: ($height / $width) * 100%;
  }
    
  > img {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
  }
}

div.sourceCode {
    background-color: #4F4F4A
}

// Change the color of the bash code to correspond with the theme color
code.sourceCode.bash span.ex {
    color: $theme-green
}

section {
    background: $theme-black;
    padding: 50px 0;
}

$mobile-breakpoint: 480px;
$desktop-breakpoint: 1024px;

.container {
    max-width: 1044px;
    margin: 0 auto;
    padding: 0 20px;
}

.carousel {
    display: block;
    text-align: left;
    position: relative;
    margin-bottom: 22px;
    
    > input {
        clip: rect(1px, 1px, 1px, 1px);
        clip-path: inset(50%);
        height: 1px;
        width: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: fixed;
        top: -100vh;
        left: -100vw;
        
        &:nth-of-type(6):checked ~ .carousel__slides .carousel__slide:first-of-type { margin-left: -500%; }
        &:nth-of-type(5):checked ~ .carousel__slides .carousel__slide:first-of-type { margin-left: -400%; }
        &:nth-of-type(4):checked ~ .carousel__slides .carousel__slide:first-of-type { margin-left: -300%; }
        &:nth-of-type(3):checked ~ .carousel__slides .carousel__slide:first-of-type { margin-left: -200%; }
        &:nth-of-type(2):checked ~ .carousel__slides .carousel__slide:first-of-type { margin-left: -100%; }
        &:nth-of-type(1):checked ~ .carousel__slides .carousel__slide:first-of-type { margin-left: 0%; }
        
        &:nth-of-type(1):checked ~ .carousel__thumbnails li:nth-of-type(1) { box-shadow: 0px 0px 0px 5px $theme-green; }
        &:nth-of-type(2):checked ~ .carousel__thumbnails li:nth-of-type(2) { box-shadow: 0px 0px 0px 5px $theme-green; }
        &:nth-of-type(3):checked ~ .carousel__thumbnails li:nth-of-type(3) { box-shadow: 0px 0px 0px 5px $theme-green; }
        &:nth-of-type(4):checked ~ .carousel__thumbnails li:nth-of-type(4) { box-shadow: 0px 0px 0px 5px $theme-green; }
        &:nth-of-type(5):checked ~ .carousel__thumbnails li:nth-of-type(5) { box-shadow: 0px 0px 0px 5px $theme-green; }
        &:nth-of-type(6):checked ~ .carousel__thumbnails li:nth-of-type(6) { box-shadow: 0px 0px 0px 5px $theme-green; }
    }
}

.carousel__slides {
    position: relative;
    z-index: 1;
    padding: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    display: flex;
}

.carousel__slide {

    position: relative;
    display: block;
    flex: 1 0 100%;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: all 300ms ease-out;
    box-sizing: border-box;
    white-space: normal;
    
    figure {
        display: flex;
        margin-top: 10px;
    }
    
    div {
        @include aspect-ratio(3, 2);
        width: 100%;

    }
    
    img {
        display: block;
        flex: 1 1 auto;
        object-fit: cover;
    }
    
    figcaption {
        align-self: flex-end;
        padding: 20px 20px 0 20px;
        flex: 0 0 auto;
        width: 25%;
        min-width: 150px;
        color: $theme-green;
    }
    
    &.scrollable {
        overflow-y: scroll;
    }

    @media (max-width: $mobile-breakpoint) {
        figure {
            flex-direction: column;

            figcaption {
                width: 100%;

                .page_button {
                    width: 100%;
                }
            }
        }
    }

}

.carousel__thumbnails {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: nowrap;
    margin: 0 -10px;
    
    .carousel__slides + & {
        margin-top: 20px;
    }
    
    li {        
        flex: 1 1 auto;
        max-width: calc((100% / 3) - 20px);  
        margin: 0 10px;
        transition: all 300ms ease-in-out;
    }
    
    label {
        display: block;
        @include aspect-ratio(1,1);
           
        &:hover,
        &:focus {
            cursor: pointer;
            
            img {
                box-shadow: 0px 0px 0px 1px rgba(0,0,0,0.25);
                transition: all 300ms ease-in-out;
            }
        }
    }
    
    img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

}

.two_image_diagram {
    display: flex;
    width: 100%;
    padding: 20px;
    gap: 1rem;

    @media (max-width: $mobile-breakpoint) {
        justify-items: center;
        justify-content: space-between;
        flex-direction: column;
    }
}

.footer-nav-icons {
    display: flex;
    width: 100%;
    padding: 20px;
    gap: 1rem;

    @media (max-width: $mobile-breakpoint) {
        justify-items: center;
        justify-content: space-between;
        flex-direction: column;
    }

    .icon-caption{
        @media (max-width: $mobile-breakpoint) {
            font-size: 28px;
        }
    }
}

.level2 {
   padding: 10px 0;
}

.level3 {
    padding: 2px 0;
}

.about-entity {
    padding-top: 1em;
}