/**
 * Core Button block — Conxious theme presets (mirrors .btn / .btn--* in components.css).
 *
 * NOT inside @layer blocks: must beat WordPress's unlayered global styles
 * (:root :where(.wp-element-button, .wp-block-button__link)) that set
 * background, padding, font properties, etc.
 */

:root {
  --conxious-btn-arrow-right-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 10' fill='none'%3E%3Cpath d='M0 5 H29 M24 1 L29 5 L24 9' stroke='%23fff' stroke-width='1.1' stroke-linecap='square'/%3E%3C/svg%3E");
  --conxious-btn-arrow-left-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 10' fill='none'%3E%3Cpath d='M32 5 H3 M8 1 L3 5 L8 9' stroke='%23fff' stroke-width='1.1' stroke-linecap='square'/%3E%3C/svg%3E");
}

/* ─── shared base: every core button gets the .btn shape ────────────── */

:is(main#main, .editor-styles-wrapper) .wp-block-button .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--sans);
  font-size: var(--fs-ui);
  font-weight: 500;
  font-style: normal;
  letter-spacing: -0.005em;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
  text-transform: none;
  transition:
    background-color var(--motion-standard),
    border-color var(--motion-standard),
    color var(--motion-standard),
    transform var(--motion-snappy);
  will-change: transform;
}

:is(main#main, .editor-styles-wrapper) .wp-block-button .wp-block-button__link:active {
  transform: scale(0.98);
}

/* ─── CTA (default) ─────────────────────────────────────────────────── */

:is(main#main, .editor-styles-wrapper) .wp-block-button:is(
    :not([class*="is-style-"]),
    .is-style-cta,
    .is-style-cta-arrow-right,
    .is-style-cta-arrow-left
  )
  .wp-block-button__link {
  background: var(--accent);
  color: #fff;
}

:is(main#main, .editor-styles-wrapper) .wp-block-button:is(
    :not([class*="is-style-"]),
    .is-style-cta,
    .is-style-cta-arrow-right,
    .is-style-cta-arrow-left
  )
  .wp-block-button__link:focus {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-2px);
}

@media (hover: hover) {
  :is(main#main, .editor-styles-wrapper) .wp-block-button:is(
      :not([class*="is-style-"]),
      .is-style-cta,
      .is-style-cta-arrow-right,
      .is-style-cta-arrow-left
    )
    .wp-block-button__link:hover {
    background: var(--accent-strong);
    color: #fff;
    transform: translateY(-2px);
  }
}

/* ─── Dark ──────────────────────────────────────────────────────────── */

:is(main#main, .editor-styles-wrapper) .wp-block-button:is(
    .is-style-dark,
    .is-style-dark-arrow-right,
    .is-style-dark-arrow-left
  )
  .wp-block-button__link {
  background: var(--accent-strong);
  color: #fff;
}

:is(main#main, .editor-styles-wrapper) .wp-block-button:is(
    .is-style-dark,
    .is-style-dark-arrow-right,
    .is-style-dark-arrow-left
  )
  .wp-block-button__link:focus {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

@media (hover: hover) {
  :is(main#main, .editor-styles-wrapper) .wp-block-button:is(
      .is-style-dark,
      .is-style-dark-arrow-right,
      .is-style-dark-arrow-left
    )
    .wp-block-button__link:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
  }
}

/* ─── Ghost dark ────────────────────────────────────────────────────── */

:is(main#main, .editor-styles-wrapper) .wp-block-button:is(
    .is-style-ghost-dark,
    .is-style-ghost-dark-arrow-right,
    .is-style-ghost-dark-arrow-left
  )
  .wp-block-button__link {
  background: transparent;
  border-color: transparent;
  color: var(--accent-strong);
  padding-inline-start: 0;
}

:is(main#main, .editor-styles-wrapper) .wp-block-button:is(
    .is-style-ghost-dark,
    .is-style-ghost-dark-arrow-right,
    .is-style-ghost-dark-arrow-left
  )
  .wp-block-button__link:focus {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: none;
}

@media (hover: hover) {
  :is(main#main, .editor-styles-wrapper) .wp-block-button:is(
      .is-style-ghost-dark,
      .is-style-ghost-dark-arrow-right,
      .is-style-ghost-dark-arrow-left
    )
    .wp-block-button__link:hover {
    background: transparent;
    border-color: transparent;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: none;
  }
}

/* ─── Light ─────────────────────────────────────────────────────────── */

:is(main#main, .editor-styles-wrapper) .wp-block-button:is(
    .is-style-light,
    .is-style-light-arrow-right,
    .is-style-light-arrow-left
  )
  .wp-block-button__link {
  background: var(--sand);
  color: var(--brand-ink);
}

:is(main#main, .editor-styles-wrapper) .wp-block-button:is(
    .is-style-light,
    .is-style-light-arrow-right,
    .is-style-light-arrow-left
  )
  .wp-block-button__link:focus {
  background: #f1e6d6;
  color: var(--brand-ink);
  transform: translateY(-2px);
}

