/* ------------------------------------------------------------------
 * Mobile rescue for the RTI / RTS / NewsFeed PDF viewer pages
 *
 * Those three views (Views/RTI, Views/RTS, Views/NewsFeed — PdfViewer.cshtml) share one
 * layout: a 60px header (Home / Sitemap nav, centred title, search box) above an iframe.
 *
 * THE BUG THIS FIXES
 * iOS Safari and Android Chrome refuse to render application/pdf inside a nested browsing
 * context, so the iframe painted blank on every phone with no link and no message. Those
 * pages also set overflow:hidden on html/body, so the blank page could not even be scrolled.
 *
 * DELIBERATELY SCOPED TO MOBILE
 * Every rule except the .pdfv-fallback default sits inside the media query at the foot of
 * this file, and .pdfv-fallback styles an element that did not previously exist. Desktop
 * rendering is therefore untouched — the existing inline <style> in each view still governs
 * it exactly as before. This file is linked AFTER that block so these rules win where they
 * apply, without the inline block needing to be rewritten.
 * ------------------------------------------------------------------ */

/* Hidden by default; the media query below reveals it where the iframe cannot work. */
.pdfv-fallback {
    display: none;
    padding: 32px 16px;
    text-align: center;
}

    .pdfv-fallback p {
        max-width: 34em;
        margin: 0 auto 24px;
        font-size: 16px;
        line-height: 1.6;
        color: #212529;
    }

    .pdfv-fallback .pdfv-btn {
        display: inline-block;
        padding: 14px 28px;
        border: 2px solid var(--nav-bg, #b1004c);
        border-radius: 4px;
        background: var(--nav-bg, #b1004c);
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
    }

        .pdfv-fallback .pdfv-btn:hover,
        .pdfv-fallback .pdfv-btn:focus {
            background: #fff;
            color: var(--nav-bg, #b1004c);
            text-decoration: underline;
        }

        .pdfv-fallback .pdfv-btn:focus-visible {
            outline: 3px solid var(--nav-bg, #b1004c);
            outline-offset: 2px;
        }

/* Touch devices are the ones that refuse inline PDF, whatever their width; the width clause
   catches a narrow window and anything reporting pointer capabilities oddly. */
@media (hover: none) and (pointer: coarse), (max-width: 767.98px) {

    /* The page set overflow:hidden with a full-height chain, which killed touch scrolling
       and could collapse the frame to zero height against a dynamic viewport. */
    html,
    body {
        height: auto;
        overflow: auto;
    }

    /* The fallback now sits inside the <main> (.iframe-container) so all content is in a
       landmark - hide only the frame, and let the main size to the fallback. */
    .iframe-container {
        height: auto;
    }

        .iframe-container > iframe {
            display: none;
        }

    .pdfv-fallback {
        display: block;
    }

    /* The header is a 1fr 2fr 1fr grid holding a fixed 220px search box. Below ~400px that
       box is wider than its column and pushes the page into horizontal scroll, so the three
       items stack instead. Without this the rescued page would still break at 320px. */
    .pdf-header {
        display: block;
        height: auto;
        padding: 12px 16px;
        text-align: center;
    }

    .title-text {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        margin: 8px 0;
    }

    .search-minimal {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        justify-self: auto;
    }
}

/* ---- GIGW additions, site-wide sweep 30-Oct-2026 ---------------------------------------
   These pages render with Layout = null, so they get neither aaa-contrast.css (the site's
   focus indicator) nor the site footer. */

/* 5.1.2 - ownership statement (the footer line every other page carries). */
.pdfv-owner {
    flex: 0 0 auto;
    padding: 6px 16px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    color: #212529;
    background: #fff;
    border-top: 1px solid #dee2e6;
}

/* 5.2.33 - visible keyboard focus. The search box had outline:none and nothing in its
   place; the header links had no indicator at all. (A focused <iframe> cannot be styled from this page - focus is inside the frame, whose own content draws the indicator.) Same two-tone ring as the
   rest of the site (aaa-contrast.css), so it stays visible on light and dark backgrounds. */
.search-minimal:focus-within,
.nav-minimal a:focus-visible {
    outline: 3px solid var(--nav-bg, #095a6f);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #fff;
}
/* The frame is sized as 100% - 60px (header) in each view; take the footer line off as
   well, or it is pushed below the fold of an overflow:hidden page and never seen. Desktop
   only - the mobile block above already lets these pages scroll. */
@media not all and (hover: none) and (pointer: coarse) {
    @media (min-width: 768px) {
        .iframe-container {
            height: calc(100% - 60px - 34px);
        }
    }
}
/* WCAG 2.4.1 - skip link (Layout = null, so the site's skip link is not here). Off-screen
   until focused, then shown top-left above the header. */
.pdfv-skip {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 1000;
    padding: 8px 16px;
    background: #fff;
    color: #095a6f;
    font-weight: 600;
    text-decoration: underline;
}

    .pdfv-skip:focus {
        left: 8px;
        outline: 3px solid var(--nav-bg, #095a6f);
        outline-offset: 2px;
    }

/* The main region receives focus from the skip link; it is not itself interactive. */
#main-content:focus {
    outline: none;
}