ferst-core 0.15.0 → 0.17.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.
Files changed (74) hide show
  1. package/NOTICE +63 -31
  2. package/README.md +13 -4
  3. package/bin/ferst-media.mjs +96 -0
  4. package/bin/ferst-modules.mjs +17 -2
  5. package/components/BlockRenderer.astro +131 -129
  6. package/components/Card.astro +53 -51
  7. package/components/MembersAccount.astro +370 -0
  8. package/components/PostCard.astro +138 -136
  9. package/components/SiteHeader.astro +32 -14
  10. package/components/blocks/Grid.astro +49 -48
  11. package/components/blocks/Heading.astro +4 -1
  12. package/components/islands/BookMonth.tsx +95 -0
  13. package/components/islands/MembersAccount.tsx +392 -0
  14. package/components/recipes/Banner.astro +146 -146
  15. package/components/recipes/Book.astro +1147 -926
  16. package/components/recipes/FeatureCards.astro +112 -118
  17. package/components/recipes/Gallery.astro +57 -59
  18. package/components/recipes/Hero.astro +112 -10
  19. package/components/recipes/LatestPosts.astro +295 -292
  20. package/components/recipes/Locations.astro +146 -143
  21. package/components/recipes/Marquee.astro +75 -75
  22. package/components/recipes/MediaCards.astro +213 -219
  23. package/components/recipes/MembersContent.astro +176 -0
  24. package/components/recipes/Pricing.astro +149 -150
  25. package/components/recipes/Stats.astro +150 -157
  26. package/components/recipes/Tiles.astro +342 -296
  27. package/content/blocks.ts +1091 -1024
  28. package/content/cookies.ts +14 -0
  29. package/content/imageSlots.mjs +542 -0
  30. package/content/recipe-questions.ts +81 -80
  31. package/content/schemas.ts +13 -11
  32. package/examples/recipes.ts +5 -0
  33. package/fonts/OFL.txt +1332 -287
  34. package/fonts/anton-latin-400-normal.woff2 +0 -0
  35. package/fonts/bangers-latin-400-normal.woff2 +0 -0
  36. package/fonts/bebas-neue-latin-400-normal.woff2 +0 -0
  37. package/fonts/bowlby-one-latin-400-normal.woff2 +0 -0
  38. package/fonts/fredoka-latin-400-normal.woff2 +0 -0
  39. package/fonts/fredoka-latin-600-normal.woff2 +0 -0
  40. package/fonts/fredoka-latin-700-normal.woff2 +0 -0
  41. package/fonts/knewave-latin-400-normal.woff2 +0 -0
  42. package/fonts/lora-latin-400-normal.woff2 +0 -0
  43. package/fonts/lora-latin-600-normal.woff2 +0 -0
  44. package/fonts/lora-latin-700-normal.woff2 +0 -0
  45. package/fonts/merriweather-latin-400-normal.woff2 +0 -0
  46. package/fonts/merriweather-latin-600-normal.woff2 +0 -0
  47. package/fonts/merriweather-latin-700-normal.woff2 +0 -0
  48. package/fonts/nunito-latin-400-normal.woff2 +0 -0
  49. package/fonts/nunito-latin-600-normal.woff2 +0 -0
  50. package/fonts/nunito-latin-700-normal.woff2 +0 -0
  51. package/fonts/oswald-latin-400-normal.woff2 +0 -0
  52. package/fonts/oswald-latin-600-normal.woff2 +0 -0
  53. package/fonts/oswald-latin-700-normal.woff2 +0 -0
  54. package/fonts/rubik-dirt-latin-400-normal.woff2 +0 -0
  55. package/integration.mjs +319 -263
  56. package/layouts/Base.astro +8 -16
  57. package/lib/book.ts +416 -378
  58. package/lib/fonts.ts +130 -0
  59. package/lib/gridRows.ts +197 -0
  60. package/lib/image-fields.ts +140 -0
  61. package/lib/image-size.mjs +108 -73
  62. package/lib/image-sizes.ts +16 -0
  63. package/lib/logo-header.ts +46 -0
  64. package/lib/media-check.mjs +524 -0
  65. package/lib/members-account.ts +276 -0
  66. package/lib/members.ts +115 -0
  67. package/lib/theme-preview.ts +203 -140
  68. package/lib/themeTokens.ts +235 -220
  69. package/package.json +80 -71
  70. package/routes/account.astro +16 -0
  71. package/routes/cookie-policy.astro +28 -28
  72. package/styles/fonts.css +239 -76
  73. package/styles/theme.css +228 -160
  74. package/lib/gridColumns.ts +0 -22
