/* Ferret's School Projects: */
/* Animal Adaptions */
@font-face {
    font-family: 'Font';
    src: url('font.ttf');
    font-display: swap;
}

/* Accent colors for different biomes */
:root {
    --accent-color: #5a6170; /* Default neutral */
}

body[data-active-section="home"] {
    --accent-color: #7fa9c9; /* Soft blue */
    background-color: #2d3338;
}

body[data-active-section="natural-selection"] {
    --accent-color: #c97a7a; /* Darwin red */
    background-color: #382a2a;
}

body[data-active-section="forest"] {
    --accent-color: #6b9d6e; /* Forest green */
    background-color: #2a332c;
}

body[data-active-section="desert"] {
    --accent-color: #d4a574; /* Sandy orange */
    background-color: #38312a;
}

body[data-active-section="ocean"] {
    --accent-color: #5b9fc7; /* Ocean blue */
    background-color: #2a3139;
}

body[data-active-section="tundra"] {
    --accent-color: #8fc5d9; /* Ice blue */
    background-color: #2d3538;
}

body[data-active-section="grassland"] {
    --accent-color: #a8b46a; /* Grass yellow-green */
    background-color: #32342a;
}

body[data-active-section="Adaptations"] {
    --accent-color: #9b87b5; /* Purple */
    background-color: #322f38;
}

body[data-active-section="bibliography"] {
    --accent-color: #a88d6e; /* Book brown */
    background-color: #33302c;
}

body {
    background-color: #2a2d33;
    color: #e8eaed;
    font-family: 'Font';
    transition: background-color 0.5s ease;
}

.subtitle_text {
    text-align: center;
    font-size: 120%;
    font-family: 'Font';
    display: block;
    margin: 10px auto 5px auto;
    color: #a8adb5;
    font-style: italic;
}

.header_text {
    text-align: center;
    font-size: 500%;
    font-family: 'Momo Trust Display', sans-serif;
    display: block;
    margin: 0 auto;
}


hr {
    border-color: var(--accent-color);
    border-width: 5px;
    border-style: solid;
    height: 0;
    transition: border-color 0.3s ease;
}

body > *:not(hr, .header_text) {
    padding-left: 10%;
    padding-right: 10%;
}

section {
    padding-left: 0;
    padding-right: 0;
}

.navbar {
    text-align: center;
    display: block;
    margin: 20px 0;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #e8eaed;
    text-decoration: none;
    font-size: 1.2em;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    display: block;
}

.nav-link:hover {
    background-color: #404450;
}

