/* Mobile layout corrections; desktop rules remain in their original stylesheets. */
@media (max-width: 1000px) {
    #banner-logo { background-position: center; margin: 12px auto 24px; }
    #banner-text > div:nth-child(2) { display: block; }
}
@media (max-width: 767px) {
    html, body { min-width: 320px; }
    .container { width: calc(100% - 32px); }
    nav #logo { max-width: calc(100% - 64px); background-size: contain; }
    nav button { flex-shrink: 0; }
    #content { width: calc(100% - 32px); margin-left: auto; margin-right: auto; }
    #content h1 { font-size: 28px; line-height: 1.4; }
    #content h2 { font-size: 23px; line-height: 1.5; }
    #content p, #content li { line-height: 1.8; }
    #content table { width: 100%; table-layout: fixed; }
    #content table tr > :first-child { width: 72px; }
    #content table tr > :nth-child(2) { padding-left: 12px; overflow-wrap: anywhere; }
    #content table img { width: 64px; height: auto; }
    footer { margin-top: 64px; }
    footer .container { justify-content: flex-start; gap: 24px; }
    footer .container div, footer .container div:nth-child(2) {
        flex: 1 1 120px; width: auto; max-width: none; padding: 0; margin: 0;
        box-sizing: border-box;
    }
    footer .container div:last-child { flex-basis: 100%; margin: 12px 0; }
    #posts article h1 { font-size: 25px; line-height: 1.5; }
    #posts article > a > img { margin-bottom: 20px; min-height: 0; }
    #topics { padding: 40px 0; }
    #topics .card { width: 100%; max-width: 360px; min-height: 0; padding: 28px 20px; margin: 8px 0; }
    #banner h1 { overflow-wrap: anywhere; }
    #forum-banner { width: calc(100% - 32px); padding: 28px 20px; }

    /* Homepage: one centered column with a visible primary action. */
    header:has(#banner-logo) { min-height: 0; }
    header:has(#banner-logo) #logo { opacity: 1; }
    #banner:has(#banner-logo) { width: 100%; padding: 12px 20px 40px; gap: 20px; }
    #banner-logo {
        width: 160px; height: 164px; max-width: none; max-height: none;
        margin: 0 auto; background-position: center; background-size: contain;
        filter: drop-shadow(0 8px 18px rgba(21, 63, 134, .5));
    }
    #banner-text { width: 100%; max-width: 500px; margin: 0 auto; padding: 0; }
    #banner-text > div:first-child h1 { font-size: clamp(26px, 7vw, 34px); line-height: 1.45; margin: 0 0 16px; }
    #banner-text > div:first-child p { font-size: 16px; line-height: 1.85; margin: 0; text-align: left; }
    #banner-text > div:last-child { display: block; margin: 24px 0 0; }
    #banner-text .btn { width: 160px; font-size: 16px; padding: 14px 20px; }
    #banner-text #documentation-link { margin-left: 0; }
    #down-arrow { display: none; }
    #ng-sec-highlights > ul { flex-direction: column; }


}
@media (prefers-reduced-motion: reduce) {
    #down-arrow, #ng-sec-platforms h1 .caret { animation: none; }
}
