/* Base Imports and Fonts */
/* Google Fonts import - commented out in favor of self-hosted fonts */
/* @import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@300;400;500;600;700;800;900&display=swap'); */

/* Self-hosted font implementation */
@font-face {
    font-family: 'Anton';
    src: url('/static/fonts/anton-regular.woff2') format('woff2'),
         url('/static/fonts/Anton-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/inter-var.woff2') format('woff2'),
         url('/static/fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Root Variables */
:root {
    /* Base */
    --primary-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --heading-font: 'Anton', Impact, 'Arial Black', sans-serif;
    --mono-font: 'Courier New', monospace;
    --heading-color: #092e20;
    
    /* Gray Scale */
    --bg-gray-50: #f9fafb;
    --bg-gray-100: #f3f4f6;
    --bg-gray-200: #e5e7eb;
    --bg-gray-300: #d1d5db;
    --bg-gray-400: #9ca3af;
    --bg-gray-500: #6b7280;
    --bg-gray-600: #4b5563;
    --bg-gray-700: #374151;
    --bg-gray-800: #192133;
    --bg-gray-900: #070e1d;

    /* Text Colors */
    --text-gray-50: #f9fafb;
    --text-gray-100: #f3f4f6;
    --text-gray-200: #e5e7eb;
    --text-gray-300: #d1d5db;
    --text-gray-400: #9ca3af;
    --text-gray-500: #6b7280;
    --text-gray-600: #4b5563;
    --text-gray-700: #374151;
    --text-gray-800: #192133;
    --text-gray-900: #070e1d;
    
    /* Theme Colors - Light */
    --bg-color: #ffffff;
    --text-color: #000000;
    --nav-bg: var(--bg-gray-100);
    --nav-text: var(--bg-gray-900);
    --link-color: #888888;
    --link-hover-color: #5b0fa2;
    --border-color: #4a5568;
    --card-bg: var(--bg-gray-50);
    --card-text: var(--bg-gray-800);
    --button-bg: #888888;
    --button-text: #ffffff;
    --input-bg: var(--bg-gray-100);
    --input-text: var(--bg-gray-900);
    --footer-bg: var(--bg-gray-100);
    --footer-text: var(--bg-gray-900);
}

/* Dark Theme Variables */
.dark {
    --bg-color: #192133;
    --text-color: #f7fafc;
    --nav-bg: #070e1d;
    --nav-text: #f7fafc;
    --link-color: #888888;
    --link-hover-color: #90cdf4;
    --border-color: #4a5568;
    --card-bg: #070e1d;
    --card-text: #f7fafc;
    --input-bg: #070e1d;
    --input-text: #f7fafc;
    --footer-bg: #070e1d;
    --footer-text: #f7fafc;
}

/* Base Element Styles */
html {
    scroll-behavior: smooth;
}

html {
    scroll-behavior: smooth;
}


body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--primary-font);
}

/* Typography - New Heading Hierarchy */
h1, .h1 {
    font-family: var(--heading-font);
    font-size: 4.5rem; /* 72px */
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    font-weight: 400; /* Anton only comes in 400 weight */
    margin-bottom: 0.5em;
}

h2, .h2 {
    font-family: var(--primary-font);
    font-size: 2.5rem; /* 40px - middle ground between h1 and former h2 */
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 0.5em;
}

h3, .h3 {
    font-family: var(--primary-font);
    font-size: 1.75rem; /* 28px - your former h2 size */
    line-height: 1.3;
    font-weight: 700;
    margin-bottom: 0.5em;
}

h4, .h4 {
    font-family: var(--primary-font);
    font-size: 1.25rem; /* 20px */
    line-height: 1.4;
    font-weight: 600;
    margin-bottom: 0.5em;
}

h5, .h5 {
    font-family: var(--primary-font);
    font-size: 1rem; /* 16px */
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: 0.5em;
}

h6, .h6 {
    font-family: var(--primary-font);
    font-size: 0.875rem; /* 14px */
    line-height: 1.5;
    font-weight: 500;
    margin-bottom: 0.5em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Code and monospace text */
code, pre, .monospace {
    font-family: var(--mono-font);
}

/* Layout Structure */
.flex.flex-col.min-h-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

#footer {
    position: relative;
    z-index: 20;
    display: block;
    margin-top: auto;
    background-color: var(--footer-bg);
}

