/* The editable page number shared by every list paginator (components/garam_pager.js,
   webfiles/garam_pager.js). "[ 3 ] / 240" as one pill: a soft track holding the white box with the
   current page and, beside it, a slot with the total. */

/* Whichever page it is on, the row around the pill is laid out the same way. */
nav:has(> .garam-page-field) { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:10px; }
/* Marketplace, Auctions and Shop gave their arrows a minimum width: the same size everywhere. */
nav:has(> .garam-page-field) > button { min-width:0; }

.garam-page-field { display:inline-flex; align-items:center; gap:6px; box-sizing:border-box; height:42px;
    padding:4px; border-radius:13px; background:rgb(255 255 255 / 55%); cursor:text; }
/* The focus ring goes round the whole pill. */
.garam-page-field:focus-within { outline:2px solid var(--garam-c-51a8e8, #51a8e8); outline-offset:1px; }
.garam-page-field .garam-page-input { box-sizing:border-box; width:40px; min-width:40px; height:34px; margin:0; padding:0 8px;
    border:0; border-radius:10px; background:#fff; box-shadow:0 1px 3px rgb(18 60 92 / 16%);
    color:var(--garam-c-123c5c, #123c5c); font:inherit; font-size:14px; font-weight:600; line-height:1.2;
    text-align:center; font-variant-numeric:tabular-nums; }
.garam-page-field .garam-page-input:focus { outline:none; }
/* The slot holds the total and the Go button in the same grid cell, so it is always as wide as
   the wider of the two and the paginator never shifts when editing starts. */
.garam-page-slot { display:inline-grid; align-items:center; height:34px; }
.garam-page-slot > * { grid-area:1 / 1; }
.garam-page-field .garam-page-total { margin:0; padding:0 10px 0 4px; color:var(--garam-c-155a8d, #155a8d); font-size:14px; font-weight:600;
    white-space:nowrap; font-variant-numeric:tabular-nums; cursor:text; transition:opacity .12s ease; }
.garam-page-field .garam-page-go { display:inline-flex; align-items:center; justify-content:center; gap:5px; box-sizing:border-box;
    width:auto; height:34px; min-width:54px; min-height:0; margin:0; padding:0 10px; border:0; border-radius:10px;
    background:var(--garam-c-087cce, #087cce); color:#fff; font:inherit; font-size:13px; font-weight:600;
    white-space:nowrap; cursor:pointer; box-shadow:none; opacity:0; visibility:hidden; pointer-events:none;
    transition:opacity .12s ease, visibility 0s .12s, transform .16s var(--garam-ease-out, ease-out); }
.garam-page-field .garam-page-go svg { width:15px; height:15px; flex:none; }
.garam-page-field .garam-page-go:active { transform:scale(.97); }
/* Editing (garam_pager.js): the total fades out and Go takes its place. */
.garam-page-field.is-editing .garam-page-total { opacity:0; visibility:hidden; }
.garam-page-field.is-editing .garam-page-go { opacity:1; visibility:visible; pointer-events:auto; transition-delay:0s; }
/* A page that doesn't exist: the number turns red and shakes its head, then the script puts the
   current page back. */
.garam-page-field.is-invalid .garam-page-input { color:#d3203a; box-shadow:0 0 0 2px #d3203a;
    animation:garam-page-no .3s var(--garam-ease-out, ease-out); }
.garam-page-field.is-invalid:focus-within { outline-color:transparent; }
@keyframes garam-page-no { 20% { transform:translateX(-4px); } 45% { transform:translateX(4px); } 70% { transform:translateX(-2px); } }

/* Onix / Ash. */
html[data-garam-mode="dark"] body .garam-page-field { background:var(--garam-dark-panel, #23242a); }
html[data-garam-mode="dark"] body .garam-page-field .garam-page-input {
    background:var(--garam-dark-raised, #34353c); color:var(--garam-dark-text, #f3f4f7); box-shadow:none; }
html[data-garam-mode="dark"] body .garam-page-field .garam-page-total { color:var(--garam-dark-muted, #a5a8b2); }
html[data-garam-mode="dark"] body .garam-page-field .garam-page-go { background:var(--garam-theme-ui-accent, #c8cad2); color:#111317; }
html[data-garam-mode="dark"] body .garam-page-field.is-invalid .garam-page-input { color:#ff8a98; box-shadow:0 0 0 2px #ff8a98; }

/* Phones: tighter, so even a seven-digit page number keeps the paginator on one row. */
@media (max-width:460px) {
    nav:has(> .garam-page-field) { gap:6px; }
    nav:has(> .garam-page-field) > button { padding-left:11px; padding-right:11px; }
    .garam-page-field { gap:4px; --garam-page-box-pad:12px; }
    .garam-page-field .garam-page-input { padding:0 6px; }
    .garam-page-field .garam-page-total { padding:0 6px 0 2px; }
}
@media (prefers-reduced-motion:reduce) {
    .garam-page-field.is-invalid .garam-page-input { animation:none; }
    .garam-page-field .garam-page-total, .garam-page-field .garam-page-go { transition:none; }
}
