/* Bootstrap 5 Compatible */

/* Layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: acumin-pro-semi-condensed, sans-serif;
}

    /* Ensure navbar and main content don't shrink */
    body > .navbar,
    body > .container.print-visible {
        flex-shrink: 0;
    }

/* Main content area - grows to fill space */
#content-container,
.wrapper-body,
.container.print-visible {
    flex: 1 0 auto;
    padding-bottom: 40px;
}

#content,
.page-content,
#mainContent {
    min-height: 400px;
}

/* Push footer to bottom */
.footer {
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
}

/* Footer Styles */
div.ab-footer {
    box-sizing: border-box;
    width: 100%;
    background: #f1f1f1;
    border-top: 1px solid #dcdcdc;
    border-bottom: 16px solid #0081ab;
}

    div.ab-footer > div.ab-wrapper {
        padding: 12px 0;
    }

    div.ab-footer .container {
        padding-top: 0;
        padding-bottom: 0;
    }

    div.ab-footer .row {
        align-items: center;
    }

    div.ab-footer img {
        max-width: 100%;
        height: auto;
    }

    div.ab-footer .btn {
        white-space: normal;
        word-wrap: break-word;
    }

/* Navbar Customization */
.navbar-dark .navbar-nav > li > a {
    color: #000;
}

    .navbar-dark .navbar-nav > li > a:hover {
        color: #fff;
        background-color: #302ce1;
    }

    .navbar-dark .navbar-nav > li > a:focus {
        color: #fff;
        background-color: #302ce1;
        border: 1px dashed black !important;
        outline: 1px dashed #ffffff;
    }

.custom-container {
    flex-wrap: wrap !important;
}

.custom-navbar-toggler {
    margin-left: auto;
}

/* Skip to Content */
.skip-to-content a {
    padding: 10px 20px;
    position: absolute;
    top: -43px;
    left: 0;
    color: #ffffff;
    border-radius: 2px;
    background: #742774;
    transition: top 1s ease-out;
    z-index: 100;
    font-size: 14px;
}

    .skip-to-content a:focus {
        top: 0;
        outline: none;
        transition: top 0.1s ease-in;
    }

/* Utility Classes */
.pr-color {
    color: #2f5fef;
}

.blue_border {
    padding-bottom: 10px;
    border-bottom: 7px solid #0b80d0;
}

/* Link Styles */
a:not(.btn):hover {
    text-decoration: underline !important;
}

[role='navigation'] a,
[role='contentinfo'] a,
.toolbar a {
    text-decoration: none;
}

/* High Contrast Mode Support */
@media screen and (-ms-high-contrast: active) {
    .navbar-dark .navbar-toggler .navbar-toggler-icon {
        background-color: #fff;
    }
}

/* Mobile Responsive - Tablets and smaller */
@media (max-width: 992px) {
    div.ab-footer .row {
        text-align: center;
    }

    div.ab-footer .col-md-5,
    div.ab-footer .col-md-3 {
        margin-bottom: 12px;
    }

    div.ab-footer .d-flex {
        justify-content: center !important;
        flex-direction: column;
        align-items: center;
    }

    div.ab-footer .gap-2 {
        gap: 8px !important;
    }
}

/* Mobile Responsive - Phones */
@media (max-width: 768px) {
    div.ab-footer > div.ab-wrapper {
        padding: 8px 0;
    }

    div.ab-footer .col-md-5,
    div.ab-footer .col-md-3 {
        width: 100%;
        margin-bottom: 10px;
        padding: 8px 15px;
    }

    div.ab-footer .d-flex {
        justify-content: center !important;
        text-align: center;
    }

    div.ab-footer img {
        max-width: 32px;
        height: 32px;
    }

    div.ab-footer .btn {
        font-size: 14px;
        padding: 6px 12px;
        width: auto;
        max-width: 100%;
    }

    div.ab-footer a {
        font-size: 14px;
        display: block;
        margin: 4px 0;
    }

    div.ab-footer span {
        font-size: 14px;
        display: block;
    }

    /* Stack Government of Alberta logo vertically on mobile */
    div.ab-footer .col-md-3[style*="flex-direction"] {
        flex-direction: column !important;
        align-items: center !important;
        display: flex !important;
    }

    div.ab-footer .col-md-3 img {
        max-width: 120px;
        margin-bottom: 8px;
    }

    #content-container,
    .wrapper-body,
    .container.print-visible {
        padding-bottom: 20px;
    }

    #content,
    .page-content,
    #mainContent {
        min-height: 300px;
    }
}

/* Extra small devices (phones in portrait mode) */
@media (max-width: 576px) {
    div.ab-footer > div.ab-wrapper {
        padding: 6px 0;
    }

    div.ab-footer .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    div.ab-footer .col-md-5,
    div.ab-footer .col-md-3 {
        padding: 6px 10px;
        margin-bottom: 8px;
    }

    div.ab-footer span,
    div.ab-footer a {
        font-size: 13px;
    }

    div.ab-footer .btn {
        font-size: 13px;
        padding: 5px 10px;
    }

    div.ab-footer img[alt="Government of Alberta Logo"] {
        max-width: 100px;
    }
}

@media (max-width: 768px) {
    #mainContent .card .table-responsive,
    #mainContent .card .view-grid.table-responsive {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

        #mainContent .card .view-grid.table-responsive table {
            min-width: 900px; /* forces horizontal scroll instead of column collapse */
        }

        #mainContent .card .view-grid.table-responsive th,
        #mainContent .card .view-grid.table-responsive td {
            white-space: nowrap;
        }
}