@font-face {
    font-family: 'IBM VGA';
    src: url('/static/fonts/Web437_IBM_VGA_8x16.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* Desktop split-pane layout (>=1024px) */
@media (min-width: 1024px) {
    .split-container {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        min-height: calc(100vh - 40px);
        width: 100%;
    }

    .left-pane {
        width: 50%;
        min-width: 0;
        overflow-y: auto;
        max-height: calc(100vh - 40px);
    }

    /* Center thread list and controls within left pane */
    .left-pane .thread-list,
    .left-pane .toggle-wrapper,
    .left-pane .pagination,
    .left-pane .no-threads,
    .left-pane .alert {
        margin-left: auto;
        margin-right: auto;
    }

    /* Fixed divider: foreground element like the titlebar */
    .pane-divider {
        display: none;
    }

    .pane-divider-fixed {
        position: fixed;
        top: 0;
        bottom: 30px; /* stop at titlebar */
        left: 50%;
        width: 1px;
        background-color: #FFFFFF;
        z-index: 1500;
        pointer-events: none;
    }

    /* Right pane: fixed position so it spans full height independently */
    .right-pane {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 30px; /* stop at titlebar */
        width: 50%;
        overflow-y: auto;
        padding: 0;
    }

    /* NFO centered within right pane */
    #nfo-fragment {
        display: flex;
        justify-content: center;
        padding: 0;
        margin: 0;
    }

    /* Thread/edit content: horizontal padding, top set dynamically by JS */
    #thread-fragment,
    #edit-fragment {
        padding: 0 1rem 1rem 10px;
    }

    /* Right pane thread/edit: square corners + drop shadow like left pane */
    #thread-fragment .thread-view,
    #edit-fragment .edit-form {
        border-radius: 0;
        box-shadow: 8px 8px 0 #212121;
        max-width: calc(80ch + 250px);
        margin-left: auto;
        margin-right: auto;
    }
}

/* Mobile: hide divider and right pane */
@media (max-width: 1023px) {
    .pane-divider {
        display: none;
    }

    .pane-divider-fixed {
        display: none;
    }

    .right-pane {
        display: none;
    }
}

/* NFO display with IBM VGA font — font-size set dynamically by JS */
.nfo-display {
    font-family: 'IBM VGA', monospace;
    line-height: 1;
    white-space: pre;
    overflow-x: hidden;
    display: block;
    padding: 0;
    margin: 0;
}

/* Right pane reply form styling (inline, not floating) */
.pane-reply-form {
    padding: 8px;
    border-top: 1px solid #555;
    margin-top: 8px;
}

.pane-reply-form h3 {
    margin-bottom: 4px;
    font-size: 0.9em;
}

.pane-reply-form .form-row {
    margin-bottom: 4px;
}

.pane-reply-form input[type="text"],
.pane-reply-form input[type="password"],
.pane-reply-form textarea {
    width: 100%;
}

/* Image popup floating window */
.image-popup {
    width: auto;
    min-width: 150px;
    max-width: none;
    overflow: hidden;
}

.image-popup .form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.image-popup-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.image-popup-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.image-popup-controls button {
    display: inline-block;
    padding: 0px 4px;
    cursor: pointer;
    color: #000000;
    background: #AAAAAA;
    font-size: 0.9rem;
    font-weight: bold;
    font-family: monospace;
    border-top: 1px solid #FFFFFF;
    border-left: 1px solid #FFFFFF;
    border-right: 1px solid #555555;
    border-bottom: 1px solid #555555;
    box-shadow: 1px 1px 0 #000000;
    border-radius: 0;
    user-select: none;
    line-height: 1.2;
}

.image-popup-controls button:hover {
    color: #FFFFFF;
    background: #AA0000;
    border-top: 1px solid #FF5555;
    border-left: 1px solid #FF5555;
    border-right: 1px solid #550000;
    border-bottom: 1px solid #550000;
}

.image-popup-body {
    padding: 0;
    overflow: hidden;
    height: calc(100% - 33px); /* fill below header */
    position: relative;
    cursor: grab;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.image-popup-body::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.image-popup-img {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    user-select: none;
}

/* Right pane edit form */
#edit-fragment .edit-form {
    padding: 8px;
}

#edit-fragment .edit-form h2 {
    font-size: 1em;
    margin-bottom: 4px;
}

#edit-fragment .edit-form h3 {
    font-size: 0.9em;
    margin-bottom: 4px;
}
