/* Existing styles (kept for context) */
body {
    background-color: #f5f5f5; /* Light grey background to match Eurosport/BBC */
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent 70%);
    padding: 1rem;
    color: white;
}

.hero-overlay h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

.card-hover {
    transition: transform 0.2s ease;
}

.card-hover:hover {
    transform: scale(1.02);
}

.rounded-4 {
    border-radius: 0.5rem !important;
}

.rounded-2 {
    border-radius: 0.25rem !important;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

.object-cover {
    object-fit: cover;
}

/* Main image aspect ratio */
.hero-section .col-lg-7 .position-relative {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

/* Tighten typography */
.category-label {
    font-size: 0.875rem; /* Slightly larger for prominence */
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    color: #666; /* Subtle grey for contrast */
}

.top-stories-title {
    font-size: 0.9rem; /* Reduced for tighter mobile layout */
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem; /* Reduced spacing */
}

.story-title {
    font-size: 0.95rem; /* Reduced for mobile alignment */
    font-weight: 700;
    line-height: 1.3;
}

.timestamp {
    font-size: 0.75rem;
    line-height: 1;
    color: #999; /* Lighter grey for timestamps */
}

/* Grid card styling (enhanced for Eurosport/BBC look) */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for pop-out effect */
    background-color: #fff; /* White background for cards */
}

.card-img-top {
    height: 200px; /* Reduced from 250px to prevent bleeding on mobile */
    object-fit: cover;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    transition: transform 0.2s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-body {
    padding: 1rem; /* More padding for better spacing */
}

.card-title {
    font-size: 1.25rem; /* Larger title for prominence */
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: #333; /* Darker text for contrast */
}

.card-text {
    font-size: 0.875rem; /* Slightly larger for readability */
    line-height: 1.2;
    color: #666;
}

/* Distance label styling for races */
.distance-label span {
    border: 1px solid #dee2e6; /* Matches Bootstrap border-light */
    border-radius: 5px;
    padding: 0.05rem 0.2rem; /* Reduced padding for smaller size */
    margin-right: 0.25rem; /* Space between multiple distances */
    font-size: 0.75rem; /* Smaller font size */
    background-color: #dc3545; /* Red background (Bootstrap's btn-danger color) */
    color: #fff; /* White text */
    display: inline-block; /* Ensure proper spacing */
}

/* Hero Section Adjustments */
.top-stories-container {
    gap: 0.5rem; /* Tighten vertical spacing between items */
}

.top-story-item {
    padding: 0.25rem 0; /* Reduce padding to tighten layout */
}

/* Eurosport-style header (for category pages) */
.category-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.category-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* BBC Sport-inspired header */
.site-header .navbar-light.bg-yellow {
    background-color: #ffd230;
    border-bottom: 1px solid #ccc;
}

.site-logo {
    font-family: 'Arial', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    color: #000;
    text-transform: uppercase;
}

.navbar-light .navbar-nav .nav-link {
    color: #000;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: #333;
    background-color: #ffeb99;
    border-radius: 0.25rem;
}

.navbar-light .navbar-toggler {
    border: none;
    display: flex;
    align-items: center;
    padding: 0.5rem;
}

.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5em;
    height: 1.5em;
}

.navbar-light .navbar-toggler-text {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    margin-left: 0.25rem;
    text-transform: uppercase;
}

.navbar-light .dropdown-menu {
    background-color: #ffd230;
}

.navbar-light .dropdown-item {
    color: #000;
}

.navbar-light .dropdown-item:hover,
.navbar-light .dropdown-item.active {
    color: #333;
    background-color: #ffeb99;
}

/* Second Bar (Section-Specific Navigation) */
.secondary-nav {
    background-color: #1a1a1a;
    border-bottom: 1px solid #333;
}

.secondary-nav .container {
    max-width: none; /* Remove container width constraint for scrolling */
    padding: 0; /* Remove padding to allow full-width scrolling */
}

.nav-scroller {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 1rem; /* Adjusted padding for better spacing */
}

.nav-scroller .nav {
    display: flex; /* Force flex display to prevent stacking */
    flex-wrap: nowrap; /* Prevent wrapping of items */
}

.nav-scroller .nav .nav-item {
    flex: 0 0 auto; /* Prevent items from shrinking or growing */
}

.nav-scroller .nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    color: #fff;
    white-space: nowrap; /* Prevent text wrapping */
}

.nav-scroller .nav-link.active {
    color: #ffd230;
    position: relative;
}

.nav-scroller .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ffd230;
}

.nav-scroller .chevron {
    color: #ffd230;
    font-weight: 900;
    margin-left: 0.25rem;
}

.nav-scroller::-webkit-scrollbar {
    display: none; /* Hide scrollbar on WebKit browsers */
}

/* Eurosport-inspired Footer */
.site-footer {
    background-color: #1a1a1a;
    color: #fff;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.site-footer .nav-link,
.site-footer a {
    color: #000000;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.site-footer .nav-link:hover,
.site-footer a:hover {
    color: #d5cf22;
    text-decoration: underline;
}

.social-icons a {
    font-size: 1.25rem;
    transition: color 0.2s ease;
}

.social-icons a:hover {
    color: #ccc;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .hero-overlay h2 {
        font-size: 1.25rem;
    }
    .col-lg-7, .col-lg-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .row-cols-md-3 {
        grid-template-columns: repeat(1, 1fr);
    }
    .category-header h1 {
        font-size: 1.5rem;
    }
    .navbar-light .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
    }
    .secondary-nav .nav-scroller {
        padding-bottom: 0.5rem; /* Ensure padding for mobile */
    }
    .top-stories-container {
        margin-bottom: 1rem; /* Add space before next section to prevent bleeding */
    }
    .card-img-top {
        height: 150px; /* Reduce image height on mobile to fit better */
    }
}

