/* --- Global Styles --- */
body {
    padding: 0;
    margin: 0;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 0.85em;
    background-color: #fff;
}

/* --- Banner --- */
.banner {
    background: #f1f1f1;
    padding: 20px 0;
    text-align: center;
}

.banner h1 {
    margin: 0;
    font-size: 1.8em;
}

/* --- Main Layout Container (Matches your HTML) --- */
.page-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;         /* Puts News and Sidebar side-by-side */
    gap: 25px;             /* Space between news and FB */
    padding: 20px 10px;
    align-items: flex-start;
}

/* Left Side: News */
.content-pane {
    flex: 1;               /* Takes up all remaining space */
    min-width: 0;          /* Prevents text from breaking layout */
}

/* Right Side: Facebook Sidebar */
.sidebar {
    width: 300px;         /* Explicit width is required for FB SDK */
    min-width: 300px;     /* Prevent flex-box from squishing it */
    flex: 0 0 300px;      /* Ensure it stays exactly 300px */
    min-height: 500px;
    overflow: visible;    /* Ensure the SDK can "pop out" if needed */
}

/* --- Navigation Main Wrapper --- */
.main-nav {
    background: #EAEAEA;
    background: linear-gradient(to bottom, #fcfcfc 0%, #EAEAEA 100%);
    border-bottom: 1px solid #d0d0d0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.nav-header {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end; 
    align-items: center;
    padding: 5px 15px;
}

.menu-toggle {
    display: none; 
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: auto;
}

.lang-switcher img {
    height: 14px;
    margin-left: 8px;
    vertical-align: middle;
}

/* --- The Track Area --- */
.track-wrapper {
    width: 100%;
    position: relative;
    height: auto; 
    margin-top: 5px;
}

/* Desktop Track (851px and up) */
@media (min-width: 851px) {
    .track-wrapper {
        height: 100px; 
    }

    .track-wrapper::before {
        content: "";
        position: absolute;
        bottom: 25px; 
        left: 0;
        width: 100%;
        border-bottom: 2px dashed #666; 
        z-index: 1;
    }
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: flex-end; 
    justify-content: space-between;
    position: relative;
    z-index: 2;
    padding: 0 10px;
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 38px; 
}

.nav-links a {
    text-decoration: none;
    color: #333;
    position: relative;
    font-size: 1.05em;
}

.nav-links a.active {
    color: #c0f;
    font-weight: bold;
}

/* Active Control Circle (Purple Circle) */
.nav-links a.active::after {
    content: "";
    position: absolute;
    bottom: -26px; 
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    background: url('images/track_symbol_control.png') no-repeat center;
    background-size: contain;
    background-color: #f1f1f1; /* Matches the gradient area to mask line */
    border-radius: 50%;
    z-index: 3;
}

/* Symbols */
.track-start, .track-finish {
    width: 50px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 4;
}

.track-start { background-image: url('images/track_symbol_start.png'); }
.track-finish { background-image: url('images/track_symbol_finish.png'); }

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #ddd;
    margin-top: 20px;
}

/* --- Mobile Logic (850px and below) --- */
@media (max-width: 850px) {
    .page-wrapper {
        flex-direction: column; /* Stack News and FB */
        align-items: center;
    }

    .sidebar {
        width: 100%;
        max-width: 300px;
        min-height: auto;
        display: flex;
        justify-content: center;
    }

    .menu-toggle { display: block; }

    .nav-container {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }

    .nav-links {
        display: none; /* Toggled by style.js */
        flex-direction: column;
        width: 100%;
        background: #f9f9f9;
        padding: 15px 0;
        gap: 15px;
        border-top: 1px solid #ddd;
    }

    .nav-links.show { display: flex; }
    
    .nav-links span, .track-start, .track-finish, .nav-links a.active::after { 
        display: none; 
    }
}