@@ -0,0 +1,370 @@
1
+ ---
2
+ /**
3
+ * MembersAccount — the members' account page's content (`/account`, the Ferst Members module):
4
+ * signing in with an emailed code, and the member's own account. The page's title is built; the
5
+ * rest is a React island (components/islands/MembersAccount.tsx, docs/BLOCK-ARCHITECTURE.md §8),
6
+ * drawn in the browser only, since it all depends on who is visiting. The island brings no look of
7
+ * its own: this file styles it from the site's tokens, in light and dark, and with the site's field
8
+ * treatment (`data-field` on <html>).
9
+ *
10
+ * Used by the injected route (routes/account.astro) and the showcase.
11
+ */
12
+ import MembersAccountIsland from './islands/MembersAccount.tsx';
13
+ import { ACCOUNT_TEXT } from '../lib/members-account';
14
+ ---
15
+
16
+ <section class="m-account" aria-labelledby="m-account-title">
17
+ <h1 id="m-account-title" class="m-account__title">{ACCOUNT_TEXT.title}</h1>
18
+ <MembersAccountIsland client:only="react">
19
+ <p slot="fallback" class="m-account__wait">{ACCOUNT_TEXT.loading}</p>
20
+ </MembersAccountIsland>
21
+ <noscript><p class="m-account__notice">{ACCOUNT_TEXT.noScript}</p></noscript>
22
+ </section>
23
+
24
+ <style is:global>
25
+ /* The island's markup isn't the build's, so these rules are global, every one under .m-account. */
26
+ .m-account {
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 1.25rem;
30
+ max-width: 34rem;
31
+ margin: 0 auto;
32
+ padding: clamp(2rem, 6vw, 4rem) 1rem;
33
+ color: var(--fg);
34
+ box-sizing: border-box;
35
+ }
36
+ .m-account__title {
37
+ margin: 0;
38
+ font-family: var(--font-heading);
39
+ font-size: clamp(1.75rem, 4vw, 2.25rem);
40
+ line-height: 1.2;
41
+ color: var(--fg);
42
+ }
43
+ .m-account__app,
44
+ .m-account__card {
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: 1.1rem;
48
+ }
49
+ .m-account__card {
50
+ padding: clamp(1.25rem, 4vw, 2rem);
51
+ border: var(--card-border, 1px solid var(--border));
52
+ border-radius: var(--radius);
53
+ background: var(--bg-surface);
54
+ box-shadow: var(--shadow-sm);
55
+ }
56
+ .m-account__step,
57
+ .m-account__part-title {
58
+ margin: 0;
59
+ font-family: var(--font-heading);
60
+ font-size: 1.25rem;
61
+ line-height: 1.3;
62
+ color: var(--fg);
63
+ overflow-wrap: anywhere;
64
+ }
65
+ .m-account__part-title {
66
+ font-size: 1.05rem;
67
+ }
68
+ .m-account__step:focus {
69
+ outline: none;
70
+ }
71
+ .m-account__step:focus-visible {
72
+ outline: 2px solid var(--gold);
73
+ outline-offset: 4px;
74
+ }
75
+ .m-account__intro,
76
+ .m-account__status,
77
+ .m-account__wait,
78
+ .m-account__back {
79
+ margin: 0;
80
+ line-height: 1.6;
81
+ }
82
+ .m-account__intro,
83
+ .m-account__wait {
84
+ color: var(--muted);
85
+ }
86
+ .m-account__status {
87
+ font-weight: 600;
88
+ }
89
+ .m-account__welcome {
90
+ margin: 0;
91
+ padding: 1rem 1.1rem;
92
+ border-inline-start: 4px solid var(--gold);
93
+ border-radius: var(--radius-sm);
94
+ background: var(--bg-section);
95
+ line-height: 1.6;
96
+ white-space: pre-line;
97
+ }
98
+ .m-account a {
99
+ color: var(--accent);
100
+ text-decoration: underline;
101
+ text-underline-offset: 0.15em;
102
+ }
103
+ .m-account a:focus-visible {
104
+ outline: 2px solid var(--gold);
105
+ outline-offset: 2px;
106
+ border-radius: 2px;
107
+ }
108
+
109
+ /* What just happened: told once, in the site's colours. */
110
+ .m-account__notice {
111
+ margin: 0;
112
+ padding: 0.85rem 1rem;
113
+ border: 1px solid var(--border);
114
+ border-radius: var(--radius-sm);
115
+ background: var(--bg-section);
116
+ color: var(--fg);
117
+ line-height: 1.5;
118
+ }
119
+ .m-account__notice--done {
120
+ border-color: var(--gold);
121
+ background: var(--gold-light);
122
+ }
123
+ .m-account__notice--error {
124
+ border-color: var(--fg);
125
+ border-inline-start-width: 4px;
126
+ }
127
+
128
+ /* Fields, as every form on the site has them (the ContactForm's treatment). */
129
+ .m-account__form {
130
+ display: flex;
131
+ flex-direction: column;
132
+ gap: 1rem;
133
+ }
134
+ .m-account__form--row {
135
+ flex-flow: row wrap;
136
+ align-items: flex-end;
137
+ }
138
+ .m-account__form--row .m-account__field {
139
+ flex: 1 1 14rem;
140
+ }
141
+ .m-account__field {
142
+ display: flex;
143
+ flex-direction: column;
144
+ gap: 0.4rem;
145
+ }
146
+ .m-account__label {
147
+ font-family: var(--font-body);
148
+ font-size: 0.9375rem;
149
+ font-weight: 600;
150
+ color: var(--fg);
151
+ }
152
+ .m-account__hint {
153
+ font-size: 0.875rem;
154
+ color: var(--muted);
155
+ line-height: 1.5;
156
+ }
157
+ .m-account__error {
158
+ margin: 0;
159
+ font-size: 0.9rem;
160
+ font-weight: 600;
161
+ color: var(--fg);
162
+ line-height: 1.5;
163
+ }
164
+ .m-account__error::before {
165
+ content: '! ';
166
+ color: var(--gold);
167
+ }
168
+ .m-account__input {
169
+ font: inherit;
170
+ font-size: 1rem;
171
+ color: var(--fg);
172
+ background: var(--field-bg, var(--bg-surface));
173
+ border: var(--field-border, 1px solid var(--border));
174
+ border-radius: var(--field-radius, var(--radius-sm));
175
+ padding: 0.7rem 0.85rem;
176
+ width: 100%;
177
+ box-sizing: border-box;
178
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
179
+ }
180
+ .m-account__input--code {
181
+ max-width: 14rem;
182
+ font-family: var(--font-mono);
183
+ font-size: 1.35rem;
184
+ letter-spacing: 0.3em;
185
+ font-variant-numeric: tabular-nums;
186
+ }
187
+ .m-account__input:focus {
188
+ outline: none;
189
+ border-color: var(--gold);
190
+ box-shadow: 0 0 0 3px var(--gold-light);
191
+ }
192
+ .m-account__input[aria-invalid='true'] {
193
+ border-color: var(--fg);
194
+ border-width: 2px;
195
+ }
196
+ html[data-field='filled'] .m-account__input {
197
+ background: var(--bg-section);
198
+ border-color: transparent;
199
+ }
200
+ html[data-field='underline'] .m-account__input {
201
+ background: transparent;
202
+ border: none;
203
+ border-bottom: 1.5px solid var(--border);
204
+ border-radius: 0;
205
+ padding-inline: 0;
206
+ }
207
+ html[data-field='underline'] .m-account__input:focus {
208
+ border-bottom-color: var(--gold);
209
+ box-shadow: none;
210
+ }
211
+
212
+ /* The terms box: React Aria's tick box (a real, visually hidden checkbox), drawn here. */
213
+ .m-account__agree {
214
+ display: flex;
215
+ flex-direction: column;
216
+ gap: 0.4rem;
217
+ }
218
+ .m-account__check {
219
+ display: inline-flex;
220
+ align-items: flex-start;
221
+ gap: 0.65rem;
222
+ line-height: 1.5;
223
+ cursor: pointer;
224
+ }
225
+ .m-account__box {
226
+ flex: none;
227
+ display: grid;
228
+ place-items: center;
229
+ width: 1.25rem;
230
+ height: 1.25rem;
231
+ margin-top: 0.1rem;
232
+ border: 2px solid var(--fg);
233
+ border-radius: calc(var(--radius-sm) * 0.5);
234
+ background: var(--bg-surface);
235
+ box-sizing: border-box;
236
+ }
237
+ .m-account__box svg {
238
+ width: 0.9rem;
239
+ height: 0.9rem;
240
+ fill: none;
241
+ stroke: var(--on-brand);
242
+ stroke-width: 3;
243
+ stroke-linecap: round;
244
+ stroke-linejoin: round;
245
+ visibility: hidden;
246
+ }
247
+ .m-account__check[data-selected] .m-account__box {
248
+ background: var(--gold);
249
+ border-color: var(--gold);
250
+ }
251
+ .m-account__check[data-selected] .m-account__box svg {
252
+ visibility: visible;
253
+ }
254
+ .m-account__check[data-focus-visible] .m-account__box {
255
+ outline: 2px solid var(--gold);
256
+ outline-offset: 2px;
257
+ }
258
+ .m-account__check[data-invalid] .m-account__box {
259
+ border-width: 3px;
260
+ }
261
+ .m-account__links {
262
+ display: flex;
263
+ flex-wrap: wrap;
264
+ gap: 0.25rem 1rem;
265
+ margin: 0 0 0 1.9rem;
266
+ font-size: 0.9rem;
267
+ }
268
+
269
+ /* Buttons: the main one filled in the site's accent; the others quieter. */
270
+ .m-account__row {
271
+ display: flex;
272
+ flex-wrap: wrap;
273
+ align-items: center;
274
+ gap: 0.75rem 1.25rem;
275
+ }
276
+ .m-account__go,
277
+ .m-account__plain,
278
+ .m-account__danger {
279
+ align-self: flex-start;
280
+ min-height: 44px;
281
+ padding: 0.6rem 1.25rem;
282
+ font: inherit;
283
+ font-family: var(--font-heading);
284
+ font-weight: 600;
285
+ border-radius: var(--radius-sm);
286
+ cursor: pointer;
287
+ box-sizing: border-box;
288
+ touch-action: manipulation;
289
+ }
290
+ .m-account__go {
291
+ border: 2px solid var(--gold);
292
+ background: var(--gold);
293
+ color: var(--on-brand);
294
+ }
295
+ .m-account__go[data-hovered] {
296
+ background: color-mix(in srgb, var(--gold) 85%, #000);
297
+ border-color: color-mix(in srgb, var(--gold) 85%, #000);
298
+ }
299
+ .m-account__plain {
300
+ border: 2px solid var(--fg);
301
+ background: transparent;
302
+ color: var(--fg);
303
+ }
304
+ .m-account__plain[data-hovered] {
305
+ border-color: var(--gold);
306
+ color: var(--gold);
307
+ }
308
+ .m-account__danger {
309
+ border: 2px solid var(--fg);
310
+ background: var(--fg);
311
+ color: var(--bg-surface);
312
+ }
313
+ .m-account__link {
314
+ padding: 0.25rem 0;
315
+ border: 0;
316
+ background: none;
317
+ color: var(--fg);
318
+ font: inherit;
319
+ text-decoration: underline;
320
+ text-underline-offset: 0.15em;
321
+ cursor: pointer;
322
+ }
323
+ .m-account__link--danger {
324
+ color: var(--muted);
325
+ }
326
+ .m-account__go[data-focus-visible],
327
+ .m-account__plain[data-focus-visible],
328
+ .m-account__danger[data-focus-visible],
329
+ .m-account__link[data-focus-visible] {
330
+ outline: 2px solid var(--gold);
331
+ outline-offset: 2px;
332
+ }
333
+ .m-account [data-disabled],
334
+ .m-account [data-pending] {
335
+ opacity: 0.55;
336
+ cursor: default;
337
+ }
338
+
339
+ .m-account__part {
340
+ padding-top: 1.25rem;
341
+ border-top: 1px solid var(--border);
342
+ }
343
+ section.m-account__part {
344
+ display: flex;
345
+ flex-direction: column;
346
+ gap: 0.85rem;
347
+ }
348
+ .m-account__delete {
349
+ padding: 1rem 1.1rem;
350
+ border: 1px solid var(--border);
351
+ border-radius: var(--radius-sm);
352
+ background: var(--bg-section);
353
+ }
354
+ .m-account__sr {
355
+ position: absolute;
356
+ width: 1px;
357
+ height: 1px;
358
+ margin: -1px;
359
+ padding: 0;
360
+ overflow: hidden;
361
+ clip: rect(0 0 0 0);
362
+ white-space: nowrap;
363
+ border: 0;
364
+ }
365
+ @media (prefers-reduced-motion: reduce) {
366
+ .m-account__input {
367
+ transition: none;
368
+ }
369
+ }
370
+ </style>
@@ -1,136 +1,138 @@
1
- ---
2
- /**
3
- * PostCard — a post preview for the news index and tag pages. Token-driven (radius,
4
- * border, shadow, colours all from the theme), equal-height in a grid, with the
5
- * whole card clickable via a stretched title link.
6
- */
7
- interface Props {
8
- href: string;
9
- title: string;
10
- date: Date | string;
11
- summary?: string;
12
- heroImage?: string;
13
- /** Optional tag labels shown as a small eyebrow. */
14
- tagLabels?: string[];
15
- /** Open the link in a new tab (e.g. a post that's just an attached PDF). */
16
- newTab?: boolean;
17
- /** The call-to-action label (default "Read more"). */
18
- moreLabel?: string;
19
- }
20
- const { href, title, date, summary, heroImage, tagLabels = [], newTab = false, moreLabel = 'Read more' } = Astro.props;
21
- const linkRel = newTab ? 'noopener' : undefined;
22
- const linkTarget = newTab ? '_blank' : undefined;
23
- const d = date instanceof Date ? date : new Date(date);
24
- const iso = Number.isNaN(d.valueOf()) ? undefined : d.toISOString().slice(0, 10);
25
- const display = Number.isNaN(d.valueOf())
26
- ? ''
27
- : d.toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' });
28
- ---
29
-
30
- <article class="b-post-card">
31
- {heroImage && (
32
- <a class="b-post-card__media" href={href} target={linkTarget} rel={linkRel} tabindex="-1" aria-hidden="true">
33
- <img src={heroImage} alt="" loading="lazy" />
34
- </a>
35
- )}
36
- <div class="b-post-card__body">
37
- <div class="b-post-card__meta">
38
- {tagLabels.length > 0 && <span class="b-post-card__eyebrow">{tagLabels[0]}</span>}
39
- {display && <time datetime={iso}>{display}</time>}
40
- </div>
41
- <h3 class="b-post-card__title">
42
- <a href={href} target={linkTarget} rel={linkRel}>{title}</a>
43
- </h3>
44
- {summary && <p class="b-post-card__summary">{summary}</p>}
45
- <span class="b-post-card__more" aria-hidden="true">{moreLabel}</span>
46
- </div>
47
- </article>
48
-
49
- <style>
50
- .b-post-card {
51
- display: flex;
52
- flex-direction: column;
53
- background: var(--bg-surface);
54
- border: var(--card-border);
55
- border-radius: var(--radius);
56
- box-shadow: var(--shadow-sm);
57
- overflow: hidden;
58
- position: relative;
59
- transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
60
- }
61
- .b-post-card:hover {
62
- transform: translateY(-2px);
63
- box-shadow: var(--shadow-md);
64
- border-color: var(--gold);
65
- }
66
- .b-post-card__media {
67
- display: block;
68
- position: relative;
69
- aspect-ratio: 16 / 9;
70
- overflow: hidden;
71
- background: var(--bg-section);
72
- }
73
- /* Absolutely-positioned + object-fit:cover so ANY source ratio is cropped to a
74
- uniform 16:9 tile — never stretched, never overflowing into the text. The
75
- compound selector (and inset/size) also out-specifies the global
76
- `img { height:auto }` in Base, which otherwise lets tall images blow the box. */
77
- .b-post-card .b-post-card__media img {
78
- position: absolute;
79
- inset: 0;
80
- width: 100%;
81
- height: 100%;
82
- object-fit: cover;
83
- display: block;
84
- }
85
- .b-post-card__body {
86
- display: flex;
87
- flex-direction: column;
88
- gap: 0.5rem;
89
- padding: 1.1rem 1.2rem 1.3rem;
90
- flex: 1;
91
- }
92
- .b-post-card__meta {
93
- display: flex;
94
- flex-wrap: wrap;
95
- align-items: center;
96
- gap: 0.5rem 0.75rem;
97
- }
98
- .b-post-card__eyebrow {
99
- font-family: var(--font-heading);
100
- font-size: 0.7rem;
101
- font-weight: 600;
102
- letter-spacing: 0.08em;
103
- text-transform: uppercase;
104
- color: var(--gold);
105
- }
106
- .b-post-card__title {
107
- margin: 0;
108
- }
109
- /* Stretch the title link over the whole card so the card is clickable, while
110
- the meta/summary stay selectable. */
111
- .b-post-card__title a::after {
112
- content: '';
113
- position: absolute;
114
- inset: 0;
115
- }
116
- .b-post-card__title a {
117
- color: var(--fg);
118
- }
119
- .b-post-card:hover .b-post-card__title a {
120
- color: var(--gold);
121
- }
122
- .b-post-card__summary {
123
- margin: 0;
124
- color: var(--muted);
125
- font-size: 0.95rem;
126
- line-height: 1.55;
127
- }
128
- .b-post-card__more {
129
- margin-top: auto;
130
- padding-top: 0.4rem;
131
- font-family: var(--font-heading);
132
- font-size: 0.85rem;
133
- font-weight: 600;
134
- color: var(--gold);
135
- }
136
- </style>
1
+ ---
2
+ /**
3
+ * PostCard — a post preview for the news index and tag pages. Token-driven (radius,
4
+ * border, shadow, colours all from the theme), equal-height in a grid, with the
5
+ * whole card clickable via a stretched title link.
6
+ */
7
+ interface Props {
8
+ href: string;
9
+ title: string;
10
+ date: Date | string;
11
+ summary?: string;
12
+ heroImage?: string;
13
+ /** Optional tag labels shown as a small eyebrow. */
14
+ tagLabels?: string[];
15
+ /** Open the link in a new tab (e.g. a post that's just an attached PDF). */
16
+ newTab?: boolean;
17
+ /** The call-to-action label (default "Read more"). */
18
+ moreLabel?: string;
19
+ /** Inline style, e.g. a planned grid's placement (lib/gridRows). */
20
+ style?: string;
21
+ }
22
+ const { href, title, date, summary, heroImage, tagLabels = [], newTab = false, moreLabel = 'Read more', style } = Astro.props;
23
+ const linkRel = newTab ? 'noopener' : undefined;
24
+ const linkTarget = newTab ? '_blank' : undefined;
25
+ const d = date instanceof Date ? date : new Date(date);
26
+ const iso = Number.isNaN(d.valueOf()) ? undefined : d.toISOString().slice(0, 10);
27
+ const display = Number.isNaN(d.valueOf())
28
+ ? ''
29
+ : d.toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' });
30
+ ---
31
+
32
+ <article class="b-post-card" style={style}>
33
+ {heroImage && (
34
+ <a class="b-post-card__media" href={href} target={linkTarget} rel={linkRel} tabindex="-1" aria-hidden="true">
35
+ <img src={heroImage} alt="" loading="lazy" />
36
+ </a>
37
+ )}
38
+ <div class="b-post-card__body">
39
+ <div class="b-post-card__meta">
40
+ {tagLabels.length > 0 && <span class="b-post-card__eyebrow">{tagLabels[0]}</span>}
41
+ {display && <time datetime={iso}>{display}</time>}
42
+ </div>
43
+ <h3 class="b-post-card__title">
44
+ <a href={href} target={linkTarget} rel={linkRel}>{title}</a>
45
+ </h3>
46
+ {summary && <p class="b-post-card__summary">{summary}</p>}
47
+ <span class="b-post-card__more" aria-hidden="true">{moreLabel}</span>
48
+ </div>
49
+ </article>
50
+
51
+ <style>
52
+ .b-post-card {
53
+ display: flex;
54
+ flex-direction: column;
55
+ background: var(--bg-surface);
56
+ border: var(--card-border);
57
+ border-radius: var(--radius);
58
+ box-shadow: var(--shadow-sm);
59
+ overflow: hidden;
60
+ position: relative;
61
+ transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
62
+ }
63
+ .b-post-card:hover {
64
+ transform: translateY(-2px);
65
+ box-shadow: var(--shadow-md);
66
+ border-color: var(--gold);
67
+ }
68
+ .b-post-card__media {
69
+ display: block;
70
+ position: relative;
71
+ aspect-ratio: 16 / 9;
72
+ overflow: hidden;
73
+ background: var(--bg-section);
74
+ }
75
+ /* Absolutely-positioned + object-fit:cover so ANY source ratio is cropped to a
76
+ uniform 16:9 tile — never stretched, never overflowing into the text. The
77
+ compound selector (and inset/size) also out-specifies the global
78
+ `img { height:auto }` in Base, which otherwise lets tall images blow the box. */
79
+ .b-post-card .b-post-card__media img {
80
+ position: absolute;
81
+ inset: 0;
82
+ width: 100%;
83
+ height: 100%;
84
+ object-fit: cover;
85
+ display: block;
86
+ }
87
+ .b-post-card__body {
88
+ display: flex;
89
+ flex-direction: column;
90
+ gap: 0.5rem;
91
+ padding: 1.1rem 1.2rem 1.3rem;
92
+ flex: 1;
93
+ }
94
+ .b-post-card__meta {
95
+ display: flex;
96
+ flex-wrap: wrap;
97
+ align-items: center;
98
+ gap: 0.5rem 0.75rem;
99
+ }
100
+ .b-post-card__eyebrow {
101
+ font-family: var(--font-heading);
102
+ font-size: 0.7rem;
103
+ font-weight: 600;
104
+ letter-spacing: 0.08em;
105
+ text-transform: uppercase;
106
+ color: var(--gold);
107
+ }
108
+ .b-post-card__title {
109
+ margin: 0;
110
+ }
111
+ /* Stretch the title link over the whole card so the card is clickable, while
112
+ the meta/summary stay selectable. */
113
+ .b-post-card__title a::after {
114
+ content: '';
115
+ position: absolute;
116
+ inset: 0;
117
+ }
118
+ .b-post-card__title a {
119
+ color: var(--fg);
120
+ }
121
+ .b-post-card:hover .b-post-card__title a {
122
+ color: var(--gold);
123
+ }
124
+ .b-post-card__summary {
125
+ margin: 0;
126
+ color: var(--muted);
127
+ font-size: 0.95rem;
128
+ line-height: 1.55;
129
+ }
130
+ .b-post-card__more {
131
+ margin-top: auto;
132
+ padding-top: 0.4rem;
133
+ font-family: var(--font-heading);
134
+ font-size: 0.85rem;
135
+ font-weight: 600;
136
+ color: var(--gold);
137
+ }
138
+ </style>