/* Dropdown styles */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: " ▼";
    font-size: 0.8em;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #404450;
    border: 2px solid #5a6170;
    border-radius: 5px;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-link {
    color: #e8eaed;
    text-decoration: none;
    padding: 8px 20px;
    display: block;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.dropdown-link:hover {
    background-color: #4f5565;
}

/* Section Styling */
section {
    margin: 40px 10%;
    padding: 20px;
    background-color: #353841;
    border-radius: 10px;
    transition: background-color 0.5s ease;
}

body[data-active-section="home"] section {
    background-color: #373e45;
}

body[data-active-section="natural-selection"] section {
    background-color: #403535;
}

body[data-active-section="forest"] section {
    background-color: #354038;
}

body[data-active-section="desert"] section {
    background-color: #3f3a35;
}

body[data-active-section="ocean"] section {
    background-color: #353d45;
}

body[data-active-section="tundra"] section {
    background-color: #384145;
}

body[data-active-section="grassland"] section {
    background-color: #3a3e35;
}

body[data-active-section="Adaptations"] section {
    background-color: #3b3841;
}

body[data-active-section="bibliography"] section {
    background-color: #3d3935;
}

section h1, section h2 {
    color: var(--accent-color);
    transition: color 0.3s ease;
    filter: brightness(1.15);
}

section h3 {
    color: var(--accent-color);
    opacity: 0.85;
    margin-top: 20px;
    transition: color 0.3s ease;
}

section ul {
    margin: 15px 0;
    padding-left: 30px;
}

section ul li {
    margin: 10px 0;
    line-height: 1.6;
}

/* Image container for each section */
.section-image {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    background-color: #404450;
    border: 3px solid var(--accent-color);
    border-radius: 10px;
    color: #a8adb5;
    font-style: italic;
    transition: border-color 0.3s ease, background-color 0.5s ease;
}

body[data-active-section="home"] .section-image {
    background-color: #404955;
}

body[data-active-section="natural-selection"] .section-image {
    background-color: #4d4040;
}

body[data-active-section="forest"] .section-image {
    background-color: #414d48;
}

body[data-active-section="desert"] .section-image {
    background-color: #4a4640;
}

body[data-active-section="ocean"] .section-image {
    background-color: #404955;
}

body[data-active-section="tundra"] .section-image {
    background-color: #434e52;
}

body[data-active-section="grassland"] .section-image {
    background-color: #474d40;
}

body[data-active-section="Adaptations"] .section-image {
    background-color: #484650;
}

body[data-active-section="bibliography"] .section-image {
    background-color: #4a4740;
}

.section-image > figure {
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

/* Figure and caption for image credits */
.section-image figure {
    width: 100%;
    height: 400px;
    margin: 0;
    position: relative;
}

/* Half-height image variant */
.section-image-half {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    background-color: #404450;
    border: 3px solid var(--accent-color);
    border-radius: 10px;
    color: #a8adb5;
    font-style: italic;
    transition: border-color 0.3s ease, background-color 0.5s ease;
}

body[data-active-section="home"] .section-image-half {
    background-color: #404955;
}

body[data-active-section="natural-selection"] .section-image-half {
    background-color: #4d4040;
}

body[data-active-section="forest"] .section-image-half {
    background-color: #414d48;
}

body[data-active-section="desert"] .section-image-half {
    background-color: #4a4640;
}

body[data-active-section="ocean"] .section-image-half {
    background-color: #404955;
}

body[data-active-section="tundra"] .section-image-half {
    background-color: #434e52;
}

body[data-active-section="grassland"] .section-image-half {
    background-color: #474d40;
}

body[data-active-section="Adaptations"] .section-image-half {
    background-color: #484650;
}

body[data-active-section="bibliography"] .section-image-half {
    background-color: #4a4740;
}

.section-image-half > figure {
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-image-half img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

.section-image-half figure {
    width: 100%;
    height: 400px;
    margin: 0;
    position: relative;
}

.img-overlay {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    font-size: 0.85em; /* smaller than body text */
    color: #e8eaed;
    background: rgba(42,45,51,0.6);
    padding: 4px 6px;
    border-radius: 4px;
}

.img-credit {
    display: block;
    font-size: 0.7em;
    color: #a8adb5;
    margin-top: 8px;
    text-align: center;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    background-color: #404450;
    border-radius: 5px;
    margin: 0 auto;
    width: 40px;
    border: none;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background-color: #e8eaed;
    margin: 4px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    body > *:not(hr, .header_text) {
        padding-left: 5%;
        padding-right: 5%;
    }
    
    section {
        margin: 20px 5%;
        padding: 15px;
    }
    
    .header_text {
        font-size: 300%;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-menu.active {
        max-height: 500px;
    }
    
    .nav-item {
        width: 100%;
        text-align: center;
    }
    
    .nav-link {
        padding: 15px;
        width: 100%;
    }
    
    /* Mobile dropdown adjustments */
    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border: none;
        background-color: #2a2d33;
    }
    
    .dropdown.active .dropdown-menu {
        max-height: 300px;
    }
    
    .dropdown-toggle::after {
        content: " ▼";
        transition: transform 0.3s ease;
    }
    
    .dropdown.active .dropdown-toggle::after {
        transform: rotate(180deg);
        display: inline-block;
    }
    
    .section-image figure {
        height: 250px;
    }
    
    .section-image-half figure {
        height: 125px;
    }
}

@media screen and (max-width: 480px) {
    body > *:not(hr, .header_text) {
        padding-left: 2%;
        padding-right: 2%;
    }
    
    section {
        margin: 15px 2%;
        padding: 10px;
    }
    
    .header_text {
        font-size: 200%;
    }
    
    .section-image figure {
        height: 200px;
    }
    
    .section-image-half figure {
        height: 100px;
    }
}

a {
    color: var(--accent-color);
    transition: color 0.3s ease;
    filter: brightness(1.15);
}

a:hover {
    filter: brightness(1.35);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Momo Trust Display', sans-serif;
}

h3 {
    font-size: 150%;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    left: 10px;
    top: 10px;
    width: auto;
    height: auto;
    background: #20232a;
    color: #e8eaed;
    padding: 8px 12px;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    z-index: 10000;
}

/* Mobile Warning Modal */
.mobile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #404450;
    border: 3px solid #5a6170;
    border-radius: 10px;
    padding: 30px;
    max-width: 400px;
    margin: 20px;
    text-align: center;
}

.modal-content h2 {
    color: #9da3af;
    margin-top: 0;
    font-family: 'Momo Trust Display', sans-serif;
}

.modal-content p {
    color: #e8eaed;
    line-height: 1.6;
    margin: 20px 0;
}

.modal-button {
    background-color: #5a6170;
    color: #e8eaed;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    font-family: 'Font';
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-button:hover {
    background-color: #6b7180;
}

/* Adaptations page specific image styling */
#Adaptations .section-image figure {
    height: auto;
}

#Adaptations .section-image img {
    object-fit: contain;
    height: auto;
}