html {
    font-size: 0.52083vw; /* 1rem = 10px at 1920px viewport width */
    min-font-size: 10px; /* Prevent font from becoming too small */
}

body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    color: #333;
    background-color: white; /* Changed to white to remove the grey border */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

header {
    background-color: #004a87;
    color: white;
    padding: 1.6rem 3.2rem;
    border-bottom: 5px solid #ffd700;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 2.4rem;
    font-weight: bold;
}

nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

nav ul li {
    display: inline-block;
    margin-left: 2rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 1.76rem;
}

main {
    padding: 1.6rem;
}

.content-wrapper {
    max-width: 120rem; /* Max width for desktop (1200px at 1920px viewport) */
    max-width: 100vw;
    max-height: 100vh;
    background-color: white; /* White background for the content area */
    min-height: 100vh; /* Ensure it takes full viewport height */
    box-sizing: border-box; /* Include padding in the width/height */
    aspect-ratio: 2.219; /* Overall aspect ratio of content */
    width: 100%;
    height: 100%;
}

main {
    padding: 1.6rem;
    max-width: 100%; /* Ensure main doesn't overflow content-wrapper */
    box-sizing: border-box;
}

h2 {
    color: #004a87;
}

.content-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 4rem;
    padding: 0 4rem;
    align-items: start; /* Align items to the top of their grid area */
}

.pdf-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-section embed {
}

.image-carousel {
    position: relative;
    max-width: 56.3rem; /* Original image width */
    width: 100%; /* Make it responsive below max-width */
    height: 70.4rem; /* Original image height */
    overflow: hidden;
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure image scales down to fit while maintaining aspect ratio */
    transition: opacity 0.5s ease-in-out;
}

.carousel-image:not(.active) {
    opacity: 0;
}

.carousel-image.active {
    opacity: 1;
}

.carousel-nav {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 10px;
    font-size: 2rem;
    z-index: 10;
}

.slides-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slides-section iframe {
    width: 125.155rem; /* 16:9 aspect ratio based on height */
    height: 70.4rem; /* Same height as image carousel */
    margin: 0;
    padding: 0;
}

.resources-text {
    color: #004a87;
    font-size: 2.88rem;
    font-weight: bold;
    margin-top: 1.92rem; /* Adjust this value for desired spacing */
    width: 100%; /* Fill parent width */
    text-align: left;
}

.mathcounts-trainer-link {
    color: #004a87;
    font-size: 1.92rem; /* Smaller than Other Resources */
    margin-top: 0.96rem; /* Adjust for spacing from Other Resources */
    width: 100%; /* Fill parent width */
    text-align: left;
}

#open-pdf-btn {
    background-color: #004a87;
    color: white;
    border: none;
    padding: 1.6rem 3.2rem;
    font-size: 1.6rem;
    cursor: pointer;
    margin-bottom: 1rem;
    border-radius: 10px;
}

#open-slides-btn {
    background-color: #004a87;
    color: white;
    border: none;
    padding: 1.6rem 3.2rem;
    font-size: 1.6rem;
    cursor: pointer;
    margin-bottom: 1rem;
    border-radius: 10px;
}

#fullscreen-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

#close-btn {
    position: absolute;
    top: 2.65rem;
    right: 3.5rem;
    color: #fff;
    font-size: 4rem;
    font-weight: bold;
    cursor: pointer;
}

#fullscreen-pdf-content {
    width: 90%;
    height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow-y: auto; /* Enable scrolling if content overflows */
    background-color: white; /* Ensure a white background for the content area */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center images horizontally */
}

#fullscreen-pdf-content img {
    max-width: 100%;
    height: auto;
    display: block; /* Remove extra space below image */
    margin: 0 auto 1rem auto; /* Center horizontally and add bottom margin */
    object-fit: contain; /* Ensure the entire image is visible */
}

#fullscreen-slides-overlay {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

.show-overlay {
    opacity: 1 !important;
    visibility: visible !important;
}

#fullscreen-slides {
    width: 100%;
    height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#close-slides-btn {
    position: absolute;
    top: 2.65rem;
    right: 3.5rem;
    color: #fff;
    font-size: 4rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}


