ferst-core 0.7.0 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/components/BlockRenderer.astro +6 -0
  2. package/components/Pagination.astro +51 -0
  3. package/components/blocks/Heading.astro +47 -46
  4. package/components/blocks/Prose.astro +10 -2
  5. package/components/blocks/Quote.astro +40 -38
  6. package/components/recipes/Accordion.astro +91 -84
  7. package/components/recipes/ContactCard.astro +172 -170
  8. package/components/recipes/Document.astro +152 -0
  9. package/components/recipes/FeatureCards.astro +112 -111
  10. package/components/recipes/Hero.astro +120 -8
  11. package/components/recipes/LinkRow.astro +91 -0
  12. package/components/recipes/MediaCards.astro +213 -212
  13. package/components/recipes/Notice.astro +90 -89
  14. package/components/recipes/Stats.astro +152 -145
  15. package/components/recipes/Table.astro +98 -97
  16. package/components/recipes/Tabs.astro +134 -133
  17. package/components/recipes/Tiles.astro +287 -271
  18. package/components/recipes/Timetable.astro +189 -0
  19. package/components/recipes/Video.astro +177 -157
  20. package/content/blocks.ts +68 -2
  21. package/content/cookies.ts +10 -0
  22. package/examples/primitives.ts +2 -0
  23. package/examples/recipes.ts +42 -36
  24. package/integration.mjs +83 -64
  25. package/layouts/Base.astro +481 -475
  26. package/lib/documents.ts +68 -62
  27. package/lib/embed-consent.ts +78 -73
  28. package/lib/inline-markdown.ts +12 -0
  29. package/lib/links.ts +12 -0
  30. package/lib/paginate.ts +23 -0
  31. package/lib/posts.ts +20 -2
  32. package/lib/timetable.ts +27 -0
  33. package/lib/video.ts +101 -56
  34. package/package.json +1 -1
  35. package/routes/cookie-policy.astro +27 -0
  36. package/routes/posts/index.astro +36 -31
  37. package/routes/posts/page/[page].astro +36 -0
  38. package/routes/posts/tag/[...tag].astro +41 -37
