/* === YOUR ORIGINAL STYLES (with minor clean-up) === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #111111;
    background-color: #F1F1E6;
}

/* Header-specific styles */
header {
    background-color: #06327D;
    color: #F1F1E6;
    padding: 15px 15px 15px 75px;
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

header.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    min-height: 55px; /* Added min-height for consistent hamburger positioning */
    position: relative; /* Needed for absolute positioning of menu/hamburger */
}

.title {
    display: flex;
    align-items: center;
}

.title img {
    margin-right: 10px;
    height: 55px;
}

header h1 {
    font-size: 35px;
    padding: 10px;
    border-radius: 5px;
    margin: 0;
}

/* Original navigation links (for larger screens) */
.links {
    display: flex;
    align-items: center;
}

.links a {
    color: #F1F1E6;
    text-decoration: none;
    margin-left: 45px;
    font-size: 20px;
    transition: transform 0.2s ease;
}

.links a:hover {
    transform: scale(1.125);
}

.hbtn {
    display: inline-flex;
    background: #f4a261;
    color: #06327D !important;
    padding: 0.4rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
}

.hbtn:hover {
    background: #DB8C4A;
    text-decoration: none !important;
}

/* Utility classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.gradient-line {
    border: 0;
    height: 10px;
    background-image: linear-gradient(to right, #06327D, rgba(6, 50, 125, 0.4), #06327D);
    margin: 0;
}

/* Main content */
main {
    display: flex;
    margin-top: 80px; /* Adjusted by JS, but a fallback */
    padding: 2rem 0;
}

article {
    flex: 3;
    background: #FFFFFF;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 2px 5px 5px #818181;
    margin-right: 2rem;
}

article h1 {
    font-size: 2.5rem;
    color: #06327D;
    margin-bottom: 1rem;
}

.article-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem;
}

article h2 {
    font-size: 1.8rem;
    color: #06327D;
    margin: 1.5rem 0 1rem;
}

article p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.article-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 2px 5px 5px #818181;
    margin: 1rem 0;
}

.cta {
    background: #06327D;
    color: #f4a261;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    margin-top: 2rem;
    box-shadow: 5px 5px 5px #6E6E6E;
}

.cta h2 {
    color: #F1F1E6;
    font-size: 1.8rem;
}

.cta p {
    color: #F1F1E6;
    font-size: 1.1rem;
}
.cta p a {
    color: #F1F1E6;
}
.cta p a:hover {
    color: #cecec3;
}
.cta a.btn {
    display: inline-block;
    background: #f4a261;
    color: #06327D;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
    font-weight: bold;
}

.cta a.btn:hover {
    background: #DB8C4A;
}

/* Sidebar */
.sidebar {
    flex: 1;
    background: #FFFFFF;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 2px 5px 5px #818181;
}

.sidebar h3 {
    font-size: 1.5rem;
    color: #06327D;
    margin-bottom: 1rem;
    text-align: center;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 0.8rem;
}

.sidebar ul li a {
    color: #06327D;
    text-decoration: none;
}

.sidebar ul li a:hover {
    text-decoration: underline;
}

.sidebar-cta {
    margin-top: 2rem;
    text-align: center;
    background: #06327D;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 5px 5px 5px #6E6E6E;
}

.sidebar-cta h3 {
    color: #F1F1E6;
}

.sidebar-cta p {
    color: #F1F1E6;
    font-size: 1rem;
}

.sidebar-cta a.btn {
    display: inline-block;
    background: #f4a261;
    color: #06327D;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.sidebar-cta a.btn:hover {
    background: #DB8C4A;
}

