/* ==========================================================================
   Accessibility Stylesheet (WCAG 2.1 & 2.2 AA/AAA & IAAP Standards)
   Tailored for Financial Organization: New Berry Capitals Pvt. Ltd (/pms/)
   Addressing Accessibility Findings Audit Report for newberry.in/pms
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Skip Link (WCAG 2.4.1 Bypass Blocks)
   -------------------------------------------------------------------------- */
.skip-link {
    position: absolute;
    top: -999px;
    left: 10px;
    z-index: 999999;
    padding: 12px 20px;
    background-color: #0c1a2e;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 16px;
    text-decoration: underline;
    border: 3px solid #f0ad4e;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: top 0.2s ease-in-out;
}

.skip-link:focus,
.skip-link:active {
    top: 15px;
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   2. Screen Reader Only Utility (WCAG 1.1.1, 1.3.1, 4.1.2)
   -------------------------------------------------------------------------- */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* --------------------------------------------------------------------------
   3. Visible Focus Indicators (WCAG 2.4.7 & 2.4.11 / 2.4.13)
   -------------------------------------------------------------------------- */
:focus-visible {
    outline: 3px solid #f0ad4e !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px rgba(12, 26, 46, 0.85) !important;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
.btn:focus,
[tabindex="0"]:focus {
    outline: 3px solid #f0ad4e;
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   4. AUDIT FIX: Remove Floating Arrow Animation (SC 2.2.2 Pause, Stop, Hide)
   Report Page 17: Stop infinite animation on down arrows beneath sections
   -------------------------------------------------------------------------- */
.mbr-arrow {
    bottom: 45px !important;
    line-height: normal !important;
}

.mbr-arrow--floating .mbr-arrow__link,
.mbr-arrow__link {
    -webkit-animation: none !important;
    -o-animation: none !important;
    animation: none !important;
    transform: none !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    text-decoration: none !important;
    color: #ffffff !important;
    transition: color 0.2s ease !important;
}

.mbr-arrow__text {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase !important;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.95) !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
}

.mbr-arrow__link i {
    font-size: 26px !important;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.95) !important;
}

.mbr-arrow__link:hover .mbr-arrow__text,
.mbr-arrow__link:focus .mbr-arrow__text,
.mbr-arrow__link:hover i,
.mbr-arrow__link:focus i {
    color: #f0ad4e !important;
}

/* --------------------------------------------------------------------------
   5. AUDIT FIX: Reflow at 320 x 256 CSS pixels (SC 1.4.10 Reflow)
   Report Page 15 & 16: Constrain expanded menu and allow vertical scrolling
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .mbr-navbar--auto-collapse.mbr-navbar--open .mbr-navbar__menu,
    .mbr-navbar--collapsed.mbr-navbar--open .mbr-navbar__menu {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-top: 75px !important;
        padding-bottom: 50px !important;
        box-sizing: border-box !important;
        background: rgba(0, 0, 0, 0.95) !important;
    }
    .mbr-navbar--auto-collapse .mbr-navbar__menu-box,
    .mbr-navbar--collapsed .mbr-navbar__menu-box {
        display: block !important;
        vertical-align: top !important;
        width: 100% !important;
    }
    .mbr-navbar--auto-collapse .mbr-navbar__items,
    .mbr-navbar--collapsed .mbr-navbar__items {
        display: block !important;
        float: none !important;
        padding-left: 0 !important;
        list-style: none !important;
        text-align: center !important;
    }
    .mbr-navbar--auto-collapse .mbr-navbar__item,
    .mbr-navbar--collapsed .mbr-navbar__item {
        display: block !important;
        float: none !important;
        margin: 8px 0 !important;
    }
}

/* AUDIT FIX: Reflow on media.html H1 at 320px width */
.media_sec .mbr-hero__text,
.bloombergquint-media_sec .mbr-hero__text,
h1, h2, h3, h4 {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
}

@media (max-width: 767px) {
    .media_sec.bloombergquint-media_sec,
    .media_sec.sec-height,
    main > .media_sec:first-of-type {
        padding-top: 100px !important;
    }
    .media_sec .mbr-hero__text,
    .bloombergquint-media_sec .mbr-hero__text {
        font-size: 26px !important;
        line-height: 1.25 !important;
        padding: 0 10px !important;
    }
}

/* --------------------------------------------------------------------------
   6. AUDIT FIX: Contrast on Selected PMS Investor Tab (SC 1.4.3 Contrast)
   Report Page 13 & 14: Darken active tab background from #DD4953 to exceed 4.5:1
   -------------------------------------------------------------------------- */
.investor-pill .nav-pills > li.active > a,
.investor-pill .nav-pills > li.active > a:hover,
.investor-pill .nav-pills > li.active > a:focus,
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
    background-color: #b71c1c !important; /* > 5.5:1 contrast against white */
    border-color: #991b1b !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   7. AUDIT FIX: Form Placeholder Contrast (SC 1.4.3 Contrast)
   Report Page 14: #B8B8B8 on #F6F6F6 was 1.84:1. Darken to reach >= 4.5:1
   -------------------------------------------------------------------------- */
input::placeholder,
textarea::placeholder {
    color: #4a5568 !important; /* > 5.2:1 against #F6F6F6 */
    opacity: 1 !important;
}
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
    color: #4a5568 !important;
}
input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
    color: #4a5568 !important;
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: #4a5568 !important;
}