@@ -1,271 +1,287 @@
1
- ---
2
- /**
3
- * Tiles — a Level-2 recipe: a responsive grid of tiles in one of five looks,
4
- * chosen with `variant`:
5
- * outline — stroke only, no shadow (the "wireframe" look)
6
- * elevated — soft shadow, lifts on hover
7
- * filled — soft brand-tinted background
8
- * gradient — brand → derived accent-2 gradient, light text
9
- * image — full-bleed photo with a legibility scrim, light text
10
- *
11
- * Radius, stroke and elevation come from the GLOBAL surface tokens (--radius,
12
- * --card-border, --shadow-*), so tiles stay consistent with every other card and
13
- * a single knob restyles them all. A tile with `href` becomes one big link.
14
- * Composes the Icon primitive.
15
- */
16
- import Heading from '../blocks/Heading.astro';
17
- import Icon from '../Icon.astro';
18
- import { isIconKey } from '../../lib/icons';
19
-
20
- interface Tile {
21
- icon?: string;
22
- eyebrow?: string;
23
- title?: string;
24
- text?: string;
25
- href?: string;
26
- linkLabel?: string;
27
- image?: { src: string; alt?: string };
28
- }
29
- interface Props {
30
- title?: string;
31
- intro?: string;
32
- columns?: 2 | 3 | 4;
33
- variant?: 'outline' | 'elevated' | 'filled' | 'gradient' | 'image';
34
- spotlight?: boolean;
35
- tiles?: Tile[];
36
- }
37
- const { title, intro, columns = 3, variant = 'elevated', spotlight = false, tiles = [] } = Astro.props;
38
- // Never reserve more columns than there are tiles; `data-single` centres a lone one.
39
- const cols = Math.min(columns, Math.max(tiles.length, 1)) as 1 | 2 | 3 | 4;
40
- ---
41
-
42
- <section class="b-tiles">
43
- {(title || intro) && (
44
- <div class="b-tiles__head">
45
- {title && <Heading text={title} level={2} align="center" />}
46
- {intro && <p class="b-tiles__intro">{intro}</p>}
47
- </div>
48
- )}
49
- <div class="b-tiles__grid" data-cols={cols} data-single={tiles.length === 1 ? 'true' : undefined} data-variant={variant} data-spotlight={spotlight ? 'true' : 'false'}>
50
- {tiles.map((tile) => {
51
- const Tag = tile.href ? 'a' : 'div';
52
- const bg =
53
- variant === 'image' && tile.image
54
- ? `--tile-image: url('${tile.image.src}')`
55
- : undefined;
56
- // A picture tile: an image with no words — the picture itself is the tile (and
57
- // the button, when it links), named by its alt text.
58
- const plain = variant === 'image' && !!tile.image && !tile.title && !tile.text && !tile.eyebrow;
59
- return (
60
- <Tag
61
- class="b-tile"
62
- href={tile.href}
63
- style={bg}
64
- data-plain={plain ? 'true' : undefined}
65
- role={plain && !tile.href ? 'img' : undefined}
66
- aria-label={plain ? tile.image?.alt || undefined : undefined}
67
- >
68
- {tile.icon && isIconKey(tile.icon) && (
69
- <span class="b-tile__icon"><Icon name={tile.icon} size={26} /></span>
70
- )}
71
- {tile.eyebrow && <span class="b-tile__eyebrow">{tile.eyebrow}</span>}
72
- {tile.title && <h3 class="b-tile__title">{tile.title}</h3>}
73
- {tile.text && <p class="b-tile__text">{tile.text}</p>}
74
- {tile.href && !plain && <span class="b-tile__more" aria-hidden="true">{tile.linkLabel ?? 'Learn more'} &rarr;</span>}
75
- </Tag>
76
- );
77
- })}
78
- </div>
79
- </section>
80
-
81
- <style>
82
- .b-tiles {
83
- display: flex;
84
- flex-direction: column;
85
- gap: 2rem;
86
- max-width: 72rem;
87
- margin-inline: auto;
88
- padding-inline: 1rem;
89
- }
90
- .b-tiles__head {
91
- max-width: var(--max);
92
- margin-inline: auto;
93
- text-align: center;
94
- display: flex;
95
- flex-direction: column;
96
- gap: 0.75rem;
97
- }
98
- .b-tiles__intro {
99
- margin: 0;
100
- color: var(--muted);
101
- font-size: 1.0625rem;
102
- line-height: 1.6;
103
- }
104
- .b-tiles__grid {
105
- display: grid;
106
- grid-template-columns: 1fr;
107
- gap: 1.25rem;
108
- }
109
- /* A solitary tile is a centred feature, not a full-width slab. */
110
- .b-tiles__grid[data-single] { max-width: 26rem; margin-inline: auto; }
111
- @media (min-width: 48em) {
112
- .b-tiles__grid[data-cols='2'] { grid-template-columns: repeat(2, 1fr); }
113
- .b-tiles__grid[data-cols='3'] { grid-template-columns: repeat(3, 1fr); }
114
- .b-tiles__grid[data-cols='4'] { grid-template-columns: repeat(2, 1fr); }
115
- }
116
- @media (min-width: 64em) {
117
- .b-tiles__grid[data-cols='4'] { grid-template-columns: repeat(4, 1fr); }
118
- }
119
-
120
- /* Base tile — radius/stroke/shadow all from the global surface tokens. */
121
- .b-tile {
122
- position: relative;
123
- display: flex;
124
- flex-direction: column;
125
- gap: 0.5rem;
126
- padding: 1.5rem;
127
- border-radius: var(--radius);
128
- background: var(--bg-surface);
129
- color: var(--fg);
130
- text-decoration: none;
131
- overflow: hidden;
132
- isolation: isolate;
133
- transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
134
- }
135
-
136
- /* ── Variants ── */
137
- .b-tiles__grid[data-variant='outline'] .b-tile {
138
- border: var(--card-border);
139
- }
140
- .b-tiles__grid[data-variant='elevated'] .b-tile {
141
- box-shadow: var(--shadow-md);
142
- border: var(--card-border);
143
- }
144
- .b-tiles__grid[data-variant='filled'] .b-tile {
145
- background: var(--gold-light);
146
- }
147
- .b-tiles__grid[data-variant='gradient'] .b-tile {
148
- background: linear-gradient(135deg, var(--gold), var(--accent-2, var(--gold)));
149
- color: var(--text-light);
150
- }
151
- .b-tiles__grid[data-variant='image'] .b-tile {
152
- color: #fff;
153
- min-height: 15rem;
154
- justify-content: flex-end;
155
- background: var(--bg-section);
156
- }
157
- .b-tiles__grid[data-variant='image'] .b-tile::before {
158
- content: '';
159
- position: absolute;
160
- inset: 0;
161
- z-index: -1;
162
- background-image: linear-gradient(to top, rgba(10, 12, 20, 0.85), rgba(10, 12, 20, 0.15)), var(--tile-image);
163
- background-size: cover;
164
- background-position: center;
165
- }
166
- /* A picture tile shows the image as it is — no scrim, nothing over it. */
167
- .b-tiles__grid[data-variant='image'] .b-tile[data-plain]::before {
168
- background-image: var(--tile-image);
169
- }
170
- a.b-tile[data-plain]:focus-visible {
171
- outline: 3px solid var(--accent);
172
- outline-offset: 3px;
173
- }
174
-
175
- /* Hover: only tiles that link lift. */
176
- a.b-tile:hover {
177
- transform: translateY(-4px);
178
- }
179
- .b-tiles__grid[data-variant='elevated'] a.b-tile:hover {
180
- box-shadow: var(--shadow-lg);
181
- }
182
- .b-tiles__grid[data-variant='outline'] a.b-tile:hover {
183
- border-color: var(--gold);
184
- }
185
- a.b-tile:focus-visible {
186
- outline: 2px solid var(--gold);
187
- outline-offset: 2px;
188
- }
189
- @media (prefers-reduced-motion: reduce) {
190
- .b-tile { transition: none; }
191
- a.b-tile:hover { transform: none; }
192
- }
193
-
194
- .b-tile__icon {
195
- display: inline-flex;
196
- color: var(--gold);
197
- margin-bottom: 0.25rem;
198
- }
199
- .b-tiles__grid[data-variant='gradient'] .b-tile__icon,
200
- .b-tiles__grid[data-variant='image'] .b-tile__icon {
201
- color: currentColor;
202
- }
203
- .b-tile__eyebrow {
204
- font-size: 0.75rem;
205
- font-weight: 700;
206
- letter-spacing: 0.1em;
207
- text-transform: uppercase;
208
- color: var(--gold);
209
- }
210
- .b-tiles__grid[data-variant='gradient'] .b-tile__eyebrow,
211
- .b-tiles__grid[data-variant='image'] .b-tile__eyebrow {
212
- color: currentColor;
213
- opacity: 0.85;
214
- }
215
- .b-tile__title {
216
- margin: 0;
217
- font-size: 1.2rem;
218
- color: inherit;
219
- }
220
- .b-tile__text {
221
- margin: 0;
222
- color: var(--muted);
223
- line-height: 1.6;
224
- }
225
- .b-tiles__grid[data-variant='gradient'] .b-tile__text,
226
- .b-tiles__grid[data-variant='image'] .b-tile__text,
227
- .b-tiles__grid[data-variant='filled'] .b-tile__text {
228
- color: inherit;
229
- opacity: 0.92;
230
- }
231
- .b-tile__more {
232
- margin-top: auto;
233
- padding-top: 0.5rem;
234
- font-size: 0.85rem;
235
- font-weight: 600;
236
- color: var(--gold);
237
- }
238
- .b-tiles__grid[data-variant='gradient'] .b-tile__more,
239
- .b-tiles__grid[data-variant='image'] .b-tile__more {
240
- color: currentColor;
241
- }
242
-
243
- /* Spotlight — a soft glow that follows the pointer on hover (opt-in). The glow
244
- sits above the surface but below the content, so text stays crisp. */
245
- .b-tiles__grid[data-spotlight='true'] .b-tile > * { position: relative; z-index: 1; }
246
- .b-tiles__grid[data-spotlight='true'] .b-tile::after {
247
- content: '';
248
- position: absolute;
249
- inset: 0;
250
- z-index: 0;
251
- border-radius: inherit;
252
- background: radial-gradient(18rem 18rem at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%);
253
- opacity: 0;
254
- transition: opacity 0.25s ease;
255
- pointer-events: none;
256
- }
257
- .b-tiles__grid[data-spotlight='true'] .b-tile:hover::after { opacity: 1; }
258
- </style>
259
-
260
- <script>
261
- // Spotlight: track the pointer over opt-in tiles and drive the glow position.
262
- if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
263
- document.querySelectorAll<HTMLElement>('.b-tiles__grid[data-spotlight="true"] .b-tile').forEach((tile) => {
264
- tile.addEventListener('pointermove', (e) => {
265
- const r = tile.getBoundingClientRect();
266
- tile.style.setProperty('--mx', `${((e.clientX - r.left) / r.width) * 100}%`);
267
- tile.style.setProperty('--my', `${((e.clientY - r.top) / r.height) * 100}%`);
268
- });
269
- });
270
- }
271
- </script>
1
+ ---
2
+ /**
3
+ * Tiles — a Level-2 recipe: a responsive grid of tiles in one of five looks,
4
+ * chosen with `variant`:
5
+ * outline — stroke only, no shadow (the "wireframe" look)
6
+ * elevated — soft shadow, lifts on hover
7
+ * filled — soft brand-tinted background
8
+ * gradient — brand → derived accent-2 gradient, light text
9
+ * image — full-bleed photo with a legibility scrim, light text
10
+ *
11
+ * Radius, stroke and elevation come from the GLOBAL surface tokens (--radius,
12
+ * --card-border, --shadow-*), so tiles stay consistent with every other card and
13
+ * a single knob restyles them all. A tile with `href` becomes one big link.
14
+ * Composes the Icon primitive.
15
+ */
16
+ import Heading from '../blocks/Heading.astro';
17
+ import Icon from '../Icon.astro';
18
+ import { isIconKey } from '../../lib/icons';
19
+
20
+ import { inlineMarkdown, inlineMarkdownNoLinks } from '../../lib/inline-markdown';
21
+ interface Tile {
22
+ icon?: string;
23
+ eyebrow?: string;
24
+ title?: string;
25
+ text?: string;
26
+ href?: string;
27
+ linkLabel?: string;
28
+ image?: { src: string; alt?: string };
29
+ }
30
+ interface Props {
31
+ title?: string;
32
+ intro?: string;
33
+ columns?: 2 | 3 | 4;
34
+ variant?: 'outline' | 'elevated' | 'filled' | 'gradient' | 'image';
35
+ spotlight?: boolean;
36
+ tiles?: Tile[];
37
+ }
38
+ const { title, intro, columns = 3, variant = 'elevated', spotlight = false, tiles = [] } = Astro.props;
39
+ // Never reserve more columns than there are tiles; `data-single` centres a lone one.
40
+ const cols = Math.min(columns, Math.max(tiles.length, 1)) as 1 | 2 | 3 | 4;
41
+ ---
42
+
43
+ <section class="b-tiles">
44
+ {(title || intro) && (
45
+ <div class="b-tiles__head">
46
+ {title && <Heading text={title} level={2} align="center" />}
47
+ {intro && <p class="b-tiles__intro" set:html={inlineMarkdown(intro)} />}
48
+ </div>
49
+ )}
50
+ <div class="b-tiles__grid" data-cols={cols} data-single={tiles.length === 1 ? 'true' : undefined} data-variant={variant} data-spotlight={spotlight ? 'true' : 'false'}>
51
+ {tiles.map((tile) => {
52
+ const Tag = tile.href ? 'a' : 'div';
53
+ // A picture tile: an image with no words, shown WHOLE as a real <img> (posters,
54
+ // wide logos, badges must never be cropped), its alt naming the tile / link.
55
+ const plain = variant === 'image' && !!tile.image && !tile.title && !tile.text && !tile.eyebrow;
56
+ const bg =
57
+ variant === 'image' && tile.image && !plain
58
+ ? `--tile-image: url('${tile.image.src}')`
59
+ : undefined;
60
+ return (
61
+ <Tag
62
+ class="b-tile"
63
+ href={tile.href}
64
+ style={bg}
65
+ data-plain={plain ? 'true' : undefined}
66
+ >
67
+ {plain && <img class="b-tile__picture" src={tile.image!.src} alt={tile.image!.alt ?? ''} loading="lazy" decoding="async" />}
68
+ {tile.icon && isIconKey(tile.icon) && (
69
+ <span class="b-tile__icon"><Icon name={tile.icon} size={26} /></span>
70
+ )}
71
+ {tile.eyebrow && <span class="b-tile__eyebrow">{tile.eyebrow}</span>}
72
+ {tile.title && <h3 class="b-tile__title">{tile.title}</h3>}
73
+ {/* A linked tile is one big link: its text keeps breaks and emphasis, no inner links. */}
74
+ {tile.text && <p class="b-tile__text" set:html={tile.href ? inlineMarkdownNoLinks(tile.text) : inlineMarkdown(tile.text)} />}
75
+ {tile.href && !plain && <span class="b-tile__more" aria-hidden="true">{tile.linkLabel ?? 'Learn more'} &rarr;</span>}
76
+ </Tag>
77
+ );
78
+ })}
79
+ </div>
80
+ </section>
81
+
82
+ <style>
83
+ .b-tiles {
84
+ display: flex;
85
+ flex-direction: column;
86
+ gap: 2rem;
87
+ max-width: 72rem;
88
+ margin-inline: auto;
89
+ padding-inline: 1rem;
90
+ }
91
+ .b-tiles__head {
92
+ max-width: var(--max);
93
+ margin-inline: auto;
94
+ text-align: center;
95
+ display: flex;
96
+ flex-direction: column;
97
+ gap: 0.75rem;
98
+ }
99
+ .b-tiles__intro {
100
+ margin: 0;
101
+ color: var(--muted);
102
+ font-size: 1.0625rem;
103
+ line-height: 1.6;
104
+ }
105
+ .b-tiles__grid {
106
+ display: grid;
107
+ grid-template-columns: 1fr;
108
+ gap: 1.25rem;
109
+ }
110
+ /* A solitary tile is a centred feature, not a full-width slab. */
111
+ .b-tiles__grid[data-single] { max-width: 26rem; margin-inline: auto; }
112
+ @media (min-width: 48em) {
113
+ .b-tiles__grid[data-cols='2'] { grid-template-columns: repeat(2, 1fr); }
114
+ .b-tiles__grid[data-cols='3'] { grid-template-columns: repeat(3, 1fr); }
115
+ .b-tiles__grid[data-cols='4'] { grid-template-columns: repeat(2, 1fr); }
116
+ }
117
+ @media (min-width: 64em) {
118
+ .b-tiles__grid[data-cols='4'] { grid-template-columns: repeat(4, 1fr); }
119
+ }
120
+
121
+ /* Base tile — radius/stroke/shadow all from the global surface tokens. */
122
+ .b-tile {
123
+ position: relative;
124
+ display: flex;
125
+ flex-direction: column;
126
+ gap: 0.5rem;
127
+ padding: 1.5rem;
128
+ border-radius: var(--radius);
129
+ background: var(--bg-surface);
130
+ color: var(--fg);
131
+ text-decoration: none;
132
+ overflow: hidden;
133
+ isolation: isolate;
134
+ transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
135
+ }
136
+
137
+ /* ── Variants ── */
138
+ .b-tiles__grid[data-variant='outline'] .b-tile {
139
+ border: var(--card-border);
140
+ }
141
+ .b-tiles__grid[data-variant='elevated'] .b-tile {
142
+ box-shadow: var(--shadow-md);
143
+ border: var(--card-border);
144
+ }
145
+ .b-tiles__grid[data-variant='filled'] .b-tile {
146
+ background: var(--gold-light);
147
+ }
148
+ .b-tiles__grid[data-variant='gradient'] .b-tile {
149
+ background: linear-gradient(135deg, var(--gold), var(--accent-2, var(--gold)));
150
+ color: var(--text-light);
151
+ }
152
+ .b-tiles__grid[data-variant='image'] .b-tile {
153
+ color: #fff;
154
+ min-height: 15rem;
155
+ justify-content: flex-end;
156
+ background: var(--bg-section);
157
+ }
158
+ .b-tiles__grid[data-variant='image'] .b-tile::before {
159
+ content: '';
160
+ position: absolute;
161
+ inset: 0;
162
+ z-index: -1;
163
+ background-image: linear-gradient(to top, rgba(10, 12, 20, 0.85), rgba(10, 12, 20, 0.15)), var(--tile-image);
164
+ background-size: cover;
165
+ background-position: center;
166
+ }
167
+ /* A picture tile shows the whole image, whatever its shape: no scrim, no crop. */
168
+ .b-tiles__grid[data-variant='image'] .b-tile[data-plain] {
169
+ min-height: 0;
170
+ justify-content: center;
171
+ align-items: center;
172
+ padding: 0.75rem;
173
+ background: var(--bg-surface);
174
+ border: var(--card-border);
175
+ }
176
+ .b-tiles__grid[data-variant='image'] .b-tile[data-plain]::before {
177
+ content: none;
178
+ }
179
+ .b-tile__picture {
180
+ display: block;
181
+ width: 100%;
182
+ height: auto;
183
+ max-height: 18rem;
184
+ object-fit: contain;
185
+ }
186
+ a.b-tile[data-plain]:focus-visible {
187
+ outline: 3px solid var(--accent);
188
+ outline-offset: 3px;
189
+ }
190
+
191
+ /* Hover: only tiles that link lift. */
192
+ a.b-tile:hover {
193
+ transform: translateY(-4px);
194
+ }
195
+ .b-tiles__grid[data-variant='elevated'] a.b-tile:hover {
196
+ box-shadow: var(--shadow-lg);
197
+ }
198
+ .b-tiles__grid[data-variant='outline'] a.b-tile:hover {
199
+ border-color: var(--gold);
200
+ }
201
+ a.b-tile:focus-visible {
202
+ outline: 2px solid var(--gold);
203
+ outline-offset: 2px;
204
+ }
205
+ @media (prefers-reduced-motion: reduce) {
206
+ .b-tile { transition: none; }
207
+ a.b-tile:hover { transform: none; }
208
+ }
209
+
210
+ .b-tile__icon {
211
+ display: inline-flex;
212
+ color: var(--gold);
213
+ margin-bottom: 0.25rem;
214
+ }
215
+ .b-tiles__grid[data-variant='gradient'] .b-tile__icon,
216
+ .b-tiles__grid[data-variant='image'] .b-tile__icon {
217
+ color: currentColor;
218
+ }
219
+ .b-tile__eyebrow {
220
+ font-size: 0.75rem;
221
+ font-weight: 700;
222
+ letter-spacing: 0.1em;
223
+ text-transform: uppercase;
224
+ color: var(--gold);
225
+ }
226
+ .b-tiles__grid[data-variant='gradient'] .b-tile__eyebrow,
227
+ .b-tiles__grid[data-variant='image'] .b-tile__eyebrow {
228
+ color: currentColor;
229
+ opacity: 0.85;
230
+ }
231
+ .b-tile__title {
232
+ margin: 0;
233
+ font-size: 1.2rem;
234
+ color: inherit;
235
+ }
236
+ .b-tile__text {
237
+ margin: 0;
238
+ color: var(--muted);
239
+ line-height: 1.6;
240
+ }
241
+ .b-tiles__grid[data-variant='gradient'] .b-tile__text,
242
+ .b-tiles__grid[data-variant='image'] .b-tile__text,
243
+ .b-tiles__grid[data-variant='filled'] .b-tile__text {
244
+ color: inherit;
245
+ opacity: 0.92;
246
+ }
247
+ .b-tile__more {
248
+ margin-top: auto;
249
+ padding-top: 0.5rem;
250
+ font-size: 0.85rem;
251
+ font-weight: 600;
252
+ color: var(--gold);
253
+ }
254
+ .b-tiles__grid[data-variant='gradient'] .b-tile__more,
255
+ .b-tiles__grid[data-variant='image'] .b-tile__more {
256
+ color: currentColor;
257
+ }
258
+
259
+ /* Spotlight — a soft glow that follows the pointer on hover (opt-in). The glow
260
+ sits above the surface but below the content, so text stays crisp. */
261
+ .b-tiles__grid[data-spotlight='true'] .b-tile > * { position: relative; z-index: 1; }
262
+ .b-tiles__grid[data-spotlight='true'] .b-tile::after {
263
+ content: '';
264
+ position: absolute;
265
+ inset: 0;
266
+ z-index: 0;
267
+ border-radius: inherit;
268
+ background: radial-gradient(18rem 18rem at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%);
269
+ opacity: 0;
270
+ transition: opacity 0.25s ease;
271
+ pointer-events: none;
272
+ }
273
+ .b-tiles__grid[data-spotlight='true'] .b-tile:hover::after { opacity: 1; }
274
+ </style>
275
+
276
+ <script>
277
+ // Spotlight: track the pointer over opt-in tiles and drive the glow position.
278
+ if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
279
+ document.querySelectorAll<HTMLElement>('.b-tiles__grid[data-spotlight="true"] .b-tile').forEach((tile) => {
280
+ tile.addEventListener('pointermove', (e) => {
281
+ const r = tile.getBoundingClientRect();
282
+ tile.style.setProperty('--mx', `${((e.clientX - r.left) / r.width) * 100}%`);
283
+ tile.style.setProperty('--my', `${((e.clientY - r.top) / r.height) * 100}%`);
284
+ });
285
+ });
286
+ }
287
+ </script>