/* Term tooltips (glossary-powered) */

.term-tip {
  display: inline;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(148, 163, 255, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.term-tip:focus-visible {
  outline: none;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.25);
}

.term-tooltip {
  position: fixed;
  z-index: 10050; /* above cookie banner (10000) */
  max-width: min(420px, calc(100vw - 28px));
  padding: 10px 12px 11px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background:
    radial-gradient(circle at 12% 8%, rgba(79, 140, 255, 0.18), transparent 55%),
    rgba(5, 7, 19, 0.94);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(79, 140, 255, 0.12),
    0 0 22px rgba(79, 140, 255, 0.10);
  color: rgba(245, 247, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.term-tooltip[hidden] { display: none !important; }

.term-tooltip__title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(168, 180, 206, 0.95);
}
.term-tooltip__body {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(235, 242, 255, 0.92);
}
.term-tooltip__meta {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(163, 173, 199, 0.78);
}
.term-tooltip__link {
  color: rgba(168, 196, 255, 0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.term-tooltip__link:hover { color: #ffffff; }

html[data-theme="light"] .term-tip {
  text-decoration-color: rgba(37, 99, 235, 0.55);
}
html[data-theme="light"] .term-tooltip {
  border-color: rgba(15, 23, 42, 0.10);
  background:
    radial-gradient(circle at 12% 8%, rgba(59, 130, 246, 0.18), transparent 55%),
    rgba(248, 250, 252, 0.98);
  box-shadow:
    0 20px 50px rgba(2, 6, 23, 0.18),
    0 0 0 1px rgba(37, 99, 235, 0.10),
    0 0 18px rgba(37, 99, 235, 0.08);
  color: rgba(2, 6, 23, 0.95);
}
html[data-theme="light"] .term-tooltip__title { color: rgba(51, 65, 85, 0.92); }
html[data-theme="light"] .term-tooltip__body { color: rgba(15, 23, 42, 0.92); }
html[data-theme="light"] .term-tooltip__meta { color: rgba(71, 85, 105, 0.82); }
html[data-theme="light"] .term-tooltip__link { color: rgba(37, 99, 235, 0.95); }

/* Brand term highlight (matches "Методология" block vibe) */
.term-tip[data-term-id="TODOIT: System Exposure"],
.term-tip[data-term-id="TODOIT: System Exposure Framework"] {
  font-weight: inherit;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: rgba(240, 248, 255, 0.98);
  text-shadow:
    0 0 14px rgba(79, 140, 255, 0.22),
    0 0 22px rgba(139, 92, 255, 0.14);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .term-tip[data-term-id="TODOIT: System Exposure"],
  .term-tip[data-term-id="TODOIT: System Exposure Framework"] {
    background: linear-gradient(90deg, #7dd3fc 0%, #60a5fa 35%, #a78bfa 70%, #c4b5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }
}

html[data-theme="light"] .term-tip[data-term-id="TODOIT: System Exposure"],
html[data-theme="light"] .term-tip[data-term-id="TODOIT: System Exposure Framework"] {
  color: rgba(11, 18, 32, 0.92);
  text-shadow: none;
  position: relative;
  padding-bottom: 0;
}
html[data-theme="light"] .term-tip[data-term-id="TODOIT: System Exposure"]::after,
html[data-theme="light"] .term-tip[data-term-id="TODOIT: System Exposure Framework"]::after {
  content: none;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  html[data-theme="light"] .term-tip[data-term-id="TODOIT: System Exposure"],
  html[data-theme="light"] .term-tip[data-term-id="TODOIT: System Exposure Framework"] {
    background: linear-gradient(90deg, #0369a1 0%, #1d4ed8 35%, #5b21b6 70%, #6d28d9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }
}

/* In hero H1 we render the brand as headline, not as an underlined term */
.methodology-hero h1 .term-tip,
.methodology-hero h1 .term-tip:focus-visible {
  text-decoration: none;
  padding-bottom: 0;
}
.methodology-hero h1 .term-tip::after {
  content: none !important;
}

/* Hero H1: keep the same brand gradient in light theme */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  html[data-theme="light"] .methodology-hero h1 .term-tip[data-term-id="TODOIT: System Exposure"],
  html[data-theme="light"] .methodology-hero h1 .term-tip[data-term-id="TODOIT: System Exposure Framework"] {
    background: linear-gradient(90deg, #0369a1 0%, #1d4ed8 35%, #5b21b6 70%, #6d28d9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }
}