/* --------------------------------------------------------------------------
   8. AUDIT FIX: Contact Email Link Contrast (SC 1.4.3 Contrast)
   Report Page 14 & 15: #DA343F on #EFEFEF was 4.02:1. Darken to reach >= 4.5:1
   -------------------------------------------------------------------------- */
.map_info a[href^="mailto:"],
.map_info a[href^="tel:"],
.map_info a {
    color: #991b1b !important; /* > 5.8:1 contrast against #EFEFEF */
    font-weight: 700 !important;
    text-decoration: underline !important;
}
.map_info a:hover,
.map_info a:focus {
    color: #7f141a !important;
}

/* --------------------------------------------------------------------------
   9. Button Contrast & General Contrast Enhancements
   -------------------------------------------------------------------------- */
.btn-warning {
    background-color: #b45309 !important; /* Accessible amber/dark orange */
    border-color: #92400e !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-warning:hover,
.btn-warning:focus {
    background-color: #92400e !important;
    border-color: #78350f !important;
    color: #ffffff !important;
}

.mbr-overlay {
    opacity: 0.65 !important;
    background-color: rgba(5, 10, 20, 0.85) !important;
}

.mbr-hero__text,
.mbr-hero__subtext {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}

/* --------------------------------------------------------------------------
   10. Accessible Form Controls
   -------------------------------------------------------------------------- */
.accessible-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.accessible-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
}

.accessible-form-group label .required-asterisk {
    color: #b71c1c;
    font-weight: bold;
    margin-left: 3px;
}