/* Header and Navigation */
.sticky {
    position: sticky;
    top: 24px;
}

/* Logo Animation */
@keyframes revealLogo {
  0% {
    clip-path: polygon(0 0, 15% 0, 15% 100%, 0 100%);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

/* Logo container base styling */
.logo-container {
    display: flex;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
}

/* Logo animation container */
.logo-animation-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.logo-text-reveal {
    position: relative;
    transform-origin: left center;
    /* Initial state - shows just the baseball part (approx. 15% of the image) */
    clip-path: polygon(0 0, 15% 0, 15% 100%, 0 100%);
    transition: clip-path 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Animation on page load is handled by JavaScript */
/* But also add hover effect for interactive feel */
.logo-container:hover .logo-text-reveal {
    animation: revealLogo 1.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Reset animation when JavaScript detects no motion preference */
.reduce-motion .logo-text-reveal {
    clip-path: none;
    animation: none;
    transition: none;
}

.logo-container img {
    height: auto;
    max-width: 180px;
    transition: opacity 0.3s ease-in-out;
    border: 0;
}

.logo-container img.hidden {
    opacity: 0;
    position: absolute;
}

/* Content Areas */
.sections-content-area {
    padding-left: 1rem;
    padding-right: 1rem;
}

.homepage .content-area {
    padding-left: 0;
    padding-right: 0;
}

.content-overlay {
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.5));
    transition: all 0.3s ease;
}

.dark .content-overlay {
    background: linerar-gradient(to bottom, transparent, rgba(0, 0, 0, 0.5));
    transition: all 0.3s ease;
}

#gradient-container {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 0;
}

/* Typography */
.title-page-header {
    font-weight: 400 !important;
    text-shadow:2px 2px 4px rgba(0, 0, 0, 0.8) !important;
}

/* Table of Contents */
#toc-container {
    width: 250px;
    max-width: 250px;
}

.layout-with-toc {
    display: flex;
    flex-direction: row;
    gap: 4em;
}

.layout-with-toc #content-area {
    width: calc(80% - 3em);
}

#toc a {
    color: #1f2937;
    font-size: 12px;
}

.dark #toc a {
    color: #d1d5db;
}

#toc a.text-indigo-600 {
    color: #888888;
}

.dark #toc a.text-indigo-600 {
    color: #888888;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    width: fit-content;
    min-width: 240px;
    flex-wrap: wrap;
    padding: 8px 4px;
    list-style: none;
    margin-right: auto;
    justify-content: left;
    background-color: var(--nav-bg);
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    padding-right: 0.5rem;
    color: #888888;
    content: "⏵";
}

.breadcrumb-item a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-color: #888888;
}

.breadcrumb-item.active {
    color: var(--text-gray-500);
}

.exclusive {
    width: fit-content !important;
    max-width: 300px;
    font-size: 12px; 
    font-weight: 700;
    padding: 4px 8px !important;
    text-transform: uppercase;
}

/* Base styles for the #bread element */
#bread {
    margin: 0 auto; /* Center the element */
    max-width: 1200px; /* Set a maximum width (adjust as needed) */
    display: flex; /* Use flexbox for layout */
    justify-content: flex-end; /* Align content to the end */
    margin-bottom: 3rem; /* Bottom margin */
}

/* Media query for mobile devices */
@media (max-width: 768px) { /* Adjust the max-width as needed for your mobile breakpoint */
    #bread {
        width: 100%; /* Make the element full width on mobile */
        max-width: none; /* Remove the maximum width on mobile */
        margin-bottom: 0; 
        display: inline-block;
    }
    .breadcrumbs {
        width: 100%;
    }
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close-lightbox {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    cursor: pointer;
}

