*, *::before, *::after { box-sizing: border-box; }

:root {
    --brand: #1565C0;
    --brand-dark: #0D47A1;
    --accent: #e53935;
    --text: #1a1a1a;
    --text-muted: #666;
    --bg: #fff;
    --bg-alt: #f5f7fa;
    --border: #e0e0e0;
    --radius: 8px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: var(--brand);
    color: white;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}
.brand:hover { text-decoration: none; }

.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.9); font-weight: 500; }
.nav-links a:hover { color: white; text-decoration: none; }
.nav-user { color: rgba(255,255,255,0.7); font-size: 0.875rem; }
.nav-signout { font-size: 0.875rem; }

/* Footer */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4rem;
}

/* Main */
.site-main { min-height: calc(100vh - 60px - 80px); }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: white;
    padding: 5rem 1.5rem;
    text-align: center;
}

.hero-content { max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: 2.5rem; margin: 0 0 1rem; font-weight: 800; }
.hero p { font-size: 1.15rem; margin: 0 0 2rem; opacity: 0.9; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn-primary { background: white; color: var(--brand); }
.btn-secondary { background: rgba(255,255,255,0.15); color: white; border: 2px solid rgba(255,255,255,0.5); }
.btn-outline { background: transparent; color: var(--brand); border: 2px solid var(--brand); }

/* Sections */
.section { padding: 3rem 0; }
.section-alt { background: var(--bg-alt); padding: 3rem 1.5rem; }
.section-footer { margin-top: 2rem; text-align: center; }

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.card {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    color: var(--text);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: var(--brand); text-decoration: none; }
.card h2, .card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--brand); }
.card p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.card .season { margin-top: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.feature h3 { margin: 0 0 0.5rem; color: var(--brand); }
.feature p { margin: 0; color: var(--text-muted); }

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 1.5rem 0 0.5rem;
}
.breadcrumb a { color: var(--text-muted); }

/* Trail map */
.trail-map {
    height: 500px;
    width: 100%;
    background: var(--bg-alt);
    margin: 1.5rem 0;
}

/* Trail list */
.section-trails, .section-hazards, .section-events { margin-top: 2rem; }
.section-trails h2, .section-hazards h2, .section-events h2 { margin-bottom: 1rem; }

.trail-list { list-style: none; padding: 0; margin: 0; }
.trail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.trail-item:last-child { border-bottom: none; }

.trail-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.trail-info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.trail-meta { font-size: 0.85rem; color: var(--text-muted); }

.badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
}
.badge-official { background: #e8f5e9; color: #2e7d32; }

/* Hazard list */
.hazard-list { list-style: none; padding: 0; margin: 0; }
.hazard-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.hazard-item:last-child { border-bottom: none; }
.hazard-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}
.hazard-item p { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--text-muted); }
.hazard-expires { font-size: 0.8rem; color: var(--text-muted); }

/* Club pages */
.club-header { display: flex; align-items: center; gap: 1.5rem; margin: 1.5rem 0; }
.club-logo { max-height: 80px; max-width: 120px; object-fit: contain; border-radius: 4px; }
.club-logo-large { max-height: 100px; max-width: 150px; object-fit: contain; border-radius: 4px; }
.established { color: var(--text-muted); margin: 0; font-size: 0.9rem; }
.club-links { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.club-contacts { margin: 1.5rem 0; }
.club-contacts p { margin: 0.25rem 0; }

/* Event list */
.event-list { list-style: none; padding: 0; margin: 0; }
.event-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.event-item:last-child { border-bottom: none; }
.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--brand);
    color: white;
    border-radius: var(--radius);
    padding: 0.4rem 0.75rem;
    min-width: 52px;
    text-align: center;
    flex-shrink: 0;
}
.event-date .month { font-size: 0.7rem; text-transform: uppercase; font-weight: 600; opacity: 0.85; }
.event-date .day { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.event-info { flex: 1; }
.event-info strong { display: block; margin-bottom: 0.25rem; }
.event-info p { margin: 0.2rem 0; font-size: 0.9rem; color: var(--text-muted); }
.event-location { font-weight: 500; color: var(--text-muted); }
.event-time { font-size: 0.8rem; }

/* Filters */
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.filter-link {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text);
    transition: background 0.1s;
}
.filter-link:hover, .filter-link.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    text-decoration: none;
}

.description { color: var(--text-muted); max-width: 700px; }
.season-info { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }
.empty { color: var(--text-muted); margin-top: 2rem; }

/* Activity type badges (club detail page) */
.activity-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }
.activity-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: #e3f2fd;
    color: #1565C0;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #bbdefb;
}

/* Manage pages */
.manage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 1rem;
    flex-wrap: wrap;
}
.manage-header h1 { margin: 0; }
.manage-actions { display: flex; gap: 0.75rem; align-items: center; flex-shrink: 0; }

.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert p { margin: 0.2rem 0; }
.alert p:first-child { margin-top: 0; }
.alert p:last-child { margin-bottom: 0; }

.manage-form { max-width: 760px; }

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; }
.form-section h2 { margin: 0 0 1.25rem; font-size: 1.15rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label, .form-row label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.form-group-narrow { max-width: 200px; }
.form-hint { color: var(--text-muted); font-size: 0.9rem; margin: -0.75rem 0 1rem; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,101,192,0.12); }
textarea.form-control { resize: vertical; }

.field-error { display: block; color: #c62828; font-size: 0.82rem; margin-top: 0.3rem; }

.activity-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

.activity-type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: border-color 0.1s, background 0.1s;
}
.activity-type-option:hover { border-color: var(--brand); background: #f0f5ff; }
.activity-type-option.checked { border-color: var(--brand); background: #e3f2fd; color: var(--brand); }
.activity-type-option input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 2rem;
}
.btn-save { background: var(--brand); color: white; border: none; font-size: 0.95rem; }
.btn-save:hover { opacity: 0.9; }

/* Responsive */
@media (max-width: 600px) {
    .hero h1 { font-size: 1.75rem; }
    .trail-map { height: 350px; }
    .nav-links { gap: 1rem; }
}
