﻿/* Every portal page renders at 80% on screens from 400px to 2200px wide, the size the portal has
   when the browser is zoomed to 80%. Wider screens are left alone.

   The zoom sits on the page wrapper rather than on html: body-level popups, such as the jQuery UI
   datepicker, are placed from getBoundingClientRect values, which are viewport pixels, and a zoomed
   html would scale those coordinates again and move the popup off its field. Left outside the zoom,
   the popup keeps its coordinates and only needs its size reduced, which the datepicker takes from
   its font size because it is laid out in em units. */
@media screen and (min-width: 400px) and (max-width: 2200px) {
    .main-container {
        zoom: 0.8;
    }

    body > #ui-datepicker-div {
        font-size: 80%;
    }

    /* The day-name row is a table header, so the portal table rule gives it the full body font
       size; it takes the zoomed size like the rest of the calendar. */
    body > #ui-datepicker-div table thead th {
        font-size: calc(var(--bs-body-font-size) * 0.8);
    }
}

/* The viewport the media queries measure is the real one, so the laptop font reductions in
   secure.css and style-override.css (at 1400px, 1280px and on high-DPI screens) still match inside
   the zoomed range and would shrink the text a second time. The desktop sizes are restored from
   laptop width up; the zoom alone brings them down to the 80% size. Below 1024px the tablet and
   phone sizes stay as they are. */
@media screen and (min-width: 1024px) and (max-width: 2200px) {
    :root {
        --bs-body-font-size: 16px;
        --bs-menu-font-size: 14px;
        --bs-heading1-font-size: 26px;
        --bs-heading2-font-size: 24px;
        --bs-heading3-font-size: 22px;
        --bs-heading4-font-size: 20px;
        --bs-heading5-font-size: 18px;
        --bs-heading6-font-size: 16px;
    }

    .content.content-locator {
        --locator-font-size: 16px;
    }
}