.thumbnail {
    cursor: pointer;
    max-width: 100%;
    height: auto;
}
md:px-2 {
    
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--sport-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Dark mode adjustments */
.dark .nav-link:hover {
    color: var(--sport-color);
}

.dark .nav-link.active {
    color: var(--sport-color);
}

/* Mobile specific styles */
@media (max-width: 768px) {
    .nav-link::after {
        bottom: 0;
    }
}


/* Sport cards section fixes */
.sports-quick-access {
    position: relative;
    z-index: 10;
    padding: 6rem 0; /* Add vertical padding */
    margin-top: -8rem; /* Pull up slightly to overlap hero */
    background: transparent;
}

.sports-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.dark .sports-card {
    background: rgba(17, 24, 39, 0.9);
    border-color: rgba(255, 255, 255, 0.05);
}

.bg-white-transparent-50 {
    background-color: rgba(255, 255, 255, 0.5);
}

.bg-black-transparent-50 {
    background-color: rgba(0, 0, 0, 0.5);
}

.backdrop-blur-sm {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* For Safari */
}

/* NFL section spacing fixes */
.nfl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.nfl-grid-item-wide {
    grid-column: span 2;
}

/* Footer visibility fix */
#footer {
    position: relative;
    z-index: 10;
    background-color: var(--footer-bg);
    margin-top: auto;
}

/* Forms and Inputs */
input,
select,
textarea {
    background-color: var(--input-bg);
    color: var(--input-text);
    border-color: var(--border-color);
}

button,
.button {
    background-color: var(--button-bg);
    color: var(--button-text);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: relative;
    display: inline-block;
    background-color: #ccc;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}


.dark-mode-toggle[aria-checked="true"] {
    background-color: #4b5563;
}

.dark-mode-toggle[aria-checked="true"] .slider {
    transform: translateX(24px);
    background-color: #1e3a8a;
}

/* Menu Items */
.menu-items {
    display: none;
}

.menu-items.active {
    display: block;
    z-index: 200;
}

/* Error Pages */
.error-page {
    background-color: #f8f9fa;
    text-align: center;
    padding: 50px 0;
}

.error-404 {
    color: #721c24;
}

.error-500 {
    color: #1b1e21;
}

.error-page h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-page p {
    font-size: 18px;
    margin-bottom: 30px;
}

.error-page a {
    color: #007bff;
    text-decoration: none;
}

.error-page a:hover {
    text-decoration: underline;
}

/* Transitions */
.theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease;
}

html.no-transition * {
    transition: none !important;
}

.transition-colors {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.2, 0, 0.1, 0.5);
    transition-duration: 3ms;
}


/* Supernav styling */
.nav-item-container {
    position: relative;
}

.nav-item-container:hover .supernav,
.supernav.active-sport {
    transform: scaleY(1);
    opacity: 1;
}

/* Add arrow indicator for nav items with dropdown */
.nav-item-container .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-item-container:hover .nav-link::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--sport-color, #FFD800);
    color: #000;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, background-color 0.2s;
    z-index: 1000;
    font-weight: 600;
}

.back-to-top-btn:hover {
    background-color: var(--sport-hover-color, #857104);
    color: var(--sport-hover-text-color, #000);
}

.back-to-top-btn.visible {
    opacity: 1;
}

/* Fix space above navigation */
.homepage .relative.min-h-\[100vh\] {
    margin-top: -64px; /* Adjust based on your nav height */
    padding-top: 64px;
}

/* Gradient container positioning */
#gradient-container {
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 0;
}

.sport-card-svg svg, .sport-card-svg {
    width: 24px !important;
    max-height: 24px !important;
}

.footer-coverage {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 20%;
    flex: 0 0 20%;
    width: 20%;
} 

/* Safari-specific fixes */
@supports (-webkit-hyphens:none) {
    .flex-col.lg\:flex-row {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        flex-direction: column;
    }

    @media (min-width: 1024px) {
        .flex-col.lg\:flex-row {
            -webkit-box-orient: horizontal;
            -webkit-box-direction: normal;
            -webkit-flex-direction: row;
            flex-direction: row;
        }
    }

    /* Footer sections width control */
    @media (min-width: 768px) { 
        .footer-news, .footer-stories {
            -webkit-box-flex: 0;
            -webkit-flex: 0 0 40%;
            flex: 0 0 40%;
            width: 40%;
        }
    }
}

@media (min-width: 768px) { 
    .footer-coverage {
        width: 20%;
    }

    .footer-news, .footer-stories {
        width: 40%;
    }
}

@media (max-width: 768px) { 
    .footer-coverage {
        padding: 1em;
        width: 100%;
    }

    .footer-news, .footer-stories {
        padding: 1em;
        width: 100%;
    }
}

/* Backup styles for social grid layout */
#social-grid {
    margin-top: 4rem;
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}

