
html, body {
    /* Allow content to flow to multiple pages */
    overflow: visible !important;
    margin:0px;

}
@page portrait {
    size: portrait;
    margin: 0in; /* Set margins to 0 for no margins */
}

@page landscape {
    size: landscape;
    margin: 0in; /* Set margins to 0 for no margins */
}

.print-portrait {
    page: portrait;
}

.print-landscape {
    page: landscape;
}

body.printing #pdf_page_wrapper {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    /* Ensure content can flow vertically */
    overflow: visible !important;
}

body.printing #worksheet_layer {
    /* Ensure content can flow vertically within the layer */
    overflow: visible !important;
    /* Images within this layer should be clipped horizontally and at the top,
       but allowed to extend vertically to the next page. This is implicitly
       handled by the browser's print engine if overflow is visible and
       elements are positioned correctly. */
}

/* Prevent individual word entries from splitting across pages */
#puzzle table tr {
    page-break-inside: avoid;
}

/* Optional: Allow the entire puzzle div to break if it's too long */
#puzzle_div {
    page-break-inside: auto; /* Allow breaking if necessary */
}

/* If there's a specific element that should always start on a new page, e.g., the answer key */
#key {
    page-break-before: auto; /* Allow it to start on a new page if previous content fills the current page */
}

.add_line {display:none !important} /* needed for handwriting worksheet */
.edit_line {display:none !important} /* needed for handwriting worksheet */
