/* ---------- Global HTML/Body Styles ---------- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 0;
    max-width: 100%;
    overflow-x: visible;
}

/* Wrapper and Page Layout - Account for fixed header */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-layout {
    flex: 1;
    padding-top: 5rem; /* Fallback space for fixed top navigation - dynamically adjusted by JavaScript */
}

#main-content {
    width: 100%;
    max-width: 100%;
}


.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.container-fluid {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    overflow-x: hidden;
    overflow-y: visible;
}

.container {
    overflow-x: hidden;
    overflow-y: visible;
}

/* Ensure row doesn't clip sticky children */
.row {
    overflow: visible !important;
}

img, svg, canvas, video, iframe {
    max-width: 100%;
    height: auto;
}

.card, .table {
    max-width: 100%;
}


#TopNavTarget {
    background-color: #080530;
    padding: 10px 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-weight: bold;
    position: fixed;
    z-index: 1300 !important;
    top: 0;
    width: 100%;
}

    #TopNavTarget .navbar-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center;
        align-items: center;
        list-style: none;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

        #TopNavTarget .navbar-nav > li {
            flex: 0 0 auto;
        }

            #TopNavTarget .navbar-nav > li > a {
                display: inline-block;
                color: #9d9d9d;
                text-decoration: none;
                padding: 5px 10px;
            }

                #TopNavTarget .navbar-nav > li > a:hover {
                    color: #ffffff;
                }

#BottomNavTarget {
    background-color: #080530;
    padding: 10px 15px;
    font-weight: bold;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    #BottomNavTarget .navbar-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center;
        align-items: center;
        list-style: none;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

        #BottomNavTarget .navbar-nav > li {
            flex: 0 0 auto;
        }

            #BottomNavTarget .navbar-nav > li > a {
                display: inline-block;
                color: #9d9d9d;
                text-decoration: none;
                padding: 5px 10px;
            }

                #BottomNavTarget .navbar-nav > li > a:hover {
                    color: #ffffff;
                }


.overlay-close {
    position: absolute;
    top: .5rem;
    right: .5rem;
}

/* ========== CARD COMPONENT - BASE STYLES ========== */
.card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    /* overflow: hidden removed - allows sticky headers to work */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.card__header {
    background: linear-gradient(135deg, #080530 0%, #3477b2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0; /* Round top corners only */
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: filter 0.2s ease;
}

.card__body {
    padding: 20px;
}

@media (min-width: 768px) {
    .card__body {
        padding: 25px;
    }
}

/* ========== CARD MODIFIERS ========== */

/* Card with footer - Flex layout allows footer to stick to bottom */
.card--with-footer {
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

/* Clickable card - Visual feedback for interactive cards */
.card--clickable:hover {
    border-color: #3477b2;
}

/* ========== CARD ELEMENTS ========== */

/* Card Action Pane - italic description section */
.card__action-pane {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e4e7;
    padding: 12px 20px;
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.4;
    font-style: italic;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

/* Card Footer - Base footer component */
.card__footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px; /* Round bottom corners only */
    padding: 12px 20px;
    font-size: 0.9rem;
    color: #000000;
    margin-top: auto;
}

/* ========== CARD HEADER MODIFIERS ========== */

/* Bold Header - Larger, bolder text */
.card__header--bold {
    font-size: 1.3rem;
    font-weight: 700;
}

/* Gradient Header - Blue gradient background */
.card__header--gradient {
    background: linear-gradient(135deg, #080530 0%, #3477b2 100%);
}

/* Sticky Header - Makes header stick when scrolling */
.card__header--sticky {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* When card is collapsed, round all corners of header (only visible element) */
.collapsible.collapsed .card__header,
.collapsible.collapsed .card__header--sticky {
    border-radius: 8px;
}

/* ========== CARD FOOTER MODIFIERS ========== */

/* Card Footer - Sponsors variant */
.card__footer--sponsors {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.sponsor-item {
    font-weight: 600;
    color: #3477b2;
    display: flex;
    align-items: center;
}

/* Expand toggle in footer */
.expand-toggle {
    color: #495057;
    font-size: 0.75rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========== CARD TRUNCATED PATTERN ========== */
/* Body truncates but stays visible, footer always visible with expand toggle */

.card--truncated.collapsed .card__body {
    max-height: 100px;
    overflow: hidden;
    visibility: visible;
    padding: 20px;
    position: relative;
}

/* Add gradient fade-out at bottom of truncated text */
.card--truncated.collapsed .card__body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}

.card--truncated.collapsed .card__action-pane {
    max-height: none;
    padding: 12px 20px;
    overflow: visible;
    visibility: visible;
    border-bottom: 1px solid #e0e4e7;
}

.card--truncated.collapsed .card__footer {
    display: flex;
}

/* When expanded, let body grow to full size */
.card--truncated:not(.collapsed) .card__body {
    max-height: none;
}

/* ========== STATUS CHIP MODIFIERS ========== */

/* LR Number Chip - gray variant for legislative tracking numbers */
.status-chip--lr {
    background: #657281;
    color: white;
}

/* Today Chip - green variant (extends .square-status-chip) */
.status-chip--today {
    background: #198754;
    color: white;
}

/* ========== COLLAPSIBLE PATTERNS ========== */

/* Collapsible - Header collapse pattern */
.collapsible .card__header {
    cursor: pointer;
}

.collapsible .card__header:hover {
    filter: brightness(1.1);
}

.collapsible .card__body {
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.collapsible.collapsed .card__body {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
    visibility: hidden;
}

/* Hide action-pane and footer when collapsible card is collapsed */
.collapsible.collapsed .card__action-pane {
    max-height: 0;
    padding: 0;
    overflow: hidden;
    visibility: hidden;
    border: none;
}

.collapsible.collapsed .card__footer {
    display: none;
}

/* Remove min-height when header-collapsible card is collapsed */
.collapsible:not(.card--truncated).collapsed {
    min-height: auto;
}

/* Mobile-Only Collapsible */
.collapsible-mobile-only .card__header {
    cursor: default;
}

@media (max-width: 1024px) {
    .collapsible-mobile-only .card__header {
        cursor: pointer;
    }

    .collapsible-mobile-only .card__header:hover {
        filter: brightness(1.1);
    }

    .collapsible-mobile-only .card__body {
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .collapsible-mobile-only.collapsed .card__body {
        max-height: 0;
        padding: 0 15px;
        overflow: hidden;
    }
}
.card-header[tabindex="0"]:focus-visible, .section-card-header:focus-visible,
.chapter-card-header:focus-visible {
    outline: 3px solid #258cfb;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 3px rgba(37, 140, 251, 0.4);
    z-index: 1;
    position: relative;
}
a[data-card-modal]:focus-visible {
    outline: none;
}
    a[data-card-modal]:focus-visible .card {
        outline: 3px solid #258cfb;
        box-shadow: 0 0 0 4px rgba(37, 140, 251, 0.35);
    }
.close-chapter-btn:focus-visible {
    outline: 3px solid #258cfb;
    outline-offset: 2px;
}
/* ---------- Search Highlight Styles ---------- */
.search-highlight {
    animation: highlightPulse 1s ease-in-out 2;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.8) !important;
    border: 2px solid #ffc107 !important;
}

@keyframes highlightPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 193, 7, 0.8); }
    50% { box-shadow: 0 0 30px rgba(255, 193, 7, 1); }
}
