/* rind's book: more room for code, SQL and tables.
 *
 * mdbook keeps the text in a 750px column. Most pages of this book show
 * SQL and tables of correspondences, which then scroll sideways. */

/* A wider column on a computer screen; mdbook's own on a small one. */
@media (min-width: 1100px) {
    :root { --content-max-width: 1000px; }
}
@media (min-width: 1500px) {
    :root { --content-max-width: 1200px; }
}

/* Code a little smaller: about 120 characters fit in the column. */
.content pre > code {
    font-size: 0.85em;
}

/* SQL and text output wrap rather than scroll: their long lines are one
 * statement, and reading it whole matters more than its layout. Rust
 * code keeps its lines. */
.content pre > code.language-sql,
.content pre > code.language-text,
.content pre > code.language-json {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* A wide table scrolls inside itself, not the whole page; a long piece of
 * code in a cell breaks rather than widening its column. */
.content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}
.content table td code {
    overflow-wrap: break-word;
}

/* On a phone: less padding around the text, smaller code and tables. */
@media (max-width: 600px) {
    .content {
        padding-left: 2px;
        padding-right: 2px;
    }
    /* every block wraps: on a phone, scrolling sideways in a block is
     * worse than a broken line */
    .content pre > code {
        font-size: 0.75em;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }
    /* the whole table on screen, its code broken where needed */
    .content table {
        font-size: 0.85em;
    }
    .content table td code {
        overflow-wrap: anywhere;
    }
    .content table td,
    .content table th {
        padding: 3px 6px;
    }
}
