/*
 * Shared interactive states
 *
 * This final layer keeps icon actions and labelled contact controls on one
 * visual contract after HivePress and extension styles have loaded.
 */

/* Contact controls use dark interaction states. */
body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar :is(
  .hp-social-links__item,
  .marnamic-vendor-contact__action
) {
  color: var(--marnamic-cream, #f1e9dd) !important;
  background: var(--marnamic-control-surface, rgba(15, 25, 27, 0.9)) !important;
  border-color: var(--marnamic-control-border, rgba(161, 192, 195, 0.3)) !important;
  box-shadow: none !important;
  transform: none !important;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease !important;
}

body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar :is(
  .hp-social-links__item,
  .marnamic-vendor-contact__action
) span {
  display: block !important;
  min-width: 0 !important;
  color: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Font Awesome, inline SVGs and text labels must inherit one foreground
 * colour. Without this explicit contract, legacy icon rules can override
 * only the glyph while the surrounding contact control has already changed
 * state. */
body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar :is(
  .hp-social-links__item,
  .marnamic-vendor-contact__action
) :is(i, i::before, .hp-icon, .hp-icon::before) {
  color: currentColor !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Brand marks are outline SVGs. Their own fill contract must win over
 * broad legacy icon rules, otherwise LinkedIn turns into glyph fragments and
 * Instagram into a filled square. */
body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar .marnamic-vendor-contact__brand-icon :is(path, rect, circle) {
  fill: none !important;
  stroke: currentColor !important;
}

body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar .marnamic-vendor-contact__brand-icon circle[fill] {
  fill: currentColor !important;
  stroke: none !important;
}

body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar .hp-social-links__item img {
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
  opacity: 0.9 !important;
  transition: filter 160ms ease, opacity 160ms ease !important;
}

body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar :is(
  .hp-social-links__item,
  .marnamic-vendor-contact__action
):is(
  :hover,
  :focus-visible,
  :active,
  [aria-pressed="true"],
  [data-state="active"],
  .is-active
) {
  /* A selected teal surface always carries one dark foreground: label and
   * icon inherit the same colour instead of producing a split state. */
  color: var(--marnamic-action-selected-text, var(--marnamic-dark, #132124)) !important;
  -webkit-text-fill-color: var(--marnamic-action-selected-text, var(--marnamic-dark, #132124)) !important;
  background: var(--marnamic-action-selected, var(--marnamic-teal, #61a5ac)) !important;
  border-color: var(--marnamic-action-selected, var(--marnamic-teal, #61a5ac)) !important;
}

body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar :is(
  .hp-social-links__item,
  .marnamic-vendor-contact__action
):is(
  :hover,
  :focus-visible,
  :active,
  [aria-pressed="true"],
  [data-state="active"],
  .is-active
) span {
  color: var(--marnamic-action-selected-text, var(--marnamic-dark, #132124)) !important;
  -webkit-text-fill-color: var(--marnamic-action-selected-text, var(--marnamic-dark, #132124)) !important;
}

body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar :is(
  .hp-social-links__item,
  .marnamic-vendor-contact__action
):is(
  :hover,
  :focus-visible,
  :active,
  [aria-pressed="true"],
  [data-state="active"],
  .is-active
) :is(i, i::before, .hp-icon, .hp-icon::before) {
  color: var(--marnamic-action-selected-text, var(--marnamic-dark, #132124)) !important;
  fill: var(--marnamic-action-selected-text, var(--marnamic-dark, #132124)) !important;
  stroke: var(--marnamic-action-selected-text, var(--marnamic-dark, #132124)) !important;
  -webkit-text-fill-color: var(--marnamic-action-selected-text, var(--marnamic-dark, #132124)) !important;
}

body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar .hp-social-links__item:is(
  :hover,
  :focus-visible,
  :active,
  [aria-pressed="true"],
  [data-state="active"],
  .is-active
) img {
  filter: none !important;
  opacity: 1 !important;
}

body.wp-child-theme-marnamic:is(
  .hp-template--vendor-view-page,
  .hp-template--listing-view-page
) .hp-page__sidebar :is(
  .hp-social-links__item,
  .marnamic-vendor-contact__action
):focus-visible {
  outline: 2px solid rgba(231, 253, 135, 0.72) !important;
  outline-offset: 3px !important;
}

/*
 * Card icon actions. The action group is layout only; the child link/button
 * owns the visible surface. This removes the previous 66px "button around a
 * button" in vendor cards embedded on listing detail pages.
 */
body.wp-child-theme-marnamic .marnamic-card :is(
  .hp-vendor__actions,
  .hp-listing__actions
) {
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.wp-child-theme-marnamic .marnamic-card :is(
  .hp-vendor__action,
  .hp-listing__action,
  .hp-vendor__actions .hp-link,
  .hp-listing__actions .hp-link
) {
  display: inline-flex !important;
  flex: 0 0 40px !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--marnamic-lime, #e7fd87) !important;
  background: rgba(15, 25, 27, 0.86) !important;
  border: 1px solid rgba(161, 192, 195, 0.34) !important;
  border-radius: var(--marnamic-card-radius, 8px) !important;
  box-shadow: none !important;
  line-height: 1 !important;
  transform: none !important;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease !important;
}

body.wp-child-theme-marnamic .marnamic-card :is(
  .hp-vendor__action,
  .hp-listing__action,
  .hp-vendor__actions .hp-link,
  .hp-listing__actions .hp-link
) :is(
  i,
  i::before,
  .hp-icon,
  .hp-icon::before,
  svg,
  svg *
) {
  color: currentColor !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}

body.wp-child-theme-marnamic .marnamic-card :is(
  .hp-vendor__action,
  .hp-listing__action,
  .hp-vendor__actions .hp-link,
  .hp-listing__actions .hp-link
):is(:hover, :focus-visible, :active) {
  color: var(--marnamic-dark, #132124) !important;
  background: var(--marnamic-lime-hover, #dffc5f) !important;
  border-color: var(--marnamic-lime-hover, #dffc5f) !important;
}

body.wp-child-theme-marnamic .marnamic-card :is(
  .hp-vendor__action,
  .hp-listing__action,
  .hp-vendor__actions .hp-link,
  .hp-listing__actions .hp-link
):focus-visible {
  outline: 2px solid rgba(231, 253, 135, 0.72) !important;
  outline-offset: 3px !important;
}

body.wp-child-theme-marnamic .marnamic-card :is(
  .hp-vendor__action,
  .hp-listing__action,
  .hp-vendor__actions .hp-link,
  .hp-listing__actions .hp-link
):is(
  [aria-pressed="true"],
  [data-state="active"],
  .is-active,
  .hp-listing__action--active,
  .hp-vendor__action--active
) {
  color: var(--marnamic-dark, #132124) !important;
  background: var(--marnamic-lime, #e7fd87) !important;
  border-color: var(--marnamic-lime, #e7fd87) !important;
}

body.wp-child-theme-marnamic .marnamic-card :is(
  .hp-vendor__action,
  .hp-listing__action,
  .hp-vendor__actions .hp-link,
  .hp-listing__actions .hp-link
):is(
  [aria-pressed="true"],
  [data-state="active"],
  .is-active,
  .hp-listing__action--active,
  .hp-vendor__action--active
):is(:hover, :focus-visible) {
  background: var(--marnamic-lime-hover, #dffc5f) !important;
  border-color: var(--marnamic-lime-hover, #dffc5f) !important;
}

/*
 * Map popup CTA contrast.
 *
 * This file is the final interaction layer. Keep every anchor state explicit
 * so global and visited-link rules cannot turn lime popup buttons cream.
 * `-webkit-text-fill-color` also protects the label from text-fill rules
 * injected by browser or optimisation layers.
 */
body.wp-child-theme-marnamic.wp-child-theme-marnamic
  .gm-style .gm-style-iw-c a.marnamic-map-card__link,
body.wp-child-theme-marnamic.wp-child-theme-marnamic
  .gm-style .gm-style-iw-c a.marnamic-map-card__link:link,
body.wp-child-theme-marnamic.wp-child-theme-marnamic
  .gm-style .gm-style-iw-c a.marnamic-map-card__link:visited,
body.wp-child-theme-marnamic.wp-child-theme-marnamic
  .gm-style .gm-style-iw-c a.marnamic-map-card__link:hover,
body.wp-child-theme-marnamic.wp-child-theme-marnamic
  .gm-style .gm-style-iw-c a.marnamic-map-card__link:focus-visible,
body.wp-child-theme-marnamic.wp-child-theme-marnamic
  .gm-style .gm-style-iw-c a.marnamic-map-card__link:active {
  color: var(--marnamic-dark, #132124) !important;
  -webkit-text-fill-color: var(--marnamic-dark, #132124) !important;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic
  .gm-style .gm-style-iw-c a.marnamic-map-card__link :is(
    span,
    i,
    i::before,
    svg,
    svg *
  ) {
  color: currentColor !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
}

@media (prefers-reduced-motion: reduce) {
  body.wp-child-theme-marnamic .marnamic-card :is(
    .hp-vendor__action,
    .hp-listing__action,
    .hp-link
  ),
  body.wp-child-theme-marnamic .hp-page__sidebar .hp-social-links__item {
    transition-duration: 0.01ms !important;
  }
}

/*
 * Listing-detail provider actions.
 *
 * These guards intentionally live in the final interaction layer. Global
 * visited-link and legacy sidebar rules otherwise turn the lime profile CTA
 * cream and the message icon dark on its dark surface.
 */
body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--listing-view-page
  .hp-page__sidebar
  .hp-vendor--view-block.marnamic-card.marnamic-card--vendor
  a.marnamic-card__cta--profile,
body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--listing-view-page
  .hp-page__sidebar
  .hp-vendor--view-block.marnamic-card.marnamic-card--vendor
  a.marnamic-card__cta--profile:link,
body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--listing-view-page
  .hp-page__sidebar
  .hp-vendor--view-block.marnamic-card.marnamic-card--vendor
  a.marnamic-card__cta--profile:visited {
  color: var(--marnamic-dark, #132124) !important;
  -webkit-text-fill-color: var(--marnamic-dark, #132124) !important;
  background: var(--marnamic-lime, #e7fd87) !important;
  border-color: var(--marnamic-lime, #e7fd87) !important;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--listing-view-page
  .hp-page__sidebar
  .hp-vendor--view-block.marnamic-card.marnamic-card--vendor
  a.marnamic-card__cta--profile
  span {
  color: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--listing-view-page
  .hp-page__sidebar
  .hp-vendor--view-block.marnamic-card.marnamic-card--vendor
  a.marnamic-card__cta--profile:is(:hover, :focus-visible, :active) {
  color: var(--marnamic-dark, #132124) !important;
  -webkit-text-fill-color: var(--marnamic-dark, #132124) !important;
  background: var(--marnamic-lime-hover, #dffc5f) !important;
  border-color: var(--marnamic-lime-hover, #dffc5f) !important;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--listing-view-page
  .hp-page__sidebar
  .hp-vendor--view-block.marnamic-card.marnamic-card--vendor
  a.hp-vendor__action--message {
  color: var(--marnamic-lime, #e7fd87) !important;
  -webkit-text-fill-color: var(--marnamic-lime, #e7fd87) !important;
  background: rgba(15, 25, 27, 0.86) !important;
  border-color: rgba(161, 192, 195, 0.34) !important;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--listing-view-page
  .hp-page__sidebar
  .hp-vendor--view-block.marnamic-card.marnamic-card--vendor
  a.hp-vendor__action--message
  :is(i, i::before, .hp-icon, .hp-icon::before, svg, svg *) {
  color: currentColor !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--listing-view-page
  .hp-page__sidebar
  .hp-vendor--view-block.marnamic-card.marnamic-card--vendor
  a.hp-vendor__action--message:is(:hover, :focus-visible, :active) {
  color: var(--marnamic-dark, #132124) !important;
  -webkit-text-fill-color: var(--marnamic-dark, #132124) !important;
  background: var(--marnamic-lime-hover, #dffc5f) !important;
  border-color: var(--marnamic-lime-hover, #dffc5f) !important;
}

/*
 * Vendor-detail matching CTA.
 *
 * Mirrors the directed action on Vendor archive cards, including its icon,
 * lime surface and explicit link states. The final-layer selectors prevent
 * legacy button and visited-link rules from changing its contrast.
 */
body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--vendor-view-page
  .hp-vendor__actions--primary
  a.marnamic-vendor-matching-cta,
body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--vendor-view-page
  .hp-vendor__actions--primary
  a.marnamic-vendor-matching-cta:link,
body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--vendor-view-page
  .hp-vendor__actions--primary
  a.marnamic-vendor-matching-cta:visited {
  display: inline-flex !important;
  color: var(--marnamic-dark, #132124) !important;
  -webkit-text-fill-color: var(--marnamic-dark, #132124) !important;
  background: var(--marnamic-lime, #e7fd87) !important;
  border-color: var(--marnamic-lime, #e7fd87) !important;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--vendor-view-page
  .hp-vendor__actions--primary
  a.marnamic-vendor-matching-cta
  :is(i, i::before, .hp-icon, .hp-icon::before, span, svg, svg *) {
  margin: 0 !important;
  color: currentColor !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1 !important;
}

body.wp-child-theme-marnamic.wp-child-theme-marnamic.hp-template--vendor-view-page
  .hp-vendor__actions--primary
  a.marnamic-vendor-matching-cta:is(:hover, :focus-visible, :active) {
  color: var(--marnamic-dark, #132124) !important;
  -webkit-text-fill-color: var(--marnamic-dark, #132124) !important;
  background: var(--marnamic-lime-hover, #dffc5f) !important;
  border-color: var(--marnamic-lime-hover, #dffc5f) !important;
}
