|
34 | 34 | border: 1px solid var(--border-default); |
35 | 35 | box-shadow: 0 4px 16px rgb(0 0 0 / 12%); |
36 | 36 | padding: 16px; |
| 37 | + padding-right: 36px; /* room for the close button */ |
37 | 38 | width: 320px; |
38 | 39 | font-family: var(--font-family-inter); |
39 | 40 | font-size: var(--fs-small); |
|
50 | 51 | font-weight: var(--fw-semibold); |
51 | 52 | } |
52 | 53 |
|
| 54 | +/* Close (X) button — top-right of every tooltip */ |
| 55 | +.glossary-term__close { |
| 56 | + position: absolute; |
| 57 | + top: 8px; |
| 58 | + right: 8px; |
| 59 | + display: flex; |
| 60 | + align-items: center; |
| 61 | + justify-content: center; |
| 62 | + width: 24px; |
| 63 | + height: 24px; |
| 64 | + padding: 0; |
| 65 | + border: none; |
| 66 | + border-radius: 4px; |
| 67 | + background: none; |
| 68 | + color: var(--text-muted); |
| 69 | + font-size: 14px; |
| 70 | + line-height: 1; |
| 71 | + cursor: pointer; |
| 72 | + transition: background var(--transition-fast), color var(--transition-fast); |
| 73 | +} |
| 74 | + |
| 75 | +.glossary-term__close:hover { |
| 76 | + background: var(--gray-100); |
| 77 | + color: var(--text-primary); |
| 78 | +} |
| 79 | + |
| 80 | +.glossary-term__close:focus-visible { |
| 81 | + outline: 2px solid var(--petroleum); |
| 82 | + outline-offset: 1px; |
| 83 | +} |
| 84 | + |
53 | 85 | .glossary-term--open > .glossary-term__tooltip { |
54 | 86 | display: block; |
55 | 87 | } |
| 88 | + |
| 89 | +/* Tooltip with an embedded explainer video — wider so the 16:9 frame is legible. |
| 90 | + Anchored below the term: the video makes it tall, and the glossary terms sit |
| 91 | + near the top of the body text where there isn't room to open upward. */ |
| 92 | +.glossary-term__tooltip--video { |
| 93 | + width: 360px; |
| 94 | + bottom: auto; |
| 95 | + top: calc(100% + 8px); |
| 96 | +} |
| 97 | + |
| 98 | +.glossary-video { |
| 99 | + position: relative; |
| 100 | + display: block; |
| 101 | + width: 100%; |
| 102 | + aspect-ratio: 16 / 9; |
| 103 | + margin-bottom: 12px; |
| 104 | + border: none; |
| 105 | + padding: 0; |
| 106 | + border-radius: 6px; |
| 107 | + overflow: hidden; |
| 108 | + cursor: pointer; |
| 109 | + /* Mock poster frame — brand-tinted gradient stands in for a real thumbnail */ |
| 110 | + background: linear-gradient(135deg, var(--petroleum-900) 0%, var(--petroleum) 100%); |
| 111 | + color: var(--white); |
| 112 | + font-family: var(--font-family-inter); |
| 113 | +} |
| 114 | + |
| 115 | +.glossary-video__play { |
| 116 | + position: absolute; |
| 117 | + top: 50%; |
| 118 | + left: 50%; |
| 119 | + transform: translate(-50%, -50%); |
| 120 | + width: 48px; |
| 121 | + height: 48px; |
| 122 | + display: flex; |
| 123 | + align-items: center; |
| 124 | + justify-content: center; |
| 125 | + border-radius: 50%; |
| 126 | + background: rgb(255 255 255 / 92%); |
| 127 | + color: var(--petroleum-900); |
| 128 | + font-size: 18px; |
| 129 | + padding-left: 3px; /* optically center the triangle */ |
| 130 | + transition: transform var(--transition-fast), background var(--transition-fast); |
| 131 | +} |
| 132 | + |
| 133 | +.glossary-video:hover .glossary-video__play, |
| 134 | +.glossary-video:focus-visible .glossary-video__play { |
| 135 | + transform: translate(-50%, -50%) scale(1.08); |
| 136 | + background: var(--white); |
| 137 | +} |
| 138 | + |
| 139 | +.glossary-video:focus-visible { |
| 140 | + outline: 2px solid var(--white); |
| 141 | + outline-offset: 2px; |
| 142 | +} |
| 143 | + |
| 144 | +.glossary-video__caption { |
| 145 | + position: absolute; |
| 146 | + left: 0; |
| 147 | + right: 0; |
| 148 | + bottom: 0; |
| 149 | + padding: 8px 10px; |
| 150 | + background: linear-gradient(to top, rgb(0 0 0 / 55%), transparent); |
| 151 | + font-size: var(--fs-xs); |
| 152 | + font-weight: var(--fw-semibold); |
| 153 | + text-align: left; |
| 154 | +} |
| 155 | + |
| 156 | +.glossary-video__duration { |
| 157 | + position: absolute; |
| 158 | + top: 8px; |
| 159 | + right: 8px; |
| 160 | + padding: 2px 6px; |
| 161 | + border-radius: 4px; |
| 162 | + background: rgb(0 0 0 / 65%); |
| 163 | + font-size: var(--fs-xs); |
| 164 | + font-variant-numeric: tabular-nums; |
| 165 | +} |
| 166 | + |
| 167 | +/* Definition text under the video — keep it clearly separated and readable. |
| 168 | + A <span> (block via CSS) because the tooltip itself is an inline <span>, |
| 169 | + which cannot legally contain block elements like <p>. */ |
| 170 | +.glossary-video__text { |
| 171 | + display: block; |
| 172 | +} |
| 173 | + |
| 174 | +/* Mock "playing" note — appears under the poster when play is clicked. |
| 175 | + The poster stays in place; this just signals it's a mock. */ |
| 176 | +.glossary-video__note { |
| 177 | + display: none; |
| 178 | + margin: 0 0 12px; |
| 179 | + padding: 8px 10px; |
| 180 | + border-radius: 6px; |
| 181 | + background: var(--petroleum-100); |
| 182 | + color: var(--petroleum-900); |
| 183 | + font-size: var(--fs-xs); |
| 184 | + line-height: 16px; |
| 185 | +} |
| 186 | + |
| 187 | +.glossary-video__note i { |
| 188 | + margin-right: 6px; |
| 189 | +} |
| 190 | + |
| 191 | +.glossary-term--video-played .glossary-video__note { |
| 192 | + display: block; |
| 193 | +} |
0 commit comments