/* ============================================
   Competitions Page Styles
   Athletic Precision Design
   ============================================ */

/* CSS Variables - Dark Mode Support.
   Defines --action/--action-hover consumed by /common/css/ranking-link.css
   (same contract as top-list/toplist.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);
    --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 Section */
.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;
    top: 0;
    left: 0;
    right: 0;
    bottom: 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;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Tabs Section */
.tabs-container {
    max-width: 1400px;
    margin: 3rem auto 0;
    padding: 0 1.5rem;
}

/* Tab styles loaded from /common/css/page-tabs.css */

/* Rankings Section */
.rankings-section {
    max-width: 1400px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
}

/* auto-fill (not auto-fit) keeps empty tracks, so a series with a single
   edition renders one column-width card instead of a full-width stripe. */
.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Ranking Card — the shell, header geometry, body, badge geometry, the
   .live-pane-* header bits and the top-3 preview all live in the shared
   /common/css/ranking-card.css. Only this catalog's badge PALETTE stays local:
   the championship cards render the solid pill (primary fill, white text),
   not the quiet chip the live hubs and the tracker use. */

.ranking-badge {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .ranking-badge {
    background: var(--accent);
}

.ranking-badge.event-type {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}

[data-theme="dark"] .ranking-badge.event-type {
    background: transparent;
}

/* .ranking-card-footer + .ranking-link CTAs come from
   /common/css/ranking-link.css (CTA-hierarchy rule: most powerful visible
   CTA = filled primary, later visible CTAs dimmed). */

/* Loading state */
.loading-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Error state */
.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Page-level empty state (whole catalog empty) */
.catalog-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Footer */
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;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 1rem 2rem;
        margin-top: 60px;
    }

    .tabs-container {
        padding: 0 1rem;
    }

    .rankings-section {
        padding: 0 1rem;
    }

    .rankings-grid {
        gap: 1.25rem;
    }
}

/* Flag image inside a page-tab label (National page) */
.page-tab-flag {
    display: inline-block;
    vertical-align: -2px;
    margin-right: 0.4rem;
    border-radius: 2px;
}

/* Quiet cross-pointer between the two championships pages */
.champs-cross-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 2.5rem;
}

.champs-cross-note a {
    color: var(--action);
    font-weight: 600;
}
