main {
    width: auto;
}

iframe {
    width: 100%;
    border: none;
    margin-top: -1.4rem;
    padding: 0;
    height: 225px;
}

/* Accessibility: Visible focus indicators */
/* ========================================
   WCAG 2.4.7 - Comprehensive Focus Styles
   Updated: January 2026
   ======================================== */

.external-link {
    color: #0056b3;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
}

.external-link:visited {
    color: #663399;
}

.external-link:focus-visible {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
}

.external-link:hover {
    text-decoration: underline;
    background-color: rgba(0, 86, 179, 0.1);
}

.external-link:active {
    background-color: rgba(0, 86, 179, 0.15);
}

/* Base focus styles for all interactive elements */
a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
[role="button"]:focus,
[role="button"]:focus-visible {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
}

/* Special handling for buttons to ensure visibility */
button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -4px;
    box-shadow: inset 0 0 0 4px #0056b3;
}

/* High contrast mode support */
@media (prefers-contrast: more) {

    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline-width: 4px;
        outline-offset: 3px;
    }
}

/* ============================================================
   ADA FIX P3-A: jQuery UI datepicker header contrast
   Original: #0b3861 text on #618baf bg = 3.32:1 (fails 4.5:1)
   Fix: #ffffff text on #1a4a7a bg = 9.13:1  ✓ WCAG AA
   Affects: marriageform datepicker (all date fields)
   ============================================================ */
.ui-datepicker .ui-datepicker-header {
    background-color: #1a4a7a !important;
    background-image: none !important;
    color: #ffffff !important;
}
.ui-datepicker .ui-datepicker-title,
.ui-datepicker .ui-datepicker-title select,
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next,
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span,
.ui-datepicker th span {
    color: #ffffff !important;
}
.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
    background-color: #0d3060 !important;
    border-color: #0d3060 !important;
}

/* ============================================================
   ADA FIX P3-B: Datepicker calendar link contrast
   Issue: Calendar date links have unknown background colors
   Fix: Ensure .ui-state-default has explicit colors
   Contrast: #000000 text on #ffffff bg = 21:1 ✓ WCAG AAA
   Affects: marriageform date picker calendar date numbers
   ============================================================ */
.ui-datepicker .ui-state-default {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    border: 1px solid #cccccc !important;
}

.ui-datepicker .ui-state-default:hover {
    background-color: #e3f2fd !important;
    color: #000000 !important;
}

.ui-datepicker .ui-state-active,
.ui-datepicker .ui-datepicker-current-day .ui-state-active {
    background-color: #1a4a7a !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: #0d3060 !important;
}

/* ============================================================
   ADA FIX P3-C: Form label color contrast
   Issue: Labels on background images/gradients cannot be analyzed
   Fix: Ensure all labels have explicit black text color
   Contrast: #000000 text on various backgrounds = minimum 4.5:1
   Affects: landrecords/index.php form labels
   ============================================================ */
label {
    color: #000000 !important;
}

/* Document type checkbox labels */
label[for^="instDocType"],
label[for="all_instdoctypes"],
label[for="homeScreenClear_desktop"],
label[for="search_type_both"],
label[for="search_type_common"],
label[for="search_type_specified"] {
    color: #000000 !important;
}

/* Search form field labels with gradients */
label[for="startamt"],
label[for="endamt"],
label[for="StreetNum"],
label[for="streetName"],
label[for="suffix"],
label[for="block"],
label[for="lot"],
label[for="SubName"],
label[for="directional"],
label[for="description"],
label[for="type"],
label[for="pagenum"],
label[for="booknum"],
label[for="inst_num"],
label[for="start_date"],
label[for="end_date"],
label[for="both_first_name"],
label[for="both_middle_initial"],
label#both_last_name_label {
    color: #000000 !important;
}

/* ============================================================
   ADA FIX P3-D: Table element color contrast
   Issue: Table headers and cells have background images
   Fix: Ensure table elements have explicit colors
   Contrast: #000000 text on #f0f0f0 header = 17:1 ✓ WCAG AAA
   Contrast: #000000 text on #ffffff data = 21:1 ✓ WCAG AAA
   Affects: landrecords/index.php search results table
   ============================================================ */

/* Table header styling */
td[scope="col"],
th {
    background-color: #f0f0f0 !important;
    background-image: none !important;
    color: #000000 !important;
    font-weight: bold;
}

/* Table data cells */
.table-striped > tbody > tr > td,
table > tbody > tr > td {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
}

/* Alternating rows */
.table-striped > tbody > tr:nth-child(even) > td {
    background-color: #f9f9f9 !important;
}

/* Clickable result rows */
tr[onclick] > td,
tr[onclick] > td[role="cell"] {
    background-color: #ffffff !important;
    color: #000000 !important;
}

tr[onclick]:hover > td,
tr[onclick]:focus > td,
tr[onclick] > td[role="cell"]:hover,
tr[onclick] > td[role="cell"]:focus {
    background-color: #e3f2fd !important;
    color: #000000 !important;
}

/* ============================================================
   ADA FIX P3-E: Datepicker reflow/zoom fix
   Issue: Datepicker overflows at 400% zoom (320px viewport)
   Fix: Ensure datepicker fits within available width
   Meets: SC 1.4.10 - Reflow at 400% zoom
   ============================================================ */
.ui-datepicker {
    width: 100% !important;
    max-width: 280px !important;
    margin: 0 !important;
    padding: 0.5em !important;
}

.ui-datepicker-calendar {
    width: 100% !important;
    border-collapse: collapse;
}

.ui-datepicker-calendar td,
.ui-datepicker-calendar th {
    width: 14.28% !important;  /* 7 columns */
    padding: 2px !important;
    text-align: center;
}

.ui-datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.ui-datepicker-prev,
.ui-datepicker-next {
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 2px !important;
}

.ui-datepicker-title {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}




/* SweetAlert2 Keyboard Accessibility Fix */
.swal2-container {
    overflow-y: auto;
    max-height: 100vh;
}

.swal2-popup {
    max-height: 90vh;
    overflow-y: auto;
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

.swal2-popup:focus {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

/* Ensure buttons are keyboard accessible */
.swal2-actions button {
    min-width: auto;
    padding: 8px 16px;
}

.swal2-actions button:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

/* Make close button accessible */
.swal2-close {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
}

.swal2-close:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 2px;
    background-color: #535353 !important;
}

/* Ensure scrollable content is accessible */
.swal2-html-container {
    max-height: 60vh;
    overflow-y: auto;
    outline: none;
}

/* Tab focus trap for modal */
.swal2-popup * {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}