/* ============================================================= */
/* Print-specific styles */
/* ============================================================= */

@media print {
    body {
        font-size: 14pt; /* Adjust font size for print */
        line-height: 1.2; /* Adjust line height for print */
    }

    p, blockquote {
        widows: 3;  /* Minimum lines at top of a page */
    }

    p {
        orphans: 4;
    }

    blockquote {
      display: block;
      border-left: 5px solid #777777;
      margin-left: 1em;
      margin-right: 1em;
      margin-top: 2em;
      margin-bottom: 2em;
      padding-left: 1em;
      padding-right: 1em;
    }


    /* Hide elements not needed for print */
    nav, aside, .no-print {
        display: none !important;
    }

    /* Force page breaks if needed */
    h1, h2 {
        page-break-after: avoid;
    }

    /* This more or less centers the title of the work */
    /* I'm not very good at CSS, so this is pretty ugly */
    div.titlepage, div.innerpage { 
        margin-top: 400px; 
        background: transparent;  
        break-before: page;

        height: 400px;
        width: 150px;
        padding-top: 350px;
        vertical-align: middle; /* Aligns the image vertically with the text */

        display: block;
        text-align: center;
        margin: auto;
        width: 50%;
	page-break-after: always;
    }


    /* ------------------------------------------------------------- */
    /* sets main body text to use the txt-page counter so as not to conflict with table of contents */
    /* ------------------------------------------------------------- */
    div.booktext {
        page: txt;
        counter-reset: txt-page 0;
    }

    /* shows page counter in Arabic numerals (1, 2, 3, ...) */
    @page txt {
        counter-increment: txt-page;
        size: auto; /* Use the default paper size */
        margin-top: 0.5in; /* Adjust page margins as needed */
        margin-bottom: 0.5in;

        @bottom-center {
            content: "- " counter(txt-page) " -";
        }
    }

    /* ------------------------------------------------------------- */
    /* sets table of contents to use the toc-page counter so as not to conflict with main body text  */
    /* ------------------------------------------------------------- */
    div.tableofcontents {
        page: toc;
        counter-reset: toc-page 0;
    }

    /* shows page counter in lower-case Roman numerals (i, ii, iii, ...) */
    @page toc {
        counter-increment: toc-page;
        size: auto; /* Use the default paper size */
        margin-top: 0.5in; /* Adjust page margins as needed */
        margin-bottom: 0.5in;

        @bottom-center {
            content: "- " counter(toc-page, lower-roman) " -";
        }
    }


    /* ------------------------------------------------------------- */
    /* formats cover to fill the page when printed */
    /* ------------------------------------------------------------- */
    .full-page-image-container {
        page-break-before: always;
        page-break-after: always;
        break-before: page;
        break-after: page;
        height: 100vh; /* Use viewport height for screen display */
        width: 100%;
        position: relative;
        margin: 0;
        padding: 0;
    }

    .full-page-image {
        width: 100%;
        height: 100%;
        object-fit: cover; /* This makes the image cover the entire container */
        display: block;
        margin: 0;
        padding: 0;
    }

    .part-page-image-container {
        height: 60%;
        position: relative;
        margin: 0;
	margin-bottom: 2em;
        padding: 0;
    }

    .part-page-image {
        width: 100%;
        height: 100%;
        object-fit: cover; /* This makes the image cover the entire container */
        display: block;
        margin: 0;
        padding: 0;
    }

    /* ------------------------------------------------------------- */
    /* sets the cover and title page to use page with no page numbers */
    /* ------------------------------------------------------------- */
    div.full-page-image-container, div.titlepage {
        page : full-page;
    }

    /* prints a page with no page numbers or margins */
    @page full-page {
        margin: 0; 
    }

    a {
        color: inherit; /* Matches the text color of surrounding content */
        text-decoration: none; /* Removes the underline */
    }


}