/*
 * Axis Audio credits widget (phase 03). Every selector is scoped under .axc-credits.
 *
 * Visual values, taken from the live axis.audio/credits page (cached HTML in data/raw/ plus
 * one fetch each of its own Squarespace site.css and custom.css, 2026-12-01):
 *   Template      Squarespace 7.0 "Brine" family; /credits is an index section with a background
 *                 photo (.Index-page--has-image): background #0f0606, text #fff.
 *   Font          body: proxima-nova (Adobe Typekit kit loaded by the Squarespace page), weight
 *                 300, 18px, line-height 1.4em. Headings h2/h3: proxima-nova 300 uppercase.
 *                 The widget inherits nothing: it names proxima-nova first, so on the live page
 *                 it uses the site's font, and falls back to Helvetica Neue / Arial elsewhere.
 *   Muted text    rgba(255,255,255,.6) (overlay header nav items).
 *   Accent        #d88518 (site link colour).
 *   Shapes        square corners (button-corner-style-square, nav button shape square).
 *   Gallery       old gallery: square crops, 6 per row, padding 0, captions uppercase,
 *                 letter-spacing 1.5px, .75em, white; artwork fades on hover (custom.css).
 *                 Captions sit over the artwork (shown on hover / tap), as the old gallery's did.
 *                 Spacing tweak gridSpacing 20px -> --axc-gap.
 * Tune the look through the custom properties below.
 */

.axc-credits {
  --axc-font: proxima-nova, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --axc-weight: 300;
  --axc-weight-bold: 700;
  --axc-size: 16px;
  --axc-text: #fff;
  --axc-muted: rgba(255, 255, 255, 0.6);
  --axc-accent: #d88518;
  --axc-chip-border: rgba(255, 255, 255, 0.35);
  --axc-chip-text: rgba(255, 255, 255, 0.8);
  --axc-chip-on-bg: #fff;
  --axc-chip-on-text: #0f0606;
  --axc-input-bg: rgba(255, 255, 255, 0.06);
  --axc-placeholder-bg: #1d1d1d;
  --axc-badge-bg: #d88518;
  --axc-badge-text: #0f0606;
  --axc-overlay-bg: rgba(10, 4, 4, 0.8);
  --axc-overlay-muted: rgba(255, 255, 255, 0.75);
  --axc-gap: 20px;
  --axc-radius: 0;
  --axc-tracking: 1.5px;
  --axc-cols: 2;

  container-type: inline-size;
  display: block;
  box-sizing: border-box;
  width: 100%;
  color: var(--axc-text);
  font-family: var(--axc-font);
  font-weight: var(--axc-weight);
  font-size: var(--axc-size);
  line-height: 1.4;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.axc-credits *,
.axc-credits *::before,
.axc-credits *::after {
  box-sizing: border-box;
}

.axc-credits .axc-inner {
  display: flex;
  flex-direction: column;
  gap: calc(var(--axc-gap) * 1.25);
}

.axc-credits [hidden] {
  display: none !important;
}

/* -- messages ------------------------------------------------------------------------------- */

.axc-credits .axc-message,
.axc-credits .axc-empty {
  margin: 0;
  padding: 2em 0;
  color: var(--axc-muted);
  text-align: center;
}

/* -- controls ------------------------------------------------------------------------------- */

.axc-credits .axc-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.axc-credits .axc-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.axc-credits .axc-legend {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  color: var(--axc-muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: var(--axc-tracking);
  text-transform: uppercase;
}

.axc-credits .axc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.axc-credits .axc-chip,
.axc-credits .axc-clear,
.axc-credits .axc-more {
  appearance: none;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--axc-chip-border);
  border-radius: var(--axc-radius);
  background: transparent;
  color: var(--axc-chip-text);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
}

.axc-credits .axc-chip:hover,
.axc-credits .axc-clear:hover:not(:disabled),
.axc-credits .axc-more:hover {
  border-color: var(--axc-text);
  color: var(--axc-text);
}

.axc-credits .axc-chip[aria-pressed="true"] {
  border-color: var(--axc-chip-on-bg);
  background: var(--axc-chip-on-bg);
  color: var(--axc-chip-on-text);
}

.axc-credits .axc-clear:disabled {
  opacity: 0.4;
  cursor: default;
}

.axc-credits .axc-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}

.axc-credits .axc-search {
  display: block;
  flex: 1 1 260px;
  max-width: 420px;
  margin: 0;
}

.axc-credits .axc-input {
  box-sizing: border-box;
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--axc-chip-border);
  border-radius: var(--axc-radius);
  background: var(--axc-input-bg);
  color: var(--axc-text);
  font: inherit;
  font-size: 16px; /* >= 16px stops iOS zooming on focus */
  line-height: 1.2;
  box-shadow: none;
}

.axc-credits .axc-input:focus {
  border-color: var(--axc-text);
}

