/* AP A440 Cents Slider
   Theme-friendly: inherits fonts + colors, and leans on WP preset variables when available.
*/
.ap-a440-widget{
  --ap-surface: var(--wp--preset--color--base, #ffffff);
  --ap-accent: var(--wp--preset--color--primary, #2563eb);

  /* Light-theme fallbacks */
  --ap-border: rgba(0,0,0,0.18);
  --ap-border-soft: rgba(0,0,0,0.10);
  --ap-soft: rgba(0,0,0,0.02);
  --ap-soft-2: rgba(0,0,0,0.05);
  --ap-shadow: rgba(0,0,0,0.06);
  --ap-shadow-strong: rgba(0,0,0,0.15);

  color: inherit;
  font: inherit;
}

@supports (color: color-mix(in srgb, currentColor 10%, transparent)) {
  .ap-a440-widget{
    /* Adapt borders/soft backgrounds to current text color (works for dark themes too). */
    --ap-border: color-mix(in srgb, currentColor 22%, transparent);
    --ap-border-soft: color-mix(in srgb, currentColor 12%, transparent);
    --ap-soft: color-mix(in srgb, currentColor 3%, transparent);
    --ap-soft-2: color-mix(in srgb, currentColor 7%, transparent);
    --ap-shadow: color-mix(in srgb, currentColor 10%, transparent);
    --ap-shadow-strong: color-mix(in srgb, currentColor 18%, transparent);
  }
}

.ap-a440-card{
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: 16px;
  padding: clamp(16px, 2.5vw, 24px);
  box-shadow: 0 8px 30px var(--ap-shadow);
  max-width: 980px;
  margin: 1.25rem auto;
}

.ap-a440-title{
  margin: 0 0 0.25rem;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.2;
}

.ap-a440-subtitle{
  margin: 0 0 1.25rem;
  opacity: 0.85;
}

.ap-a440-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

.ap-a440-layout{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}


.ap-a440-gauge{
  position: relative;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--ap-soft-2), var(--ap-soft));
  border: 1px solid var(--ap-border-soft);
  padding: 14px 12px 18px;
  overflow: hidden;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.ap-a440-gauge-svg{
  width: 100%;
  max-width: 320px;
  height: auto;
}


.ap-a440-gauge-svg{
  position: relative;
  z-index: 1;
}

.ap-a440-wave{
  position: absolute;
  width: min(320px, 100%);
  height: 90px;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}


.ap-a440-arc-bg{
  fill: none;
  stroke: var(--ap-border-soft);
  stroke-width: 12;
  stroke-linecap: round;
}

.ap-a440-needle{
  position: absolute;
  width: 4px;
  height: 94px;
  background: var(--ap-accent);
  left: 50%;
  top: 46%;
  transform-origin: 50% 100%;
  transform: rotate(0deg);
  border-radius: 999px;
  box-shadow: 0 4px 12px var(--ap-shadow-strong);
  transition: transform 120ms cubic-bezier(.2,.8,.2,1);
  z-index: 2;
}

.ap-a440-knob{
  position: absolute;
  width: 14px;
  height: 14px;
  left: 50%;
  top: calc(46% + 88px);
  transform: translateX(-50%);
  background: var(--ap-surface);
  border: 2px solid var(--ap-accent);
  border-radius: 999px;
  box-shadow: 0 4px 12px var(--ap-shadow);
  z-index: 3;
}

.ap-a440-readout{
  position: absolute;
  inset: auto 0 16px 0;
  text-align: center;
  padding: 0 12px;
  z-index: 4;
}

.ap-a440-note{
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.ap-a440-frequency{
  font-size: 1.1rem;
  font-weight: 600;
}

.ap-a440-centsline{
  margin-top: 0.25rem;
  display: inline-flex;
  gap: 0.5rem;
  align-items: baseline;
  justify-content: center;
  opacity: 0.9;
}

.cents-label{
display:none;
}

.ap-a440-centsval{
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.ap-a440-controls{
  display: grid;
  gap: 1rem;
}

.ap-a440-label{
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.ap-a440-slider-wrap{
  border: 1px solid var(--ap-border-soft);
  border-radius: 14px;
  padding: 14px 14px 12px;
  background: var(--ap-soft);
}

.ap-a440-slider-row{
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 0.6rem;
  align-items: center;
}

.ap-a440-endcap{
  font-size: 0.9rem;
  opacity: 0.75;
  text-transform: lowercase;
}

.ap-a440-slider{
  width: 100%;
  margin: 0;
  accent-color: var(--ap-accent);
}

.ap-a440-scale{
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  opacity: 0.75;
}

.ap-a440-fields{
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 560px){
  .ap-a440-fields{
    grid-template-columns: 1fr 1fr;
  }
}

.ap-a440-field{
  border: 1px solid var(--ap-border-soft);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--ap-soft);
}

.ap-a440-input{
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--ap-border);
  background: var(--ap-surface);
}

.ap-a440-input:focus{
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 1px;
}

.ap-a440-presets{
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ap-a440-chip{
  font: inherit;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--ap-border);
  background: var(--ap-soft);
  cursor: pointer;
  transition: transform 120ms cubic-bezier(.2,.8,.2,1), background 120ms;
}

.ap-a440-chip:hover{
  transform: translateY(-1px);
  background: var(--ap-soft-2);
}

.ap-a440-chip:active{
  transform: translateY(0px);
}

.ap-a440-audio{
  border: 1px solid var(--ap-border-soft);
  border-radius: 14px;
  padding: 14px 14px 12px;
  background: var(--ap-soft);
}

.ap-a440-play{
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--ap-border);
  background: #DDD;
  cursor: pointer;
  color: #000;
}
.ap-a440-play:hover{
	background: #AAA;
	color: #000;
}

.ap-a440-play-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--ap-accent);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  transition: box-shadow 180ms;
}

.ap-a440-widget.ap-a440-playing .ap-a440-play-dot{
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.18);
}

.ap-a440-hint{
  margin: 0.55rem 0 0;
  opacity: 0.75;
  font-size: 0.92rem;
}

.ap-a440-footnote{
  margin: 0;
  opacity: 0.7;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce){
  .ap-a440-needle,
  .ap-a440-chip{
    transition: none !important;
  }
}
