﻿/* kc-v2 v1.5.7 -- pagination */
/* Full class contract and conventions: see README.md and kc-v2-base.css. */

/* ---------------------------------------------------------------------------
 * Pagination
 *
 * Every page button is a real 44x44px hit target (Checkpoint 4), not padding
 * simulating one. Current page uses aria-current="page", not a modifier
 * class alone (convention #4) -- a page adds a visual modifier class too if
 * it wants, but the semantic state lives on the attribute.
 *
 * Depends on kc-v2-forms.css's .kc-v2-select / .kc-v2-select-wrapper for the
 * items-per-page control -- load order between component files doesn't
 * matter for correctness (the overrides below win purely on specificity),
 * but forms.css does need to be present for these selectors to mean anything.
 * ------------------------------------------------------------------------- */

.kc-v2-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--kc-v2-space-3);
}

.kc-v2-pagination__info {
  margin-right: auto;
  color: var(--kc-v2-ink-500);
  font-family: var(--kc-v2-font-family);
  font-size: 14px;
}

.kc-v2-pagination__pages {
  display: flex;
  align-items: center;
  gap: var(--kc-v2-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.kc-v2-page-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--kc-v2-space-2);
  border: 1px solid var(--kc-v2-ink-300);
  border-radius: var(--kc-v2-radius-md);
  background-color: var(--kc-v2-white);
  color: var(--kc-v2-ink-800);
  font-family: var(--kc-v2-font-family);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.kc-v2-page-btn:visited {
  color: var(--kc-v2-ink-800);
}
.kc-v2-page-btn:hover,
.kc-v2-page-btn:focus,
.kc-v2-page-btn:active {
  text-decoration: none;
}
.kc-v2-page-btn:hover {
  background-color: var(--kc-v2-ink-100);
  border-color: var(--kc-v2-ink-300);
}
.kc-v2-page-btn:focus-visible {
  outline: var(--kc-v2-focus-ring-width) solid var(--kc-v2-focus-ring-color);
  outline-offset: var(--kc-v2-focus-ring-offset);
}
.kc-v2-page-btn[aria-current="page"] {
  border-color: var(--kc-v2-blue);
  background-color: var(--kc-v2-blue);
  color: var(--kc-v2-white);
}
.kc-v2-page-btn[aria-current="page"]:hover {
  background-color: var(--kc-v2-blue-dark);
  border-color: var(--kc-v2-blue-dark);
}
.kc-v2-page-btn:disabled {
  background-color: var(--kc-v2-white);
  border-color: var(--kc-v2-ink-200);
  color: var(--kc-v2-ink-400);
  cursor: not-allowed;
}
.kc-v2-page-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
}

.kc-v2-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  color: var(--kc-v2-ink-500);
  font-family: var(--kc-v2-font-family);
  font-size: 14px;
}

.kc-v2-pagination__per-page {
  display: flex;
  align-items: center;
  gap: var(--kc-v2-space-2);
}
.kc-v2-pagination__label {
  color: var(--kc-v2-ink-500);
  font-family: var(--kc-v2-font-family);
  font-size: 14px;
  white-space: nowrap;
}
.kc-v2-pagination__per-page .kc-v2-select-wrapper {
  /* A fixed width, not width: auto -- shrink-to-fit sizing on a <select>
     with a custom appearance: none arrow is unreliable across engines, since
     "auto" doesn't consistently reserve the padding-right gutter the arrow
     sits in, and the option text (up to 3 digits, e.g. "500") can render
     clipped. Sized for 3 digits + the select's 14px/40px padding + border. */
  width: 90px;
}
.kc-v2-pagination__per-page .kc-v2-select {
  width: 100%;
  height: 44px; /* matches the page buttons' touch target, not the 43px .kc-v2-input default */
  /* The padding-top/bottom zeroing that used to live here moved onto the base
     .kc-v2-select in 1.5.0, when that rule gained a fixed height of its own and
     needed the same treatment. Kept as a note rather than a duplicate rule: the
     reason it is needed is the same one, and stating it in two places is how it
     came to be applied in one and forgotten in the other. */
}

@media print {
  .kc-v2-pagination {
    display: none;
  }
}
