/* ===========================================================================
   bootstrap-lite.css — the minimal Bootstrap-compatible subset the remaining
   editor screens still depend on, recolored to the soil design system
   (docs/design.md). Replaces libs/bootstrap/css/bootstrap.min.css and
   bootstrap5-compat.css (roadmap Phase 8).

   Scope (from the class inventory of active templates + app JS):
   grid (.row/.form-row/.col-md*), forms (.form-control/.form-group/
   .form-text/.invalid-feedback/.is-invalid), buttons (.btn*), cards,
   collapse/tab plumbing for editor-ui.js, nav-tabs, BS4 custom checkboxes,
   a few display helpers. Spacing utilities (mb-*, mt-*, …) are provided by
   Tailwind (important: true), not here.
   =========================================================================== */

/* --- Grid ----------------------------------------------------------------- */
.row,
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -5px;
  margin-left: -5px;
}
.form-row > * ,
.row > * {
  padding-right: 5px;
  padding-left: 5px;
  min-width: 0;
}
[class^="col-"],
[class*=" col-"] {
  position: relative;
  width: 100%;
}
@media (min-width: 768px) {
  .col-md { flex: 1 0 0%; }
  .col-md-1 { flex: 0 0 auto; width: 8.3333%; }
  .col-md-2 { flex: 0 0 auto; width: 16.6667%; }
  .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
  .col-md-5 { flex: 0 0 auto; width: 41.6667%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-7 { flex: 0 0 auto; width: 58.3333%; }
  .col-md-10 { flex: 0 0 auto; width: 83.3333%; }
  .col-md-11 { flex: 0 0 auto; width: 91.6667%; }
  .col-md-12 { flex: 0 0 auto; width: 100%; }
}

/* --- Forms ------------------------------------------------------------------ */
.form-group {
  margin-bottom: 1rem;
}
.form-group > label,
.form-group > .requiredField {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #33210d;
}
.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.5;
  color: #33210d;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #cabeb3;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
textarea.form-control { min-height: calc(1.5em + 0.75rem + 2px); }
select.form-control {
  /* Tailwind-forms already draws the chevron; a native arrow would double it */
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.25rem;
}
.form-control:focus {
  outline: 0;
  border-color: #3498DB;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}
.form-control:disabled,
.form-control[readonly] {
  background-color: #f4ece9;
  opacity: 1;
}
input[type="checkbox"].form-control,
input[type="radio"].form-control {
  display: inline-block;
  width: auto;
}
.form-text {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #7a6a5c;
}
.text-muted { color: #7a6a5c; }
.invalid-feedback {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: #b3261e;
}
.is-invalid,
.form-control.is-invalid {
  border-color: #b3261e;
}

/* BS4-era custom checkboxes (markup still uses custom-control classes) */
.custom-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
}
.custom-control-input {
  width: 1rem;
  height: 1rem;
  accent-color: #3498DB;
  flex-shrink: 0;
}
.custom-control-label {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #33210d;
}
.custom-file { position: relative; display: block; width: 100%; }
.custom-file-input { width: 100%; }
.custom-file-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: #7a6a5c;
}

/* --- Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.5;
  color: #33210d;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
.btn:disabled { opacity: 0.65; pointer-events: none; }
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
  border-radius: 0.4rem;
}
.btn-primary,
.bonares-btn-primary {
  color: #fff;
  background-color: #3498DB;
  border-color: #3498DB;
}
.btn-primary:hover,
.bonares-btn-primary:hover {
  color: #fff;
  background-color: #2384c6;
  border-color: #2384c6;
}
.btn-secondary {
  color: #fff;
  background-color: #2C3E50;
  border-color: #2C3E50;
}
.btn-secondary:hover {
  color: #fff;
  background-color: #1f2d3b;
  border-color: #1f2d3b;
}
.btn-success {
  color: #fff;
  background-color: #944925;
  border-color: #944925;
}
.btn-success:hover {
  color: #fff;
  background-color: #773310;
  border-color: #773310;
}
.btn-danger {
  color: #fff;
  background-color: #b3261e;
  border-color: #b3261e;
}
.btn-danger:hover {
  color: #fff;
  background-color: #8c1d18;
  border-color: #8c1d18;
}
.btn-dark {
  color: #fff;
  background-color: #33210d;
  border-color: #33210d;
}
.btn-dark:hover {
  color: #fff;
  background-color: #4b3621;
  border-color: #4b3621;
}

/* --- Cards (editor accordions) ---------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid #e2d8cf;
  border-radius: 0.75rem;
}
.card-header {
  padding: 0.6rem 1rem;
  margin-bottom: 0;
  background-color: #f4ece9;
  border-bottom: 1px solid #e2d8cf;
  border-radius: 0.75rem 0.75rem 0 0;
}
.card-header h5 { margin: 0; font-size: 1rem; }
.card-body {
  flex: 1 1 auto;
  padding: 1rem;
}

/* --- Collapse / tabs plumbing (paired with editor-ui.js) --------------------- */
.collapse:not(.show) { display: none; }
.tab-content > .tab-pane { display: none; }
.tab-content > .active { display: block; }
.fade { opacity: 1; }

/* --- Nav tabs ----------------------------------------------------------------- */
.nav-tabs,
.nav {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}
.nav-item { list-style: none; }
.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: #944925;
  text-decoration: none;
  cursor: pointer;
}
.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}
.nav-tabs .nav-link.active {
  color: #33210d;
  background-color: #fff;
  border-color: #e2d8cf #e2d8cf #944925;
  border-bottom-width: 2px;
}
.nav-justified > .nav-item,
.nav-justified .nav-link {
  flex-basis: 0;
  flex-grow: 1;
  text-align: center;
}

/* --- Misc helpers still referenced ------------------------------------------- */
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.align-items-end { align-items: flex-end !important; }
.h-100 { height: 100% !important; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a { color: #944925; }
a:hover { color: #773310; }

/* --- Bootstrap 4 -> 5 utility shims (from bootstrap5-compat.css) --------- */
.text-left {
  text-align: left !important;
}

.text-right {
  text-align: right !important;
}

.float-left {
  float: left !important;
}

.float-right {
  float: right !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.badge-pill {
  border-radius: 50rem;
}

.close {
  float: right;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 0;
}

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }
.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }
.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 0.25rem !important; }
.pl-2 { padding-left: 0.5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }
.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 0.25rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pr-5 { padding-right: 3rem !important; }
