/* ------------------------------------------------------------------
   Certification Institute - responsive layer for the classic layout
   Desktop rendering (>= 981px) is untouched: every rule below lives
   inside a max-width media query, so the original 960px design is
   preserved exactly as-is on desktop.
   ------------------------------------------------------------------ */

/* Universal safety: never let media overflow its container. */
img,
video,
iframe,
object,
embed {
    max-width: 100%;
}

table {
    max-width: 100%;
}

/* ---------- Tablet and below: release the fixed 960px shell ---------- */
@media (max-width: 980px) {

    body {
        -webkit-text-size-adjust: 100%;
    }

    #homeMain,
    #contentMainWrapper,
    #interiorContentTop,
    #interiorContent,
    #interiorContentBottom,
    #footerWrapper {
        width: auto;
        max-width: 960px;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    #homeMain,
    #contentMainWrapper,
    #footerWrapper {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* The header art is a fixed-size background image; let the header
       grow with its content instead of clipping at 148px. */
    #homeMain {
        height: auto;
        background-size: cover;
        padding-bottom: 24px;
    }

    #contentHeaderWrapper {
        height: auto;
        background-size: cover;
        padding: 12px 0;
    }

    /* Un-anchor the absolutely positioned header furniture so it can
       stack in normal flow. */
    #homeHeaderWrapper,
    #contentHeader,
    #homeContent {
        position: static;
    }

    #homeLogo,
    #homeNav,
    #homePrograms,
    #homeOrgs,
    #contentLogo,
    #contentNav,
    #contentSlogan,
    #interiorProgramWC-on,
    #interiorProgramWC-off,
    #interiorProgramVendor-on,
    #interiorProgramVendor-off,
    #footerIconsGodaddy,
    #footerIconsTrustE {
        position: static;
        top: auto;
        left: auto;
        right: auto;
    }

    #homeLogo,
    #contentLogo {
        text-align: center;
        margin-bottom: 10px;
    }

    /* Navigation: wrap the button strip instead of overflowing. */
    #homeNav,
    #contentNav,
    #nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        margin-bottom: 10px;
    }

    #homeNav a.NavLink,
    #contentNav a,
    #nav a {
        float: none;
    }

    #contentSlogan {
        text-align: center;
        margin: 8px 0;
    }

    #interiorProgramWC-on,
    #interiorProgramWC-off,
    #interiorProgramVendor-on,
    #interiorProgramVendor-off {
        margin: 8px auto;
    }

    /* Home page call-to-action blocks */
    #homePrograms {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin: 20px 0;
    }

    #homeOrgs {
        width: auto;
        max-width: 337px;
        height: auto;
        background-size: 100% 100%;
        margin: 0 auto;
    }

    /* The two decorative slivers above/below the content panel have a
       fixed-width background image; hide rather than let them tile. */
    #interiorContentTop,
    #interiorContentBottom {
        background-size: 100% 100%;
    }

    #interiorContent {
        background-size: 100% 100%;
        min-height: 0;
    }

    /* Two-column body -> proportional, still side by side. */
    #interiorContentLeftCI,
    #interiorContentLeftWC,
    #interiorContentLeftVendor {
        width: 30%;
        box-sizing: border-box;
    }

    #interiorContentRightCI,
    #interiorContentRightWC,
    #interiorContentRightVendor {
        width: 66%;
        box-sizing: border-box;
        padding: 0 12px 10px 12px;
    }
}

/* ---------- Phones: single column ---------- */
@media (max-width: 760px) {

    #interiorContentLeftCI,
    #interiorContentLeftWC,
    #interiorContentLeftVendor,
    #interiorContentRightCI,
    #interiorContentRightWC,
    #interiorContentRightVendor {
        width: 100%;
        float: none;
        margin: 0;
        padding: 4px 14px 12px 14px;
    }

    #interiorContentRightCI,
    #interiorContentRightWC,
    #interiorContentRightVendor {
        line-height: 1.6;
    }

    /* Side nav reads as a list above the content on small screens. */
    #interiorContentLeftCI,
    #interiorContentLeftWC,
    #interiorContentLeftVendor {
        border-bottom: 1px solid rgba(0, 0, 0, .15);
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    /* Give tap targets room. */
    #homeNav a.NavLink,
    #contentNav a,
    #nav a,
    #interiorContentLeftCI a,
    #interiorContentLeftWC a,
    #interiorContentLeftVendor a {
        line-height: 1.9;
    }

    #footerWrapper {
        text-align: center;
    }

    #navBottom {
        line-height: 2;
    }

    #footerIconsGodaddy,
    #footerIconsTrustE {
        display: inline-block;
        margin: 8px 6px 0 6px;
        vertical-align: middle;
    }

    /* Wide data tables scroll horizontally instead of breaking layout. */
    .tableScroll {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {

    #homeMain,
    #contentMainWrapper,
    #footerWrapper {
        padding-left: 8px;
        padding-right: 8px;
    }

    #homeOrgs {
        background-image: none;
        background-color: #dfe6ef;
        border-radius: 6px;
        padding: 14px;
    }
}

/* ------------------------------------------------------------------
   Legacy sub-sites (PEOCertWC, PEOCertTax, peocertwc, wc-sub)

   These are rigid ~750px table layouts built with spacer GIFs and
   fixed <td width> attributes. They are served with a 780px layout
   viewport so the browser scales the page to fit the screen instead of
   overflowing it, which keeps the original design pixel-exact. The
   rules below are the safe fluid improvements that do not disturb the
   table geometry.
   ------------------------------------------------------------------ */

/* Never let an oversized image push a table wider than its design. */
td img,
th img {
    max-width: 100%;
    height: auto;
}

/* Long unbroken strings (URLs, document names) used to force a table
   wider than 750px; wrap them instead. */
td,
th,
p,
li {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Anything the design left wider than the shell can scroll on its own
   rather than stretching the page. */
.tableScroll,
.scrollWrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
