/* Accessibility and home layout refinements for the existing MIR.EXPRESS themes. */
html {
    --mir-focus: #f0cb55;
    --mir-action-ink: #171307;
}
html[data-mir-theme="light"] { --mir-focus: #775611; }

.mir-skip-link {
    position: fixed;
    z-index: 100000;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    padding: 12px 18px;
    border-radius: 8px;
    background: #f0cb55;
    color: #171307 !important;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    transform: translateY(-180%);
}
.mir-skip-link:focus { transform: translateY(0); }

#wrapper :is(a, button, input, select, textarea, summary):focus-visible,
.mir-skip-link:focus-visible {
    outline: 3px solid var(--mir-focus);
    outline-offset: 4px;
}
#wrapper :is(input, textarea) { caret-color: var(--mir-focus); }
#wrapper ::selection { background: #f0cb55; color: #171307; }
#wrapper a { text-underline-offset: .18em; }

html #primary-menu #primary-menu-trigger {
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font: inherit;
    cursor: pointer;
    appearance: none;
}
html #primary-menu-trigger:focus-visible { outline-offset: 3px; }

html #top-bar .mx-header-register {
    color: var(--mir-action-ink) !important;
    text-shadow: none !important;
}
html #top-bar .topbar-search-input::placeholder {
    color: #cfc39b;
    opacity: 1;
}
html[data-mir-theme="light"] #top-bar .topbar-search-input::placeholder { color: #535e6d; }
html #content .mxb-search label { color: var(--mxb-text, #fff4d1) !important; }
html #content .mxb-search :is(input, select) { font-size: 16px; }
html #content .mxb-search input::placeholder { color: var(--mxb-muted, #cfc39b); opacity: 1; }
html[data-mir-theme="light"] #footer #copyrights .col_full { color: var(--mx-v2-muted, #535e6d) !important; }

/* Informational pages now use semantic H1/H2, retaining the former H3 scale. */
.mx-page-hero :is(h1, h2) {
    position: relative;
    margin: 0 0 14px !important;
    font-size: 36px !important;
    line-height: 1.14 !important;
    color: #fff8e6 !important;
}

.mx-v2-home > .mx-v2-hero { padding-block: clamp(32px, 5vw, 64px); }
.mx-v2-home .mx-v2-hero__grid { align-items: start; gap: 40px; }
.mx-v2-home .mx-v2-hero__copy h1 {
    font-size: clamp(36px, 6vw, 72px) !important;
    line-height: 1.05 !important;
    letter-spacing: -.025em !important;
    margin-block: 0 18px !important;
}
.mx-v2-home .mx-v2-hero__copy h2 {
    max-width: 25ch;
    font-size: clamp(24px, 3vw, 36px) !important;
    line-height: 1.2 !important;
    text-wrap: balance;
}
.mx-v2-home .mx-v2-lead { max-width: 54ch; font-size: 16px !important; line-height: 1.6 !important; }
.mx-v2-home .mx-v2-actions { gap: 12px; }
.mx-v2-home .mx-v2-btn { min-height: 46px; }
.mx-v2-home .mx-v2-stage {
    max-width: 65ch;
    margin-block: 18px 0;
    color: var(--mx-v2-muted, #cfc39b);
    font-size: 14px;
    line-height: 1.6;
}
.mx-v2-home .mx-v2-dashboard { margin: 0; }
.mx-v2-home > .mxb-home { margin-block-start: 0; }

@media (max-width: 991px) {
    html #top-bar .mir-theme-switch button { min-height: 44px; }
    html #top-bar :is(.mx-header-register, .auth-enter-link) { min-height: 44px; }
}
@media (max-width: 767px) {
    .mx-page-hero :is(h1, h2) { font-size: 27px !important; }
    .mx-v2-home .mx-v2-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .mx-v2-home .mx-v2-hero__copy h2 { max-width: 28ch; }
    .mx-v2-home .mx-v2-actions { align-items: stretch; }
    .mx-v2-home .mx-v2-actions .mx-v2-btn { justify-content: center; }
    .mx-v2-home .mx-v2-dashboard { padding: 22px; }
    .mx-v2-home .mx-v2-dashboard__head { margin-block-end: 14px; }
}
@media (max-width: 359px) {
    html #top-bar .col_half.fright.col_last { gap: 6px !important; }
    html #top-bar .mir-theme-switch button svg { display: none; }
}
@media (forced-colors: active) {
    #wrapper :is(a, button, input, select, textarea, summary):focus-visible { outline-color: Highlight; }
    .mir-skip-link { border: 1px solid ButtonText; }
}
@media print { .mir-skip-link { display: none; } }

/* Closed cabinet menus must not contribute off-screen layout in either theme. */
html #top-bar .mx-role-cabinet-wrap .mx-role-cabinet-menu {
    display: none !important;
    left: auto !important;
    right: 0 !important;
    min-width: 0 !important;
    width: 220px;
    max-width: calc(100vw - 32px);
}
html #top-bar .mx-role-cabinet-wrap.is-open .mx-role-cabinet-menu {
    display: grid !important;
}
html #top-bar .mx-role-cabinet-menu a {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Keep authenticated RFQ labels legible on the existing night surfaces. */
html[data-mir-theme="dark"] #content .mx-rfq-form .mx-rfq-field > span {
    color: #f2e8c6 !important;
}
html[data-mir-theme="dark"] #content .mx-rfq-form .mx-rfq-field > small {
    color: #cfc39b !important;
}

@media (max-width: 767.98px) {
    #content .breadcrumb-container a {
        display: inline-flex;
        align-items: center;
        min-height: 28px;
    }
}
