.scrolly-container {
    position: relative;
    margin: 0 auto 1.2em auto;
    color: white;
    padding: 25px 0;
    line-height: 25px;
    font-size: 15px;
    opacity: 0.8;
    transition: filter 0.3s ease, opacity 0.3s ease;
    z-index: 10;
    filter: none;
    /* display: flex; */
    flex-direction: column;
    align-items: center;
}

.sticky-thing {
    position: sticky;
    top: 10;
    transform: translate(0px, 0px);
    z-index: 1;
    height: 100vh;
    width: 100vw;
    margin: 0;
    overflow: hidden;
    /* Center things inside */
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.sticky-thing > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;  
}

.video-container {
    position: sticky;
    top: 0;
    z-index: -1;
}

.scrolly-container video {
    position: absolute;
    top: 0;
    height: auto;
    width: 100%;
}

.sticky-thing iframe {
    position: absolute;
    top: 0;
    max-width: 100%;
    min-height: 100vh;
}

.steps-container {
    transform: translate3d(0,0,0);
    position: relative;
    padding: 0;
    z-index: 10;
    max-width: 35rem;
    margin: 0 auto;
    padding-bottom: 1em;
    max-width: 640px;
}

svg.panel {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.6s ease;
    display: none;
    margin: 0 auto;
    position: relative;
    /* background-color: white; */
}

svg.panel.active {
    opacity: 1;
    pointer-events: auto;
    display: block;
    /* background-color: white; */
}

#scrolly-text {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* overflow-y: auto; */
    max-width: 100%; 
    /* transition: opacity 0.3s ease; */
}

.step {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 60vh; /* adjust for your scroll pacing */
    opacity: 0.25;
    transition: opacity 0.3s ease;
    color: black;
    min-height: 10vh;
}

.step.active {
    opacity: 0.95;
    z-index: 10;
}

.step-content,
.step > * {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 1.2em;
    background-color: #ffffff;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.step p {
    text-align: left;
}

.step p:last-child {
    padding: 0;
}

.step:last-of-type {
    margin-bottom: 20px;
}


.sticky-thing > canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;  
}

/* When it's less than 700 pixels wide, do normal scrollytelling */

@media only screen and (min-width: 700px) {
    .scrolly-container.side-by-side {
        display: flex;
        justify-content: center;
        align-items: flex-start;
    }

    .scrolly-container.side-by-side > div {
        /* flex-basis: 0;
        flex-grow: 1;
        flex-shrink: 1; */
        padding: 0.em;
        flex: 1;
    }

    .scrolly-container.side-by-side .scrolly-overlay {
        margin-top: 70vh;
        order: 0;
        /* Change these to adjust sizing options */
        min-width: 15rem;
        max-width: 20rem;
    }

    .scrolly-container.side-by-side .sticky-thing {
        order: 1;
        flex-grow: 2;
    }
}

#graphic {
    flex: 1;
    position: sticky;
    top: 1rem;
    height: 100%;
    /* background: #f9f9f9; */
    padding: 0;
    display: flex;
    justify-content: center; /* horizontal center */
    align-items: center;     /* vertical center */
    min-height: 500px;
}

.panel {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#control-container {
  text-align: center;
  padding: 0;
  z-index: 100;
  margin-bottom: 0;
}


#vessel-dropdown {
    margin-top: 5px;
    margin-bottom: 0;
    display: block;
    position: relative;
    z-index: 9999;
    padding: 0;
}


#vessel-ui {
    position: relative;
    z-index: 1001;
    /* background: white; */
    padding: 0;
    border-radius: 8px;
    margin-bottom: 0;
    display: none;
    justify-content: center;
    align-items: center;
}

#panel5-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 200px;
  margin: 0;
  padding: 0;
  z-index: 999;
}

#panel5-container.fade-in {
    display: flex;
    opacity: 1;
}


#panel-5 {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}




/* Mobile view tweaks */
@media (max-width: 768px) {
    #graphic {
        height: auto;
        min-height: none;
    }
    
    svg.panel {
        max-height: 90vh;
        position: relative;
        min-height: 60vh;
        height: auto;
    }

    .sticky-thing {
        height: 70vh;
        width: 100%;
    }
}

#scrolly-text, #control-container {
    transition: opacity 0.5s ease;
}

#control-container.hidden, #scrolly-text.hidden {
    opacity: 0;
    pointer-events: none;  /* disable interactions */
    height: 0;
    overflow: hidden;
}

#tooltip {
    position: absolute;
    display: none;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 9999;
    max-width: 250px;
    line-height: 1.4em;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}



#legend-row {
    position: sticky;
    right: auto;
    padding: 0.5rem 1rem;
    z-index: 11;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    padding: 0;
    margin: 0 auto;
    width: 100%;
    transition: opacity 0.3s ease;
    color: white;
}

#legend {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    color: white;

}




#legend svg {
    width: 100%;
    height: auto;
    display: block;
}

#chart-header {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#chart-title-container {
    position: sticky;
    top: 0px;
    z-index: 10;
    background-color: black;
    padding: 0.1rem 0;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}


#chart-title-container h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

#chart-title-container .subtitle {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.8;
}

#key {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
}

#key svg {
    display: block;
    width: 16px;
    height: 16px;
}

#key svg rect {
    width: 14px;
    height: 14px;
}