/* ============================================
   Competitions Hub — subcategory landing
   Athletic Precision Design
   Four (extensible) cards route to the competition-results surfaces:
   Championships, Tracker, 107Live, and the 107Live PDF archive.
   Self-contained; reuses the shared --action contract from
   /common/css/ranking-link.css.
   ============================================ */

:root {
    --primary: var(--t7-text);
    --accent: var(--t7-athletic-orange);
    --accent-hover: var(--t7-athletic-orange-deep);
    --action: var(--t7-result-blue);
    --action-hover: var(--t7-result-blue-hover);
    --standings: var(--t7-standings-blue, #3b82f6);
    --surface: var(--t7-card-white);
    --surface-alt: var(--t7-paper);
    --text: var(--t7-text);
    --text-muted: var(--t7-ink-mute);
    --border: var(--t7-border);
    --shadow: var(--t7-shadow);
}

[data-theme="dark"] {
    --accent-hover: var(--t7-athletic-orange-light);
    --action-hover: var(--t7-result-blue-light);
    --surface: var(--t7-night);
    --surface-alt: var(--t7-night-card);
    --text: var(--t7-night-text);
    --text-muted: var(--t7-night-text-soft);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--surface);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--t7-night) 0%, #1e3a5f 100%);
    color: white;
    padding: 4rem 1.5rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 70px;
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, var(--t7-night-card) 0%, var(--t7-night-rule) 100%);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/common/images/2005-08_mm-kisat_helsinki_katsomokuva_2265x1029.JPG');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.3rem);
    opacity: 0.9;
    font-weight: 400;
}

/* Card grid */
.hub-section {
    max-width: 1100px;
    margin: 3rem auto 4rem;
    padding: 0 1.5rem;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* Subcategory card — whole card is the link */
.hub-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-alt);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease, border-color 0.3s ease;
}

.hub-card:hover,
.hub-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px var(--shadow);
    border-color: var(--accent);
    outline: none;
}

.hub-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: white;
}

.hub-card-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hub-card-icon.icon-live { background: var(--standings); }
.hub-card-icon.icon-championships { background: var(--primary); }
[data-theme="dark"] .hub-card-icon.icon-championships { background: var(--accent); }
.hub-card-icon.icon-archive { background: var(--t7-jump-green-dark); }
[data-theme="dark"] .hub-card-icon.icon-archive { background: var(--t7-jump-green); }
.hub-card-icon.icon-national { background: var(--t7-day2-indigo); }
[data-theme="dark"] .hub-card-icon.icon-national { background: var(--t7-day2-indigo-light); }

.hub-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.85rem;
    background: var(--standings);
    color: white;
}

.hub-card-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.6rem;
}

.hub-card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 1.5rem;
}

.hub-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--action);
    font-size: 0.95rem;
}

.hub-card-cta svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.hub-card:hover .hub-card-cta svg,
.hub-card:focus-visible .hub-card-cta svg {
    transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
    .hub-card,
    .hub-card-cta svg { transition: box-shadow 0.3s ease, border-color 0.3s ease; }
    .hub-card:hover,
    .hub-card:focus-visible { transform: none; }
    .hub-card:hover .hub-card-cta svg,
    .hub-card:focus-visible .hub-card-cta svg { transform: none; }
}

/* Footer (matches other hubs) */
footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--t7-ink-deep) 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.5), transparent);
}

[data-theme="dark"] footer {
    background: linear-gradient(135deg, #0a0f1a 0%, #151a28 100%);
    border-top-color: rgba(255, 255, 255, 0.05);
}

footer p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.3px;
}

@media (max-width: 768px) {
    .hero { padding: 3rem 1rem 2rem; margin-top: 60px; }
    .hub-section { padding: 0 1rem; }
    .hub-grid { gap: 1.5rem; }
    .hub-card { padding: 1.5rem; }
}
