ferst-core 0.14.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/cms/config.template.yml +11 -0
- package/components/Card.astro +53 -51
- package/components/PostCard.astro +138 -136
- package/components/SiteHeader.astro +1356 -1273
- package/components/blocks/Grid.astro +49 -48
- package/components/blocks/Heading.astro +4 -1
- package/components/recipes/Banner.astro +146 -146
- package/components/recipes/Book.astro +39 -4
- package/components/recipes/FeatureCards.astro +112 -118
- package/components/recipes/Gallery.astro +57 -59
- package/components/recipes/Hero.astro +638 -533
- 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 +35 -2
- 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 +253 -249
- package/layouts/Base.astro +13 -3
- package/lib/book.ts +94 -1
- 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 -0
- 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
package/README.md
CHANGED
|
@@ -67,17 +67,26 @@ No code change; the colours live in your repo, edited by hand or in the CMS:
|
|
|
67
67
|
"corners": "rounded",
|
|
68
68
|
"elevation": "raised",
|
|
69
69
|
"stroke": "on",
|
|
70
|
-
"fields": "boxed"
|
|
70
|
+
"fields": "boxed",
|
|
71
|
+
"titleEffect": "none"
|
|
71
72
|
}
|
|
72
73
|
```
|
|
73
74
|
|
|
74
75
|
`brand` drives buttons/links/accents, `ink` text, `surface` backgrounds (cards,
|
|
75
|
-
sections and borders are tinted from it). The
|
|
76
|
-
`elevation` / `stroke` / `fields` — are set once and apply
|
|
77
|
-
|
|
76
|
+
sections and borders are tinted from it). The knobs — `corners` /
|
|
77
|
+
`elevation` / `stroke` / `fields` / `titleEffect` — are set once and apply across
|
|
78
|
+
the whole site. Set no brand and the neutral defaults stand. For the rare token that
|
|
78
79
|
must differ from what the three colours derive, `advanced.light` / `advanced.dark`
|
|
79
80
|
are raw `{ "--token": "value" }` escape hatches layered last.
|
|
80
81
|
|
|
82
|
+
Fonts are picked from a curated set of self-hosted, open-licence faces grouped by
|
|
83
|
+
mood (`lib/fonts.ts`: clean, rounded, serif, bold condensed, punchy, brush), each
|
|
84
|
+
offered only for the roles it suits; poster and brush faces are for display titles,
|
|
85
|
+
never body text. A face downloads only when a page uses it. `titleEffect` (`none`,
|
|
86
|
+
`stroke`, `shadow` or `glow`) gives the display titles (the opener, banners, the
|
|
87
|
+
marquee) an outline, a poster shadow or a glow in the brand colour; it never changes
|
|
88
|
+
the text colour itself, so the theme's contrast holds.
|
|
89
|
+
|
|
81
90
|
## Licence
|
|
82
91
|
|
|
83
92
|
[Business Source License 1.1](./LICENSE) from v0.2.0 (v0.1.x was Apache-2.0 and stays
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// ferst-media — the site's pictures against the places they're shown (content/imageSlots.mjs).
|
|
3
|
+
// Run it in a site's folder:
|
|
4
|
+
//
|
|
5
|
+
// npx --no-install ferst-media check # each picture used, per place: ok, fixable or remake
|
|
6
|
+
// npx --no-install ferst-media brief # the shape and size each place on this site needs
|
|
7
|
+
// npx --no-install ferst-media brief --all # every place a picture can go, used or not
|
|
8
|
+
// npx --no-install ferst-media check --json # the same, as JSON (also for brief)
|
|
9
|
+
// npx --no-install ferst-media check <folder> # a site in another folder
|
|
10
|
+
//
|
|
11
|
+
// Advice only: it never changes a picture and always exits 0, so it can't fail a build.
|
|
12
|
+
import { readFileSync, realpathSync } from 'node:fs';
|
|
13
|
+
import { join, resolve } from 'node:path';
|
|
14
|
+
import { pathToFileURL } from 'node:url';
|
|
15
|
+
import { briefSite, checkSite, formatBrief, formatCheck } from '../lib/media-check.mjs';
|
|
16
|
+
|
|
17
|
+
export const HELP = `ferst-media: the site's pictures against the places they're shown.
|
|
18
|
+
|
|
19
|
+
ferst-media check [folder] [--json]
|
|
20
|
+
Each picture the pages, posts and logo settings use, per place:
|
|
21
|
+
ok fits the place
|
|
22
|
+
fixable close to the place's shape, too big, or with a plain border baked in
|
|
23
|
+
remake too far from the shape, or too small: it needs a new version
|
|
24
|
+
and the media rules each file breaks (names in lower case with hyphens,
|
|
25
|
+
nothing wider than 2400 pixels, no location data).
|
|
26
|
+
|
|
27
|
+
ferst-media brief [folder] [--all] [--json]
|
|
28
|
+
The places this site's pages show pictures, with the shape, size and tips for
|
|
29
|
+
each: a brief for whoever supplies the pictures. --all lists every place.
|
|
30
|
+
|
|
31
|
+
Nothing is changed and the exit code is always 0. Fitting pictures to their places
|
|
32
|
+
automatically (ferst-media fit) is planned; until then, a fixable picture is trimmed,
|
|
33
|
+
cropped or scaled in any image editor.`;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* True when THIS file is run as a CLI (not imported). Each bin needs its own copy:
|
|
37
|
+
* `import.meta.url` is per file. Handles npm's `node_modules/.bin` symlink via realpath.
|
|
38
|
+
*/
|
|
39
|
+
export function isDirectInvocation(argv1) {
|
|
40
|
+
if (!argv1) return false;
|
|
41
|
+
if (import.meta.url === pathToFileURL(argv1).href) return true;
|
|
42
|
+
try {
|
|
43
|
+
return import.meta.url === pathToFileURL(realpathSync(argv1)).href;
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The command, the site's folder and the flags from the arguments. */
|
|
50
|
+
export function parseArgs(argv) {
|
|
51
|
+
const flags = new Set(argv.filter((a) => a.startsWith('--')));
|
|
52
|
+
const rest = argv.filter((a) => !a.startsWith('--'));
|
|
53
|
+
const command = ['check', 'brief'].includes(rest[0]) ? rest.shift() : rest[0] ? 'help' : 'check';
|
|
54
|
+
return { command, root: resolve(rest[0] ?? '.'), json: flags.has('--json'), all: flags.has('--all'), help: flags.has('--help') || flags.has('-h') };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** sharp, when the site has it (it comes with Astro): it finds borders baked into pictures. */
|
|
58
|
+
async function loadSharp() {
|
|
59
|
+
try {
|
|
60
|
+
return (await import('sharp')).default;
|
|
61
|
+
} catch {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function siteName(root) {
|
|
67
|
+
try {
|
|
68
|
+
const s = JSON.parse(readFileSync(join(root, 'src/content/siteSettings/index.json'), 'utf8'));
|
|
69
|
+
return s?.identity?.siteTitle || s?.identity?.shortName || '';
|
|
70
|
+
} catch {
|
|
71
|
+
return '';
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Run one command and return what it prints. */
|
|
76
|
+
export async function run(argv, { sharp } = {}) {
|
|
77
|
+
const args = parseArgs(argv);
|
|
78
|
+
if (args.help || args.command === 'help') return HELP;
|
|
79
|
+
if (args.command === 'brief') {
|
|
80
|
+
const entries = briefSite(args.root, { all: args.all });
|
|
81
|
+
return args.json ? JSON.stringify(entries, null, 2) : formatBrief(entries, { siteName: siteName(args.root) });
|
|
82
|
+
}
|
|
83
|
+
const result = await checkSite(args.root, { sharp: sharp === undefined ? await loadSharp() : sharp });
|
|
84
|
+
return args.json ? JSON.stringify(result, null, 2) : formatCheck(result);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function main() {
|
|
88
|
+
try {
|
|
89
|
+
console.log(await run(process.argv.slice(2)));
|
|
90
|
+
} catch (err) {
|
|
91
|
+
console.log(`ferst-media couldn't finish: ${err instanceof Error ? err.message : err}`);
|
|
92
|
+
}
|
|
93
|
+
process.exitCode = 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (isDirectInvocation(process.argv[1])) main();
|
package/cms/config.template.yml
CHANGED
|
@@ -81,6 +81,17 @@ collections:
|
|
|
81
81
|
- { name: secondaryLogoLight, label: Footer logo (light), widget: image, required: false }
|
|
82
82
|
- { name: secondaryLogoDark, label: Footer logo (dark), widget: image, required: false }
|
|
83
83
|
- { name: favicon, label: Browser icon, widget: image, required: false, hint: "A square image (PNG or SVG), at least 48 x 48. Leave blank to use the header logo if it's square, or the site's initial in its brand colour." }
|
|
84
|
+
- name: header
|
|
85
|
+
label: Header logo layout
|
|
86
|
+
widget: object
|
|
87
|
+
required: false
|
|
88
|
+
collapsed: true
|
|
89
|
+
hint: How big the header logo is, and whether it hangs below the bar over the top of the page (good for a round badge).
|
|
90
|
+
fields:
|
|
91
|
+
- { name: size, label: Size, widget: select, required: false, default: standard, options: [{ label: "Standard", value: standard }, { label: "Large (about twice)", value: large }, { label: "Extra large (about four times)", value: xl }] }
|
|
92
|
+
- { name: placement, label: Placement, widget: select, required: false, default: inline, options: [{ label: "Inside the bar", value: inline }, { label: "Hanging below the bar", value: overhang }] }
|
|
93
|
+
- { name: shrinkOnScroll, label: Tuck into the bar when scrolling, widget: boolean, required: false, default: true, hint: "Hanging logos only. Off keeps it hanging while visitors read." }
|
|
94
|
+
- { name: shadow, label: Soft shadow, widget: boolean, required: false, default: false, hint: "Helps a dark round badge stand out from a dark header." }
|
|
84
95
|
|
|
85
96
|
- name: navbar
|
|
86
97
|
label: Navigation
|
package/components/Card.astro
CHANGED
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
---
|
|
2
|
-
interface Props {
|
|
3
|
-
as?: string;
|
|
4
|
-
hover?: boolean;
|
|
5
|
-
padding?: string;
|
|
6
|
-
overflow?: string;
|
|
7
|
-
class?: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
border: var(--
|
|
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
|
-
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
as?: string;
|
|
4
|
+
hover?: boolean;
|
|
5
|
+
padding?: string;
|
|
6
|
+
overflow?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
/** Extra inline style, e.g. a planned grid's placement (lib/gridRows). */
|
|
9
|
+
style?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { as: Tag = 'div', hover = true, padding = '1.25rem 1.5rem', overflow = 'hidden', class: className, style } = Astro.props;
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<Tag class:list={['card', { 'card--hover': hover }, className]} style={`--card-padding: ${padding}; --card-overflow: ${overflow}${style ? `; ${style}` : ''}`}>
|
|
16
|
+
<slot />
|
|
17
|
+
</Tag>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
/* Token-driven so the global surface "knobs" (--radius / --card-border /
|
|
21
|
+
--shadow-*) restyle every card at once, in both themes. */
|
|
22
|
+
.card {
|
|
23
|
+
position: relative;
|
|
24
|
+
border-radius: var(--radius);
|
|
25
|
+
background: var(--bg-surface);
|
|
26
|
+
border: var(--card-border);
|
|
27
|
+
box-shadow: var(--shadow-md);
|
|
28
|
+
overflow: var(--card-overflow, hidden);
|
|
29
|
+
padding: var(--card-padding);
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
/* Children follow the page / section alignment (Base: --content-items). */
|
|
33
|
+
align-items: var(--content-items, stretch);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.card--hover {
|
|
37
|
+
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.card--hover:hover {
|
|
41
|
+
transform: translateY(-4px);
|
|
42
|
+
box-shadow: var(--shadow-lg);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (prefers-reduced-motion: reduce) {
|
|
46
|
+
.card--hover {
|
|
47
|
+
transition: none;
|
|
48
|
+
}
|
|
49
|
+
.card--hover:hover {
|
|
50
|
+
transform: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</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
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
font-
|
|
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
|
-
font-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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>
|