/* Pagination controls. See app/views/shared/_pagination.html.erb.
   No colour values here on purpose: the buttons are Web Awesome components and
   take their colour from the theme, and a hex outside eventkrowd_theme.css is a
   bug this project has a test for. */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-block-start: 1.5rem;
}

.pagination__status {
  margin: 0;
  font-size: 0.875rem;
  white-space: nowrap;
}

turbo-frame[data-hotel-pagination-frame] {
  display: block;
}

turbo-frame[data-hotel-pagination-frame].turbo-frame--busy::before,
turbo-frame[data-hotel-pagination-frame][busy]::before {
  inset: auto;
  top: 50%;
  left: 50%;
  margin: 1.5rem 0 0;
  transform: translateX(-50%);
}

/* HMS-1798 — hotel portal table footer (shared/_hotel_pagination_footer):
   Show-per-page pinned left, the "from–to of total" range dead-center,
   numbered pages with ‹ › arrows on the right. The 1fr auto 1fr grid centers
   the range on the footer itself rather than the gap between uneven side
   groups — the same contract as the admin sustainability footer (HMS-1707).
   Stacks on narrow screens. */
.hotel-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: var(--wa-space-s, 0.75rem);
  font-size: 0.875rem;
  color: var(--wa-color-text-quiet);
}

/* display:contents makes the GET form's <label> the grid item of the
   footer, so the select sits in the left zone like the sibling anchors did
   under the old flex footers. */
.hotel-pagination__size {
  display: contents;
}

.hotel-pagination__per-page {
  display: inline-flex;
  align-items: center;
  gap: var(--wa-space-xs, 0.25rem);
  white-space: nowrap;
  margin: 0;
  justify-self: start;
}

/* 5.5rem leaves real slack for a two-digit value beside the combobox chevron;
   5rem clipped "20" to "2" at QA's smaller zoom (HMS-1798 re-test). */
.hotel-pagination__per-page-select {
  width: 5.5rem;
  min-width: 5.5rem;
}

.hotel-pagination__range {
  margin: 0;
  justify-self: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hotel-pagination__pages {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--wa-space-2xs, 4px);
}

.hotel-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  box-sizing: border-box;
  border: 1px solid var(--wa-color-neutral-border-quiet);
  border-radius: var(--wa-border-radius-m);
  color: var(--wa-color-text-normal);
  text-decoration: none;
  font-size: var(--wa-font-size-s, 0.875rem);
}

.hotel-pagination__page--current {
  background: var(--wa-color-brand-fill-loud);
  border-color: var(--wa-color-brand-fill-loud);
  color: var(--wa-color-brand-on-loud);
}

.hotel-pagination__page[aria-disabled="true"] {
  opacity: 0.4;
}

.hotel-pagination__page-gap {
  color: var(--wa-color-text-quiet);
  padding: 0 0.25rem;
}

@media (max-width: 40rem) {
  .hotel-pagination {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}
