/* Sidebar styles */
#rightSidebar {
    width: 100%; /* Sidebar takes full width of flex container by default */
    float: left; /* Align the sidebar to the left */
    min-width: 200px;
    padding: 20px 0 10px 10px; /* Remove right padding for flush alignment */
    background-color: transparent; /* Make sidebar background transparent */
    border: none; /* Remove the white border */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-self: flex-start;
    /* No left margin by default; only on desktop */
}

.sidebar-block {
    margin-bottom: 20px;
    border: 3px solid #8fd938; /* Add green border matching the main wrapper */
    padding: 10px;
    background-color: black; /* Set the background color of each section to black */
}

.sidebar-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
}

.box {
    border: none; /* Remove the grey border with rounded corners */
    border-radius: 0; /* Remove rounded corners */
}

#visitor-counter-box span {
    display: block;
    margin-top: 16px;
}

#guestbook-form {
    margin-top: 16px;
}

.box ul {
    list-style: none;
    padding: 0;
}

.box ul li {
    margin-bottom: 10px;
}

.box ul li a {
    text-decoration: none;
    color: #333;
}

.box ul li a:hover {
    text-decoration: underline;
}

#rightSidebar h3 {
    font-size: 1.4em;
    margin: 0;
    padding: 10px 15px;
    text-align: left;
    display: block;
    border-bottom: 2px solid #8fd938;
}

#rightSidebar u {
    color: #8fd938;
    text-decoration: underline;
    font-weight: bold;
}

#rightSidebar ul {
    list-style-type: none;
    padding-left: 9px;
    margin-left: 0;
}

#rightSidebar ul li {
    margin-bottom: 16px;
    line-height: 1.6;
}

#rightSidebar a {
    color: #1d7bff;
    text-decoration: none;
}

#rightSidebar a:hover {
    color: #008000;
}

#rightSidebar h3.guest-book-divider, #rightSidebar h3.visitor-counter-divider {
    margin-bottom: 20px !important; /* Extra space below dividers */
}

@media (min-width: 769px) {
    #flex {
        flex-direction: row;
    }

    #rightSidebar {
        width: 300px;
        max-width: 300px;
        margin-top: 0;
        order: 1; /* Ensure it appears to the right of the main content */
        position: relative;
        margin-left: auto !important;
        margin-right: 0 !important;
        right: 0;
        /* Sidebar pushed flush to right edge of flex container */
    }
}

@media (max-width: 768px) {
    #flex {
        flex-direction: column;
    }

    #rightSidebar {
        width: 100%;
        max-width: 600px;
        margin-top: 20px;
        order: 2; /* Ensure it appears after all main content */
        position: relative;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }
}