/*
 * Audiojack plugin styles. Everything is prefixed `aj-` and scoped under the
 * shortcode container (`.aj`) or the body-appended dock (`.aj-dock`), so no
 * theme selector collides. Tokens mirror website/src/styles/tokens.css,
 * which mirrors the app — the app is the source of truth for brand values.
 * Fonts deliberately inherit from the theme; the brand teal does not.
 */
.aj,
.aj-dock {
  --aj-brand: #163d4d;
  --aj-brand-contrast: #ffffff;
  --aj-brand-deep: #0d2530;
  --aj-on-deep-muted: #b7c6cd;
  --aj-text-muted: #5c6b73;
  --aj-surface: #f4f7f8;
  --aj-border: #d9e2e6;
  --aj-error: #b3261e;
  --aj-radius: 8px;
  --aj-radius-lg: 14px;
  --aj-shadow-2: 0 6px 24px rgba(13, 37, 48, 0.14);
}

/* --- shells -------------------------------------------------------------- */
.aj-sheet {
  max-width: 28rem;
  margin: 0 auto;
}
.aj-wrap {
  max-width: 48rem;
  margin: 0 auto;
}
.aj-center {
  text-align: center;
}
.aj-listen {
  /* room for the docked player so the last row is never hidden behind it */
  padding-bottom: 10rem;
}

/* --- forms ---------------------------------------------------------------- */
.aj-field {
  margin-bottom: 1rem;
}
.aj-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.aj-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--aj-border);
  border-radius: var(--aj-radius);
  font: inherit;
  background: #fff;
  color: inherit;
}
.aj-field input:focus {
  outline: 2px solid var(--aj-brand);
  outline-offset: 1px;
}
.aj-error {
  color: var(--aj-error);
  min-height: 1.2em;
  margin: 0.5rem 0;
}
.aj-error:empty {
  margin: 0;
}
.aj-note {
  color: var(--aj-text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}
.aj-name {
  margin: 0 0 0.25rem;
}

/* --- buttons -------------------------------------------------------------- */
.aj-btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: var(--aj-radius);
  border: 1px solid var(--aj-brand);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 150ms ease-out;
}
.aj-btn:hover {
  opacity: 0.9;
}
.aj-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.aj-btn-solid {
  background: var(--aj-brand);
  color: var(--aj-brand-contrast);
}
.aj-btn-outline {
  background: transparent;
  color: var(--aj-brand);
}
.aj-card-glyph {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.18em;
  margin-right: 0.35em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
/* PayPal's button colour, per their brand guidance; the wordmark stays text. */
.aj-btn-paypal {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: var(--aj-radius);
  background: #ffc439;
  color: #003087;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.aj-btn-paypal:hover {
  background: #f2ba36;
}
.aj-btn-paypal:disabled {
  opacity: 0.6;
  cursor: default;
}
.aj-btn-paypal strong {
  font-style: italic;
}

/* --- account card ---------------------------------------------------------- */
.aj-card {
  background: var(--aj-surface);
  border: 1px solid var(--aj-border);
  border-radius: var(--aj-radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0 2rem;
}
.aj-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--aj-text-muted);
}
.aj-card p {
  margin: 0 0 0.25rem;
}

/* --- subscribe ------------------------------------------------------------- */
.aj-plans {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.aj-plan {
  border: 1px solid var(--aj-border);
  border-radius: var(--aj-radius-lg);
  padding: 1.5rem;
  background: var(--aj-surface);
  text-align: center;
}
.aj-plan-featured {
  border: 2px solid var(--aj-brand);
}
.aj-plan h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}
.aj-price {
  margin: 0 0 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.aj-price strong {
  font-size: 2.4rem;
  line-height: 1.1;
  color: var(--aj-brand);
}
.aj-price span {
  color: var(--aj-text-muted);
  font-size: 0.9rem;
}
.aj-plan-note {
  color: var(--aj-text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}
.aj-fine {
  color: var(--aj-text-muted);
  font-size: 0.875rem;
  margin-top: 2.5rem;
}

/* --- library --------------------------------------------------------------- */
.aj-category {
  border-bottom: 1px solid var(--aj-border);
}
.aj-category summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 60px;
  padding: 1rem 0.25rem;
  cursor: pointer;
}
.aj-category summary::-webkit-details-marker {
  display: none;
}
.aj-cat-title {
  flex: 1 1 auto;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--aj-brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.aj-cat-count {
  color: var(--aj-text-muted);
  font-size: 0.85rem;
}
.aj-cat-chevron {
  display: inline-flex;
  color: var(--aj-text-muted);
  transition: transform 150ms ease-out;
}
.aj-category[open] .aj-cat-chevron {
  transform: rotate(180deg);
}
/* The category holding what is playing stays findable when collapsed. */
.aj-category.aj-has-playing .aj-cat-title::after {
  content: " ♪";
}
.aj-stories {
  list-style: none;
  padding: 0 0 1.5rem;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.aj-stories li {
  margin: 0;
  list-style: none;
}
.aj-story {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
  padding: 1rem;
  background: var(--aj-brand);
  color: var(--aj-brand-contrast);
  border: 0;
  border-radius: var(--aj-radius);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease-out;
}
.aj-story:hover {
  transform: translateY(-1px);
}
.aj-story.aj-playing {
  box-shadow: inset 0 0 0 2px var(--aj-brand-contrast);
}
.aj-story-title {
  flex: 1 1 auto;
}
.aj-story-time,
.aj-story-lock {
  opacity: 0.85;
  font-size: 0.9rem;
}

/* --- docked player ---------------------------------------------------------- */
.aj-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--aj-brand-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--aj-shadow-2);
  z-index: 99999;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
}
.aj-dock[hidden] {
  display: none;
}
.aj-dock-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--aj-on-deep-muted);
  cursor: pointer;
}
.aj-dock-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--aj-brand-contrast);
}
.aj-dock-inner {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.aj-now {
  flex: 1 1 12rem;
  min-width: 0;
  color: var(--aj-brand-contrast);
  padding-right: 44px;
}
.aj-now-title {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aj-now-time {
  display: block;
  color: var(--aj-on-deep-muted);
  font-size: 0.85rem;
  /* tabular figures stop the layout twitching every second */
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.aj-progress {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  margin-top: 0.5rem;
  overflow: hidden;
}
.aj-bar {
  height: 100%;
  width: 0%;
  background: var(--aj-brand-contrast);
}
.aj-transport {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.aj-tbtn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: transparent;
  color: var(--aj-brand-contrast);
  cursor: pointer;
  transition: background 150ms ease-out;
}
.aj-tbtn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.aj-tbtn-primary {
  width: 60px;
  height: 60px;
  background: var(--aj-brand-contrast);
  color: var(--aj-brand-deep);
  border-color: var(--aj-brand-contrast);
}
.aj-tbtn-primary:hover {
  background: var(--aj-brand-contrast);
  opacity: 0.9;
}
/* Repeat off is dimmed, like the legacy half-alpha button. */
.aj-tbtn[aria-pressed] {
  opacity: 0.45;
}
.aj-tbtn.aj-on {
  opacity: 1;
  background: rgba(255, 255, 255, 0.16);
}
