/* Buttons — one set for the public site and the admin, modelled on coss ui's Button
   (https://coss.com/ui/docs/components/button): same variants, sizes, radius, borders,
   shadows and states, with the club blue as the primary colour.

   <a|button class="btn">                       primary (default)
              class="btn btn--outline">          white with a hairline border
              class="btn btn--secondary">        soft grey fill
              class="btn btn--ghost">            no fill until hovered
              class="btn btn--destructive">      solid red — the final "yes, delete"
              class="btn btn--destructive-outline">  red text — delete links in lists
              class="btn btn--link">             looks like a link, sized like a button
   Sizes: btn--xs, btn--sm, (default), btn--lg, btn--xl; square icon buttons: btn--icon, btn--icon-sm
   Add btn--arrow for a trailing → */

:root {
  --btn-primary: #0047ab;
  --btn-primary-fg: #fff;
  --btn-destructive: #e7000b;
  --btn-destructive-fg: #c10007;
  --btn-fg: #1b2533;
  --btn-input: rgba(0, 0, 0, .1);
  --btn-accent: rgba(0, 0, 0, .04);
  --btn-ring: #159955;
  --btn-radius: 10px;
}

.btn {
  position: relative;
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 11px;
  border: 1px solid transparent; border-radius: var(--btn-radius);
  font: 500 16px/1 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  letter-spacing: normal; text-transform: none; text-decoration: none; white-space: nowrap;
  color: var(--btn-primary-fg); background: var(--btn-primary); border-color: var(--btn-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(0, 71, 171, .24);
  cursor: pointer; outline: none; transition: box-shadow .15s, background-color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
/* inner highlight line, as coss draws it */
.btn::before { content: ''; position: absolute; inset: 0; border-radius: calc(var(--btn-radius) - 1px); pointer-events: none; }
.btn:hover { background: color-mix(in srgb, var(--btn-primary) 90%, #fff); color: var(--btn-primary-fg); }
.btn:active { box-shadow: inset 0 1px 0 rgba(0, 0, 0, .08); }
.btn:focus-visible { box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--btn-ring); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .64; pointer-events: none; box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; margin: 0 -2px; opacity: .8; pointer-events: none; }
@media (min-width: 640px) {
  .btn { height: 32px; font-size: 14px; }
  .btn svg { width: 16px; height: 16px; }
}
/* easier to hit on touch screens, without looking any bigger */
@media (pointer: coarse) { .btn::after { content: ''; position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 100%; height: 100%; min-width: 44px; min-height: 44px; } }

/* ---------- Variants ---------- */

.btn--outline,
.btn--destructive-outline {
  color: var(--btn-fg); background: #fff; border-color: var(--btn-input);
  background-clip: padding-box; box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.btn--outline::before,
.btn--destructive-outline::before { box-shadow: 0 1px 0 rgba(0, 0, 0, .04); }
.btn--outline:hover { background: #fafafa; color: var(--btn-fg); }
.btn--destructive-outline { color: var(--btn-destructive-fg); }
.btn--destructive-outline:hover { color: var(--btn-destructive-fg); background: rgba(231, 0, 11, .04); border-color: rgba(231, 0, 11, .32); }
.btn--outline:active, .btn--destructive-outline:active { box-shadow: none; }
.btn--outline:active::before, .btn--destructive-outline:active::before { box-shadow: none; }

.btn--secondary { color: var(--btn-fg); background: var(--btn-accent); border-color: transparent; box-shadow: none; }
.btn--secondary:hover { color: var(--btn-fg); background: rgba(0, 0, 0, .06); }
.btn--secondary:active { background: rgba(0, 0, 0, .08); box-shadow: none; }

.btn--destructive { color: #fff; background: var(--btn-destructive); border-color: var(--btn-destructive); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(231, 0, 11, .24); }
.btn--destructive:hover { color: #fff; background: color-mix(in srgb, var(--btn-destructive) 90%, #fff); }

.btn--ghost { color: var(--btn-fg); background: transparent; border-color: transparent; box-shadow: none; }
.btn--ghost:hover { color: var(--btn-fg); background: var(--btn-accent); }
.btn--ghost:active { box-shadow: none; }

.btn--link { color: var(--btn-fg); background: transparent; border-color: transparent; box-shadow: none; text-underline-offset: 4px; }
.btn--link:hover { color: var(--btn-fg); background: transparent; text-decoration: underline; }
.btn--link:active { box-shadow: none; }

.btn:focus-visible { box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--btn-ring); }

/* ---------- Sizes ---------- */

.btn--xs { height: 28px; gap: 4px; padding: 0 7px; font-size: 14px; border-radius: 8px; }
.btn--xs::before { border-radius: 7px; }
.btn--sm { height: 32px; gap: 6px; padding: 0 9px; }
.btn--lg { height: 40px; padding: 0 13px; }
.btn--xl { height: 44px; padding: 0 15px; font-size: 18px; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon-sm { width: 32px; height: 32px; padding: 0; }
@media (min-width: 640px) {
  .btn--xs { height: 24px; font-size: 12px; }
  .btn--sm { height: 28px; }
  .btn--lg { height: 36px; }
  .btn--xl { height: 40px; font-size: 16px; }
  .btn--icon { width: 32px; }
  .btn--icon-sm { width: 28px; height: 28px; }
}

.btn--arrow::after { content: '→'; position: static; transform: none; width: auto; height: auto; min-width: 0; min-height: 0; transition: transform .15s; }
.btn--arrow:hover::after, a:hover .btn--arrow::after { transform: translateX(2px); }

/* The browser's own "Choose file" button, drawn as an outline button */
input[type=file]::file-selector-button {
  height: 32px; margin-right: 10px; padding: 0 11px;
  border: 1px solid var(--btn-input); border-radius: var(--btn-radius);
  font: 500 14px/1 'Figtree', system-ui, sans-serif; color: var(--btn-fg);
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: #fafafa; }

/* A row of buttons */
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
