* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    background: url('https://chemlancer.com/images/Kilauea.jpeg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: 32px;
    text-decoration: none;
    text-align: center;
}

p {
    font-size: 18px;
}

#hamburger-icon {
    font-size: 30px;
    color: white;
    cursor: pointer;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 6;
}

/* Main content container */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

section {
    flex-direction: row; /* Default to row layout */
    justify-content: space-between; /* Space items evenly */
    align-items: flex-start; /* Align items to the top */
    display: flex;
}

/* Create two columns/boxes that float next to each other */
#weatherDataContainer {
    width: 30%; /* Set width for sidebar */
    padding: 20px;
    order: 1; /* Display second on wider screens */
    text-align: center;
    max-width: 800px; /* Adjust max-width as needed */
    padding-bottom: 10px;
    z-index: 3;
    position: relative;
}

#weatherData p {
    margin: 0;
    padding: 4px 0;
    font-size: 12px;
    text-align: center;
}

#weatherData a {
    color: white;
    text-decoration: none;
}

/* Navigation box properties */
nav {
    width: 30%; /* Set width for sidebar */
    order: 1; /* Display second on wider screens */
    text-align: center;
    max-width: 800px; /* Adjust max-width as needed */
    padding-bottom: 10px;
    z-index: 3;
    position: relative;
}

nav p {
    margin: 0;
    padding: 4px 0;
    font-size: 12px;
    text-align: center;
}

nav a {
    color: white;
    text-decoration: none;
    display: block; /* Ensure the anchor tags fill the li block */
    padding: 10px; /* Add padding for better click area */
    text-align: center; /* Center the text inside the block */
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0; /* Reset margin for ul */
}

nav ul ul {
    display: none; /* Hide nested list by default */
    position: absolute;
    background-color: rgba(0, 0, 0, 0.75); /* Background color for the dropdown */
    padding: 0;
    margin: 0;
    list-style-type: none;
    z-index: 5; /* Ensure dropdown is above other content */
    left: 50%; /* Align sublist center */
    transform: translateX(-50%); /* Center align sublist */
    min-width: 100%; /* Ensure sublist is at least as wide as the parent */
}

nav ul li {
    position: relative; /* Ensure positioning context for nested ul */
}

nav ul li:hover > ul {
    display: block; /* Show nested list on hover */
}

nav ul li:hover > a,
nav ul ul li:hover > a {
    background-color: rgba(255, 255, 255, 0.2); /* Highlight the entire block */
}

nav ul ul li {
    padding: 0; /* Remove padding to prevent squishing */
}

nav ul ul li a {
    color: white;
    text-decoration: none;
    display: block; /* Ensure the anchor tags fill the li block */
    padding: 10px; /* Add padding for better click area */
    text-align: center; /* Center the text inside the block */
    min-width: 150px; /* Set a minimum width for the sublist items */
}

nav ul ul li:hover {
    background-color: rgba(255, 255, 255, 0.2); /* Highlight the entire block for sublist items */
}

nav ul ul li a:hover {
    color: white; /* Keep text color same on hover */
}

.bold-value {
    font-weight: bold;
}

article {
    max-width: 800px; 
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.75);
    align-self: stretch; /* Stretch to take full width */
    order: 0; /* Display first on wider screens */
}

article p {
    margin: 16px 0; /* Add margin for better vertical spacing */
    padding: 0; /* Remove padding to rely on margins for spacing */
    font-size: 18px; /* Adjust font size if needed */
    line-height: 1.6; /* Increase line height for better readability */
    text-shadow: none;
}

article a {
    color: white;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    display: inline; /* Ensure the link remains inline */
    padding: 0; /* Remove padding to prevent layout issues */
}

article a:hover {
    background-color: rgba(255, 255, 255, 0.2); /* Custom hover background */
    color: white; /* Maintain text color on hover */
}

footer {
    padding: 10px;
    text-align: center;
    font-size: 10px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
}

#sideMenu {
    position: fixed;
    top: 0;
    left: -100%; /* Start off-screen */
    width: 50%; /* Adjust width as needed for side menu on narrow screens */
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 4;
    transition: left 0.3s ease; /* Smooth transition for left position */
    overflow-y: auto; /* Enable scrolling if menu items overflow */
}

#sideMenu.open {
    left: 0; /* Slide in the menu from left */
}

#sideMenu nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px; /* Adjust as needed for top spacing */
}

#sideMenu a {
    display: block;
    padding: 10px;
    font-size: 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease; /* Smooth background color transition */
}

#sideMenu a:hover {
    background-color: rgba(255, 255, 255, 0.7); /* Semi-transparent white background */
    color: black; /* Dark text color */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* Text shadow for hover effect */
    transition: background-color 0.3s ease; /* Smooth background color transition */
    border-radius: 10px; /* Rounded corners */
}

#sideMenuOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 0; /* Initial width */
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 5; /* Ensure overlay is above side menu */
    transition: width 0.3s ease; /* Smooth width transition */
    pointer-events: none; /* Allow clicks to go through initially */
}

#sideMenuOverlay.open {
    width: 100%; /* Expand to full width */
    pointer-events: auto; /* Enable clicks on overlay when it's visible */
}

#sideMenu .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    cursor: pointer;
    color: white;
}

/* Loading spinner for weather data */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: auto;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner.show {
    display: block;
}

.story-media {
    text-align: center;
}

.story-caption,
article .story-caption,
.story-media .story-caption {
    text-align: center;
    font-family: Georgia, serif;
    font-size: 13px;
    font-style: italic;
    margin: 4px 0 24px 0;
}

.story-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.story-img-80 {
    width: 80%;
}

.story-img-60 {
    width: 60%;
}

.story-img-50 {
    width: 50%;
}

.story-img-25 {
    width: 25%;
}

@media (max-width: 767px) {
    section {
        flex-direction: column; /* Ensure it's column layout for mobile */
        justify-content: center;
        align-items: center;
    }

    #weatherDataContainer {
        width: 100%; /* Take full width initially */
        padding-bottom: 10px;
        order: -1; /* Display above article on narrow screens */
    }
    
    nav  {
        width: 100%; /* Take full width initially */
        padding-bottom: 10px;
        order: -1; /* Display above article on narrow screens */
    }

    article {
        padding-top: 10px;
    }
    
    #sideMenu {
        width: 70%;
    }
}
