/**
 * Bootstrap 5 Compatibility Overrides
 * Adjusts spacing to match the Bootstrap 3 layout that the custom CSS was designed for.
 */

/* Tighten body and container default spacing */
body {
    font-size: 14px;
    line-height: 1.42857143;
}

/* Reduce default paragraph spacing */
p {
    margin-bottom: 0.5rem;
    font-size: 14px;
}

/* List items match body font */
li {
    font-size: 14px;
}

/* Tighten heading margins */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5rem;
    margin-top: 20px;
    line-height: 1.1;
}

/* Match BS3 fixed heading sizes (override BS5 responsive calc sizes) */
h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 18px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }

/* Navigation spacing */
.navbar {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* Form control spacing - BS5 has larger default padding */
.form-control {
    padding: 0.375rem 0.75rem;
    font-size: 14px;
}

/* Row gutter reduction to match BS3 (BS3 used 15px, BS5 uses 12px by default) */
.row {
    --bs-gutter-x: 30px;
}

/* Container max-widths matching BS3 defaults */
@media (min-width: 1200px) {
    .container {
        max-width: 1170px;
    }
}

/* Footer - prevent BS5 shadow class from adding box-shadow */
.footer .shadow {
    box-shadow: none !important;
}

/* Match BS3 breakpoint for sm (768px instead of BS5's 576px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
    .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* Reduce hero/header section spacing */
#dashboard {
    padding: 0 24px 0;
}

/* Article main content - match BS3 padding */
.article_main {
    padding-top: 0;
}

/* Ensure content area doesn't have extra top margin from BS5 resets */
.article {
    margin-top: 0;
    padding-top: 0;
}

/* Fix: BS5 .row adds gutter padding - reset only the gutter vars, keep .padded padding */
#event-register-form.row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
}

#formContent {
    margin: 0;
    padding: 0;
}

/* BS3 used float:left for columns - BS5 uses flex. 
   Allow columns to work without explicit .row parent (BS3 behavior) */
[class*="col-sm-"] > [class*="col-sm-"]:not(.d-block):not(.d-none):not([class*="d-sm-"]):not([class*="d-md-"]),
[class*="col-md-"] > [class*="col-sm-"]:not(.d-block):not(.d-none):not([class*="d-sm-"]):not([class*="d-md-"]),
[class*="col-"] > [class*="col-sm-"]:not(.d-block):not(.d-none):not([class*="d-sm-"]):not([class*="d-md-"]) {
    float: left;
    padding-left: 15px;
    padding-right: 15px;
}

[class*="col-sm-"]::after,
[class*="col-md-"]::after {
    content: "";
    display: table;
    clear: both;
}

/* Radio button and checkbox label alignment */
.radio, .checkbox {
    position: relative;
    display: block;
    margin-top: 10px;
    margin-bottom: 10px;
    padding-left: 0;
}

.radio label, .checkbox label {
    padding-left: 0 !important;
    cursor: pointer;
}

/* Remove BS5 form-check padding that indents radio/checkbox groups */
.form-groupcheckbox .radio,
.form-groupcheckbox .checkbox {
    padding-left: 0;
    margin-left: 0;
}

/* Print button - prevent full width in BS5 */
.btn.btn-raised,
a.btn.btn-raised {
    width: auto;
    display: inline-block;
}