.axc-credits .axc-count {
  margin: 0 0 0 auto;
  padding: 0 0 8px;
  color: var(--axc-muted);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* -- focus ---------------------------------------------------------------------------------- */

.axc-credits :focus {
  outline: none;
}

.axc-credits :focus-visible {
  outline: 2px solid var(--axc-accent);
  outline-offset: 2px;
}

/* -- featured ------------------------------------------------------------------------------- */

.axc-credits .axc-heading {
  margin: 0 0 12px;
  padding: 0;
  color: var(--axc-text);
  font-family: var(--axc-font);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: var(--axc-tracking);
  line-height: 1.2;
  text-transform: uppercase;
}

/* -- grid ----------------------------------------------------------------------------------- */

.axc-credits .axc-grid {
  display: grid;
  grid-template-columns: repeat(var(--axc-cols), minmax(0, 1fr));
  gap: var(--axc-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.axc-credits .axc-item {
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.axc-credits .axc-item::before,
.axc-credits .axc-item::marker {
  content: none;
}

.axc-credits .axc-tile {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  text-decoration: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

.axc-credits .axc-art {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--axc-radius);
  background: var(--axc-placeholder-bg);
}

.axc-credits .axc-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
}

.axc-credits .axc-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 12%;
  color: var(--axc-muted);
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
}

/* -- caption overlay -------------------------------------------------------------------------
 * Over the artwork, hidden by default. Shown on hover (pointer devices), on keyboard focus, and
 * for the tile a touch tap opened (.axc-is-open, set by credits.js). Hidden with opacity only so
 * screen readers always get the text. */

.axc-credits .axc-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px;
  overflow: hidden;
  background: var(--axc-overlay-bg);
  text-align: center;
  overflow-wrap: anywhere;
  opacity: 0;
}

/* Over a text placeholder the overlay is opaque, so the placeholder text does not show through. */
.axc-credits .axc-ph + .axc-caption {
  background: var(--axc-placeholder-bg);
}

/* Text blocks keep their height; only the role lines give way (clip) if a tile is too small. */
.axc-credits .axc-caption > * {
  flex-shrink: 0;
}

@media (hover: hover) {
  .axc-credits .axc-tile:hover .axc-caption {
    opacity: 1;
  }
}

.axc-credits .axc-tile:focus-visible .axc-caption,
.axc-credits .axc-tile.axc-is-open .axc-caption {
  opacity: 1;
}

.axc-credits .axc-artist,
.axc-credits .axc-title,
.axc-credits .axc-role,
.axc-credits .axc-hint {
  display: block;
  max-width: 100%;
}

.axc-credits .axc-artist,
.axc-credits .axc-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.axc-credits .axc-artist {
  color: var(--axc-text);
  font-size: 15px;
  font-weight: var(--axc-weight-bold);
  line-height: 1.25;
}

.axc-credits .axc-title {
  color: var(--axc-text);
  font-size: 14px;
  line-height: 1.25;
}

.axc-credits .axc-roles {
  display: block;
  max-width: 100%;
  min-height: 0;
  margin-top: 6px;
  overflow: hidden;
}

.axc-credits .axc-caption > .axc-roles {
  flex-shrink: 1;
}

.axc-credits .axc-role {
  color: var(--axc-overlay-muted);
  font-size: 11px;
  letter-spacing: var(--axc-tracking);
  line-height: 1.4;
  text-transform: uppercase;
}

.axc-credits .axc-name {
  white-space: nowrap;
}

.axc-credits .axc-hint {
  margin-top: 8px;
  color: var(--axc-accent);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.3;
  text-transform: uppercase;
}

/* The touch hint only shows on a tile a tap opened. */
.axc-credits .axc-tile:not(.axc-is-open) .axc-hint {
  display: none;
}

/* Visually hidden, still read by screen readers (role lines beyond "+N more"). */
.axc-credits .axc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.axc-credits .axc-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.axc-credits .axc-badge {
  padding: 3px 6px;
  border-radius: var(--axc-radius);
  background: var(--axc-badge-bg);
  color: var(--axc-badge-text);
  font-size: 10px;
  font-weight: var(--axc-weight-bold);
  letter-spacing: 1px;
  line-height: 1.2;
  text-transform: uppercase;
}

.axc-credits .axc-more {
  align-self: center;
  padding: 10px 28px;
}

/* -- responsive columns (follow the container, not the viewport) ----------------------------- */

@container (min-width: 600px) {
  .axc-credits .axc-grid {
    --axc-cols: 3;
  }
}

@container (min-width: 900px) {
  .axc-credits .axc-grid {
    --axc-cols: 4;
  }
}

@container (min-width: 1150px) {
  .axc-credits .axc-grid {
    --axc-cols: 5;
  }
}

@container (max-width: 480px) {
  .axc-credits .axc-grid {
    gap: 12px;
  }

  .axc-credits .axc-caption {
    padding: 8px;
  }

  .axc-credits .axc-artist {
    font-size: 13px;
  }

  .axc-credits .axc-title {
    font-size: 12px;
  }

  .axc-credits .axc-roles {
    margin-top: 4px;
  }

  .axc-credits .axc-role,
  .axc-credits .axc-hint {
    font-size: 9px;
    letter-spacing: 0.5px;
  }

  .axc-credits .axc-hint {
    margin-top: 6px;
  }

  .axc-credits .axc-chip {
    padding: 7px 10px;
    font-size: 12px;
  }
}

/* -- motion --------------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .axc-credits .axc-caption {
    transition: opacity 0.25s ease-in-out;
  }

  .axc-credits .axc-chip,
  .axc-credits .axc-clear,
  .axc-credits .axc-more {
    transition:
      background-color 0.17s ease-in-out,
      color 0.17s ease-in-out,
      border-color 0.17s ease-in-out;
  }
}