@media (hover: hover) {
  :is(main#main, .editor-styles-wrapper) .wp-block-button:is(
      .is-style-light,
      .is-style-light-arrow-right,
      .is-style-light-arrow-left
    )
    .wp-block-button__link:hover {
    background: #f1e6d6;
    color: var(--brand-ink);
    transform: translateY(-2px);
  }
}

/* ─── inline arrow SVG (front-end, injected by render_block) ───────── */

:is(main#main, .editor-styles-wrapper) .wp-block-button .wp-block-button__link svg.btn-arrow {
  width: 1.75em;
  height: auto;
  flex-shrink: 0;
  color: currentColor;
  transition: transform var(--motion-standard), color var(--motion-standard);
}

:is(main#main, .editor-styles-wrapper) .wp-block-button .wp-block-button__link:focus svg.btn-arrow {
  transform: translateX(3px);
}

:is(main#main, .editor-styles-wrapper) .wp-block-button .wp-block-button__link:focus svg.btn-arrow--left {
  transform: translateX(-3px);
}

@media (hover: hover) {
  :is(main#main, .editor-styles-wrapper) .wp-block-button .wp-block-button__link:hover svg.btn-arrow {
    transform: translateX(3px);
  }

  :is(main#main, .editor-styles-wrapper) .wp-block-button .wp-block-button__link:hover svg.btn-arrow--left {
    transform: translateX(-3px);
  }
}

/* ─── editor arrows (pseudo-elements, hidden when real svg present) ─ */

:is(main#main, .editor-styles-wrapper)
  .wp-block-button:is(
    .is-style-cta-arrow-right,
    .is-style-dark-arrow-right,
    .is-style-ghost-dark-arrow-right,
    .is-style-light-arrow-right
  )
  .wp-block-button__link:not(:has(.btn-arrow))::after,
:is(main#main, .editor-styles-wrapper)
  .wp-block-button:is(
    .is-style-cta-arrow-left,
    .is-style-dark-arrow-left,
    .is-style-ghost-dark-arrow-left,
    .is-style-light-arrow-left
  )
  .wp-block-button__link:not(:has(.btn-arrow))::before {
  content: "";
  display: inline-block;
  width: 1.75em;
  height: 0.625em;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: transform var(--motion-standard), color var(--motion-standard);
}

:is(main#main, .editor-styles-wrapper)
  .wp-block-button:is(
    .is-style-cta-arrow-right,
    .is-style-dark-arrow-right,
    .is-style-ghost-dark-arrow-right,
    .is-style-light-arrow-right
  )
  .wp-block-button__link:not(:has(.btn-arrow))::after {
  -webkit-mask-image: var(--conxious-btn-arrow-right-mask);
  mask-image: var(--conxious-btn-arrow-right-mask);
}

:is(main#main, .editor-styles-wrapper)
  .wp-block-button:is(
    .is-style-cta-arrow-left,
    .is-style-dark-arrow-left,
    .is-style-ghost-dark-arrow-left,
    .is-style-light-arrow-left
  )
  .wp-block-button__link:not(:has(.btn-arrow))::before {
  -webkit-mask-image: var(--conxious-btn-arrow-left-mask);
  mask-image: var(--conxious-btn-arrow-left-mask);
}

:is(main#main, .editor-styles-wrapper)
  .wp-block-button:is(
    .is-style-cta-arrow-right,
    .is-style-dark-arrow-right,
    .is-style-ghost-dark-arrow-right,
    .is-style-light-arrow-right
  )
  .wp-block-button__link:not(:has(.btn-arrow)):focus::after {
  transform: translateX(3px);
}

:is(main#main, .editor-styles-wrapper)
  .wp-block-button:is(
    .is-style-cta-arrow-left,
    .is-style-dark-arrow-left,
    .is-style-ghost-dark-arrow-left,
    .is-style-light-arrow-left
  )
  .wp-block-button__link:not(:has(.btn-arrow)):focus::before {
  transform: translateX(-3px);
}

@media (hover: hover) {
  :is(main#main, .editor-styles-wrapper)
    .wp-block-button:is(
      .is-style-cta-arrow-right,
      .is-style-dark-arrow-right,
      .is-style-ghost-dark-arrow-right,
      .is-style-light-arrow-right
    )
    .wp-block-button__link:not(:has(.btn-arrow)):hover::after {
    transform: translateX(3px);
  }

  :is(main#main, .editor-styles-wrapper)
    .wp-block-button:is(
      .is-style-cta-arrow-left,
      .is-style-dark-arrow-left,
      .is-style-ghost-dark-arrow-left,
      .is-style-light-arrow-left
    )
    .wp-block-button__link:not(:has(.btn-arrow)):hover::before {
    transform: translateX(-3px);
  }
}
