Merge pull request 'feat(frontend): branded auth, denser home, editorial visual (BIT-26753)' (#32) from task/BIT-26753-frontend-auth-home-visual into main
feat(frontend): branded auth, denser home, editorial visual (BIT-26753) Fixes wp-login.php and /wp-admin exposure; replaces entrar/registar WP redirect with branded Astro auth pages; denser home layout. Also fixes flaky ranking.test freshness assertion (BIT-26754).
This commit was merged in pull request #32.
This commit is contained in:
commit
2528e3fa0e
16 files changed
+850
-122
No files matched your search
@@ -13,8 +13,9 @@ import type { WriterConfig } from './writer-config.js';
|
||||
// ── calculate_freshness_score ──────────────────────────────────────────────
|
||||
|
||||
test('freshness score is 1 for a brand-new article', () => {
|
||||
const now = new Date().toISOString();
|
||||
assert.equal(calculate_freshness_score(now), 1.0);
|
||||
// Use a future timestamp: ageHours < 0 → guaranteed return 1.0, no floating-point drift.
|
||||
const nearFuture = new Date(Date.now() + 1000).toISOString();
|
||||
assert.equal(calculate_freshness_score(nearFuture), 1.0);
|
||||
});
|
||||
|
||||
test('freshness score is 0 for article at or beyond maxAgeHours', () => {
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
---
|
||||
import type { DomainConfig } from '../../types/index.js';
|
||||
|
||||
interface Props {
|
||||
config: DomainConfig;
|
||||
title: string;
|
||||
lead: string;
|
||||
switchHref: string;
|
||||
switchLabel: string;
|
||||
switchPrompt: string;
|
||||
}
|
||||
|
||||
const { config, title, lead, switchHref, switchLabel, switchPrompt } = Astro.props;
|
||||
---
|
||||
<section class="auth-shell" aria-labelledby="auth-title">
|
||||
<div class="auth-shell__panel">
|
||||
<p class="auth-shell__brand">{config.site_name}</p>
|
||||
<h1 class="auth-shell__title" id="auth-title">{title}</h1>
|
||||
<p class="auth-shell__lead">{lead}</p>
|
||||
<slot />
|
||||
<p class="auth-shell__switch">
|
||||
{switchPrompt}
|
||||
{' '}
|
||||
<a href={switchHref}>{switchLabel}</a>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.auth-shell {
|
||||
min-height: calc(100dvh - var(--header-height) - 8rem);
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: var(--space-8) var(--container-pad);
|
||||
background:
|
||||
linear-gradient(165deg, color-mix(in srgb, var(--color-primary) 8%, var(--color-bg)) 0%, var(--color-bg) 45%),
|
||||
radial-gradient(ellipse 80% 50% at 100% 0%, color-mix(in srgb, var(--color-secondary) 12%, transparent), transparent 60%);
|
||||
}
|
||||
|
||||
.auth-shell__panel {
|
||||
width: min(100%, 420px);
|
||||
padding: var(--space-8) var(--space-6);
|
||||
border-left: 4px solid var(--color-primary);
|
||||
background: var(--color-bg-card);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.auth-shell__brand {
|
||||
font-family: var(--font-heading, var(--font-sans));
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--color-primary);
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.auth-shell__title {
|
||||
font-family: var(--font-heading, var(--font-serif));
|
||||
font-size: clamp(1.75rem, 4vw, 2.25rem);
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1.15;
|
||||
margin-bottom: var(--space-2);
|
||||
}
|
||||
|
||||
.auth-shell__lead {
|
||||
color: var(--color-text-muted);
|
||||
font-size: var(--text-sm);
|
||||
margin-bottom: var(--space-6);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.auth-shell__switch {
|
||||
margin-top: var(--space-6);
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.auth-shell__switch a {
|
||||
color: var(--color-primary);
|
||||
font-weight: 700;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,165 @@
|
||||
---
|
||||
import type { ArticleListItem } from '../../types/index.js';
|
||||
import { relativeTime, truncate } from '../../lib/format.js';
|
||||
import { getUiStrings } from '../../lib/ui-i18n.js';
|
||||
|
||||
interface Props {
|
||||
articles: ArticleListItem[];
|
||||
locale?: string;
|
||||
titleId?: string;
|
||||
show_more_href?: string;
|
||||
/** Prefer 24–36 near fold; slice defensively if bridge returns more. */
|
||||
max_items?: number;
|
||||
}
|
||||
|
||||
const {
|
||||
articles,
|
||||
locale = 'en-US',
|
||||
titleId = 'homepage-latest-compact-title',
|
||||
show_more_href = '/noticias',
|
||||
max_items = 36,
|
||||
} = Astro.props;
|
||||
const ui = getUiStrings(locale);
|
||||
const items = articles.slice(0, max_items);
|
||||
---
|
||||
{items.length > 0 && (
|
||||
<section class="latest-compact" aria-labelledby={titleId}>
|
||||
<div class="container">
|
||||
<div class="latest-compact__header">
|
||||
<h2 class="latest-compact__title" id={titleId}>{ui.latest_news}</h2>
|
||||
{show_more_href && (
|
||||
<a href={show_more_href} class="latest-compact__more">{ui.view_all}</a>
|
||||
)}
|
||||
</div>
|
||||
<ol class="latest-compact__list" role="list">
|
||||
{items.map((article, index) => (
|
||||
<li class="latest-compact__item">
|
||||
<span class="latest-compact__index" aria-hidden="true">
|
||||
{String(index + 1).padStart(2, '0')}
|
||||
</span>
|
||||
<div class="latest-compact__body">
|
||||
<a href={`/category/${article.category.slug}`} class="latest-compact__cat">
|
||||
{article.category.name}
|
||||
</a>
|
||||
<a href={`/article/${article.slug}`} class="latest-compact__headline">
|
||||
{truncate(article.title, 110)}
|
||||
</a>
|
||||
</div>
|
||||
<time class="latest-compact__time" datetime={article.published_at}>
|
||||
{relativeTime(article.published_at, locale)}
|
||||
</time>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<style>
|
||||
.latest-compact {
|
||||
padding: var(--space-5) 0 var(--space-6);
|
||||
border-block: 1px solid var(--color-border);
|
||||
background: color-mix(in srgb, var(--color-primary) 3%, var(--color-bg));
|
||||
}
|
||||
|
||||
.latest-compact__header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-4);
|
||||
margin-bottom: var(--space-4);
|
||||
}
|
||||
|
||||
.latest-compact__title {
|
||||
font-family: var(--font-heading, var(--font-serif));
|
||||
font-size: clamp(1.15rem, 2.2vw, 1.45rem);
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.02em;
|
||||
margin: 0;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.latest-compact__more {
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
color: var(--color-secondary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.latest-compact__more:hover {
|
||||
color: var(--color-primary);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.latest-compact__list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: 0;
|
||||
columns: 1;
|
||||
}
|
||||
|
||||
@media (min-width: 900px) {
|
||||
.latest-compact__list {
|
||||
columns: 2;
|
||||
column-gap: var(--space-8);
|
||||
}
|
||||
|
||||
.latest-compact__item {
|
||||
break-inside: avoid;
|
||||
}
|
||||
}
|
||||
|
||||
.latest-compact__item {
|
||||
display: grid;
|
||||
grid-template-columns: 2rem 1fr auto;
|
||||
gap: var(--space-3);
|
||||
align-items: start;
|
||||
padding: 0.55rem 0;
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
|
||||
}
|
||||
|
||||
.latest-compact__index {
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-size: var(--text-xs);
|
||||
font-weight: 700;
|
||||
color: var(--color-text-muted);
|
||||
padding-top: 0.2rem;
|
||||
}
|
||||
|
||||
.latest-compact__body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.15rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.latest-compact__cat {
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
color: var(--color-secondary);
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.latest-compact__headline {
|
||||
font-family: var(--font-heading, var(--font-serif));
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 700;
|
||||
line-height: 1.35;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.latest-compact__headline:hover {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.latest-compact__time {
|
||||
font-size: var(--text-xs);
|
||||
color: var(--color-text-muted);
|
||||
white-space: nowrap;
|
||||
padding-top: 0.2rem;
|
||||
}
|
||||
</style>
|
||||
@@ -66,18 +66,6 @@ const { Header, Footer } = getThemeComponents(config.theme);
|
||||
<script type="application/ld+json" set:html={JSON.stringify(schema)} />
|
||||
)}
|
||||
|
||||
<!-- Google Fonts: Inter (institutional theme) -->
|
||||
{config.theme === 'institutional' && (
|
||||
<>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
<!-- Sitemap -->
|
||||
<link rel="sitemap" href="/sitemap.xml" />
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { browserAuthPath, authApiBase, safeNextPath } from './auth.ts';
|
||||
|
||||
test('browserAuthPath uses /api/auth prefix', () => {
|
||||
assert.equal(browserAuthPath('login'), '/api/auth/login');
|
||||
assert.equal(browserAuthPath('register'), '/api/auth/register');
|
||||
assert.equal(browserAuthPath('session'), '/api/auth/session');
|
||||
assert.equal(browserAuthPath('logout'), '/api/auth/logout');
|
||||
});
|
||||
|
||||
test('authApiBase follows bridge site routing', () => {
|
||||
assert.equal(
|
||||
authApiBase('andebol.net', 'http://127.0.0.1:3200'),
|
||||
'http://andebol.net/api/auth',
|
||||
);
|
||||
assert.equal(
|
||||
authApiBase('localhost', 'http://localhost:3200'),
|
||||
'http://localhost:3200/auth',
|
||||
);
|
||||
});
|
||||
|
||||
test('safeNextPath rejects open redirects', () => {
|
||||
assert.equal(safeNextPath('/noticias'), '/noticias');
|
||||
assert.equal(safeNextPath('https://evil.example/'), '/');
|
||||
assert.equal(safeNextPath('//evil.example'), '/');
|
||||
assert.equal(safeNextPath(null), '/');
|
||||
assert.equal(safeNextPath('/ok?x=1'), '/ok?x=1');
|
||||
});
|
||||
@@ -0,0 +1,72 @@
|
||||
import { bridgeBaseForSite } from './bridge.js';
|
||||
|
||||
export interface AuthUser {
|
||||
id: number;
|
||||
username: string;
|
||||
display_name: string;
|
||||
email: string;
|
||||
avatar_url: string | null;
|
||||
roles: string[];
|
||||
}
|
||||
|
||||
export interface AuthSessionResponse {
|
||||
user: AuthUser;
|
||||
}
|
||||
|
||||
export interface AuthErrorResponse {
|
||||
error: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Browser-facing auth path (nginx proxies `/api` → bridge).
|
||||
* Prefer this from client scripts so cookies stay same-site.
|
||||
*/
|
||||
export function browserAuthPath(action: 'session' | 'login' | 'register' | 'logout'): string {
|
||||
return `/api/auth/${action}`;
|
||||
}
|
||||
|
||||
/** SSR auth base URL (same rules as homepage bridge calls). */
|
||||
export function authApiBase(
|
||||
site_host: string | null | undefined,
|
||||
bridge_endpoint: string,
|
||||
): string {
|
||||
return `${bridgeBaseForSite(site_host, bridge_endpoint)}/auth`;
|
||||
}
|
||||
|
||||
export async function fetchAuthSession(
|
||||
site_host: string | null | undefined,
|
||||
bridge_endpoint: string,
|
||||
cookie_header: string | null,
|
||||
): Promise<AuthUser | null> {
|
||||
const url = `${authApiBase(site_host, bridge_endpoint)}/session`;
|
||||
const headers: Record<string, string> = { Accept: 'application/json' };
|
||||
if (cookie_header) {
|
||||
headers['Cookie'] = cookie_header;
|
||||
}
|
||||
try {
|
||||
const res = await fetch(url, {
|
||||
headers,
|
||||
signal: AbortSignal.timeout(3000),
|
||||
});
|
||||
if (!res.ok) {
|
||||
return null;
|
||||
}
|
||||
const data = (await res.json()) as AuthSessionResponse;
|
||||
return data.user ?? null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Safe redirect target — same-origin path only. */
|
||||
export function safeNextPath(raw: string | null | undefined, fallback = '/'): string {
|
||||
if (!raw) return fallback;
|
||||
const trimmed = raw.trim();
|
||||
if (!trimmed.startsWith('/') || trimmed.startsWith('//')) {
|
||||
return fallback;
|
||||
}
|
||||
if (trimmed.includes('\\') || trimmed.includes('\n') || trimmed.includes('\r')) {
|
||||
return fallback;
|
||||
}
|
||||
return trimmed.slice(0, 500);
|
||||
}
|
||||
@@ -189,7 +189,7 @@ export class MockBridgeClient extends BridgeClient {
|
||||
hero: this.mockArticles(3, true, false),
|
||||
trending: this.mockArticles(5, false, true),
|
||||
featured: this.mockArticles(4, true, false),
|
||||
latest: this.mockArticles(12),
|
||||
latest: this.mockArticles(24),
|
||||
by_category: {
|
||||
football: this.mockArticles(4),
|
||||
basketball: this.mockArticles(4),
|
||||
|
||||
@@ -99,6 +99,23 @@ export type UiStrings = {
|
||||
category_meta_latest: (sectionName: string) => string;
|
||||
/** Search results could not be loaded from bridge */
|
||||
search_upstream_error: string;
|
||||
/** Branded auth pages (no WordPress UI) */
|
||||
auth_login_title: string;
|
||||
auth_login_lead: string;
|
||||
auth_login_submit: string;
|
||||
auth_login_cta: string;
|
||||
auth_register_title: string;
|
||||
auth_register_lead: string;
|
||||
auth_register_submit: string;
|
||||
auth_register_cta: string;
|
||||
auth_username_label: string;
|
||||
auth_username_field: string;
|
||||
auth_email_label: string;
|
||||
auth_password_label: string;
|
||||
auth_password_hint: string;
|
||||
auth_password_too_short: string;
|
||||
auth_no_account: string;
|
||||
auth_have_account: string;
|
||||
};
|
||||
|
||||
const en: UiStrings = {
|
||||
@@ -179,6 +196,22 @@ const en: UiStrings = {
|
||||
more_from_category: name => `More from ${name}`,
|
||||
category_meta_latest: name => `Latest ${name} news`,
|
||||
search_upstream_error: 'Results could not be loaded. Please try again shortly.',
|
||||
auth_login_title: 'Sign in',
|
||||
auth_login_lead: 'Access your account to follow clubs and save preferences.',
|
||||
auth_login_submit: 'Sign in',
|
||||
auth_login_cta: 'Sign in',
|
||||
auth_register_title: 'Create account',
|
||||
auth_register_lead: 'Join the community — one account for comments and preferences.',
|
||||
auth_register_submit: 'Create account',
|
||||
auth_register_cta: 'Create account',
|
||||
auth_username_label: 'Username or email',
|
||||
auth_username_field: 'Username',
|
||||
auth_email_label: 'Email',
|
||||
auth_password_label: 'Password',
|
||||
auth_password_hint: 'At least 8 characters.',
|
||||
auth_password_too_short: 'Password must be at least 8 characters.',
|
||||
auth_no_account: 'No account yet?',
|
||||
auth_have_account: 'Already have an account?',
|
||||
};
|
||||
|
||||
const pt: UiStrings = {
|
||||
@@ -260,6 +293,22 @@ const pt: UiStrings = {
|
||||
category_meta_latest: name => `Últimas notícias: ${name}`,
|
||||
search_upstream_error:
|
||||
'Não foi possível obter resultados. Tenta novamente dentro de momentos.',
|
||||
auth_login_title: 'Entrar',
|
||||
auth_login_lead: 'Acede à tua conta para seguir clubes e guardar preferências.',
|
||||
auth_login_submit: 'Entrar',
|
||||
auth_login_cta: 'Entrar',
|
||||
auth_register_title: 'Criar conta',
|
||||
auth_register_lead: 'Junta-te à comunidade — uma conta para comentários e preferências.',
|
||||
auth_register_submit: 'Criar conta',
|
||||
auth_register_cta: 'Criar conta',
|
||||
auth_username_label: 'Utilizador ou email',
|
||||
auth_username_field: 'Utilizador',
|
||||
auth_email_label: 'Email',
|
||||
auth_password_label: 'Palavra-passe',
|
||||
auth_password_hint: 'Mínimo de 8 caracteres.',
|
||||
auth_password_too_short: 'A palavra-passe deve ter pelo menos 8 caracteres.',
|
||||
auth_no_account: 'Ainda não tens conta?',
|
||||
auth_have_account: 'Já tens conta?',
|
||||
};
|
||||
|
||||
export function getUiStrings(locale: string): UiStrings {
|
||||
|
||||
@@ -1,10 +1,176 @@
|
||||
---
|
||||
import Base from '../layouts/Base.astro';
|
||||
import AuthShell from '../components/auth/AuthShell.astro';
|
||||
import { getDomainConfig } from '../lib/domain.js';
|
||||
import { getUiStrings } from '../lib/ui-i18n.js';
|
||||
import { fetchAuthSession, safeNextPath, browserAuthPath } from '../lib/auth.js';
|
||||
|
||||
const host = Astro.request.headers.get('host') ?? 'localhost';
|
||||
const site_host = host.split(':')[0];
|
||||
const config = getDomainConfig(host);
|
||||
const ui = getUiStrings(config.locale);
|
||||
|
||||
const config = getDomainConfig(Astro.url.hostname);
|
||||
if (config.auth_links === false) {
|
||||
return Astro.redirect('/', 302);
|
||||
}
|
||||
|
||||
Astro.response.headers.set('Cache-Control', 'no-store');
|
||||
return Astro.redirect('/wp-login.php', 302);
|
||||
|
||||
const next = safeNextPath(Astro.url.searchParams.get('next'));
|
||||
const cookie = Astro.request.headers.get('cookie');
|
||||
const session_user = await fetchAuthSession(site_host, config.bridge_endpoint, cookie);
|
||||
if (session_user) {
|
||||
return Astro.redirect(next, 302);
|
||||
}
|
||||
|
||||
const login_path = browserAuthPath('login');
|
||||
---
|
||||
<Base config={config} title={ui.auth_login_title} description={ui.auth_login_lead}>
|
||||
<AuthShell
|
||||
config={config}
|
||||
title={ui.auth_login_title}
|
||||
lead={ui.auth_login_lead}
|
||||
switchHref={`/registar?next=${encodeURIComponent(next)}`}
|
||||
switchPrompt={ui.auth_no_account}
|
||||
switchLabel={ui.auth_register_cta}
|
||||
>
|
||||
<form
|
||||
id="auth-login-form"
|
||||
class="auth-form"
|
||||
method="post"
|
||||
action={login_path}
|
||||
novalidate
|
||||
data-auth-endpoint={login_path}
|
||||
data-auth-next={next}
|
||||
>
|
||||
<div class="auth-form__field">
|
||||
<label for="auth-username">{ui.auth_username_label}</label>
|
||||
<input
|
||||
id="auth-username"
|
||||
name="username"
|
||||
type="text"
|
||||
autocomplete="username"
|
||||
required
|
||||
maxlength="120"
|
||||
spellcheck="false"
|
||||
/>
|
||||
</div>
|
||||
<div class="auth-form__field">
|
||||
<label for="auth-password">{ui.auth_password_label}</label>
|
||||
<input
|
||||
id="auth-password"
|
||||
name="password"
|
||||
type="password"
|
||||
autocomplete="current-password"
|
||||
required
|
||||
maxlength="200"
|
||||
/>
|
||||
</div>
|
||||
<p id="auth-error" class="auth-form__error" role="alert" hidden></p>
|
||||
<button type="submit" class="btn btn--primary auth-form__submit" id="auth-submit">
|
||||
{ui.auth_login_submit}
|
||||
</button>
|
||||
</form>
|
||||
</AuthShell>
|
||||
</Base>
|
||||
|
||||
<style>
|
||||
.auth-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.auth-form__field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.auth-form__field label {
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.auth-form__field input {
|
||||
width: 100%;
|
||||
padding: 0.7rem 0.85rem;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 4px;
|
||||
background: var(--color-bg);
|
||||
color: var(--color-text);
|
||||
font-size: var(--text-base);
|
||||
}
|
||||
|
||||
.auth-form__field input:focus {
|
||||
outline: 2px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
|
||||
outline-offset: 1px;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.auth-form__error {
|
||||
margin: 0;
|
||||
padding: var(--space-3);
|
||||
background: color-mix(in srgb, var(--color-primary) 12%, var(--color-bg));
|
||||
border-left: 3px solid var(--color-primary);
|
||||
color: var(--color-text);
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.auth-form__submit {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
padding: 0.75rem 1.25rem;
|
||||
font-size: var(--text-base);
|
||||
}
|
||||
|
||||
.auth-form__submit:disabled {
|
||||
opacity: 0.7;
|
||||
cursor: wait;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
const form = document.getElementById('auth-login-form') as HTMLFormElement | null;
|
||||
const error_el = document.getElementById('auth-error');
|
||||
const submit_btn = document.getElementById('auth-submit') as HTMLButtonElement | null;
|
||||
|
||||
form?.addEventListener('submit', async (event) => {
|
||||
event.preventDefault();
|
||||
if (!form || !error_el || !submit_btn) return;
|
||||
|
||||
error_el.hidden = true;
|
||||
error_el.textContent = '';
|
||||
submit_btn.disabled = true;
|
||||
|
||||
const endpoint = form.dataset.authEndpoint ?? '/api/auth/login';
|
||||
const next = form.dataset.authNext ?? '/';
|
||||
const data = new FormData(form);
|
||||
const username = String(data.get('username') ?? '').trim();
|
||||
const password = String(data.get('password') ?? '');
|
||||
|
||||
try {
|
||||
const res = await fetch(endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ username, password }),
|
||||
});
|
||||
const payload = (await res.json().catch(() => ({}))) as { error?: string };
|
||||
if (!res.ok) {
|
||||
error_el.textContent = payload.error || 'Login failed';
|
||||
error_el.hidden = false;
|
||||
submit_btn.disabled = false;
|
||||
return;
|
||||
}
|
||||
window.location.assign(next);
|
||||
} catch {
|
||||
error_el.textContent = 'Network error. Please try again.';
|
||||
error_el.hidden = false;
|
||||
submit_btn.disabled = false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import Base from '../layouts/Base.astro';
|
||||
import LatestGrid from '../components/home/LatestGrid.astro';
|
||||
import LatestCompact from '../components/home/LatestCompact.astro';
|
||||
import DiscoverSection from '../themes/institutional/DiscoverSection.astro';
|
||||
import FpaAgendaSection from '../themes/institutional/FpaAgendaSection.astro';
|
||||
import { getDomainConfig } from '../lib/domain.js';
|
||||
@@ -64,6 +65,15 @@ const website_schema = {
|
||||
<TrendingBar articles={homepage.trending} locale={config.locale} />
|
||||
<HeroSection articles={homepage.hero} locale={config.locale} />
|
||||
|
||||
{/* Compact rail near fold — denser than card grid (BIT-26753) */}
|
||||
<LatestCompact
|
||||
articles={homepage.latest}
|
||||
locale={config.locale}
|
||||
titleId="homepage-latest-compact-title"
|
||||
show_more_href="/noticias"
|
||||
max_items={36}
|
||||
/>
|
||||
|
||||
{config.fpa_agenda_enabled && homepage.fpa_agenda != null && (
|
||||
<FpaAgendaSection games={homepage.fpa_agenda} locale={config.locale} />
|
||||
)}
|
||||
@@ -86,14 +96,6 @@ const website_schema = {
|
||||
/>
|
||||
)}
|
||||
|
||||
<LatestGrid
|
||||
theme={config.theme}
|
||||
articles={homepage.latest}
|
||||
titleId="homepage-latest-title"
|
||||
show_more_href="/noticias"
|
||||
locale={config.locale}
|
||||
/>
|
||||
|
||||
{config.theme === 'institutional' && <DiscoverSection config={config} />}
|
||||
|
||||
{config.categories.filter(cat => homepage.by_category[cat.slug]?.length).map(cat => (
|
||||
|
||||
@@ -1,10 +1,205 @@
|
||||
---
|
||||
import Base from '../layouts/Base.astro';
|
||||
import AuthShell from '../components/auth/AuthShell.astro';
|
||||
import { getDomainConfig } from '../lib/domain.js';
|
||||
import { getUiStrings } from '../lib/ui-i18n.js';
|
||||
import { fetchAuthSession, safeNextPath, browserAuthPath } from '../lib/auth.js';
|
||||
|
||||
const host = Astro.request.headers.get('host') ?? 'localhost';
|
||||
const site_host = host.split(':')[0];
|
||||
const config = getDomainConfig(host);
|
||||
const ui = getUiStrings(config.locale);
|
||||
|
||||
const config = getDomainConfig(Astro.url.hostname);
|
||||
if (config.auth_links === false) {
|
||||
return Astro.redirect('/', 302);
|
||||
}
|
||||
|
||||
Astro.response.headers.set('Cache-Control', 'no-store');
|
||||
return Astro.redirect('/wp-login.php?action=register', 302);
|
||||
|
||||
const next = safeNextPath(Astro.url.searchParams.get('next'));
|
||||
const cookie = Astro.request.headers.get('cookie');
|
||||
const session_user = await fetchAuthSession(site_host, config.bridge_endpoint, cookie);
|
||||
if (session_user) {
|
||||
return Astro.redirect(next, 302);
|
||||
}
|
||||
|
||||
const register_path = browserAuthPath('register');
|
||||
---
|
||||
<Base config={config} title={ui.auth_register_title} description={ui.auth_register_lead}>
|
||||
<AuthShell
|
||||
config={config}
|
||||
title={ui.auth_register_title}
|
||||
lead={ui.auth_register_lead}
|
||||
switchHref={`/entrar?next=${encodeURIComponent(next)}`}
|
||||
switchPrompt={ui.auth_have_account}
|
||||
switchLabel={ui.auth_login_cta}
|
||||
>
|
||||
<form
|
||||
id="auth-register-form"
|
||||
class="auth-form"
|
||||
method="post"
|
||||
action={register_path}
|
||||
novalidate
|
||||
data-auth-endpoint={register_path}
|
||||
data-auth-next={next}
|
||||
data-auth-password-short={ui.auth_password_too_short}
|
||||
>
|
||||
<div class="auth-form__field">
|
||||
<label for="auth-username">{ui.auth_username_field}</label>
|
||||
<input
|
||||
id="auth-username"
|
||||
name="username"
|
||||
type="text"
|
||||
autocomplete="username"
|
||||
required
|
||||
maxlength="60"
|
||||
spellcheck="false"
|
||||
/>
|
||||
</div>
|
||||
<div class="auth-form__field">
|
||||
<label for="auth-email">{ui.auth_email_label}</label>
|
||||
<input
|
||||
id="auth-email"
|
||||
name="email"
|
||||
type="email"
|
||||
autocomplete="email"
|
||||
required
|
||||
maxlength="120"
|
||||
/>
|
||||
</div>
|
||||
<div class="auth-form__field">
|
||||
<label for="auth-password">{ui.auth_password_label}</label>
|
||||
<input
|
||||
id="auth-password"
|
||||
name="password"
|
||||
type="password"
|
||||
autocomplete="new-password"
|
||||
required
|
||||
minlength="8"
|
||||
maxlength="200"
|
||||
/>
|
||||
<p class="auth-form__hint">{ui.auth_password_hint}</p>
|
||||
</div>
|
||||
<p id="auth-error" class="auth-form__error" role="alert" hidden></p>
|
||||
<button type="submit" class="btn btn--primary auth-form__submit" id="auth-submit">
|
||||
{ui.auth_register_submit}
|
||||
</button>
|
||||
</form>
|
||||
</AuthShell>
|
||||
</Base>
|
||||
|
||||
<style>
|
||||
.auth-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.auth-form__field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.auth-form__field label {
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.auth-form__field input {
|
||||
width: 100%;
|
||||
padding: 0.7rem 0.85rem;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 4px;
|
||||
background: var(--color-bg);
|
||||
color: var(--color-text);
|
||||
font-size: var(--text-base);
|
||||
}
|
||||
|
||||
.auth-form__field input:focus {
|
||||
outline: 2px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
|
||||
outline-offset: 1px;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.auth-form__hint {
|
||||
margin: 0;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.auth-form__error {
|
||||
margin: 0;
|
||||
padding: var(--space-3);
|
||||
background: color-mix(in srgb, var(--color-primary) 12%, var(--color-bg));
|
||||
border-left: 3px solid var(--color-primary);
|
||||
color: var(--color-text);
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.auth-form__submit {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
padding: 0.75rem 1.25rem;
|
||||
font-size: var(--text-base);
|
||||
}
|
||||
|
||||
.auth-form__submit:disabled {
|
||||
opacity: 0.7;
|
||||
cursor: wait;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
const form = document.getElementById('auth-register-form') as HTMLFormElement | null;
|
||||
const error_el = document.getElementById('auth-error');
|
||||
const submit_btn = document.getElementById('auth-submit') as HTMLButtonElement | null;
|
||||
|
||||
form?.addEventListener('submit', async (event) => {
|
||||
event.preventDefault();
|
||||
if (!form || !error_el || !submit_btn) return;
|
||||
|
||||
error_el.hidden = true;
|
||||
error_el.textContent = '';
|
||||
submit_btn.disabled = true;
|
||||
|
||||
const endpoint = form.dataset.authEndpoint ?? '/api/auth/register';
|
||||
const next = form.dataset.authNext ?? '/';
|
||||
const too_short = form.dataset.authPasswordShort ?? 'Password must be at least 8 characters.';
|
||||
const data = new FormData(form);
|
||||
const username = String(data.get('username') ?? '').trim();
|
||||
const email = String(data.get('email') ?? '').trim();
|
||||
const password = String(data.get('password') ?? '');
|
||||
|
||||
if (password.length < 8) {
|
||||
error_el.textContent = too_short;
|
||||
error_el.hidden = false;
|
||||
submit_btn.disabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await fetch(endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ username, email, password }),
|
||||
});
|
||||
const payload = (await res.json().catch(() => ({}))) as { error?: string };
|
||||
if (!res.ok) {
|
||||
error_el.textContent = payload.error || 'Registration failed';
|
||||
error_el.hidden = false;
|
||||
submit_btn.disabled = false;
|
||||
return;
|
||||
}
|
||||
window.location.assign(next);
|
||||
} catch {
|
||||
error_el.textContent = 'Network error. Please try again.';
|
||||
error_el.hidden = false;
|
||||
submit_btn.disabled = false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
import type { ArticleListItem } from '../../types/index.js';
|
||||
import { relativeTime, truncate } from '../../lib/format.js';
|
||||
import { getUiStrings } from '../../lib/ui-i18n.js';
|
||||
|
||||
interface Props {
|
||||
article: ArticleListItem;
|
||||
@@ -11,7 +10,6 @@ interface Props {
|
||||
}
|
||||
|
||||
const { article, size = 'md', show_excerpt = true, locale = 'en-US' } = Astro.props;
|
||||
const ui = getUiStrings(locale);
|
||||
const is_large = size === 'lg';
|
||||
const is_small = size === 'sm';
|
||||
---
|
||||
@@ -30,13 +28,10 @@ const is_small = size === 'sm';
|
||||
) : (
|
||||
<div class="inst-card__thumb inst-card__thumb--empty" aria-hidden="true" />
|
||||
)}
|
||||
{article.is_featured && (
|
||||
<span class="inst-card__ribbon">{ui.featured}</span>
|
||||
)}
|
||||
</a>
|
||||
|
||||
<div class="inst-card__body">
|
||||
<a href={`/category/${article.category.slug}`} class="inst-card__badge">
|
||||
<a href={`/category/${article.category.slug}`} class="inst-card__kicker">
|
||||
{article.category.name}
|
||||
</a>
|
||||
|
||||
@@ -62,20 +57,19 @@ const is_small = size === 'sm';
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
background: var(--color-bg-card);
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
border-bottom: 2px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
|
||||
border-radius: 0;
|
||||
overflow: hidden;
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
|
||||
transition: box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .inst-card {
|
||||
border-color: var(--color-border);
|
||||
border-bottom-color: var(--color-border);
|
||||
}
|
||||
|
||||
.inst-card:hover {
|
||||
border-color: var(--color-secondary);
|
||||
box-shadow: 0 4px 16px rgba(26, 58, 92, 0.08);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 24px rgba(26, 58, 92, 0.1);
|
||||
}
|
||||
|
||||
.inst-card--sm {
|
||||
@@ -96,7 +90,7 @@ const is_small = size === 'sm';
|
||||
|
||||
.inst-card--md .inst-card__thumb-link,
|
||||
.inst-card--lg .inst-card__thumb-link {
|
||||
aspect-ratio: 16 / 9;
|
||||
aspect-ratio: 3 / 2;
|
||||
}
|
||||
|
||||
.inst-card--sm .inst-card__thumb-link {
|
||||
@@ -109,15 +103,15 @@ const is_small = size === 'sm';
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
transition: transform 0.35s ease;
|
||||
transition: transform 0.45s ease;
|
||||
}
|
||||
|
||||
.inst-card:hover .inst-card__thumb {
|
||||
transform: scale(1.03);
|
||||
transform: scale(1.04);
|
||||
}
|
||||
|
||||
.inst-card__thumb--empty {
|
||||
min-height: 140px;
|
||||
min-height: 160px;
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
@@ -125,23 +119,8 @@ const is_small = size === 'sm';
|
||||
min-height: 88px;
|
||||
}
|
||||
|
||||
.inst-card__ribbon {
|
||||
position: absolute;
|
||||
top: var(--space-2);
|
||||
left: var(--space-2);
|
||||
font-family: var(--font-heading, inherit);
|
||||
font-size: 0.65rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
padding: 0.2rem 0.55rem;
|
||||
background: var(--color-primary);
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.inst-card__body {
|
||||
padding: var(--space-4);
|
||||
padding: var(--space-4) var(--space-1) var(--space-3);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
@@ -153,32 +132,30 @@ const is_small = size === 'sm';
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.inst-card__badge {
|
||||
.inst-card__kicker {
|
||||
align-self: flex-start;
|
||||
display: inline-block;
|
||||
padding: 0.2rem 0.6rem;
|
||||
border-radius: 3px;
|
||||
font-family: var(--font-heading, inherit);
|
||||
font-size: 0.65rem;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
text-decoration: none;
|
||||
background: rgba(26, 58, 92, 0.08);
|
||||
color: var(--color-primary);
|
||||
transition: background 0.15s ease;
|
||||
color: var(--color-secondary);
|
||||
padding: 0;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.inst-card__badge:hover {
|
||||
background: rgba(26, 58, 92, 0.15);
|
||||
.inst-card__kicker:hover {
|
||||
color: var(--color-primary);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.inst-card__title {
|
||||
font-family: var(--font-heading, inherit);
|
||||
font-family: var(--font-display, var(--font-heading, inherit));
|
||||
font-size: var(--text-base);
|
||||
font-weight: 700;
|
||||
line-height: 1.3;
|
||||
letter-spacing: -0.01em;
|
||||
line-height: 1.28;
|
||||
letter-spacing: -0.015em;
|
||||
margin: 0;
|
||||
flex: 1;
|
||||
}
|
||||
@@ -186,7 +163,7 @@ const is_small = size === 'sm';
|
||||
.inst-card--lg .inst-card__title {
|
||||
font-size: var(--text-xl);
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.015em;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.inst-card--sm .inst-card__title {
|
||||
|
||||
@@ -39,7 +39,7 @@ const secondary = rest.slice(0, 4);
|
||||
)}
|
||||
</a>
|
||||
<div class="inst-hero__featured-overlay">
|
||||
<a href={`/category/${main.category.slug}`} class="inst-hero__pill">{main.category.name}</a>
|
||||
<a href={`/category/${main.category.slug}`} class="inst-hero__kicker">{main.category.name}</a>
|
||||
<h1 class="inst-hero__featured-title">
|
||||
<a href={`/article/${main.slug}`}>{main.title}</a>
|
||||
</h1>
|
||||
@@ -74,7 +74,7 @@ const secondary = rest.slice(0, 4);
|
||||
)}
|
||||
</a>
|
||||
<div class="inst-hero__card-body">
|
||||
<a href={`/category/${article.category.slug}`} class="inst-hero__pill inst-hero__pill--muted">
|
||||
<a href={`/category/${article.category.slug}`} class="inst-hero__kicker inst-hero__kicker--muted">
|
||||
{article.category.name}
|
||||
</a>
|
||||
<h2 class="inst-hero__card-title">
|
||||
@@ -113,7 +113,7 @@ const secondary = rest.slice(0, 4);
|
||||
|
||||
.inst-hero__featured {
|
||||
position: relative;
|
||||
border-radius: var(--inst-radius-lg, 10px);
|
||||
border-radius: 0;
|
||||
overflow: hidden;
|
||||
background: #0f172a;
|
||||
box-shadow: var(--inst-shadow-feature, 0 12px 40px rgba(26, 58, 92, 0.12));
|
||||
@@ -158,32 +158,30 @@ const secondary = rest.slice(0, 4);
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.inst-hero__pill {
|
||||
.inst-hero__kicker {
|
||||
align-self: flex-start;
|
||||
display: inline-block;
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 3px;
|
||||
font-family: var(--font-heading, inherit);
|
||||
font-size: 0.7rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
letter-spacing: 0.08em;
|
||||
text-decoration: none;
|
||||
background: var(--color-secondary);
|
||||
color: #fff;
|
||||
border-bottom: 2px solid color-mix(in srgb, var(--color-secondary) 80%, #fff);
|
||||
padding-bottom: 0.1rem;
|
||||
}
|
||||
|
||||
.inst-hero__pill--muted {
|
||||
background: rgba(255, 255, 255, 0.18);
|
||||
color: #fff;
|
||||
.inst-hero__kicker--muted {
|
||||
color: var(--color-secondary);
|
||||
border-bottom-color: color-mix(in srgb, var(--color-secondary) 40%, transparent);
|
||||
}
|
||||
|
||||
.inst-hero__featured-title {
|
||||
font-family: var(--font-heading, inherit);
|
||||
font-size: clamp(1.6rem, 4.2vw, 2.6rem);
|
||||
font-family: var(--font-display, var(--font-heading, inherit));
|
||||
font-size: clamp(1.7rem, 4.4vw, 2.75rem);
|
||||
font-weight: 800;
|
||||
line-height: 1.15;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1.12;
|
||||
letter-spacing: -0.025em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
@@ -250,16 +248,15 @@ const secondary = rest.slice(0, 4);
|
||||
.inst-hero__card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--color-bg-card);
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--inst-radius-lg, 8px);
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
overflow: hidden;
|
||||
transition: box-shadow 0.2s ease, transform 0.2s ease;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.inst-hero__card:hover {
|
||||
box-shadow: var(--shadow-md);
|
||||
transform: translateY(-2px);
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.inst-hero__card-media {
|
||||
@@ -268,7 +265,7 @@ const secondary = rest.slice(0, 4);
|
||||
|
||||
.inst-hero__card-img {
|
||||
width: 100%;
|
||||
aspect-ratio: 16 / 9;
|
||||
aspect-ratio: 3 / 2;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
@@ -278,7 +275,7 @@ const secondary = rest.slice(0, 4);
|
||||
}
|
||||
|
||||
.inst-hero__card-body {
|
||||
padding: var(--space-4);
|
||||
padding: var(--space-3) 0 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
@@ -286,11 +283,11 @@ const secondary = rest.slice(0, 4);
|
||||
}
|
||||
|
||||
.inst-hero__card-title {
|
||||
font-family: var(--font-heading, inherit);
|
||||
font-family: var(--font-display, var(--font-heading, inherit));
|
||||
font-size: var(--text-base);
|
||||
font-weight: 700;
|
||||
line-height: 1.3;
|
||||
letter-spacing: -0.01em;
|
||||
letter-spacing: -0.015em;
|
||||
margin: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* Institutional theme — token overrides
|
||||
*
|
||||
* Typography strategy (BIT-626):
|
||||
* Headings → condensed sans-serif stack for authority and density
|
||||
* Body/UI → clean sans-serif for readability
|
||||
* Typography (BIT-26753 editorial refresh):
|
||||
* Headings → condensed/system display sans + serif accent (no Inter/CDN)
|
||||
* Body/UI → system UI sans for readability
|
||||
* Articles → serif (inherited from global.css .article-body)
|
||||
*
|
||||
* Inspired by professional sports portals (eurohandball.com pattern):
|
||||
* bold sans headings, generous weight contrast, navy palette.
|
||||
* Inspired by professional sports portals:
|
||||
* bold weight contrast, navy palette, photo-forward cards.
|
||||
*/
|
||||
:root {
|
||||
--color-primary: #1a3a5c;
|
||||
@@ -15,15 +15,15 @@
|
||||
--color-secondary: #4a6fa5;
|
||||
--color-accent: #f5f5f5;
|
||||
|
||||
/* Typography — sans-serif for headings + body */
|
||||
--font-heading: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont,
|
||||
'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
--font-body: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont,
|
||||
'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
/* Typography — local stacks only (no external font CDN) */
|
||||
--font-heading: 'Avenir Next Condensed', 'Segoe UI Semibold', 'Helvetica Neue',
|
||||
Arial Narrow, Arial, sans-serif;
|
||||
--font-body: 'Segoe UI', 'Helvetica Neue', system-ui, -apple-system, sans-serif;
|
||||
--font-display: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, serif;
|
||||
|
||||
/* Institutional surfaces */
|
||||
--inst-surface-muted: #eef2f7;
|
||||
--inst-radius-lg: 8px;
|
||||
--inst-radius-lg: 2px;
|
||||
--inst-shadow-feature: 0 12px 40px rgba(26, 58, 92, 0.12);
|
||||
|
||||
/* Section titles — heavier underline accent */
|
||||
@@ -47,5 +47,5 @@ body {
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family: var(--font-heading);
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.01em;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
@@ -33,13 +33,10 @@ const is_small = size === 'sm';
|
||||
</svg>
|
||||
</div>
|
||||
)}
|
||||
{article.is_featured && (
|
||||
<span class="article-card__badge badge">Featured</span>
|
||||
)}
|
||||
</a>
|
||||
|
||||
<div class="article-card__body">
|
||||
<a href={`/category/${article.category.slug}`} class="article-card__category badge badge--secondary">
|
||||
<a href={`/category/${article.category.slug}`} class="article-card__category">
|
||||
{article.category.name}
|
||||
</a>
|
||||
|
||||
@@ -152,11 +149,15 @@ const is_small = size === 'sm';
|
||||
|
||||
.article-card__category {
|
||||
align-self: flex-start;
|
||||
font-size: 0.65rem;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
text-decoration: none;
|
||||
transition: opacity var(--transition-fast);
|
||||
color: var(--color-secondary);
|
||||
transition: color var(--transition-fast);
|
||||
}
|
||||
.article-card__category:hover { opacity: 0.8; }
|
||||
.article-card__category:hover { color: var(--color-primary); }
|
||||
|
||||
.article-card__title {
|
||||
font-size: var(--text-base);
|
||||
|
||||
@@ -28,7 +28,7 @@ export interface DomainConfig {
|
||||
timezone: string;
|
||||
ads_enabled: boolean;
|
||||
analytics_id: string | null;
|
||||
/** When true, show login/register in chrome and expose /entrar + /registar → WordPress. */
|
||||
/** When true, show login/register in chrome and expose branded /entrar + /registar. */
|
||||
auth_links?: boolean;
|
||||
/** Homepage includes FPA fixture feed (bridge proxies ws.fpa.pt). */
|
||||
fpa_agenda_enabled?: boolean;
|
||||
|
||||
Reference in new issue
Block a user