/* Footer */
footer {
    margin-top: 1rem;
    background: #06327D;
    color: #F1F1E6;
    padding: 2rem 0;
    text-align: center;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

footer ul {
    list-style: none;
    display: flex;
    margin-top: 1rem;
    padding: 0; /* Ensure no default padding from list-style */
}

footer ul li {
    margin: 0 1rem;
}

footer ul li a {
    color: #F1F1E6;
    text-decoration: none;
}

footer ul li a:hover {
    text-decoration: underline;
}

/* ======================================= */
/* === NEW RESPONSIVE STYLES START HERE === */
/* ======================================= */

/* Hamburger menu styles (hidden by default) */
.menu-toggle {
    display: none; /* Hide the actual checkbox */
}

.hamburger-icon {
    display: none; /* Hidden by default, shown on small screens */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 1001; /* Ensure it's above other content */
    position: absolute; /* Position relative to nav */
    right: 15px; /* Adjust as needed */
    top: 50%; /* Center vertically */
    transform: translateY(-50%); /* Adjust for perfect vertical center */
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #F1F1E6;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Animation for the hamburger icon to close/X icon */
.menu-toggle:checked + .hamburger-icon span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.menu-toggle:checked + .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.menu-toggle:checked + .hamburger-icon span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* Tablet and smaller desktop adjustments */
@media (max-width: 1024px) {
    header {
        padding: 15px 30px; /* Adjust header padding */
    }

    main {
        padding: 1rem 0; /* Reduce main content padding */
    }

    article, .sidebar {
        padding: 1.5rem; /* Reduce section padding */
    }

    article h1 {
        font-size: 2rem; /* Adjust article title size */
    }

    article h2 {
        font-size: 1.5rem; /* Adjust article heading size */
    }

    .cta h2, .sidebar-cta h3 {
        font-size: 1.5rem; /* Adjust CTA headings */
    }
}

/* Mobile Phones (under 768px) */
@media (max-width: 768px) {
    header {
        padding: 15px; /* Tighten header padding */
        /* IMPORTANT: Ensure header is not hidden when menu is active */
        transform: translateY(0) !important;
        opacity: 1 !important;
    }

    nav {
        flex-direction: row; /* Keep logo and hamburger on the same row */
        justify-content: space-between;
        align-items: center;
    }

    .hamburger-icon {
        display: flex; /* Show hamburger icon */
    }

    /* Hide the regular links on small screens */
    .links {
        display: none;
        flex-direction: column; /* Stack menu items vertically */
        width: 100%;
        position: absolute;
        top: 85px; /* Adjust based on your header height */
        left: 0;
        background-color: #06327D; /* Match header background */
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        padding: 20px 0;
        transition: all 0.3s ease-in-out;
        z-index: 999;
    }

    /* Show links when menu is toggled */
    .menu-toggle:checked ~ .links {
        display: flex;
    }

    .links a {
        margin: 10px 0; /* Vertical spacing for menu items */
        text-align: center;
        padding: 10px 0;
        width: 100%; /* Make full width for better tapping */
        margin-left: 0; /* Reset margin-left from desktop styles */
    }

    .links a.hbtn { /* Target the specific button within the mobile menu */
        width: auto; /* Allow the button to size based on its content */
        margin-left: auto; /* Center the button */
        margin-right: auto; /* Center the button */
        padding: 0.4rem 1rem; /* Reapply original button padding */
    }

    header h1 {
        font-size: 28px; /* Reduce title font size */
        padding: 0; /* Remove extra padding */
    }

    main {
        flex-direction: column; /* Stack article and sidebar */
        /* IMPORTANT: Adjust margin-top to push content below the fixed header,
                     especially when the menu is open */
        margin-top: var(--header-height, 85px); /* Use CSS variable for dynamic height */
        padding: 1rem 15px; /* Add horizontal padding to main content */
    }

    /* When menu is open, push down the main content further */
    body.menu-open main {
        margin-top: calc(var(--header-height, 85px) + 200px); /* Adjust 200px as needed for menu height */
    }


    article {
        margin-right: 0; /* Remove right margin when stacked */
        margin-bottom: 2rem; /* Add bottom margin for spacing between stacked elements */
        padding: 1.5rem; /* Adjust padding for smaller screens */
    }

    .sidebar {
        margin-top: 0; /* No top margin when stacked (unless desired) */
        padding: 1.5rem; /* Adjust padding for smaller screens */
    }

    /* Ensure article images scale within their container */
    .article-image {
        width: 100%;
        max-width: 100%;
    }

    .cta, .sidebar-cta {
        padding: 1.5rem; /* Adjust padding for smaller screens */
    }

    .cta h2, .sidebar-cta h3 {
        font-size: 1.6rem; /* Further reduce heading sizes for mobile */
    }

    /* Table Responsiveness */
    table, thead, tbody, th, td, tr {
        display: block; /* Make table elements behave like blocks */
    }

    thead tr {
        position: absolute;
        top: -9999px; /* Hide table header */
        left: -9999px;
    }

    tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        display: block; /* Ensure each row is a block */
        border-radius: 5px;
        overflow: hidden;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50% !important; /* Make room for the data-label */
        text-align: right;
        padding: 8px 10px;
    }

    td:before {
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        content: attr(data-label); /* Use data-label attribute for headers */
    }

       td[data-label="Model Number"]:before { content: "Model Number"; }
    td[data-label="Risk Level"]:before { content: "Risk Level"; }

    /* Define content for data-labels in the "Uploading Your Portfolio Data" article's table */
    td[data-label="Description / Fund"]:before { content: "Description / Fund"; }
    td[data-label="Symbol / CUSIP / ID"]:before { content: "Symbol / CUSIP / ID"; }
    td[data-label="Asset Class"]:before { content: "Asset Class"; }
    td[data-label="Market Value"]:before { content: "Market Value"; }

    footer ul {
        flex-direction: column; /* Stack footer links */
        gap: 10px; /* Space between stacked links */
    }

    footer ul li {
        margin: 0; /* Remove horizontal margin */
    }
}