/* Safari-specific grid fixes */
@supports (-webkit-hyphens:none) {
    #social-grid > div {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        flex-direction: column;
        gap: 2rem;
    }

    @media (min-width: 1024px) {
        #social-grid > div {
            -webkit-box-orient: horizontal;
            -webkit-box-direction: normal;
            -webkit-flex-direction: row;
            flex-direction: row;
        }
    }

    .sport-grid {
        display: -ms-grid;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

/* Social section */
.social-section {
    width: 100%;
}

.sport-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.sport-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

/* Logo section */
.logo-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo-section img {
    max-width: 150px;
    margin-bottom: 1.5rem;
}

.logo-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.logo-section p {
    font-size: 1.125rem;
    text-align: center;
}


.dark .sport-card {
    background: #1f2937;
    border-color: #374151;
}

.dark .logo-section h2 {
    color: #fff;
}

.dark .logo-section p {
    color: #9ca3af;
}


/* Tablet breakpoint */
@media (min-width: 768px) {
    .sport-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop breakpoint */
@media (min-width: 1024px) {
    #social-grid > div {
        flex-direction: row;
    }

    .social-section {
        width: 75%;
    }

    .sport-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .logo-section {
        width: 25%;
        justify-content: end;
    }

    .logo-section h2,
    .logo-section p {
        text-align: right;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {


    /* Fix space above navigation */
    .homepage .relative.min-h-\[100vh\] {
        margin-top: 0; /* Adjust based on your nav height */
        padding-top: 0;
    }

    /* Gradient container positioning */
    #gradient-container {
        height: auto;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 0;
    }


    .logo-container img {
        height: auto;
        max-width: 180px;
    }

    #bread,
    .breadcrumb {
        width: 100% !important;
    }

    
    #main-menu {
        padding: 0 1em;
    }

    .menu-items {
        position: fixed;
        top: 100px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--bg-color);
        padding: 1.5rem;
        z-index: 40;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }

    .menu-items.active {
        display: block;
        transform: translateX(0);
    }

    .menu-backdrop {
        display: none;
        position: fixed;
        top: 100px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 39;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

    .menu-backdrop.active {
        display: block;
        opacity: 1;
    }

    .menu-items a {
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease-in-out;
        transition-delay: calc(var(--item-index) * 0.05s);
    }

    .menu-items.active a {
        opacity: 1;
        transform: translateX(0);
    }

    body.overflow-hidden {
        overflow: hidden;
    }

    #resetFilters {
        margin-top: 1em;
        margin-left: 0;
    }

    #toc-container {
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 1rem;
    }

    .layout-with-toc {
        display: block !important;
    }

    .layout-with-toc #content-area,
    .layout-with-toc #toc-container {
        width: 100% !important;
        padding: 1em !important;
    }

    #toc-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0.5rem;
        background-color: #e5e7eb;
        border-radius: 0.5rem;
        cursor: pointer;
    }

    .dark #toc-toggle {
        background-color: #374151;
    }

    #toc-content {
        display: none;
        margin-top: 1rem;
    }

    #toc-content.active {
        display: block;
    }

    .w-full.text-sm.text-left.text-gray-500.dark\:text-gray-400 {
        padding-right: 20px;
    }

    .w-full.text-sm.text-left.text-gray-500.dark\:text-gray-400::after {
        content: '➡️';
        position: absolute;
        top: 50%;
        right: 5px;
        transform: translateY(-50%);
        font-size: 20px;
        color: #888;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .w-full.text-sm.text-left.text-gray-500.dark\:text-gray-400.has-overflow::after {
        opacity: 1;
    }

    /* Force mobile menu to always be above everything else when active */
    body .menu-backdrop.active {
        z-index: 999 !important;
    }
    
    body .menu-items.active {
        z-index: 1000 !important;
    }
    
    /* Ensure main menu nav stays above floating menu */
    nav#main-menu {
        position: relative;
        z-index: 999 !important;
    }
    
    /* Floating menu sits below the navigation */
    .floating-menu {
        z-index: 5 !important;
        top: 0 !important; /* Flush with top */
    }
}