@media (min-width: 1100px) {
    .hero-overlay {
        padding: 1.5rem;
    }
    .hero-overlay h2 {
        font-size: 1.75rem;
    }
    .category-header h1 {
        font-size: 2rem;
    }
    .secondary-nav .nav-scroller {
        overflow-x: hidden;
    }
    .navbar-light .navbar-collapse {
        display: flex !important; /* Always show nav links on desktop */
    }
    .navbar-light .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
}

/* Ensure the second nav bar is scrollable on mobile */
@media (max-width: 991px) {
    .secondary-nav .nav-scroller {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .secondary-nav .nav-scroller .nav {
        display: flex; /* Force flex display */
        flex-wrap: nowrap; /* Prevent wrapping */
    }

    /* Make the parent category white */
    .secondary-nav .nav-scroller .nav .nav-item:first-child .nav-link {
        color: white !important; /* Override Bootstrap's active state */
    }

    /* Remove margin from the last item to avoid extra space */
    .secondary-nav .nav-scroller .nav .nav-item:last-child {
        margin-right: 0;
    }

    /* Hide the chevron on mobile for better spacing */
    .secondary-nav .nav-scroller .nav .chevron {
        display: none;
    }

    /* Ensure nav items are inline and don't stack */
    .secondary-nav .nav-scroller .nav .nav-item {
        display: inline-block;
        flex: 0 0 auto; /* Prevent items from shrinking or growing */
    }
}

/* Ensure the nav items don't wrap and fit inline */
.secondary-nav .nav-scroller .nav .nav-item {
    display: inline-block;
}

/* Optional: Adjust padding for better mobile appearance */
@media (max-width: 991px) {
    .secondary-nav .nav-scroller .nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem; /* Slightly smaller font for mobile */
    }
}

/* Ensure filters are in a single row */
.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Space between dropdowns */
    justify-content: space-between;
    align-items: flex-end; /* Aligns labels properly */
}

/* Make sure each filter has equal width */
.filters-form .filter-group {
    flex: 1;
    min-width: 150px; /* Ensures proper spacing */
    display: flex;
    flex-direction: column;
}

/* Adjust label spacing */
.filters-form .form-label {
    font-size: 0.85rem;
    margin-bottom: 2px;
}

/* Reduce select box padding for better alignment */
.filters-form .form-select {
    width: 100%;
    padding: 6px;
}

/* Ensure full width on mobile */
@media (max-width: 768px) {
    .filters-form {
        flex-direction: column;
        gap: 5px;
    }

    .filters-form .filter-group {
        width: 100%;
    }
}

.race-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.race-details div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.race-details i {
    margin-right: 8px;
}

.floating-share-bar {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7); /* Semi-transparent black background */
    padding: 10px;
    border-radius: 30px;
}

.floating-share-bar .share-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.floating-share-bar .share-btn i {
    color: white !important; /* Ensures icons are white */
    font-size: 20px;
}

/* Background colours per platform */
.whatsapp { background: #25D366; } /* WhatsApp Green */
.facebook { background: #1877F2; } /* Facebook Blue */
.sms { background: #34B7F1; } /* SMS Blue */
.twitter { background: #000; } /* X (Twitter) Black */

.nav-pills .nav-link.active, .nav-pills .show>.nav-link {
    background-color: #ff00;
}

.secondary-nav .container {
    max-width: 1320px;
    padding: 0px;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}
@media (max-width: 768px) {
    .list-unstyled.collapse {
        display: none;
    }
    .list-unstyled.collapse.show {
        display: block;
    }
}

.text-muted {
    --bs-text-opacity: 1;
    color: rgb(161 161 162 / 75%) !important;
}

/* Set default logo height to 35px */
.site-header .navbar-brand img {
    height: 35px !important; /* Override inline 50px everywhere */
}

/* Adjust logo height to 30px on mobile */
@media (max-width: 991px) {
    .site-header .navbar-brand img {
        height: 30px !important; /* Keep mobile at 30px */
    }
}

.text-4 {
    font-size: 0.75rem;
    line-height: 1;
    color: #ec2e2e;
}

/* Default height is set inline to 40px */

/* Adjust logo height on mobile screens (below 768px) */
@media (max-width: 767.98px) {
    .footer-logo-img {
        height: 20px !important; /* Override the inline style */
    }
}

.content figure {
    max-width: 100%;
}
.content img {
    max-width: 100%;
    height: auto;
}



.child-category-title > a{
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    margin-bottom: 0 !important;
    color: #000000 !important;
    opacity: 1 !important;
    transform: scale(1) !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}
.child-category-title >a:hover {
    opacity: 0.5 !important;
    transform: scale(1.05) !important;
}

/* ===== Races entry page tweaks ===== */
.race-entry-page {
    margin-top: -6px; /* parent has py-4 (~24px). -6px nets ~18px above billboard */
}

/* Ensure ad creatives fill their containers */
.rr-ad img {
    width: 100%;
    height: auto;
    display: block;
}

/* Tighten billboard spacing a touch */
.rr-billboard {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
}
.races-list-page {
    margin-top: -6px; /* tighten spacing above content */
    background-color: #f5f5f5;
    padding-top: 8px !important; /* override .py-4 top padding */
}

@media (max-width: 575.98px) {
  .races-list-page .rr-billboard {
    margin-bottom: 10px !important;
  }
  .races-list-page .category-header {
    margin-top: 4px;
    padding-bottom: .5rem;
  }
}

/* Taller featured image on mobile */
.race-featured {
    max-height: 400px;
}
@media (max-width: 575.98px) {
    .race-featured {
        max-height: 520px;
    }
}