* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}
html {
    scroll-behavior: smooth;
}
body {
    background-color: #2A1E5C; /* rich violet */
    color: #E8E9F3; /* soft lavender */
    overflow-x: hidden;
}

nav {
    position: sticky;
    padding: 20px;
    background-color: #0F1020; /* deep indigo */
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-bottom: 4px solid #B91372; /* vibrant pink */
    top: 0;
    z-index: 10;
    box-shadow: 0px 4px 16px rgb(0, 0, 0);
    
    & > a, & > ul a {
        cursor: pointer;
        color: #F7C59F; /* warm peach */
        transition: color 0.3s ease;
        text-decoration: none;
        text-shadow: 0 0 5px #F7C59F; /* subtle glow */

        &:hover {
            color: #ffe4d0; /* warm peach */
        }
        &:active {
            color: #ffb380; /* warm peach */
            opacity: 0.75;
        }
    }
    & > ul {
        list-style: none;
        display: flex;
        gap: 20px;
    }
}
header {
    text-align: center;
    /* background: linear-gradient(135deg, #6A0572, #B91372); */
    background: url('./assets/wooden-stage.jpg') no-repeat bottom center/cover; /* replace with actual image path */
    color: #F7C59F; /* warm peach */
    text-shadow: 0 0 10px #F7C59F; 
    border-bottom: 4px solid #B91372; /* vibrant pink */
    
    & .theater-image {
        background: url('./assets/theater-curtain.png') no-repeat top center/cover; /* replace with actual image path */
        filter: drop-shadow(0px -8px 8px black);
        padding: 240px 20px;
    }
    & h1 {font-size: 3rem};/* subtle glow */
    & h3 {font-size: 1.5rem; margin-top: 10px; font-style: italic; color: #ffe4d0;} /* warm peach */
}
main {
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 35px;

    & .topic {
        background-color: #3B1F5B; /* darker violet */
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        
        & h2 {
            color: #F7C59F; /* warm peach */
            margin-bottom: 10px;
            text-shadow: 0 0 5px #F7C59F; /* subtle glow */
        }
        & h4 {
            line-height: 1.6;
            color: #E8E9F3; /* soft lavender */
        }
        & hr {
            margin: 20px 0;
            border: none;
            border-top: 2px solid #B91372; /* vibrant pink */
        }
        & .topic-content .left-bar {
            margin: 20px 0px;
            padding-left: 20px;
            border-left: 4px solid #B91372; /* vibrant pink */
        }
        & .topic-content ul li {
            margin-bottom: 10px;
            margin-left: 10px;
            color: #E8E9F3; /* soft lavender */
            line-height: 1.6;
        }
        & .topic-content .left-bar p {
            color: #E8E9F3; /* soft lavender */
            line-height: 1.6;
            margin-top: 10px;
        }
        & .source {
            text-shadow: 0 0 5px #F7C59F; /* subtle glow */
            margin: 0 0 0 20px;
            color: #F7C59F; /* warm peach */
            text-decoration: underline dashed #E8E9F3;
            transition: color 0.3s ease;
            display: inline-block;

            &:hover {
                color: #ffe4d0; /* warm peach */
            }
            &:active {
                color: #ffb380; /* warm peach */
                opacity: 0.75;
            }
        }
        & .person {
            display: flex;
            align-items: center;
            gap: 15px;
            height: 100px;

            & img {
                width: 80px;
                height: 80px;
                border-radius: 50%;
                object-fit: cover;
                object-position: top;
                border: 4px solid #B91372; /* vibrant pink */
                transition: transform 0.3s ease-in-out;

                &:hover {
                    transform: scale(2);
                    height: auto;
                    border-radius: 10px;
                }
            }
        }
    }
    & .images {
        display: flex;
        gap: 30px;
        justify-content: center;

        & .image-container {
            background-color: #3B1F5B; /* darker violet */
            padding: 10px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            height: 300px;
            width: 50%;
            text-align: center;
            
            & > div {
                z-index: 1;
                position: relative;
                height: 100%;
                transition: transform 0.3s ease;
                display: flex;
                align-items: center;
                justify-content: center;

                &:has( p:hover), &:has( img:hover) {
                    transform: scale(1.05);
                    z-index: 5;
                    flex-direction: column;

                    & img {
                        height: auto;
                    }
                    & p {
                        display: none;
                    }
                }
            }
            & p {
                position: absolute;
                bottom: 0px;
                width: 100%;
                height: 40px;
                color: #F7C59F; /* warm peach */
                text-shadow: 0 0 5px #F7C59F;
                background-color: rgba(0, 0, 0, 0.5);
                transition: transform 0.3s ease;
                border-bottom-left-radius: 10px;
                border-bottom-right-radius: 10px;
                display: flex;
                justify-content: center;
                align-items: center;
            }
            & img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                object-position: center;
                border-radius: 10px;
                border: 2px solid black;
                transition: transform 0.3s ease;

                &.top {
                    object-position: top;
                }
            }
        }
    }
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #0F1020; /* deep indigo */
    color: #E8E9F3; /* soft lavender */
    border-top: 4px solid #B91372; /* vibrant pink */
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;

    & div.left-side {
        text-align: left;
        & a {
            color: #F7C59F; /* warm peach */
            text-shadow: 0 0 5px #F7C59F; /* subtle glow */
            text-decoration: underline dotted #E8E9F3;
            transition: color 0.3s ease;

            &:hover {
                color: #ffe4d0; /* warm peach */
            }
            &:active {
                color: #ffb380; /* warm peach */
                opacity: 0.75;
            }
        }
    }
    & div.credits {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        max-width: 500px;
        width: 100%;
        
        & p {
            margin: 0;
            color: #F7C59F; /* warm peach */
            text-shadow: 0 0 5px #F7C59F; /* subtle glow */
            padding: 5px;
            border-radius: 8px;
            
            &.bg {
                background-color: #B91372; /* vibrant pink */
            }
        }
    }
}

@media (max-width: 800px) {
    main .images {
        flex-direction: column;
        gap: 20px;

        & .image-container {
            width: 100%;

            & > div:has(p:hover), & > div:has(img:hover) {
                transform: scale(0.95) !important;
            }
        }
    }
    footer {
        padding: 40px 20px 30px 20px;
    }
}

@media (max-width: 560px) {
    nav { 
        flex-direction: column;
        gap: 15px;
        & > ul{
            flex-wrap: wrap;
            justify-content: space-evenly
        }
    }
    footer {
        gap: 30px;
        
        & div.left-side {
            text-align: center;
        }
        & div.credits {
            width: 300px;
            & .bg {
                background-color: transparent !important;
                /* text-shadow: 0 0 5px #F7C59F; */
            }
            & .mobile-bg {
                background-color: #B91372 !important; /* vibrant pink */
            }
        }
    }
}

@media (max-width: 400px) {
    main {
        padding: 15px 15px;
        gap: 20px;

        & .images .image-container > div:has(p:hover),
        & .images .image-container > div:has(img:hover) {
            transform: none !important;
            & img {
                height: 100%;
            }
            & p {
                display: flex;
            }
        }

        & .topic .person img:hover {
            transform: none;
            border-radius: 50%;
            height: 80px;
        }
    }
    footer div.credits {
        width: 260px;
    }
}
