/* General Styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Custom Utilities */
.hover-shadow {
    transition: box-shadow 0.3s ease-in-out;
}
.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}
/* Add this CSS to your public styles or in a <style> block in the template */
.card-img-top {
    border-top-left-radius: calc(0.25rem - 1px);
    border-top-right-radius: calc(0.25rem - 1px);
}

/* Hover effect for cards */
.hover-shadow {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Image overlay for better text contrast on cards with header over image */
.card .card-header {
    position: relative;
    z-index: 1;
}

/* Ensure images maintain aspect ratio */
.card-img-top {
    object-fit: cover;
}

/* Detail page image styling */
.img-fluid.rounded.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-img-top {
        height: 180px !important;
    }
    
    .img-fluid.rounded.shadow {
        max-height: 300px !important;
    }
}
/* Runner name links */
.runner-name-link {
    color: #0d6efd !important;
    cursor: pointer;
    transition: color 0.2s ease;
}

.runner-name-link:hover {
    color: #0a58ca !important;
    text-decoration: underline !important;
}

/* Runner chevron animation */
.runner-chevron {
    transition: transform 0.3s ease;
    font-size: 0.8em;
}

/* Details row animation */
.runner-details-row {
    transition: all 0.3s ease;
}

.runner-details-row.collapse:not(.show) {
    display: none;
}

.runner-details-row.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

.runner-details-row.show {
    display: table-row;
    animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Details card styling */
.runner-details-row .card {
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

/* Performance badges */
.runner-details-row .badge {
    font-size: 0.75em;
    padding: 0.5em 0.8em;
}

/* Statistics cards inside details */
.runner-details-row .card .card {
    background: white;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.runner-details-row .card-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    font-weight: 500;
}

/* Lap and checkpoint tables */
.runner-details-row .table {
    margin-bottom: 0.5rem;
    font-size: 0.9em;
}

.runner-details-row .table th {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    font-weight: 600;
    color: #495057;
    font-size: 0.85em;
    padding: 0.5rem;
}

.runner-details-row .table td {
    padding: 0.4rem 0.5rem;
    border-color: #dee2e6;
}

/* Fastest/slowest lap highlights */
.runner-details-row .table tbody tr:hover {
    background-color: #f1f3f4;
}

/* Loading spinner styling */
.runner-details-row .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .runner-details-row .row > div {
        margin-bottom: 1rem;
    }
    
    .runner-details-row .table {
        font-size: 0.8em;
    }
    
    .runner-details-row .card-body {
        padding: 0.75rem;
    }
}

/* Certificate download button styling */
.btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

/* Results table enhancements */
.table th {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.table th:hover {
    background-color: #f8f9fa;
}

/* Action column styling */
.result-row td:last-child {
    white-space: nowrap;
}

/* Enhanced status badges */
.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-primary {
    background-color: #007bff !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

/* Smooth transitions for all interactive elements */
.btn, .badge, .card {
    transition: all 0.2s ease;
}

/* Details content styling */
.runner-details-row h5 {
    color: #495057;
    font-weight: 600;
}

.runner-details-row h6 {
    color: #007bff;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.runner-details-row small {
    line-height: 1.6;
}

/* Performance comparison styling */
.runner-details-row .text-success {
    color: #28a745 !important;
    font-weight: 600;
}

.runner-details-row .text-warning {
    color: #fd7e14 !important;
    font-weight: 600;
}

.runner-details-row .text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}
/* Admin Layout Styles */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 56px);
    margin-top: 56px;
    width: 100%;
    overflow-x: hidden;
}

.admin-sidebar {
    width: 64px; /* Narrow on mobile */
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    transition: width 0.3s ease;
    background-color: #f8f9fa;
}

.admin-main {
    flex: 1;
    margin-left: 64px; /* Match sidebar width */
    width: calc(100% - 64px);
    transition: margin-left 0.3s ease;
    padding: 0;
}

.admin-main .container-fluid {
    width: 100%;
    padding: 15px;
}

