ferst-core 0.15.0 → 0.16.0
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.
- package/README.md +13 -4
- package/bin/ferst-media.mjs +96 -0
- package/components/Card.astro +53 -51
- package/components/PostCard.astro +138 -136
- package/components/SiteHeader.astro +10 -14
- package/components/blocks/Grid.astro +49 -48
- package/components/blocks/Heading.astro +4 -1
- package/components/recipes/Banner.astro +146 -146
- package/components/recipes/FeatureCards.astro +112 -118
- package/components/recipes/Gallery.astro +57 -59
- package/components/recipes/Hero.astro +112 -10
- package/components/recipes/LatestPosts.astro +295 -292
- package/components/recipes/Locations.astro +146 -143
- package/components/recipes/Marquee.astro +75 -75
- package/components/recipes/MediaCards.astro +213 -219
- package/components/recipes/Pricing.astro +149 -150
- package/components/recipes/Stats.astro +150 -157
- package/components/recipes/Tiles.astro +342 -296
- package/content/blocks.ts +1072 -1024
- package/content/imageSlots.mjs +542 -0
- package/content/schemas.ts +13 -11
- package/examples/recipes.ts +4 -0
- package/fonts/OFL.txt +1332 -287
- package/fonts/anton-latin-400-normal.woff2 +0 -0
- package/fonts/bangers-latin-400-normal.woff2 +0 -0
- package/fonts/bebas-neue-latin-400-normal.woff2 +0 -0
- package/fonts/bowlby-one-latin-400-normal.woff2 +0 -0
- package/fonts/fredoka-latin-400-normal.woff2 +0 -0
- package/fonts/fredoka-latin-600-normal.woff2 +0 -0
- package/fonts/fredoka-latin-700-normal.woff2 +0 -0
- package/fonts/knewave-latin-400-normal.woff2 +0 -0
- package/fonts/lora-latin-400-normal.woff2 +0 -0
- package/fonts/lora-latin-600-normal.woff2 +0 -0
- package/fonts/lora-latin-700-normal.woff2 +0 -0
- package/fonts/merriweather-latin-400-normal.woff2 +0 -0
- package/fonts/merriweather-latin-600-normal.woff2 +0 -0
- package/fonts/merriweather-latin-700-normal.woff2 +0 -0
- package/fonts/nunito-latin-400-normal.woff2 +0 -0
- package/fonts/nunito-latin-600-normal.woff2 +0 -0
- package/fonts/nunito-latin-700-normal.woff2 +0 -0
- package/fonts/oswald-latin-400-normal.woff2 +0 -0
- package/fonts/oswald-latin-600-normal.woff2 +0 -0
- package/fonts/oswald-latin-700-normal.woff2 +0 -0
- package/fonts/rubik-dirt-latin-400-normal.woff2 +0 -0
- package/integration.mjs +4 -14
- package/layouts/Base.astro +7 -16
- package/lib/fonts.ts +130 -0
- package/lib/gridRows.ts +197 -0
- package/lib/image-fields.ts +140 -0
- package/lib/image-size.mjs +108 -73
- package/lib/image-sizes.ts +16 -0
- package/lib/logo-header.ts +46 -0
- package/lib/media-check.mjs +524 -0
- package/lib/theme-preview.ts +203 -140
- package/lib/themeTokens.ts +235 -220
- package/package.json +3 -2
- package/styles/fonts.css +239 -76
- package/styles/theme.css +228 -160
- package/lib/gridColumns.ts +0 -22
|
@@ -1,296 +1,342 @@
|
|
|
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
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{tile.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
.b-tiles__grid[data-variant='
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
.b-tiles__grid[data-variant='
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
.b-tiles__grid[data-variant='
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
background: var(--
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
background
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
content:
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.b-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
.b-tiles__grid[data-variant='image'] .b-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
.b-tiles__grid[data-variant='
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
.b-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
.b-tiles__grid[data-
|
|
271
|
-
.b-tiles__grid[data-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
.b-tiles__grid[data-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
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
|
+
* A picture tile (variant `image`, a picture with no words) is the picture alone: `fit`
|
|
12
|
+
* chooses a padded `frame` (default, the whole picture) or `bleed` (the picture is the tile,
|
|
13
|
+
* edge to edge), and `ratio` gives every picture tile one shape (cropped round its `focus`
|
|
14
|
+
* with `bleed`, contained in a `frame`).
|
|
15
|
+
*
|
|
16
|
+
* Radius, stroke and elevation come from the GLOBAL surface tokens (--radius,
|
|
17
|
+
* --card-border, --shadow-*), so tiles stay consistent with every other card and
|
|
18
|
+
* a single knob restyles them all. A tile with `href` becomes one big link.
|
|
19
|
+
* Composes the Icon primitive.
|
|
20
|
+
*/
|
|
21
|
+
import Heading from '../blocks/Heading.astro';
|
|
22
|
+
import { planGrid } from '../../lib/gridRows';
|
|
23
|
+
import Icon from '../Icon.astro';
|
|
24
|
+
import { isIconKey } from '../../lib/icons';
|
|
25
|
+
|
|
26
|
+
import { inlineMarkdown, inlineMarkdownNoLinks } from '../../lib/inline-markdown';
|
|
27
|
+
interface Tile {
|
|
28
|
+
icon?: string;
|
|
29
|
+
eyebrow?: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
text?: string;
|
|
32
|
+
href?: string;
|
|
33
|
+
linkLabel?: string;
|
|
34
|
+
image?: { src: string; alt?: string; focus?: string };
|
|
35
|
+
}
|
|
36
|
+
interface Props {
|
|
37
|
+
title?: string;
|
|
38
|
+
intro?: string;
|
|
39
|
+
columns?: 2 | 3 | 4;
|
|
40
|
+
variant?: 'outline' | 'elevated' | 'filled' | 'gradient' | 'image';
|
|
41
|
+
spotlight?: boolean;
|
|
42
|
+
fit?: 'frame' | 'bleed';
|
|
43
|
+
ratio?: 'auto' | '16/9' | '3/2' | '4/3' | '1/1' | '3/4';
|
|
44
|
+
tiles?: Tile[];
|
|
45
|
+
/** How the ragged last row lays out (lib/gridRows). */
|
|
46
|
+
lastRow?: 'auto' | 'fill' | 'center';
|
|
47
|
+
}
|
|
48
|
+
const { title, intro, columns = 3, variant = 'elevated', spotlight = false, fit = 'frame', ratio = 'auto', tiles = [], lastRow = 'auto' } = Astro.props;
|
|
49
|
+
// A set shape for picture tiles; with `bleed` the picture is cropped to it round its focus.
|
|
50
|
+
const shaped = ratio !== 'auto';
|
|
51
|
+
const crop = shaped && fit === 'bleed';
|
|
52
|
+
// Headings stay in order: items sit one level under the block's title, or take its place.
|
|
53
|
+
const ItemHeading = title ? 'h3' : 'h2';
|
|
54
|
+
// Alignment overrides (BlockLayout): the title + intro default to centred; the block's
|
|
55
|
+
// own `align`, or `headingAlign` for the title alone, overrides it from the page data.
|
|
56
|
+
const { align: blockAlign, headingAlign } = Astro.props as { align?: 'start' | 'center' | 'end'; headingAlign?: 'start' | 'center' | 'end' };
|
|
57
|
+
const headAlign = headingAlign ?? blockAlign ?? 'center';
|
|
58
|
+
// Rows planned per screen (lib/gridRows); `data-single` centres a lone tile.
|
|
59
|
+
// Picture tiles keep a larger readable minimum than worded ones.
|
|
60
|
+
const plan = planGrid(tiles.length, { columns, item: variant === 'image' ? 'pictureTiles' : 'tiles', lastRow });
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
<section class="b-tiles">
|
|
64
|
+
{(title || intro) && (
|
|
65
|
+
<div class="b-tiles__head" data-recipe-head data-content-align={headAlign}>
|
|
66
|
+
{title && <Heading text={title} level={2} />}
|
|
67
|
+
{intro && <p class="b-tiles__intro" set:html={inlineMarkdown(intro)} />}
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
<div class="b-tiles__grid ferst-rows" data-cols={plan.cols} data-single={tiles.length === 1 ? 'true' : undefined} data-variant={variant} data-spotlight={spotlight ? 'true' : 'false'} data-fit={fit} data-ratio={shaped ? ratio : undefined} style={[plan.gridStyle, shaped && `--tile-ratio: ${ratio.replace('/', ' / ')}`].filter(Boolean).join('; ')}>
|
|
71
|
+
{tiles.map((tile, i) => {
|
|
72
|
+
const Tag = tile.href ? 'a' : 'div';
|
|
73
|
+
// A picture tile: an image with no words, shown WHOLE as a real <img> (posters,
|
|
74
|
+
// wide logos, badges must never be cropped), its alt naming the tile / link.
|
|
75
|
+
const plain = variant === 'image' && !!tile.image && !tile.title && !tile.text && !tile.eyebrow;
|
|
76
|
+
const bg =
|
|
77
|
+
variant === 'image' && tile.image && !plain
|
|
78
|
+
? `--tile-image: url('${tile.image.src}')${tile.image.focus ? `; --tile-focus: ${tile.image.focus}` : ''}`
|
|
79
|
+
: undefined;
|
|
80
|
+
return (
|
|
81
|
+
<Tag
|
|
82
|
+
class="b-tile"
|
|
83
|
+
href={tile.href}
|
|
84
|
+
style={[bg, plan.itemStyles[i]].filter(Boolean).join('; ') || undefined}
|
|
85
|
+
data-plain={plain ? 'true' : undefined}
|
|
86
|
+
>
|
|
87
|
+
{plain && <img class="b-tile__picture" src={tile.image!.src} alt={tile.image!.alt ?? ''} loading="lazy" decoding="async" style={crop && tile.image!.focus ? `object-position: ${tile.image!.focus}` : undefined} />}
|
|
88
|
+
{tile.icon && isIconKey(tile.icon) && (
|
|
89
|
+
<span class="b-tile__icon"><Icon name={tile.icon} size={26} /></span>
|
|
90
|
+
)}
|
|
91
|
+
{tile.eyebrow && <span class="b-tile__eyebrow">{tile.eyebrow}</span>}
|
|
92
|
+
{tile.title && <ItemHeading class="b-tile__title">{tile.title}</ItemHeading>}
|
|
93
|
+
{/* A linked tile is one big link: its text keeps breaks and emphasis, no inner links. */}
|
|
94
|
+
{tile.text && <p class="b-tile__text" set:html={tile.href ? inlineMarkdownNoLinks(tile.text) : inlineMarkdown(tile.text)} />}
|
|
95
|
+
{tile.href && !plain && <span class="b-tile__more" aria-hidden="true">{tile.linkLabel ?? 'Learn more'} →</span>}
|
|
96
|
+
</Tag>
|
|
97
|
+
);
|
|
98
|
+
})}
|
|
99
|
+
</div>
|
|
100
|
+
</section>
|
|
101
|
+
|
|
102
|
+
<style>
|
|
103
|
+
.b-tiles {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
gap: 2rem;
|
|
107
|
+
/* The full content width: a grid of pictures with a set shape has no width of its own,
|
|
108
|
+
and would otherwise shrink to fit its title. */
|
|
109
|
+
width: 100%;
|
|
110
|
+
max-width: 72rem;
|
|
111
|
+
margin-inline: auto;
|
|
112
|
+
padding-inline: 1rem;
|
|
113
|
+
}
|
|
114
|
+
.b-tiles__head {
|
|
115
|
+
max-width: var(--max);
|
|
116
|
+
margin-inline: auto;
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-direction: column;
|
|
119
|
+
gap: 0.75rem;
|
|
120
|
+
}
|
|
121
|
+
.b-tiles__intro {
|
|
122
|
+
margin: 0;
|
|
123
|
+
color: var(--muted);
|
|
124
|
+
font-size: 1.0625rem;
|
|
125
|
+
line-height: 1.6;
|
|
126
|
+
}
|
|
127
|
+
.b-tiles__grid {
|
|
128
|
+
display: grid;
|
|
129
|
+
gap: 1.25rem;
|
|
130
|
+
}
|
|
131
|
+
/* A solitary tile is a centred feature, not a full-width slab. */
|
|
132
|
+
.b-tiles__grid[data-single] { max-width: 26rem; margin-inline: auto; }
|
|
133
|
+
/* Rows come from lib/gridRows (the global .ferst-rows rules): even rows where the
|
|
134
|
+
count allows by using fewer columns, else full rows and a tidied last row. */
|
|
135
|
+
|
|
136
|
+
/* Base tile — radius/stroke/shadow all from the global surface tokens. */
|
|
137
|
+
.b-tile {
|
|
138
|
+
position: relative;
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
align-items: var(--content-items, stretch); /* follows the page / section alignment */
|
|
142
|
+
gap: 0.5rem;
|
|
143
|
+
padding: 1.5rem;
|
|
144
|
+
border-radius: var(--radius);
|
|
145
|
+
background: var(--bg-surface);
|
|
146
|
+
color: var(--fg);
|
|
147
|
+
text-decoration: none;
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
isolation: isolate;
|
|
150
|
+
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* ── Variants ── */
|
|
154
|
+
.b-tiles__grid[data-variant='outline'] .b-tile {
|
|
155
|
+
border: var(--card-border);
|
|
156
|
+
}
|
|
157
|
+
.b-tiles__grid[data-variant='elevated'] .b-tile {
|
|
158
|
+
box-shadow: var(--shadow-md);
|
|
159
|
+
border: var(--card-border);
|
|
160
|
+
}
|
|
161
|
+
.b-tiles__grid[data-variant='filled'] .b-tile {
|
|
162
|
+
background: var(--gold-light);
|
|
163
|
+
}
|
|
164
|
+
.b-tiles__grid[data-variant='gradient'] .b-tile {
|
|
165
|
+
background: linear-gradient(135deg, var(--gold), var(--accent-2, var(--gold)));
|
|
166
|
+
color: var(--on-brand);
|
|
167
|
+
}
|
|
168
|
+
.b-tiles__grid[data-variant='image'] .b-tile {
|
|
169
|
+
color: #fff;
|
|
170
|
+
min-height: 15rem;
|
|
171
|
+
justify-content: flex-end;
|
|
172
|
+
background: var(--bg-section);
|
|
173
|
+
}
|
|
174
|
+
.b-tiles__grid[data-variant='image'] .b-tile::before {
|
|
175
|
+
content: '';
|
|
176
|
+
position: absolute;
|
|
177
|
+
inset: 0;
|
|
178
|
+
z-index: -1;
|
|
179
|
+
background-image: linear-gradient(to top, rgba(10, 12, 20, 0.85), rgba(10, 12, 20, 0.15)), var(--tile-image);
|
|
180
|
+
background-size: cover;
|
|
181
|
+
background-position: center, var(--tile-focus, center);
|
|
182
|
+
}
|
|
183
|
+
/* A picture tile shows the whole image, whatever its shape: no scrim, no crop. */
|
|
184
|
+
.b-tiles__grid[data-variant='image'] .b-tile[data-plain] {
|
|
185
|
+
min-height: 0;
|
|
186
|
+
justify-content: center;
|
|
187
|
+
align-items: center;
|
|
188
|
+
padding: 0.75rem;
|
|
189
|
+
background: var(--bg-surface);
|
|
190
|
+
border: var(--card-border);
|
|
191
|
+
}
|
|
192
|
+
.b-tiles__grid[data-variant='image'] .b-tile[data-plain]::before {
|
|
193
|
+
content: none;
|
|
194
|
+
}
|
|
195
|
+
.b-tile__picture {
|
|
196
|
+
display: block;
|
|
197
|
+
width: 100%;
|
|
198
|
+
height: auto;
|
|
199
|
+
max-height: 18rem;
|
|
200
|
+
object-fit: contain;
|
|
201
|
+
}
|
|
202
|
+
a.b-tile[data-plain]:focus-visible {
|
|
203
|
+
outline: 3px solid var(--accent);
|
|
204
|
+
outline-offset: 3px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* fit: bleed — the picture is the tile, edge to edge: no padding, surface or stroke; the
|
|
208
|
+
tile's own corners clip it. Each tile hugs its picture, so a row lines up at the top. */
|
|
209
|
+
.b-tiles__grid[data-variant='image'][data-fit='bleed'] .b-tile[data-plain] {
|
|
210
|
+
padding: 0;
|
|
211
|
+
background: none;
|
|
212
|
+
border: 0;
|
|
213
|
+
align-self: start;
|
|
214
|
+
}
|
|
215
|
+
.b-tiles__grid[data-fit='bleed'] .b-tile[data-plain] .b-tile__picture {
|
|
216
|
+
max-height: none; /* never letterboxed or cut short */
|
|
217
|
+
}
|
|
218
|
+
/* A linked poster still reads as a button: the hover lift casts a shadow. */
|
|
219
|
+
.b-tiles__grid[data-fit='bleed'] a.b-tile[data-plain]:hover {
|
|
220
|
+
box-shadow: var(--shadow-lg);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* ratio — every picture tile takes one shape. The picture fills it: cropped round its
|
|
224
|
+
focus with bleed, shown whole inside the frame's padding otherwise. */
|
|
225
|
+
.b-tiles__grid[data-variant='image'][data-ratio] .b-tile[data-plain] {
|
|
226
|
+
aspect-ratio: var(--tile-ratio);
|
|
227
|
+
align-self: start;
|
|
228
|
+
}
|
|
229
|
+
.b-tiles__grid[data-ratio] .b-tile[data-plain] .b-tile__picture {
|
|
230
|
+
position: absolute;
|
|
231
|
+
top: 0.75rem;
|
|
232
|
+
left: 0.75rem;
|
|
233
|
+
width: calc(100% - 1.5rem);
|
|
234
|
+
height: calc(100% - 1.5rem);
|
|
235
|
+
max-height: none;
|
|
236
|
+
object-fit: contain;
|
|
237
|
+
}
|
|
238
|
+
.b-tiles__grid[data-fit='bleed'][data-ratio] .b-tile[data-plain] .b-tile__picture {
|
|
239
|
+
top: 0;
|
|
240
|
+
left: 0;
|
|
241
|
+
width: 100%;
|
|
242
|
+
height: 100%;
|
|
243
|
+
object-fit: cover;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* Hover: only tiles that link lift. */
|
|
247
|
+
a.b-tile:hover {
|
|
248
|
+
transform: translateY(-4px);
|
|
249
|
+
}
|
|
250
|
+
.b-tiles__grid[data-variant='elevated'] a.b-tile:hover {
|
|
251
|
+
box-shadow: var(--shadow-lg);
|
|
252
|
+
}
|
|
253
|
+
.b-tiles__grid[data-variant='outline'] a.b-tile:hover {
|
|
254
|
+
border-color: var(--gold);
|
|
255
|
+
}
|
|
256
|
+
a.b-tile:focus-visible {
|
|
257
|
+
outline: 2px solid var(--gold);
|
|
258
|
+
outline-offset: 2px;
|
|
259
|
+
}
|
|
260
|
+
@media (prefers-reduced-motion: reduce) {
|
|
261
|
+
.b-tile { transition: none; }
|
|
262
|
+
a.b-tile:hover { transform: none; }
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.b-tile__icon {
|
|
266
|
+
display: inline-flex;
|
|
267
|
+
color: var(--gold);
|
|
268
|
+
margin-bottom: 0.25rem;
|
|
269
|
+
}
|
|
270
|
+
.b-tiles__grid[data-variant='gradient'] .b-tile__icon,
|
|
271
|
+
.b-tiles__grid[data-variant='image'] .b-tile__icon {
|
|
272
|
+
color: currentColor;
|
|
273
|
+
}
|
|
274
|
+
.b-tile__eyebrow {
|
|
275
|
+
font-size: 0.75rem;
|
|
276
|
+
font-weight: 700;
|
|
277
|
+
letter-spacing: 0.1em;
|
|
278
|
+
text-transform: uppercase;
|
|
279
|
+
color: var(--gold);
|
|
280
|
+
}
|
|
281
|
+
.b-tiles__grid[data-variant='gradient'] .b-tile__eyebrow,
|
|
282
|
+
.b-tiles__grid[data-variant='image'] .b-tile__eyebrow {
|
|
283
|
+
color: currentColor;
|
|
284
|
+
opacity: 0.85;
|
|
285
|
+
}
|
|
286
|
+
.b-tile__title {
|
|
287
|
+
margin: 0;
|
|
288
|
+
font-size: 1.2rem;
|
|
289
|
+
color: inherit;
|
|
290
|
+
}
|
|
291
|
+
.b-tile__text {
|
|
292
|
+
margin: 0;
|
|
293
|
+
color: var(--muted);
|
|
294
|
+
line-height: 1.6;
|
|
295
|
+
}
|
|
296
|
+
.b-tiles__grid[data-variant='gradient'] .b-tile__text,
|
|
297
|
+
.b-tiles__grid[data-variant='image'] .b-tile__text,
|
|
298
|
+
.b-tiles__grid[data-variant='filled'] .b-tile__text {
|
|
299
|
+
color: inherit;
|
|
300
|
+
opacity: 0.92;
|
|
301
|
+
}
|
|
302
|
+
.b-tile__more {
|
|
303
|
+
margin-top: auto;
|
|
304
|
+
padding-top: 0.5rem;
|
|
305
|
+
font-size: 0.85rem;
|
|
306
|
+
font-weight: 600;
|
|
307
|
+
color: var(--gold);
|
|
308
|
+
}
|
|
309
|
+
.b-tiles__grid[data-variant='gradient'] .b-tile__more,
|
|
310
|
+
.b-tiles__grid[data-variant='image'] .b-tile__more {
|
|
311
|
+
color: currentColor;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* Spotlight — a soft glow that follows the pointer on hover (opt-in). The glow
|
|
315
|
+
sits above the surface but below the content, so text stays crisp. */
|
|
316
|
+
.b-tiles__grid[data-spotlight='true'] .b-tile > * { position: relative; z-index: 1; }
|
|
317
|
+
.b-tiles__grid[data-spotlight='true'] .b-tile::after {
|
|
318
|
+
content: '';
|
|
319
|
+
position: absolute;
|
|
320
|
+
inset: 0;
|
|
321
|
+
z-index: 0;
|
|
322
|
+
border-radius: inherit;
|
|
323
|
+
background: radial-gradient(18rem 18rem at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%);
|
|
324
|
+
opacity: 0;
|
|
325
|
+
transition: opacity 0.25s ease;
|
|
326
|
+
pointer-events: none;
|
|
327
|
+
}
|
|
328
|
+
.b-tiles__grid[data-spotlight='true'] .b-tile:hover::after { opacity: 1; }
|
|
329
|
+
</style>
|
|
330
|
+
|
|
331
|
+
<script>
|
|
332
|
+
// Spotlight: track the pointer over opt-in tiles and drive the glow position.
|
|
333
|
+
if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
|
334
|
+
document.querySelectorAll<HTMLElement>('.b-tiles__grid[data-spotlight="true"] .b-tile').forEach((tile) => {
|
|
335
|
+
tile.addEventListener('pointermove', (e) => {
|
|
336
|
+
const r = tile.getBoundingClientRect();
|
|
337
|
+
tile.style.setProperty('--mx', `${((e.clientX - r.left) / r.width) * 100}%`);
|
|
338
|
+
tile.style.setProperty('--my', `${((e.clientY - r.top) / r.height) * 100}%`);
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
</script>
|