/* FAQ term underline and tooltip chrome.
   Markup and positioning logic live in lib/components/faq_term.dart. */

.term {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--color-secondary) 45%, transparent);
  padding-bottom: 1px;
  cursor: help;
  transition: border-color 200ms ease, background 200ms ease;
}

.term:hover {
  border-bottom-color: var(--color-secondary);
  background: color-mix(in srgb, var(--color-secondary) 5%, transparent);
}

.faq-tip {
  z-index: 30;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 20px;
  background: var(--color-surface);
  color: var(--color-on-surface);
  border-radius: 8px;
  box-shadow:
    0 24px 48px rgba(0, 10, 30, 0.18),
    0 0 0 1px color-mix(in srgb, var(--color-on-surface) 6%, transparent);
}

.faq-tip::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 32px;
  width: 14px;
  height: 14px;
  background: var(--color-surface);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: -1px -1px 0 color-mix(in srgb, var(--color-on-surface) 6%, transparent);
}

.faq-tip-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0;
  background: none;
  border: none;
  color: color-mix(in srgb, var(--color-on-surface) 35%, transparent);
  cursor: pointer;
}

.faq-tip-close:hover {
  color: var(--color-on-surface);
}

.faq-tip-backdrop {
  display: none;
}

:root[data-style="city"] .faq-tip {
  border: var(--fp-outline-width) solid var(--fp-ink);
  border-radius: var(--fp-card-radius);
  box-shadow: 6px 7px 0 color-mix(in srgb, var(--fp-ink) 26%, transparent);
}

:root[data-style="city"] .faq-tip::before {
  border-left: var(--fp-outline-width) solid var(--fp-ink);
  border-top: var(--fp-outline-width) solid var(--fp-ink);
  border-radius: 0;
  box-shadow: none;
}

:root[data-style="city"] .faq-tip-close {
  align-items: center;
  background: var(--color-tertiary);
  border: var(--fp-outline-width) solid var(--fp-ink);
  border-radius: var(--fp-card-radius);
  color: var(--color-on-tertiary);
  display: flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

@keyframes faq-sheet-up {
  0% {
    transform: translateY(100%);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes faq-sheet-fade {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .faq-tip-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--color-primary) 50%, transparent);
    z-index: 29;
    animation: faq-sheet-fade 200ms ease;
  }

  .faq-tip {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0;
    bottom: 64px;
    width: auto;
    max-width: none;
    max-height: calc(85vh - 64px);
    overflow-y: auto;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -16px 48px rgba(0, 10, 30, 0.28);
    animation: faq-sheet-up 260ms cubic-bezier(.2, 0, 0, 1);
  }

  .faq-tip::before {
    display: none;
  }

  :root[data-style="city"] .faq-tip-backdrop {
    background: color-mix(in srgb, var(--color-primary) 62%, transparent);
  }

  :root[data-style="city"] .faq-tip {
    border-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 -7px 0 color-mix(in srgb, var(--fp-ink) 26%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-tip,
  .faq-tip-backdrop {
    animation: none;
  }
}