/* Desktop view */
@media (min-width: 768px) {
    .admin-sidebar {
        width: 250px;
    }
    
    .admin-main {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .admin-main .container-fluid {
        padding: 10px;
    }
}

/* Race Cards */
.race-card {
    transition: transform 0.2s;
}
.race-card:hover {
    transform: translateY(-5px);
}

/* Timeline for race schedule */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 30px;
}

.timeline-date {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    text-align: right;
    font-weight: bold;
}

.timeline-content {
    border-left: 2px solid #dee2e6;
    padding-left: 20px;
}

/* Results Table */
.results-table th {
    cursor: pointer;
}
.results-table th:hover {
    background-color: #f8f9fa;
}

/* Form Styles */
.form-floating > label {
    padding-left: 1rem;
}

/* Custom Checkboxes */
.custom-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.custom-checkbox:hover {
    background-color: #f8f9fa;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Custom Alert Styles */
.alert-float {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    .admin-main {
        margin-left: 0 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* Fix for nav tabs text color */
.nav-tabs .nav-link {
    color: #495057; /* Dark gray text for better contrast */
}

/* Ensure active tab has proper styling */
.nav-tabs .nav-link.active {
    color: #007bff; /* Bootstrap primary blue for active tab */
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Hover state for better UX */
.nav-tabs .nav-link:hover:not(.active) {
    color: #0056b3; /* Darker blue on hover */
    border-color: #e9ecef #e9ecef #dee2e6;
}

/* ═══════════════════════════════════════════════════════════
   PUBLIC DESIGN SYSTEM
   ═══════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --orange: #ff7200;
  --blue:   #0018ff;
  --ink:    #0d0f14;
  --ink2:   #383b45;
  --muted:  #797d8c;
  --border: #e4e4e0;
  --surface: #ffffff;
  --bg:     #f4f4f2;
  --radius: 14px;
  --radius-sm: 8px;
}

/* ── Body ──────────────────────────────────────────────────── */
body {
  background: var(--bg);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  margin-bottom: 4px;
}
.hero-topbar { height: 3px; background: linear-gradient(90deg, var(--orange), var(--blue)); }
.hero-body { padding: 44px 40px 40px; position: relative; }
.hero-body::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 32px solid rgba(0,24,255,0.06);
  pointer-events: none;
}
.hero-live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(22,163,74,0.08); border: 1px solid rgba(22,163,74,0.2);
  color: #15803d; border-radius: 20px;
  padding: 5px 12px; font-size: 13px; font-weight: 500;
  margin-bottom: 18px;
}
.hero-h1 { font-size: 38px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 10px; }
.hero-lead { font-size: 16px; color: var(--muted); margin-bottom: 28px; max-width: 520px; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-cta-orange { background: var(--orange); color: #fff; border-radius: 9px; padding: 11px 22px; font-size: 14px; font-weight: 600; text-decoration: none; transition: background 0.15s; }
.btn-cta-orange:hover { background: #e06400; color: #fff; }
.btn-cta-outline { background: transparent; color: var(--ink2); border: 1px solid var(--border); border-radius: 9px; padding: 11px 22px; font-size: 14px; font-weight: 500; text-decoration: none; transition: background 0.15s; }
.btn-cta-outline:hover { background: var(--bg); color: var(--ink); text-decoration: none; }

/* ── Section headers ───────────────────────────────────────── */
.section-hd { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 12px; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.section-label-live { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: #16a34a; display: flex; align-items: center; gap: 7px; }
.section-all { font-size: 13px; color: var(--blue); text-decoration: none; }
.section-all:hover { text-decoration: underline; }

/* ── Card grid ─────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

/* ── Race card ─────────────────────────────────────────────── */
.race-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform 0.18s, box-shadow 0.18s; position: relative; }
.race-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.07); text-decoration: none; }
.race-card-accent { height: 3px; flex-shrink: 0; }
.accent-orange { background: var(--orange); }
.accent-blue   { background: var(--blue); }
.race-card-img { display: block; width: 100%; height: 164px; object-fit: cover; flex-shrink: 0; }
.race-card-img-ph { width: 100%; height: 164px; flex-shrink: 0; background: #eeecea; display: flex; align-items: center; justify-content: center; color: #c0bdb8; font-size: 34px; }
.race-card-body { padding: 15px 17px 17px; display: flex; flex-direction: column; flex: 1; }
.race-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.race-card-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; flex: 1; }
.race-meta { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.race-meta-row { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.race-meta-row i { font-size: 11px; width: 12px; text-align: center; flex-shrink: 0; }
.event-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 13px; }
.event-tag { font-size: 11px; font-weight: 500; background: var(--bg); color: var(--ink2); border: 1px solid var(--border); border-radius: 5px; padding: 2px 8px; }
/* Long event lists fold to two rows (set up by public.js). z-index lifts the list
   above the card's stretched link, so a click opens the list instead of the race. */
.event-tags.is-collapsible { position: relative; z-index: 2; overflow: hidden; cursor: pointer; border-radius: 5px; transition: max-height 0.25s ease; }
.event-tags.is-collapsible::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: linear-gradient(to bottom, rgba(255,255,255,0), var(--surface) 85%); pointer-events: none; transition: opacity 0.2s; }
.event-tags.is-collapsible:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.event-tags.is-expanded::after { opacity: 0; }
.event-tag-more { position: absolute; right: 0; bottom: 0; z-index: 1; font-weight: 600; background: var(--surface); box-shadow: -10px 0 8px var(--surface); }
.event-tags.is-collapsible:hover .event-tag-more { border-color: var(--ink2); }
.event-tags.is-expanded .event-tag-more { display: none; }
@media (prefers-reduced-motion: reduce) {
  .event-tags.is-collapsible, .event-tags.is-collapsible::after { transition: none; }
}
.race-card-actions { display: flex; gap: 7px; margin-top: auto; }
.btn-card-outline { flex: 1; text-align: center; font-size: 12px; font-weight: 500; color: var(--ink2); border: 1px solid var(--border); border-radius: 7px; padding: 7px 4px; text-decoration: none; transition: background 0.15s; }
.btn-card-outline:hover { background: var(--bg); text-decoration: none; color: var(--ink2); }
.btn-card-fill { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--blue); border-radius: 7px; padding: 7px 4px; text-decoration: none; transition: opacity 0.15s; }
.btn-card-fill:hover { opacity: 0.88; text-decoration: none; color: #fff; }

/* ── Badges (public) ───────────────────────────────────────── */
.badge-online { background: rgba(255,114,0,0.1);  color: #c05000; border: 1px solid rgba(255,114,0,0.25); font-size: 10px; font-weight: 600; letter-spacing: 0.03em; padding: 3px 8px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; line-height: 1.4; }
.badge-onsite { background: rgba(0,24,255,0.07);  color: #0012bb; border: 1px solid rgba(0,24,255,0.2);   font-size: 10px; font-weight: 600; letter-spacing: 0.03em; padding: 3px 8px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; line-height: 1.4; }
.badge-closed { background: rgba(0,0,0,0.05);     color: var(--muted); border: 1px solid var(--border);   font-size: 10px; font-weight: 600; letter-spacing: 0.03em; padding: 3px 8px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; line-height: 1.4; }
.badge-live   { background: rgba(22,163,74,0.1);  color: #15803d; border: 1px solid rgba(22,163,74,0.25); font-size: 10px; font-weight: 600; letter-spacing: 0.03em; padding: 3px 8px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; line-height: 1.4; display: inline-flex; align-items: center; gap: 5px; }

/* ── Live dot ──────────────────────────────────────────────── */
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; flex-shrink: 0; animation: live-blink 1.8s ease infinite; display: inline-block; }
@keyframes live-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── League card ───────────────────────────────────────────── */
.league-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform 0.18s, box-shadow 0.18s; }
.league-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.07); text-decoration: none; }
.league-card-img { display: block; width: 100%; height: 150px; object-fit: cover; flex-shrink: 0; }
.league-card-img-ph { width: 100%; height: 150px; flex-shrink: 0; background: #e8eaf0; display: flex; align-items: center; justify-content: center; color: #a8acbc; font-size: 32px; }
.league-card-header { background: var(--blue); color: #fff; font-size: 12px; font-weight: 500; padding: 7px 15px; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.league-card-body { padding: 15px 17px 17px; display: flex; flex-direction: column; flex: 1; }
.league-card-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.league-progress-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.league-progress-row strong { color: var(--blue); font-weight: 600; }
.progress-track { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.progress-fill  { height: 100%; background: var(--blue); border-radius: 3px; }
.league-stat { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-bottom: 13px; }
.btn-block-blue { display: block; text-align: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--blue); border-radius: 7px; padding: 8px; text-decoration: none; margin-top: auto; transition: opacity 0.15s; }
.btn-block-blue:hover { opacity: 0.88; color: #fff; text-decoration: none; }

/* ── Result card ───────────────────────────────────────────── */
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform 0.18s, box-shadow 0.18s; }
.result-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.07); text-decoration: none; }
.result-card-img { display: block; width: 100%; height: 130px; object-fit: cover; flex-shrink: 0; }
.result-card-img-ph { width: 100%; height: 130px; flex-shrink: 0; background: #eeecea; display: flex; align-items: center; justify-content: center; color: #c0bdb8; font-size: 28px; }
.result-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.result-card-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.result-card-date { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.btn-results { display: block; text-align: center; font-size: 12px; font-weight: 500; color: var(--blue); background: rgba(0,24,255,0.06); border: 1px solid rgba(0,24,255,0.22); border-radius: 7px; padding: 7px; text-decoration: none; margin-top: auto; transition: background 0.15s; }
.btn-results:hover { background: rgba(0,24,255,0.1); color: var(--blue); text-decoration: none; }

/* ── Blog section ──────────────────────────────────────────── */
.blog-section { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--orange); border-radius: var(--radius); padding: 26px 26px 22px; margin-top: 28px; }
.blog-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.blog-card { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; text-decoration: none; color: inherit; transition: transform 0.15s; }
.blog-card:hover { transform: translateY(-2px); text-decoration: none; }
.blog-card-img { width: 78px; height: 78px; object-fit: cover; flex-shrink: 0; display: block; }
.blog-card-img-ph { width: 78px; height: 78px; flex-shrink: 0; background: linear-gradient(135deg, var(--orange), var(--blue)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; }
.blog-card-body { padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1; }
.blog-card-title { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-bottom: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.blog-card-date  { font-size: 11px; color: var(--muted); }

/* ── Cookie consent reskin ─────────────────────────────────── */
#cookieConsent { background: #0c0e14 !important; border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 24px !important; }
#acceptCookies { background: var(--orange) !important; border: none !important; border-radius: 7px !important; color: #fff !important; font-size: 13px; padding: 7px 18px !important; }
#rejectCookies { background: transparent !important; border: 1px solid rgba(255,255,255,0.2) !important; border-radius: 7px !important; color: rgba(255,255,255,0.7) !important; font-size: 13px; padding: 7px 18px !important; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cards-grid  { grid-template-columns: 1fr; }
  .blog-cards  { grid-template-columns: 1fr; }
  .hero-h1     { font-size: 28px; }
  .hero-body::after { display: none; }
  .hero-body   { padding: 28px 22px 24px; }
}

/* ══════════════════════════════════════════════════════════════
   PUBLIC NAV & FOOTER
   ══════════════════════════════════════════════════════════════ */
.pub-navbar { background: rgba(255,255,255,0.95) !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border) !important; box-shadow: none !important; }
.brand-icon { width: 32px; height: 32px; background: var(--orange); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.brand-name { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 700; font-size: 15px; color: var(--blue); letter-spacing: -0.01em; }
.pub-nav-link { font-size: 14px !important; color: var(--muted) !important; border-radius: 6px !important; padding: 5px 10px !important; transition: background 0.15s, color 0.15s !important; }
.pub-nav-link:hover { background: var(--bg) !important; color: var(--ink) !important; }
.pub-lang-btn { font-size: 12px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; color: var(--ink2); background: transparent; transition: background 0.15s; }
.pub-lang-btn:hover { background: var(--bg); }
.pub-btn-login { background: var(--blue) !important; color: #fff !important; border-radius: 8px !important; font-size: 13px; padding: 6px 16px !important; border: none !important; }
.pub-btn-login:hover { background: #0014d0 !important; color: #fff !important; }
.pub-btn-admin { background: var(--orange) !important; color: #fff !important; border-radius: 8px !important; font-size: 13px; padding: 6px 16px !important; border: none !important; }
.pub-btn-admin:hover { background: #e06400 !important; color: #fff !important; }
.pub-btn-outline { background: transparent !important; border: 1px solid var(--border) !important; color: var(--ink2) !important; border-radius: 8px !important; font-size: 13px; padding: 6px 14px !important; }
.pub-btn-outline:hover { background: var(--bg) !important; }

.pub-footer { background: #0c0e14; color: rgba(255,255,255,0.5); padding: 40px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; margin-bottom: 28px; }
.footer-brand-name { font-size: 15px; font-weight: 700; color: #fff; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.footer-col-title { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.3); margin-bottom: 12px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: rgba(255,255,255,0.9); }
.footer-email { color: rgba(255,255,255,0.5); text-decoration: none; }
.footer-email:hover { color: var(--orange); }
.footer-cookie-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.5); font-size: 12px; border-radius: 6px; padding: 5px 12px; cursor: pointer; margin-top: 14px; transition: background 0.15s; }
.footer-cookie-btn:hover { background: rgba(255,255,255,0.1); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; text-align: center; font-size: 13px; }
.footer-bottom a { color: var(--orange); text-decoration: none; }

/* ══════════════════════════════════════════════════════════════
   PUBLIC PAGE COMPONENTS
   ══════════════════════════════════════════════════════════════ */

/* Breadcrumb */
.pub-breadcrumb { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); list-style: none; padding: 0; margin: 0 0 4px; flex-wrap: wrap; }
.pub-breadcrumb a { color: var(--muted); text-decoration: none; }
.pub-breadcrumb a:hover { color: var(--blue); }
.page-header { margin-bottom: 22px; }
.page-header-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 6px; }

/* Filter tabs */
.filter-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 16px; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.filter-tab { font-size: 13px; font-weight: 500; color: var(--muted); padding: 6px 14px; border-radius: 7px; text-decoration: none; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.filter-tab:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.filter-tab.active { background: var(--ink); color: #fff; }
.filter-tab-live { color: #16a34a; }
.filter-tab-live.active { background: #16a34a; color: #fff; }

/* Filter card */
.filter-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }

/* Pagination */
.pub-pagination { display: flex; gap: 4px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pub-page-link { font-size: 13px; font-weight: 500; color: var(--ink2); border: 1px solid var(--border); border-radius: 7px; padding: 6px 12px; text-decoration: none; background: var(--surface); transition: background 0.15s; }
.pub-page-link:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.pub-page-link.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pub-page-link.disabled { color: var(--muted); pointer-events: none; opacity: 0.5; }

/* Content card (detail pages) */
.content-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.content-card-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 16px; letter-spacing: -0.01em; }

/* Info row */
.info-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--ink2); }
.info-row:last-child { border-bottom: none; }
.info-row i { color: var(--blue); width: 16px; text-align: center; flex-shrink: 0; margin-top: 2px; font-size: 13px; }
.info-row strong { color: var(--ink); font-weight: 500; margin-right: 4px; }

/* Live banner (race detail, top of page on mobile) */
.live-banner { background: linear-gradient(90deg, #15803d, #16a34a); color: #fff; padding: 10px 0; }
.live-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-banner-text { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.live-banner-btn { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); color: #fff; border-radius: 7px; padding: 5px 14px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background 0.15s; }
.live-banner-btn:hover { background: rgba(255,255,255,0.3); color: #fff; text-decoration: none; }

/* Detail hero */
.detail-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.detail-hero-topbar { height: 3px; background: linear-gradient(90deg, var(--orange), var(--blue)); }
.detail-hero-body { padding: 22px 26px 20px; }
.detail-hero-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 8px; }
.detail-hero-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); align-items: center; }
.detail-hero-meta i { color: var(--blue); margin-right: 4px; font-size: 12px; }

/* Sidebar card */
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.sidebar-card-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 14px; letter-spacing: -0.01em; }

/* Register / CTA buttons */
.btn-register { display: block; width: 100%; text-align: center; background: var(--blue); color: #fff; border-radius: 9px; padding: 12px; font-size: 14px; font-weight: 600; text-decoration: none; transition: opacity 0.15s; }
.btn-register:hover { opacity: 0.88; color: #fff; text-decoration: none; }
.btn-register-green { background: #16a34a; }
.btn-register-orange { background: var(--orange); }

/* Event card (inside race detail) */
.event-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.event-info-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.event-info-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.event-detail-row { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.event-detail-row i { font-size: 11px; width: 12px; color: var(--blue); flex-shrink: 0; }

/* Age category badge */
.age-badge { font-size: 11px; font-weight: 500; background: rgba(0,24,255,0.07); color: #0012bb; border: 1px solid rgba(0,24,255,0.18); border-radius: 5px; padding: 2px 8px; display: inline-block; margin: 2px 2px 2px 0; }

/* Table */
.pub-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.pub-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pub-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--ink2); vertical-align: middle; }
.pub-table tr:last-child td { border-bottom: none; }
.pub-table tbody tr:hover td { background: var(--bg); }
.position-tied { font-style: italic; color: var(--muted); }
.has-tie td:first-child { color: var(--muted); }

/* Blog post article */
.post-article-header { margin-bottom: 28px; }
.post-article-title { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 12px; line-height: 1.25; }
.post-article-meta { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.post-content { font-size: 16px; line-height: 1.8; color: var(--ink2); }
.post-content h2 { font-size: 20px; font-weight: 600; color: var(--ink); margin: 2rem 0 0.75rem; letter-spacing: -0.02em; }
.post-content h3 { font-size: 17px; font-weight: 600; color: var(--ink); margin: 1.5rem 0 0.5rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1.5rem 0; display: block; }
.post-content a { color: var(--blue); }
.post-content blockquote { border-left: 3px solid var(--orange); padding-left: 1rem; margin: 1.5rem 0; color: var(--muted); font-style: italic; }
.post-content ul, .post-content ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }

/* Share buttons */
.share-btn { font-size: 12px; font-weight: 500; border: 1px solid var(--border); border-radius: 7px; padding: 6px 14px; color: var(--ink2); text-decoration: none; transition: background 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.share-btn:hover { background: var(--bg); color: var(--ink); text-decoration: none; }

/* League detail: progress */
.league-detail-progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.league-detail-progress-fill { height: 100%; background: var(--blue); border-radius: 4px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.35; display: block; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--ink2); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Two-column detail layout ──────────────────────────────── */
.detail-two-col { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 20px; align-items: start; }
.detail-main { min-width: 0; }
.detail-sidebar { min-width: 0; }
.detail-hero-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin-bottom: 20px; }

/* Share buttons coloured variants */
.share-btn-fb { border-color: #1877f2; color: #1877f2; }
.share-btn-fb:hover { background: #1877f2; color: #fff; }
.share-btn-tw { border-color: #1da1f2; color: #1da1f2; }
.share-btn-tw:hover { background: #1da1f2; color: #fff; }
.share-btn-li { border-color: #0a66c2; color: #0a66c2; }
.share-btn-li:hover { background: #0a66c2; color: #fff; }

/* ── Responsive additions ──────────────────────────────────── */
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .detail-hero-body { padding: 16px; }
  .detail-hero-title { font-size: 18px; }
  .content-card { padding: 16px; }
  .event-info-grid { grid-template-columns: 1fr; }
  .post-article-title { font-size: 22px; }
  .pub-navbar .navbar-collapse { background: rgba(255,255,255,0.98); border-radius: 12px; margin-top: 8px; padding: 12px; border: 1px solid var(--border); }
  .detail-two-col { grid-template-columns: 1fr; }
}