/* One back control across EventMe.
   At rest: a calm round glass circle with a white arrow, easy to find but quiet.
   On hover, press or keyboard focus: the EventMe red glass glow.
   Icon only buttons use the circle directly; labelled ones ("All services", "Profile",
   the Community logo) wrap the circle in .em-back-ic / .comm-back-ic.
   Windows that sit on top of the page keep their X to close. */
:root {
  --emb-size: 38px;
  --emb-bg: rgba(255,255,255,0.06);
  --emb-line: rgba(255,255,255,0.16);
  --emb-ink: #fff;
  --emb-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 1px 2px rgba(0,0,0,0.25);
  --emb-hot-bg: linear-gradient(135deg, rgba(200,16,46,0.30), rgba(139,0,26,0.24));
  --emb-hot-line: rgba(255,58,92,0.7);
  --emb-hot-ink: #fff;
  --emb-hot-shadow: 0 0 18px rgba(200,16,46,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
}
[data-theme="light"] {
  --emb-bg: #fff;
  --emb-line: rgba(20,20,30,0.14);
  --emb-ink: #1a1a1a;
  --emb-shadow: 0 1px 2px rgba(20,20,30,0.08);
  --emb-hot-bg: rgba(200,16,46,0.08);
  --emb-hot-line: rgba(200,16,46,0.5);
  --emb-hot-ink: #C8102E;
  --emb-hot-shadow: 0 0 0 3px rgba(200,16,46,0.08);
}

/* the circle */
:is(.em-back, [id="vtBack"], .mx-back, .thread-back-btn, .people-close-btn, .hp-icon[data-hp="back"], .cvv-close, .comm-back-ic, .em-back-ic) {
  position: relative; place-items: center !important; justify-content: center !important; align-items: center !important; flex: none !important;
  width: var(--emb-size) !important; height: var(--emb-size) !important; min-width: 0 !important; padding: 0 !important; margin: 0;
  border-radius: 50% !important; color: var(--emb-ink) !important; font-size: 0 !important; line-height: 0 !important;
  background: var(--emb-bg) !important; border: 1px solid var(--emb-line) !important; box-shadow: var(--emb-shadow) !important;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); filter: none !important;
  cursor: pointer; transition: background 160ms, border-color 160ms, color 160ms, box-shadow 160ms, transform 160ms;
}
:is(.comm-back-ic, .em-back-ic) { display: grid !important; cursor: inherit; }
:is(.em-back, [id="vtBack"], .mx-back, .thread-back-btn, .people-close-btn, .hp-icon[data-hp="back"], .cvv-close, .comm-back-ic, .em-back-ic) :is(svg, .phx) {
  width: 17px !important; height: 17px !important; font-size: 17px; stroke-width: 2.5; display: block; margin-left: -1px;
}
/* a 44px tap target around the 38px circle */
:is(.em-back, [id="vtBack"], .mx-back, .thread-back-btn, .people-close-btn, .hp-icon[data-hp="back"], .cvv-close)::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
}
/* over photos and videos the circle needs a darker glass to stay readable */
.cvv-close { --emb-bg: rgba(0,0,0,0.35); --emb-line: rgba(255,255,255,0.22); --emb-ink: #fff; }

/* hot state: hover on devices with a mouse, press everywhere, keyboard focus */
@media (hover: hover) {
  :is(.em-back, [id="vtBack"], .mx-back, .thread-back-btn, .people-close-btn, .hp-icon[data-hp="back"], .cvv-close):hover,
  :is(.comm-nav-back, .em-back-link, .back-home):hover :is(.comm-back-ic, .em-back-ic) {
    background: var(--emb-hot-bg) !important; border-color: var(--emb-hot-line) !important; color: var(--emb-hot-ink) !important;
    box-shadow: var(--emb-hot-shadow) !important; transform: translateX(-2px);
  }
}
:is(.em-back, [id="vtBack"], .mx-back, .thread-back-btn, .people-close-btn, .hp-icon[data-hp="back"], .cvv-close):active,
:is(.comm-nav-back, .em-back-link, .back-home):active :is(.comm-back-ic, .em-back-ic) {
  background: var(--emb-hot-bg) !important; border-color: var(--emb-hot-line) !important; color: var(--emb-hot-ink) !important;
  box-shadow: var(--emb-hot-shadow) !important; transform: scale(0.94);
}
:is(.em-back, [id="vtBack"], .mx-back, .thread-back-btn, .people-close-btn, .hp-icon[data-hp="back"], .cvv-close):focus-visible,
:is(.comm-nav-back, .em-back-link, .back-home):focus-visible :is(.comm-back-ic, .em-back-ic) {
  outline: 2px solid #ff5c7a !important; outline-offset: 2px; border-color: var(--emb-hot-line) !important; color: var(--emb-hot-ink) !important;
}

/* labelled back links: circle + text, no pill around them */
button.em-back-link.em-back-link, a.em-back-link.em-back-link {
  align-items: center; gap: 10px; width: auto; height: auto; min-height: 44px; padding: 0 6px 0 0; margin: 0 0 10px;
  border: 0 !important; background: none !important; box-shadow: none !important; border-radius: 999px;
  color: var(--text-1, #F2EAEA); font: 700 .88rem/1.2 var(--font-body, 'Inter', sans-serif); text-decoration: none; cursor: pointer;
}
.em-back-link.em-back-link:not(.pset-back) { display: inline-flex; }
.em-back-link.em-back-link:focus-visible { outline: none; }
[data-theme="light"] .em-back-link.em-back-link { color: #111; }
.pset-back.em-back-link.em-back-link { margin: 0 0 0 -2px; }
@media (max-width: 720px) { .pset-back.em-back-link.em-back-link { width: auto; padding: 0; } }

@media (prefers-reduced-motion: reduce) {
  :is(.em-back, [id="vtBack"], .mx-back, .thread-back-btn, .people-close-btn, .hp-icon[data-hp="back"], .cvv-close, .comm-back-ic, .em-back-ic) { transition: none; transform: none !important; }
}
