/* Ask Reno Tennis Center (functions.php §1b, assets/js/ask.js).
   A white card with Randy's face in the bottom right corner opens his Google
   Form. Once a week it grows into a short invitation from that same corner,
   so the face never leaves the screen. The same design as TennisNation.com
   v3.94.0; the tokens below dress it in this site's type and colours. Loads
   only on the pages that carry it. */
.tn-ask {
  --ask-display: var(--rt-font-display);
  --ask-title-weight: 700;
  --ask-title-tracking: 0;
  --ask-body: var(--rt-font-body);
  --ask-ink: var(--rt-text-primary);
  --ask-muted: var(--rt-text-secondary);
  --ask-line: var(--rt-border-mid);
  --ask-soft: var(--rt-off-white);
  --ask-radius: var(--rt-radius-lg);
  --ask-cta-font: var(--rt-font-label);
  --ask-cta-radius: var(--rt-radius-sm);
  --ask-cta-bg: var(--rt-blue);
  --ask-cta-fg: var(--rt-white);
  /* The site's buttons turn gold on hover, but white on gold is 2:1. */
  --ask-cta-hover-bg: var(--rt-blue-dark);
  --ask-cta-hover-fg: var(--rt-white);
  --ask-focus: var(--rt-blue);
}

.tn-ask__invite,
.tn-ask__button {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  margin: 0;
  background: #fff;
  color: var(--ask-ink);
  font-family: var(--ask-body);
}
.tn-ask__invite[hidden],
.tn-ask__button[hidden] { display: none; }

@keyframes tn-ask-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes tn-ask-grow {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}

.tn-ask__avatar { flex: none; display: block; max-width: none; border-radius: 50%; object-fit: cover; }

/* Every state of each button is set here, so no default button style shows
   through. */
.tn-ask__button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px 8px 8px;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  text-align: left;
  line-height: 1.2;
  cursor: pointer;
  animation: tn-ask-in 0.24s cubic-bezier(0.23, 1, 0.32, 1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tn-ask__button:hover,
.tn-ask__button:focus { background: #fff; color: var(--ask-ink); }
.tn-ask__button .tn-ask__avatar { width: 48px; height: 48px; }
.tn-ask__card-text { display: block; }
.tn-ask__card-title {
  display: block;
  font-family: var(--ask-display);
  font-weight: var(--ask-title-weight);
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: var(--ask-title-tracking);
}
.tn-ask__short { display: none; }
.tn-ask__card-sub { display: block; margin-top: 3px; font-size: 13px; line-height: 1.3; color: var(--ask-muted); }

.tn-ask__invite {
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 18px;
  border-radius: var(--ask-radius);
  box-shadow: 0 14px 40px rgba(0,0,0,0.22);
  transform-origin: bottom right;
  animation: tn-ask-grow 0.26s cubic-bezier(0.23, 1, 0.32, 1);
}
.tn-ask__invite-head { display: flex; align-items: center; gap: 12px; margin: 0 32px 12px 0; }
.tn-ask__invite-head .tn-ask__avatar { width: 52px; height: 52px; }
.tn-ask__invite-title,
.tn-ask__title {
  margin: 0;
  padding: 0;
  font-family: var(--ask-display);
  font-weight: var(--ask-title-weight);
  line-height: 1.15;
  letter-spacing: var(--ask-title-tracking);
  color: var(--ask-ink);
}
.tn-ask__invite-title { font-size: 22px; }
.tn-ask__invite-team,
.tn-ask__sub { margin: 3px 0 0; font-size: 13px; line-height: 1.3; color: var(--ask-muted); }
.tn-ask__invite-text { margin: 0 0 14px; font-size: 15px; line-height: 1.55; color: var(--ask-ink); }

.tn-ask__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: var(--ask-cta-radius);
  background: var(--ask-cta-bg);
  color: var(--ask-cta-fg);
  font-family: var(--ask-cta-font);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.tn-ask__cta:hover,
.tn-ask__cta:focus { background: var(--ask-cta-hover-bg); color: var(--ask-cta-hover-fg); }

.tn-ask__dismiss,
.tn-ask__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ask-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.tn-ask__dismiss:hover,
.tn-ask__dismiss:focus,
.tn-ask__close:hover,
.tn-ask__close:focus { background: var(--ask-soft); color: var(--ask-ink); }
.tn-ask button:focus-visible { outline: 2px solid var(--ask-focus); outline-offset: 2px; }

.tn-ask__dialog {
  width: min(560px, 92vw);
  height: min(760px, 88vh);
  max-width: none;
  max-height: 88vh;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--ask-ink);
  font-family: var(--ask-body);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.tn-ask__dialog[open] { display: flex; flex-direction: column; }
.tn-ask__dialog::backdrop { background: rgba(0,0,0,0.55); }
.tn-ask__head { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 60px 16px 18px; border-bottom: 1px solid var(--ask-line); }
.tn-ask__head .tn-ask__avatar { width: 44px; height: 44px; }
.tn-ask__title { font-size: 20px; }
.tn-ask__head .tn-ask__close { top: 18px; right: 12px; }
.tn-ask__frame { flex: 1; display: block; width: 100%; min-height: 0; border: 0; }

/* The lift only where a mouse hovers: on a phone a tap would leave it stuck. */
@media ( hover: hover ) {
  .tn-ask__button:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,0.24); }
}
@media ( prefers-reduced-motion: reduce ) {
  .tn-ask__invite,
  .tn-ask__button { animation: none; transition: none; }
  .tn-ask__button:hover { transform: none; }
}

/* On a phone the card says only "Questions?" beside the face, so it covers
   less of the page; the invitation spans the screen and the form fills it. */
@media ( max-width: 600px ) {
  .tn-ask__long,
  .tn-ask__card-sub { display: none; }
  .tn-ask__short { display: inline; }
  .tn-ask__button { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); gap: 10px; padding: 6px 18px 6px 6px; }
  .tn-ask__button .tn-ask__avatar { width: 44px; height: 44px; }
  .tn-ask__card-title { font-size: 16px; }
  .tn-ask__invite { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; }
  .tn-ask__dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tn-ask__head { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .tn-ask__head .tn-ask__close { top: calc(18px + env(safe-area-inset-top, 0px)); }
}
