/* Site-wide layout helpers.
   Keep this file to structural fixes that Bootstrap's utilities cannot express;
   component styling belongs in the template or Bootstrap itself. */

/* Page header action bars (item detail, location detail).
   Mobile first: the buttons share the full width and wrap two per row instead of
   crowding the page title or hugging the left edge with ragged widths.
   From 576px up they sit inline, right aligned, at their natural width. */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.action-bar > * {
  flex: 1 1 9rem;
  min-width: 0;
}

.action-bar .btn {
  width: 100%;
}

@media (min-width: 576px) {
  .action-bar {
    width: auto;
  }

  .action-bar > * {
    flex: 0 0 auto;
  }

  /* The tablet-and-up button row is one nested flex item. Without this the
     `flex: 0 0 auto` above leaves it unshrinkable, so its own flex-wrap never
     engages and the row runs past the viewport (broken ~768-990px). */
  .action-bar > .action-cluster {
    flex: 0 1 auto;
    min-width: 0;
  }

  .action-bar .btn {
    width: auto;
  }
}

/* Let a long title/description shrink instead of forcing the action row off screen. */
.header-title {
  min-width: 0;
}

/* Item list (location detail). Five columns do not fit a phone, so below the md
   breakpoint each row becomes a stacked card and every cell shows its column
   name. From md up the normal table returns. */
@media (max-width: 767.98px) {
  .items-table thead {
    display: none;
  }

  .items-table,
  .items-table tbody,
  .items-table tr,
  .items-table td {
    display: block;
    width: 100%;
  }

  .items-table tr {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin: 0 0 0.5rem;
  }

  .items-table td {
    border: 0;
    padding: 0.15rem 0;
    text-align: left !important;
  }

  .items-table td:empty {
    display: none;
  }

  .items-table td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--bs-secondary-color);
  }

  /* The first cell is the thumbnail plus name; it needs no label. */
  .items-table td:first-child::before {
    content: none;
  }
}
/* providers/provider_print.html: the contact sheet prints as plain black on white, without the site chrome. */
@media print {
  body.provider-sheet { background: #fff !important; color: #000 !important; }
  body.provider-sheet .navbar,
  body.provider-sheet .breadcrumb { display: none !important; }
  body.provider-sheet .sheet-entry { break-inside: avoid; border: 1px solid #000; padding: .5rem; margin-bottom: .5rem; }
  body.provider-sheet a { color: #000; text-decoration: none; }
}
