/* --- 1. GLOBAL RESET & SCROLLBAR FIX --- */
/* Forces only ONE scrollbar by resetting Pico's default container behaviors */
html {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    overflow-x: hidden; /* Prevents side-scrolling */
    scroll-padding-top: 75px !important; /* Changed from 85px to 75px to pull titles closer */
    scroll-behavior: smooth;
}
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    overflow-y: visible !important; /* Eliminates the double scrollbar */
    min-height: 100%;
    background-color: #ffffec;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    padding-top: 75px !important; /* Space for the fixed nav bar */
}

/* --- 2. FIXED NAVIGATION BAR --- */
nav.main-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 70px !important;
    background-color: #fff8f5 !important;
    z-index: 10000 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: 0 !important;
    border-radius: 0 !important;
}

/* Logo & Text Alignment */
.logo-area {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.logo-area img {
    height: 45px !important;
    width: auto !important;
    margin-right: 10px !important;
}

.logo-area strong {
    white-space: nowrap !important;
    font-size: 0.95rem;
    color: #5b4c6e;
}

/* Desktop Tabs Spacing */
.desktop-nav {
    display: flex !important;
    gap: 20px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- 3. MOBILE MENU & TOGGLE --- */
#menu-toggle {
    display: none !important; /* Hidden on Desktop */
    background: none !important;
    border: none !important;
    font-size: 2rem !important;
    color: #5b4c6e !important;
    cursor: pointer !important;
    z-index: 10001 !important;
}

.mobile-nav {
    display: none; /* Controlled by JS */
    position: fixed !important;
    top: 70px !important;
    right: 15px !important;
    width: 220px !important;
    background-color: #fff8f5 !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
    z-index: 10002 !important;
    list-style: none !important;
    padding: 15px !important;
}

@media screen and (max-width: 991px) {
    .desktop-nav { display: none !important; }
    #menu-toggle { display: block !important; }
}

/* --- 4. BACK TO TOP BUTTON --- */
.back-to-top {
    display: none; /* Initially hidden, flex added via JS */
    position: fixed !important;
    bottom: 30px !important;
    left: 30px !important;
    width: 50px !important;
    height: 50px !important;
    background-color: #4A90E2 !important;
    color: white !important;
    border-radius: 50% !important;
    z-index: 999999 !important; /* Highest layer to prevent "swallowing" */
    justify-content: center;
    align-items: center;
    text-decoration: none !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
    cursor: pointer;
    font-size: 24px !important;
    -webkit-backface-visibility: hidden; /* Android Chrome rendering fix */
}

.back-to-top:hover {
    background-color: #357ABD !important;
}

/* --- 5. PAGE CONTENT SPACING --- */
#home h2 {
    margin-top: 10px !important;
}

h1, h2, h3 { color: #5b4c6e; }
a { color: #a16ae8; }
a:hover { color: #7c4dcc; }

/* Space out the mobile menu links */
.mobile-nav li {
    padding: 12px 0 !important; /* Adds vertical space between links */
    border-bottom: 1px solid #eee; /* Optional: adds a subtle separator line */
}

.mobile-nav li:last-child {
    border-bottom: none; /* Removes the line from the last item */
}

/* Pulls the main content container higher */
main.container {
    margin-top: 5px !important; 
    padding-top: 0 !important;
}

/* Tightens the space inside hgroup headers */
hgroup {
    margin-bottom: 1rem !important;
}

/* Make legal text more readable on mobile */
main.container article {
    font-size: 1.1rem; /* Slightly larger text */
    line-height: 1.7;   /* More space between lines */
}

@media (max-width: 768px) {
    main.container h1 {
        font-size: 1.8rem !important; /* Ensure titles aren't too huge on small screens */
    }
}

/* Center and add margins to legal pages for Desktop & Mobile */
.privacy-container, .terms-container {
    max-width: 900px !important; /* Prevents text from being too wide on desktop */
    margin: 40px auto !important; /* Centers the whole block */
    padding-left: 30px !important; /* Side margin for the left */
    padding-right: 30px !important; /* Side margin for the right */
}

/* Ensure the article box inside has consistent spacing */
main.container article {
    padding: 40px !important; /* Adds space inside the box */
}

/* Mobile-specific tweak for smaller screens */
@media screen and (max-width: 768px) {
    .privacy-container, .terms-container {
        padding-left: 20px !important;
        padding-right: 20px !important;
        margin-top: 20px !important;
    }
}

/* Pull legal text closer to the top menu */
.privacy-container, .terms-container {
    margin-top: 10px !important; /* Reduces space above the container */
}

.privacy-container article, .terms-container article {
    padding-top: 10px !important; /* Reduces space inside the top of the box */
}

/* Specific adjustment for the very first heading */
.privacy-container h1, .terms-container h1 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

