/* Add the Google font */
@import url('https://fonts.googleapis.com/css2?family=Rock+Salt&display=swap');

/* Apply gradient background only to the behavior, about, index, and habitat page */
body {
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    margin: 0;
    padding: 0;
    text-align-last: center;
    scroll-behavior: smooth; /* Smooth scrolling */
    padding-top: 80px; /* Prevent overlap with fixed navbar */
    transition: background 0.5s ease; /* Smooth transition for background */
}

/* Style for source links */
.source-link {
    color: darkslategrey; 
    text-decoration: none; 
    transition: color 0.3s ease; 
}

.source-link:hover {
    color: tomato; 
}

/* Apply gradient background to About and Habitat Pages */
body.about-page, body.habitat-page {
    background: linear-gradient(to right, black, white); /* Black to white gradient */
    color: #333;
    transition: background 0.5s ease; /* Smooth transition for background */
}

.main-content {
    margin-top: 80px;
    text-align: center; /* Centering all the content */
    display: flex;
    flex-direction: column;
    align-items: center; /* Aligning content to the center */
    justify-content: center; /* Ensuring vertical centering */
}

/* Ensure all image captions are white */
figcaption, .image-caption {
    color: white; 
    font-size: 18px; 
    text-align: center; 
    font-style: italic; 
}

/* Apply gradient background to About Page */
body.about-page {
    background: linear-gradient(to bottom, black, white); /* Black to white gradient */
    color: #333;
    transition: background 0.5s ease; /* Smooth transition for background */
}

/* Navbar Styles */
.navbar {
    background: rgba(34, 34, 34, 0.9);
    position: fixed;
    top: 0;
    width: 100%;
    padding: 10px 0;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: top 0.3s;
}

/* List items under headings (not in navbar) */
.main-content ul li {
    color: white;
    font-weight: bold;
}

/* Apply black and white gradient background to About page */
body.about-page {
    background: linear-gradient(to bottom, black, white); /* Black to white gradient */
    color: #333;
    transition: background 0.5s ease; /* Smooth transition for background */
}

/* About Page Paragraph Text (Black in White Background, White in Black Background) */
body.about-page p {
    color: white; /* Default color for white background */
    font-weight: bold;
}

/* Styling for paragraph text */
body.about-page .white-background {
    color: black; /* Text color black for white background */
}

body.about-page .black-background {
    color: white; /* Text color white for black background */
}

/* Behavior Page Paragraph Text (Black in White Background, White in Black Background) */
body.behavior-page p {
    color: white; /* Default color for white background */
    font-weight: bold;
}

/* For sections that are white background (ensure text is black) */
body.behavior-page .white-background p {
    color: black; /* For white background, text should be black */
}

/* For sections that are black background (ensure text is white) */
body.behavior-page .black-background p {
    color: white; /* For black background, text should be white */
}


/* About Page Paragraph Text */
body.about-page p {
    color: white; /* Change text color to white */
    font-weight: bold; /* Make the text bold */
}


body.about-page {
    background: linear-gradient(to bottom, #000000, #ffffff); /* Black to white gradient */
    color: #333;
    transition: background 0.5s ease;
}

/* Apply gradient-based color changes dynamically */
body {
    --text-color: color;
}

body.habitat-page, body.index-page, body.behavior-page, body.about-page {
    --text-color: white; /* Default text color for darker background */
}

/* Set text colors dynamically */
h1, h2, p, .caption {
    color: var(--text-color);
}

.navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

.navbar li {
    margin: 0 15px;
}

.navbar a {
    text-decoration: none;
    color: white;
    font-family: 'Rock Salt', cursive, Arial, sans-serif;
    font-size: 18px;
    padding: 10px 15px;
    transition: background 0.3s, color 0.3s;
}

/* Hover effect for links in the navbar */
.navbar a:hover {
    background: #4CAF50; /* More distinct green */
    color: black;
    border-radius: 5px;
    transform: scale(1.05); /* Smooth hover effect */
}

/* About Page Image Captions */
.about-page .caption {
    font-size: 14px; /* Same size as habitat page caption */
    font-weight: normal;
    text-align: center;
    margin-top: 5px;
    background: none;
}

/* Habitat Page Gradient Background */
body.habitat-page {
    background: linear-gradient(to bottom, #004d00, #007f33, #66cc66); /* Green gradient */
    color: #333;
    transition: background 0.5s ease;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    body {
        font-size: 16px;
        padding: 10px;
    }

    img {
        max-width: 90%;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 20px;
    }

    p {
        font-size: 16px;
    }

    iframe {
        width: 100%;
        height: auto;
    }
}

.email-link {
    color: black; /* Set the initial text color to black */
    text-decoration: none; /* Remove underline */
    transition: color 0.3s ease; /* Smooth transition */
}

.email-link:hover {
    color: tomato; /* Change color to tomato on hover */
}

/* Common Image Styling */
img {
    display: block; /* Ensure image is treated as a block-level element */
    margin: 0 auto; /* Center the image */
}

/* About Page Image Captions */
.about-page .caption {
    font-size: 14px; /* Same size as habitat page caption */
    font-weight: normal;
    text-align: center; /* Center-align text */
    margin-top: 5px;
    background: none;
    display: block; /* Make sure the caption is a block element */
    width: 100%; /* Ensure caption takes up full width for centering */
}

/* Index Page Image Caption */
.index-page .caption {
    font-size: 12px; /* Match the size of habitat image caption */
    font-weight: normal;
    text-align: center; /* Center the text */
    margin-top: 5px;
    background: none; /* No background */
    display: block; /* Make sure the caption is a block element */
    width: 100%; /* Ensure caption takes up full width */
}

/* Change the title color of 'The Behavior of a Giant Panda' to white */
.behavior-title {
    color: white;
}

/* Change font size for all paragraphs */
p {
    font-size: 24px;
    font-weight: bold; /* Make paragraphs bold */
    color: white; /* Make paragraphs white */
}

/* Change font size for all lists (unordered and ordered) */
ul, ol {
    font-size: 24px;
}

/* Add gradient black and white frame to headings */
h1, h2, h3 {
    font-family: 'Big Shoulders Text', sans-serif; 
    color: #003300; 
    padding: 10px 20px;
    display: inline-block; 
    border: 5px solid transparent; 
    border-image-source: linear-gradient(to right, black, white); 
    border-image-slice: 1; 
}

/* Change font size for h1 */
h1 {
    font-size: 29px;
    font-family: 'Big Shoulders Text', sans-serif;
    color: skyblue;
}

/* Change font size for h2 */
h2 {
    font-size: 27px;
    font-family: 'Big Shoulders Text', sans-serif;
    color: skyblue;
}

/* Change font size for h3 */
h3 {
    font-size: 25px;
    font-family: 'Big Shoulders Text', sans-serif;
    color: skyblue;
}

.about-page h1,
.about-page h2,
.about-page h3 {
    font-family: "Big Shoulders", sans-serif;
    color: skyblue; 
    display: inline-block;
    padding: 10px 20px;
    border: 5px solid;
    border-image: linear-gradient(to right, black, white, black) 1;
}