.accessible-form-group .form-control {
    border: 2px solid #ccd1d9;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 15px;
    color: #1a202c;
    background-color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.accessible-form-group .form-control:focus {
    border-color: #0b5394;
    box-shadow: 0 0 0 3px rgba(11, 83, 148, 0.25);
    outline: none;
}

.accessible-form-feedback {
    display: none;
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.accessible-form-feedback.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.accessible-form-feedback.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --------------------------------------------------------------------------
   11. Touch Targets & Link Padding (WCAG 2.5.5 & 2.5.8)
   -------------------------------------------------------------------------- */
/* Ensure hamburger is strictly hidden on desktop */
@media (min-width: 769px) {
    .mbr-navbar__hamburger,
    .mbr-navbar--auto-collapse .mbr-navbar__hamburger {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .mbr-navbar--auto-collapse .mbr-navbar__hamburger {
        min-width: 44px;
        min-height: 44px;
        cursor: pointer;
        background: transparent;
        border: none;
    }
}

.mbr-navbar--collapsed .mbr-navbar__hamburger {
    cursor: pointer;
    background: transparent;
    border: none;
}

.mbr-arrow__link {
    display: inline-block;
    min-width: 48px;
    min-height: 48px;
    line-height: 48px;
    text-align: center;
}

.mbr-buttons__link {
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
}

/* --------------------------------------------------------------------------
   12. Accessibility Toolbar & Panel
   -------------------------------------------------------------------------- */
.a11y-toolbar-toggle {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 99999;
    background-color: #0b3954;
    color: #ffffff;
    border: 2px solid #f0ad4e;
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s, background-color 0.2s;
}

.a11y-toolbar-toggle:hover {
    background-color: #08263a;
    transform: translateY(-2px);
    color: #fff;
}

.a11y-toolbar-toggle:focus {
    outline: 3px solid #f0ad4e;
    outline-offset: 3px;
}

.a11y-panel {
    position: fixed;
    bottom: 80px;
    left: 25px;
    width: 320px;
    max-width: 90vw;
    background-color: #ffffff;
    border: 2px solid #0b3954;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 99999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: Arial, sans-serif;
    color: #1a1a1a;
}

.a11y-panel.is-open {
    display: flex;
}

.a11y-panel-header {
    background-color: #0b3954;
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.a11y-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.a11y-panel-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.a11y-panel-close:hover,
.a11y-panel-close:focus {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.a11y-panel-body {
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.a11y-control-group {
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 12px;
}

.a11y-control-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.a11y-control-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555555;
    margin-bottom: 8px;
}

.a11y-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.a11y-btn {
    background-color: #f4f6f8;
    border: 1px solid #c9d2db;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #222222;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.a11y-btn:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
}

.a11y-btn.is-active {
    background-color: #0b3954;
    color: #ffffff;
    border-color: #0b3954;
}

.a11y-btn-reset {
    grid-column: span 2;
    background-color: #fbeae8;
    color: #c0392b;
    border-color: #e6b8b3;
    margin-top: 4px;
}

.a11y-btn-reset:hover {
    background-color: #f7d7d3;
    color: #a93226;
}

/* --------------------------------------------------------------------------
   13. Body Accessibility State Classes
   -------------------------------------------------------------------------- */
body.a11y-text-large {
    font-size: 115% !important;
}
body.a11y-text-large p,
body.a11y-text-large span,
body.a11y-text-large a,
body.a11y-text-large li {
    font-size: 1.1em !important;
    line-height: 1.7 !important;
}

body.a11y-text-xlarge {
    font-size: 130% !important;
}
body.a11y-text-xlarge p,
body.a11y-text-xlarge span,
body.a11y-text-xlarge a,
body.a11y-text-xlarge li {
    font-size: 1.25em !important;
    line-height: 1.8 !important;
}

body.a11y-high-contrast {
    background-color: #000000 !important;
    color: #ffffff !important;
}

body.a11y-high-contrast section,
body.a11y-high-contrast footer,
body.a11y-high-contrast .mbr-navbar__section,
body.a11y-high-contrast .content-2 {
    background-color: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: #ffff00 !important;
}

body.a11y-high-contrast a,
body.a11y-high-contrast .mbr-hero__text,
body.a11y-high-contrast h1,
body.a11y-high-contrast h2,
body.a11y-high-contrast h3,
body.a11y-high-contrast h4 {
    color: #ffff00 !important;
}

body.a11y-high-contrast p,
body.a11y-high-contrast span,
body.a11y-high-contrast li {
    color: #ffffff !important;
}

body.a11y-high-contrast .investor-item,
body.a11y-high-contrast .testimonial,
body.a11y-high-contrast .media_data_space {
    border: 2px solid #ffff00 !important;
    background-color: #111111 !important;
}

body.a11y-high-contrast input,
body.a11y-high-contrast textarea,
body.a11y-high-contrast select {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffff00 !important;
}

body.a11y-dyslexic-font {
    font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
    line-height: 1.8 !important;
}

body.a11y-highlight-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 4px !important;
    background-color: rgba(240, 173, 78, 0.2) !important;
    color: #f0ad4e !important;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }
    .animated,
    .wow,
    .fadeInUp,
    .fadeIn,
    .zoomIn {
        animation: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

body.a11y-reduced-motion *,
body.a11y-reduced-motion *::before,
body.a11y-reduced-motion *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
}
