/*
 * bs3-bridge.css — Bootstrap 3 -> 5.3.x upgrade (see upgrade-to-bootstrap-5.3.8.md, Phase 1).
 *
 * Loaded AFTER bootstrap5.css on flipped families only. Re-implements the BS3 classes the
 * codemod deliberately does NOT rewrite (panels, wells, labels-as-pills, form-group,
 * help-block, control-label, input-group-btn, thumbnails, jumbotrons) so a family is
 * functional immediately after the mechanical class/attribute transforms, before the
 * structural per-area passes (panel -> card, form-group -> mb-3, etc.) land.
 *
 * Values are the stock Bootstrap 3.4.1 defaults (assets/externals/tsbootstrap-jquery/
 * vendor/bootstrap/dist/css/bootstrap.css) — what's actually rendering today — not the
 * Angle theme's per-instance color skins, which the structural pass replaces properly.
 *
 * Do NOT add grid/pull/hidden classes here — those are codemodded exhaustively (rename or
 * dual mode), never bridged. This file shrinks as each area's structural pass removes its
 * last consumer of a rule below; delete rules once `git grep` finds no more matches. Goal
 * is full deletion by the end of Phase 6 (keep only the .label-*/.btn-default aliases if
 * server/DB-generated markup still emits them — see WebDbMigrations seed data).
 */

/* ---- type scale ----------------------------------------------------------------------- */
/* BS3's fixed heading sizes (36/30/24/18/14/12, weight 500, line-height 1.1, BS3 margins).
   BS5 switched h1-h4 to responsive calc() sizes (e.g. .h4 ≈ 24px at desktop widths vs 18px
   in BS3) and h5/.h5 to 20px vs 14px, which blew up every legacy page that sizes text with
   h*/.h* classes (event/facility card titles, panel headings, kendo templates). App sheets
   (webportals.css .h4 { 18px; 700 } etc.) load after this file and still win, as they did
   over BS3's bootstrap.css. */
h1, .h1 { font-size: 36px; }
h2, .h2 { font-size: 30px; }
h3, .h3 { font-size: 24px; }
h4, .h4 { font-size: 18px; }
h5, .h5 { font-size: 14px; }
h6, .h6 { font-size: 12px; }
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: inherit;
  font-weight: 500;
  line-height: 1.1;
  color: inherit;
}
h1, h2, h3, .h1, .h2, .h3 { margin-top: 20px; margin-bottom: 10px; }
h4, h5, h6, .h4, .h5, .h6 { margin-top: 10px; margin-bottom: 10px; }

/* ---- hidden --------------------------------------------------------------------------- */
/* BS3 utility with no BS5 equivalent class. Still emitted by kendo templates and server
   markup all over (the `<thead class="hidden">` accessibility idiom, etc.) — without this
   the literal placeholder content renders. */
.hidden { display: none !important; }

/* ---- anchors -------------------------------------------------------------------------- */
/* BS3 reboot: links are not underlined until hover/focus. BS5's _reboot.scss underlines
   every anchor by default (including href-less ones that carry a class), which reads as
   a stray decoration on card titles, kendo templates, etc. Restore the BS3 behavior.
   The outline reset mirrors the Angle theme's a{outline:0} so pages that don't load the
   logged-in bundles (login, error) match — no !important, so any page or component can
   still opt back into a visible focus style. */
a {
  outline: 0;
  text-decoration: none !important;
}
a:hover,
a:focus {
  text-decoration: underline;
}

/* ---- btn-default -> btn-secondary -------------------------------------------------- */
/* The codemod renames btn-default to btn-secondary at the markup level — BS5's own
   .btn-secondary (dark gray fill) is what needs restyling. Uses BS5's per-component CSS
   variable hooks (the supported way to reskin a variant) rather than fighting
   .btn-secondary's specificity. .btn-default is kept as an alias for markup the codemod
   didn't reach (dynamically-built class strings, server/DB-generated markup); the theme
   files (theme-light/theme-dark/login-*) re-point their own skins the same way. */
