/* Shared "ask the chatbot about this entity" affordance, used by companies.html and
   company.html. Provides two implicit, non-icon affordances: the entity's own visible
   text (name/heading) turns hover-clickable (.ec-entity), and selecting any text on the
   page surfaces a floating "Ask Parallax" pill (.ec-ask-pill). Both open a right-side
   drawer that embeds the chatbot (same-origin iframe, seeded with entity context) + an
   "Open full chatbot" link. Uses --accent (both pages define it #F06731). Self-contained
   so it works regardless of each page's own CSS. */


/* The entity's own visible text (name/heading), directly clickable. */
.ec-entity { cursor: pointer; transition: color .15s; }
.ec-entity:hover, .ec-entity:focus-visible { color: var(--text, #0A0A0A); }
.ec-entity:focus-visible { border-radius: 3px; }

.ec-ask-pill {
  position: fixed; top: 0; left: 0; z-index: 95;
  display: none; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: #FFFFFF; color: var(--text, #0A0A0A);
  font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  border: none; outline: none; box-shadow: none;
}
.ec-ask-pill.show { display: inline-flex; }
.ec-ask-pill:hover, .ec-ask-pill:focus, .ec-ask-pill:focus-visible, .ec-ask-pill:active {
  background: #FFFFFF; color: var(--text, #0A0A0A); outline: none; box-shadow: none;
}

.ec-ask-pill .ec-star { width: 14px; }

.ec-info-card {
  position: fixed; top: 0; left: 0; z-index: 96;
  display: none; align-items: center; gap: 7px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--panel, #fff);
  box-shadow: var(--shadow, 0 12px 40px rgba(10,10,10,0.10));
  font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12.5px; font-weight: 500; color: var(--text, #0A0A0A);
  pointer-events: none; white-space: nowrap;
}
.ec-info-card.show { display: inline-flex; }
.ec-info-card .ec-star { width: 16px; }

.ec-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 101;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent, #F06731); color: #FFFFFF;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(240,103,49,0.38);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.ec-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(240,103,49,0.48); }
.ec-fab:active { transform: translateY(0); }
.ec-fab svg { width: 26px; height: 26px; }
@media (max-width: 520px) { .ec-fab { right: 16px; bottom: 16px; width: 50px; height: 50px; } .ec-fab svg { width: 23px; height: 23px; } }

body:has(.ec-drawer.open) .ec-fab { display: none; }

:root { --ec-w: 620px; --ec-h: 560px; }

.ec-drawer {
  position: fixed;
  right: 0; bottom: 0;
  box-sizing: border-box;
  width: min(var(--ec-w), 100vw);
  height: 100vh;
  background: #FFFFFF; color: #0A0A0A;
  border: 1px solid #E0E0E0; border-right: 0; border-radius: 24px 0 0 24px;
  z-index: 100; display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateX(100%);
  transition: opacity .26s ease, transform .26s cubic-bezier(0.2,0.8,0.2,1), visibility .26s;
  pointer-events: none;
}
.ec-drawer.open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }

.ec-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; flex: none;
  background: #FFFFFF; border-bottom: 1px solid #E0E0E0;
  border-radius: 24px 0 0 0;
}

.ec-brand {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0;
  text-decoration: none; color: #0A0A0A;
}
.ec-brand:hover, .ec-brand:focus-visible { text-decoration: none; }
.ec-brand:hover .ec-title { color: #F06731; }
.ec-star {
  width: 22px; aspect-ratio: 1; flex: none;
  background-color: #F06731;
  -webkit-mask: url("../img/av-star.png") center / contain no-repeat;
          mask: url("../img/av-star.png") center / contain no-repeat;
}
.ec-title {
  /* Explicit Satoshi for the same reason as .ec-ask-pill: the drawer header renders in the
     host page's DOM, which cross-origin may not have Satoshi as its body font. */
  font-family: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500; font-size: 15px; letter-spacing: -0.015em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  color: #0A0A0A; transition: color .15s;
}

.ec-close { border: none; background: transparent; color: #858585; font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; flex: none; }
.ec-close:hover { color: #0A0A0A; }
.ec-body { flex: 1; min-height: 0; }

.ec-body iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 1024px){
     .ec-drawer {
      border-radius: 24px 0 0 0px;
     }
}

@media (max-width: 520px) {
  .ec-drawer {
    left: 0;
    width: 100%;
    height: 100dvh;
    border-left: 0;
    border-radius: 0;
  }

  .ec-head { border-radius: 0; }
}


@media (pointer: coarse) {
  html.ec-drawer-open, html.ec-drawer-open body { overflow: hidden; }
}
