/**
 * Smart Buttons – Frontend Stylesheet
 *
 * Defines the base .smart-button component and its size variants.
 * Colours and border-radius are applied via CSS custom properties
 * (--sb-bg, --sb-fg, --sb-hover, --sb-r) that are set inline on each
 * rendered element, keeping post content free of <style> blocks.
 *
 * Compatible with:  WordPress 6.0+  |  Modern browsers (CSS custom properties)
 * @package Smart_Buttons
 * @since   1.0.0
 */

/* ─── Wrapper ────────────────────────────────────────────────────────────── */

.smart-button-wrapper {
  display: block;
  margin: 1em 0;
  line-height: 1;
}

/* ─── Base button ─────────────────────────────────────────────────────────── */

.smart-button {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  letter-spacing: 0.02em;

  /* Read values from CSS custom properties (set per-element via style attr) */
  background-color: var(--sb-bg, #0073aa);
  color:            var(--sb-fg, #ffffff);
  border-radius:    var(--sb-r,  4px);

  /* Smooth colour transition */
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

/* ─── Hover / Focus states ────────────────────────────────────────────────── */

.smart-button:hover {
  background-color: var(--sb-hover, #005177);
  color:            var(--sb-fg,    #ffffff);
  text-decoration:  none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.smart-button:focus {
  background-color: var(--sb-hover, #005177);
  color:            var(--sb-fg,    #ffffff);
  text-decoration:  none;
  outline:          2px solid var(--sb-bg, #0073aa);
  outline-offset:   3px;
}

.smart-button:focus:not(:focus-visible) {
  outline: none;
}

.smart-button:focus-visible {
  outline:        2px solid var(--sb-bg, #0073aa);
  outline-offset: 3px;
}

/* ─── Sizes ──────────────────────────────────────────────────────────────── */

.smart-button.sb-size-small {
  padding:   0.4em 0.9em;
  font-size: 0.8rem;
}

.smart-button.sb-size-medium {
  padding:   0.65em 1.4em;
  font-size: 1rem;
}

.smart-button.sb-size-large {
  padding:   0.85em 2em;
  font-size: 1.15rem;
}

/* ─── Print: show URL next to link ───────────────────────────────────────── */

@media print {
  .smart-button::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
  }
}
