/* --- Premium Modern Redesign - ATS Themed --- */
@import url('tokens.css');

/* --- Skip Link (accessibility) --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    color: white;
}

/* --- Global Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 16px;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

main {
    padding: 2rem 0;
    min-height: calc(100vh - 160px); /* Adjust based on header/footer */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-color);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    margin-top: 0;
    line-height: 1.2;
}

h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

/* --- Header --- */
.site-header {
    background-color: var(--primary-dark);
    color: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo-area {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-area img {
    height: 40px;
    width: auto;
    margin-right: 1rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.05em;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
}

.main-nav a:hover, .main-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Hamburger for Mobile */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    height: 20px;
    width: 24px;
    padding: 0;
}

.hamburger-menu span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    background-color: var(--primary-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav ul {
    list-style: none;
    padding: 0.5rem 1rem;
    margin: 0;
}

.mobile-nav li {
    margin-bottom: 0;
}

.mobile-nav a {
    display: block;
    color: white;
    font-size: 0.95rem;
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* --- Hero Section --- */
.intro-section {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, #ffffff 100%);
    border-radius: 16px;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.intro-section h1 {
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.intro-section p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* --- Card Grid System --- */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.event-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0.8;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.event-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.event-meta {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.meta-icon {
    margin-right: 0.5rem;
    opacity: 0.7;
}

.btn-card {
    display: block;
    text-align: center;
    background-color: var(--bg-body);
    color: var(--primary-dark);
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.event-card:hover .btn-card {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(230, 57, 70, 0.3);
}

/* --- Results Page Header --- */
.results-header-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--accent-color);
    transform: translateX(-4px);
}

/* --- Search Bar --- */
.search-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    font-size: 1rem;
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    background-color: white;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--text-main);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-links  {
    margin-bottom: 1rem;
}

.footer-links a {
    color: white;
    margin: 0 0.75rem;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* --- Sub-navigation (All Events / Archer Search) --- */
.sub-nav-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.sub-nav-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.sub-nav-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.sub-nav-link.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

/* --- Filter Bar (Search Page) --- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.filter-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    background-color: white;
    font-family: var(--font-body);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.filter-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
}

/* --- Results Button (shared CTA style) --- */
.results-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: var(--font-body);
    text-decoration: none;
}

.results-button:hover {
    background-color: var(--accent-color);
    color: white;
}

.search-submit-btn {
    padding: 0.75rem 1.5rem;
    width: 100%;
}

/* --- Events Table (Search Results) --- */
.events-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
}

.events-table th {
    background-color: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-subtle);
}

.events-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    color: var(--text-main);
}

.events-table tbody tr {
    transition: background-color 0.2s ease;
}

.events-table tbody tr:hover {
    background-color: #f9fafb;
}

.events-table-title {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.info-text {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1.5rem 0;
    text-align: center;
}

.no-events {
    text-align: center;
    grid-column: 1 / -1;
    padding: 2rem;
    color: var(--text-secondary);
}

/* --- Utility Classes --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.hidden {
    display: none !important;
}

/* --- Back to Top --- */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* --- Error / Info Messages --- */
.error-message {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .hamburger-menu { display: flex; }
    .mobile-nav.active { display: block; }

    /* Compact header */
    .header-container { padding: 0 0.75rem; height: 48px; }
    .logo-area img { height: 28px; margin-right: 0.5rem; }
    .logo-text { font-size: 1rem; letter-spacing: 0; }

    /* Compact main padding */
    main { padding: 1rem 0; }
    .container { padding: 0 0.75rem; }
    h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }

    /* Compact intro hero */
    .intro-section {
        padding: 1.5rem 0.75rem;
        margin-bottom: 1.25rem;
        border-radius: 10px;
    }
    .intro-section p { font-size: 0.95rem; }

    /* Compact sub-nav tabs */
    .sub-nav-bar {
        margin: 0.75rem 0;
        gap: 0.35rem;
    }
    .sub-nav-link {
        padding: 0.35rem 0.9rem;
        font-size: 0.75rem;
        border-radius: 20px;
    }

    /* Compact event cards */
    .event-grid { grid-template-columns: 1fr; gap: 1rem; }
    .event-card { padding: 1rem; border-radius: 10px; }
    .event-card h3 { font-size: 1.1rem; }
    .btn-card { padding: 0.5rem; font-size: 0.9rem; }

    /* Compact filter / search */
    .filter-bar { flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
    .filter-group { min-width: 100%; }
    .filter-group input[type="text"] { padding: 0.6rem 0.75rem; font-size: 0.95rem; }
    .search-submit-btn { padding: 0.6rem 1rem; }

    /* Compact tables */
    .events-table { display: block; overflow-x: auto; }
    .events-table th, .events-table td { padding: 0.5rem 0.6rem; font-size: 0.85rem; }

    /* Compact footer */
    .site-footer { padding: 1.25rem 0; }
    .footer-links a { margin: 0 0.5rem; font-size: 0.8rem; }
    .footer-copyright { font-size: 0.8rem; }

    /* Compact back-to-top */
    #back-to-top { width: 36px; height: 36px; font-size: 1rem; bottom: 1rem; right: 1rem; }
}

/* --- Display Font Class --- */
.font-headline {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

/* --- Focus-Visible (keyboard-only focus ring) --- */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .site-header, .site-footer, #back-to-top, .sub-nav-bar { display: none; }
}
