/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* General Body Styles */
body {
    font-family: 'Roboto', sans-serif;
    color: #333;
    padding: 3% 15%;
    font-size: 16px; /* unified base font size */
    line-height: 1.7;
}
.caption {
    font-weight: bold;
}
/* Top Ad Banner */
.top-ad-banner {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.top-ad-banner img {
    width: 100%;
    display: block;
    max-height: 120px;
    object-fit: cover;
}

a {
    text-decoration: none !important;
    color: inherit;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 2px solid #ccc;
    flex-wrap: wrap; /* allow wrapping on small screens */
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: 50px;
    margin-right: 10px;
}

.site-title {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 100;
    font-size: 36px;
    color: black;
    padding-right: 30px;
}

/* Main Figure */
.main-figure {
    width: 100%;        /* scale to container width */
    max-width: 800px;   /* prevent huge image on large screens */
    height: auto;       /* maintain aspect ratio */
    display: block;
    margin: 20px 0;     /* spacing around the image */
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: flex-end;
    flex: 1;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.navbar li {
    list-style: none;
}

.navbar a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #007acc;
}

/* Container Layout */
.container {
    display: flex;
    flex-direction: row;
    margin: 30px auto;
    gap: 20px;
    flex-wrap: wrap; /* allow stacking */
}

/* Main Content */
.main-content {
    flex: 3;
    background: #fff;
    padding: 30px;
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.1);
    min-width: 300px; /* prevent collapsing on mobile */
}

.main-content h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

.main-content h2 {
    margin-bottom: 10px;
    color: #222;
}

p, p strong {
    font-size: 1em;
    line-height: 1.7;
}

.disclaimer {
    font-size: 0.75em
}

/* Sidebar */
.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 150px; /* prevent collapsing */
}

.sidebar h3 {
    margin-bottom: 10px;
    color: #444;
}

.sidebar img {
    width: 100%;
    height: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 2px solid #ccc;
    text-align: center;
    color: #777;
    font-size: 0.9em;
}

.footer-logo {
    width: 20px;
    vertical-align: middle;
    margin-right: 5px;
}

/* Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
}

.nav-buttons button {
    padding: 10px 20px;
    background: #007acc;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.nav-buttons button:hover {
    background: #005e99;
}

/* Responsive Styles */

/* Tablets */
@media screen and (max-width: 1024px) {
    body {
        font-size: 15px;
        padding: 3% 8%;
    }

    .site-title {
        font-size: 32px;
    }
}

/* Small tablets / landscape phones */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 3% 5%;
    }

    /* Stack container on mobile */
    .container {
        flex-direction: column;
    }

    /* Sidebar thumbnails horizontal scroll */
    .sidebar {
        flex-direction: row;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
    }

    .sidebar img {
        width: 100px;
        flex-shrink: 0;
    }

    /* Navbar stacked */
    .navbar ul {
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }

    /* Reduce title sizes */
    .site-title {
        font-size: 28px;
        padding-right: 10px;
    }

    .main-content h1 {
        font-size: 1.8em;
    }

    .main-content h2 {
        font-size: 1.3em;
    }

    p {
        font-size: 0.95em;
    }

    .nav-buttons {
        flex-direction: column;
        gap: 10px;
    }

    /* Main figure scales properly */
    .main-figure {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 15px 0;
    }
}

/* Phones */
@media screen and (max-width: 480px) {
    body {
        font-size: 13px;
        padding: 2% 3%;
    }

    .site-title {
        font-size: 24px;
    }

    .main-content h1 {
        font-size: 1.5em;
    }

    .main-content h2 {
        font-size: 1.2em;
    }
    
    .sidebar {
        flex-direction: row;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
    }

    .sidebar img {
        max-height: 100px;   /* keep all thumbnails same height */
        width: auto;         /* scale width to preserve aspect ratio */
        flex-shrink: 0;      /* don’t let flexbox squash them */
        object-fit: contain; /* makes sure the whole image is shown */
    }

    p {
        font-size: 0.9em;
    }

    .nav-buttons button {
        width: 100%;
        padding: 12px 0;
        font-size: 0.95em;
    }

    /* Make header items stack nicely */
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar {
        width: 100%; /* full width */
        justify-content: flex-start;
        margin-top: 10px;
    }

    .navbar ul {
        flex-direction: row;   /* keep in a row */
        flex-wrap: wrap;       /* allow wrapping if needed */
        gap: 10px;
    }

    .navbar li {
        width: auto;           /* don't force full width */
    }

    .navbar a {
        display: block;
        padding: 6px 8px;      /* optional spacing */
    }

}
