/* DigiPrep SEO/mobile enhancements — layout fixes only, no visual redesign */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Subject hub: stack tiles on narrow screens */
@media (max-width: 768px) {
    body.dp-page-subject .mainarea {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        height: auto;
        min-height: calc(100vh - var(--dp-header-height, 64px));
        padding: 1rem 1rem 2rem;
        gap: 0.75rem;
        overflow-x: hidden;
    }

    body.dp-page-subject .left-div {
        width: 100%;
        height: auto;
        min-height: 7.5rem;
        margin: 0;
        font-size: 1.25rem;
        touch-action: manipulation;
    }
}

/* Past paper viewer: phones show PDF only (iPad annotator keeps sidebars) */
@media (max-width: 768px) {
    html:not(.is-ipad-annotator) body[data-digiprep-viewer='true'] #left-sidebar,
    html:not(.is-ipad-annotator) body[data-digiprep-viewer='true'] #right-sidebar {
        display: none !important;
    }

    html:not(.is-ipad-annotator) body[data-digiprep-viewer='true'] .app-layout {
        height: calc(100vh - var(--dp-header-height, 64px)) !important;
        max-height: calc(100vh - var(--dp-header-height, 64px));
    }

    html:not(.is-ipad-annotator) body[data-digiprep-viewer='true'] .viewer-section {
        padding: 8px 6px 12px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    html:not(.is-ipad-annotator) body[data-digiprep-viewer='true'] #pdf-render-target {
        gap: 12px;
    }
}

/* Touch targets — header auth & carousel controls */
@media (max-width: 768px) {
    header.dp-site-header .dp-site-header__link,
    header.dp-site-header .dp-site-header__logo {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .home-hero-carousel__progress {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 4px;
    }

    .home-hero-scroll-cue {
        min-height: 44px;
        padding: 10px 16px;
    }
}

/* Prevent horizontal scroll on small screens */
body.dp-has-site-header {
    overflow-x: hidden;
}

/* Paper list session buttons — easier tapping */
@media (max-width: 640px) {
    .Session > div,
    .Session > a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