.btn-secondary,
.btn-default {
  --bs-btn-color: #333;
  --bs-btn-bg: #fff;
  --bs-btn-border-color: #ccc;
  --bs-btn-hover-color: #333;
  --bs-btn-hover-bg: #e6e6e6;
  --bs-btn-hover-border-color: #adadad;
  --bs-btn-focus-shadow-rgb: 204, 204, 204;
  --bs-btn-active-color: #333;
  --bs-btn-active-bg: #e6e6e6;
  --bs-btn-active-border-color: #8c8c8c;
  --bs-btn-disabled-color: #333;
  --bs-btn-disabled-bg: #fff;
  --bs-btn-disabled-border-color: #ccc;
}

/* ---- panels ------------------------------------------------------------------------- */
.panel {
  margin-bottom: 20px;
  background-color: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.panel-body { padding: 15px; }
.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid transparent;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}
.panel-heading > .dropdown .dropdown-toggle { color: inherit; }
.panel-title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 16px;
  color: inherit;
}
.panel-title > a,
.panel-title > small,
.panel-title > .small { color: inherit; }
.panel-footer {
  padding: 10px 15px;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
}
.panel-group .panel { border-radius: 4px; }
.panel-group .panel + .panel { margin-top: 5px; }

.panel-default { border-color: #ddd; }
.panel-default > .panel-heading { color: #333; background-color: #f5f5f5; border-color: #ddd; }
.panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ddd; }

.panel-primary { border-color: #337ab7; }
.panel-primary > .panel-heading { color: #fff; background-color: #337ab7; border-color: #337ab7; }

.panel-success { border-color: #d6e9c6; }
.panel-success > .panel-heading { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; }

.panel-info { border-color: #bce8f1; }
.panel-info > .panel-heading { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; }

.panel-warning { border-color: #faebcc; }
.panel-warning > .panel-heading { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; }

.panel-danger { border-color: #ebccd1; }
.panel-danger > .panel-heading { color: #a94442; background-color: #f2dede; border-color: #ebccd1; }

/* ---- well ----------------------------------------------------------------------------- */
.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.well-lg { padding: 24px; border-radius: 6px; }
.well-sm { padding: 9px; border-radius: 3px; }

/* ---- thumbnail -------------------------------------------------------------------- */
.thumbnail {
  display: block;
  padding: 4px;
  margin-bottom: 20px;
  line-height: 1.42857143;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.thumbnail > img,
.thumbnail a > img { margin-right: auto; margin-left: auto; }
.thumbnail .caption { padding: 9px; color: #333; }

/* ---- jumbotron ---------------------------------------------------------------------- */
.jumbotron {
  padding: 30px 15px;
  margin-bottom: 30px;
  color: inherit;
  background-color: #eee;
}
.jumbotron h1,
.jumbotron .h1 { color: inherit; }
.jumbotron p { margin-bottom: 15px; font-size: 21px; font-weight: 200; }
@media (min-width: 768px) {
  .jumbotron { padding: 48px 0; }
}

/* ---- label -> badge pill (residual, non-codemodded instances only) ----------------- */
/* The codemod converts the "label label-X" idiom to "badge text-bg-X" wherever it finds
   both tokens together. This covers the survivors: dynamically-built class strings the
   codemod's static scan can't see (C# string concatenation, unusual token order). */
.label {
  display: inline;
  padding: 0.2em 0.6em 0.3em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25em;
}
.label-default { background-color: #777; }
.label-primary { background-color: #337ab7; }
.label-success { background-color: #5cb85c; }
.label-info { background-color: #5bc0de; }
.label-warning { background-color: #f0ad4e; }
.label-danger { background-color: #d9534f; }

/* ---- close (residual, non-idiom uses only) ----------------------------------------- */
/* The codemod fully rewrites the <button class="close" data-dismiss="modal|alert"> idiom
   to BS5's .btn-close element. This covers .close used outside that idiom (~30% per the
   codemod's own flag count) until the structural pass looks at each one by hand. */
.close {
  float: right;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.2;
}
.close:hover,
.close:focus { color: #000; text-decoration: none; cursor: pointer; opacity: 0.5; }

/* ---- forms: form-group / control-label / help-block -------------------------------- */
.form-group { margin-bottom: 1rem; } /* BS5 spacing scale; structural pass -> mb-3 utility directly */
.control-label { padding-top: 0.375rem; margin-bottom: 0; } /* matches BS5's own .col-form-label */
.help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; }

/* ---- nav / nav-tabs / nav-pills (BS3 li > a structure) -------------------------------- */
/* BS5 only styles .nav-item/.nav-link; navs still using BS3's bare <li><a> markup lost
   bootstrap.css's structural rules when BS3 was dropped. Anchors fell back to
   display:inline — their backgrounds fragment into slivers around the icon/label
   (the POS cart transaction tiles rendered as tiny blue squares with invisible labels)
   — and tabs lost their box/border model. Stock BS3.4.1 values; the theme sheets
   (theme-pos.css, app.css) go on skinning colors over these exactly as they did
   pre-flip. Harmless for BS5-structured navs: these selectors also match
   .nav-item/.nav-link li>a markup, but block display and ~equal padding is what
   BS3's bootstrap.css already applied to them before the flip. */
.nav > li { position: relative; display: block; }
.nav > li > a { position: relative; display: block; padding: 10px 15px; }
.nav > li > a:hover,
.nav > li > a:focus { text-decoration: none; background-color: #eee; }
.nav-pills > li { float: left; }
.nav-pills > li > a { border-radius: 4px; }
.nav-pills > li + li { margin-left: 2px; }
.nav-tabs > li { float: left; margin-bottom: -1px; }
.nav-tabs > li > a { margin-right: 2px; line-height: 1.42857143; border: 1px solid transparent; border-radius: 4px 4px 0 0; }
.nav-tabs > li > a:hover { border-color: #eee #eee #ddd; }
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  color: #555;
  cursor: default;
  background-color: #fff;
  border: 1px solid #ddd;
  border-bottom-color: transparent;
}

/* ---- input-group-btn ---------------------------------------------------------------- */
/* BS3's .input-group used table-cell display and never wrapped to a new line. BS5's own
   .input-group sets flex-wrap: wrap (for validation-feedback divs to drop below), which
   instead drops .input-group-btn's buttons onto their own row the moment the row is a
   little tight for space (input placeholder + two buttons) — the "search box, then
   Search/Reset stacked underneath" bug seen across search bars site-wide. Legacy markup
   built around .input-group-btn never expected that; pin the row to one line and keep
   the button wrapper at its natural (not flex-shrunk) width, same as BS3's table-cell.
   !important is required on display/flex-wrap: the app.css/app-dark.css theme bundles
   (/bundles/lighttheme, /bundles/darktheme — loaded on every page, after this file) still
   carry the full BS3 Angle-theme stylesheet, including its own
   `.input-group{display:table}` at equal specificity; without !important that later,
   unqualified rule wins the cascade and silently reverts .input-group to table layout,
   making flex-wrap: nowrap inert (see bs5-migration-cascade-contract memory).
   No :has(.wrapper_ts_overlay) carve-out: an earlier version of this rule excluded
   .wrapper_ts_overlay search bars (servicerequest-filter on Issue/Home, sr-searchgroup on
   Employee/PayrollView) on the assumption that they relied on BS3 table/table-cell display
   to lay .input-group-btn and .wrapper_ts_overlay out side by side. That assumption was
   wrong: true side-by-side table-cell layout requires *each* child to be individually
   display:table-cell (stock BS3's `.input-group-addon,.input-group-btn,.input-group
   .form-control{display:table-cell}`), and that rule doesn't exist anywhere in this
   codebase's bundled app.css. Without it, two consecutive non-table-row children of a
   display:table element collapse into a single anonymous cell and stack in normal block
   flow — table mode never actually put them side by side; it just happened to *look*
   plausible in the source comments. Forcing flex here too (with explicit flex-sizing on
   .wrapper_ts_overlay in townsuite-redesign.css, matching the already-working
   .ev-search-row/.md-welcome pattern) is what actually achieves one-line, full-width
   layout — verified via a static repro loading the real app.css/search_overlay.css. */
.input-group { display: flex !important; flex-wrap: nowrap !important; }
.input-group > .input-group-btn { display: flex; flex: 0 0 auto; }
