/* ========================================================================
   SHARED NAVIGATION CONTROLS
   Used by index.php and downloads.php.
   This file contains only header/menu layout rules. Page visual styling is
   intentionally left untouched so existing page design remains unchanged.
   ======================================================================== */

/* Fixed visual order used in both desktop header and hamburger menu. */
.links a:nth-child(1), .mobile a:nth-child(1) { order: 1; } /* Home */
.links a:nth-child(2), .mobile a:nth-child(2) { order: 2; } /* Status */
.links a:nth-child(3), .mobile a:nth-child(3) { order: 3; } /* Resellers */
.links a:nth-child(4), .mobile a:nth-child(4) { order: 4; } /* Firmware */
.links a:nth-child(5), .mobile a:nth-child(5) { order: 5; } /* Downloads */
.links a:nth-child(6), .mobile a:nth-child(6) { order: 6; } /* OTP Check */
.links a:nth-child(7), .mobile a:nth-child(7) { order: 7; } /* Support */
.mobile a:nth-child(8) { order: 8; } /* Login */
.mobile a:nth-child(9) { order: 9; } /* Register */

/* Never crop menu links on short phone screens; the menu can scroll itself. */
.mobile.open {
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Medium desktop: keep the visible header compact without hiding OTP Check. */
@media (min-width: 1181px) and (max-width: 1500px) {
    /* This overrides the earlier legacy medium-width rule: Resellers stays visible. */
    .links a:nth-child(3) { display: inline-flex !important; }
    .links a { padding-left: 7px; padding-right: 7px; font-size: 12px; }
}

/* Seven requested links fit on desktop. The hamburger is mobile-only. */
@media (min-width: 1181px) {
    .menu { display: none !important; }
}

/* Home is not preselected: it receives the same active appearance only on hover. */
.home-page .links a:first-child:not(:hover) {
    background: transparent !important;
    box-shadow: none !important;
    color: #37665a !important;
}
