/* ═══════════════════════════════════════════════════════════
   RH GRAVITY — AUTOTAG STYLES
   (1) Keyword link pill treatment
   (2) Inline CTA card
   ═══════════════════════════════════════════════════════════ */


/* ── (1) Keyword link ──────────────────────────────────────── */

a.rh-autotag {
  position: relative;
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted !important;
  text-decoration-color: var(--rh-primary, #400718);
  text-decoration-thickness: 1.5px !important;
  text-underline-offset: 3px !important;
  cursor: pointer;
  border-radius: 6px !important;
  background: #f6ede7 !important;
  padding: 2px 5px;
  transition: background-color 0.15s ease,
              text-decoration-style 0.15s ease;
}

a.rh-autotag:hover,
a.rh-autotag:focus-visible {
  color: var(--rh-primary, #400718);
  text-decoration-style: solid !important;
  background-color: rgba(64, 7, 24, 0.12) !important;
  outline: none;
}

a.rh-autotag:focus-visible {
  outline: 2px solid var(--rh-primary, #400718);
  outline-offset: 2px;
}

/* ── Calculator icon after link text ──────────────────────── */

a.rh-autotag::after {
  content: '';
  display: inline-block;
  width: 19px;
  height: 19px;
  margin-left: 4px;
  vertical-align: -4px;
  flex-shrink: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23400718' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='12' height='12' rx='2.5'/%3E%3Cpath d='M5 5.5h6M5 8h6M5 10.5h3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transition: opacity 0.15s ease;
}

a.rh-autotag:hover::after,
a.rh-autotag:focus-visible::after {
  opacity: 0.85;
}

/* ── Tooltip showing tool name ─────────────────────────────── */

a.rh-autotag::before {
  content: 'Open: ' attr(data-tool-name);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--rh-primary, #400718);
  color: #fff;
  font-family: var(--rh-font-body, sans-serif);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
  filter: drop-shadow(0 2px 6px rgba(64, 7, 24, 0.25));
}

a.rh-autotag:hover::before,
a.rh-autotag:focus-visible::before {
  opacity: 1;
}

@media (max-width: 480px) {
  a.rh-autotag::before {
    left: 0;
    transform: none;
    white-space: normal;
    max-width: 200px;
  }
}


/* ── (2) CTA Card ──────────────────────────────────────────── */
/*
 * Injected by PHP after paragraphs containing a matched keyword.
 * Reuses .rh-toolkit__card-* styles for inner content so it looks
 * identical to the toolkit shortcode cards.
 */

.rh-autotag-cta {
  margin: 20px 0 28px;
}

.rh-autotag-cta__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  background: var(--rh-white, #fff);
  border: 1.5px solid var(--rh-border, #e0d8d5);
  border-radius: var(--rh-radius-lg, 12px);
  box-shadow: 0 2px 12px rgba(64, 7, 24, 0.06);
}

.rh-autotag-cta__body {
  flex: 1;
  min-width: 0;
}

/* Inherit .rh-toolkit__card-name and .rh-toolkit__card-desc styles
   from rh-tools-base.css — no overrides needed here. */

/* ── "Open tool" button ────────────────────────────────────── */
/*
 * .rh-toolkit__card-action already styles this from base CSS.
 * The extra rule below ensures the button stays right-aligned
 * and doesn't grow to fill the flex row.
 */

.rh-autotag-cta__btn.rh-toolkit__card-action {
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}

/* ── Mobile ────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .rh-autotag-cta__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .rh-autotag-cta__btn.rh-toolkit__card-action {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}
