/* Core structure assumed from previous context */
:root {
    --primary-color: #17a2b8; /* Light Blue/Teal (Adjust if needed) */
    --secondary-color: #0f3e44; /* Dark Teal (Adjust if needed) */
    --accent-color: #ffc107; /* Yellow/Gold (Adjust if needed) */
    --white: #ffffff;
    --text-dark: #333;
    --text-light: #666;
    --topbar-bg: #f4f4f4;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
}

/* Prevent accidental horizontal scrolling site-wide (keeps layout tidy) */
html, body {
    overflow-x: hidden;
}

/* ===================================================
   TOP BAR STYLING (Desktop)
   =================================================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5%;
    background-color: var(--topbar-bg);
    font-size: 0.85rem;
    color: var(--text-light);
}
.top-info span {
    margin-right: 20px;
}
.top-info i {
    color: var(--primary-color);
    margin-right: 5px;
}
.top-socials a {
    color: var(--secondary-color);
    margin-left: 10px;
    font-size: 1.1rem;
    transition: color 0.3s;
}
.top-socials a:hover {
    color: var(--primary-color);
}

/* ===================================================
   MAIN NAVBAR STYLING (Desktop)
   =================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
    border-bottom: 1px solid transparent; 
    box-sizing: border-box;
    width: 100%;
}
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-weight: bold;
}
.logo img {
    height: 50px; 
    margin-right: 10px;
}
.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

/* Hide nav initially until JS redistribution completes (prevents flash) */
.nav-links.initializing {
    visibility: hidden;
}
.nav-links li a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 600;
    transition: color 0.3s;
}
.nav-links li a:hover,
.nav-links li a.active {
    color: var(--primary-color);
}
.btn-donate {
    background-color: var(--accent-color);
    color: var(--secondary-color) !important;
    padding: 8px 15px !important;
    border-radius: 5px;
    font-weight: bold;
}

/* Hide the toggle button on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 10px;
}

/* ===================================================
   FOOTER LAYOUT FIX (DESKTOP)
   =================================================== */

footer {
    background-color: var(--secondary-color); /* Dark Teal */
    color: var(--white);
    padding: 60px 5% 20px;
}

.footer-grid {
    display: grid;
    /* Define 3 equal columns for the desktop layout */
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 40px;
    margin-bottom: 20px;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

.footer-col p {
    color: rgba(255,255,255,0.7); 
    font-size: 0.95rem;
}

/* Footer Links List */
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col ul li {
    margin-bottom: 8px;
}
.footer-col ul li a {
    color: var(--white);
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    opacity: 0.8;
}
.footer-col ul li a:hover {
    opacity: 1;
    color: var(--primary-color);
}

/* Contact Info rows */
.contact-row {
    display: flex; /* Aligns the icon and text */
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--white);
    opacity: 0.8;
}
.contact-row i {
    color: var(--primary-color);
    margin-right: 8px;
    font-size: 1rem;
}

/* Social icons at the bottom of the contact column */
.footer-col > div a {
    transition: color 0.3s;
}
.footer-col > div a:hover {
    color: var(--primary-color) !important;
}

.copyright {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 1200px;
    margin: 0 auto;
}

/* ===================================================
   MOBILE MEDIA QUERY
   =================================================== */

@media (max-width: 900px) {
    /* --- TOP BAR FIX --- */
    .top-bar {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    .top-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 5px 0;
    }
    .top-info span {
        margin: 2px 0; 
        margin-right: 0; 
    }
    .top-socials {
        padding: 5px 0;
    }

    /* --- MAIN NAVBAR FIX --- */
    .navbar {
        flex-wrap: wrap; 
        padding: 10px 5%;
    }
    
    /* 1. Show the toggle button */
    .menu-toggle {
        display: block;
        margin-left: auto; 
    }

    /* 2. Collapse the navigation links */
    .nav-links {
        display: none; /* Hide menu by default */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%; 
        left: 0;
        background-color: var(--white);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 9;
        border-top: 1px solid #eee;
    }

    /* 3. Style individual menu items for mobile */
    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }
    .nav-links li:last-child {
        border-bottom: none;
    }
    .nav-links li a {
        padding: 15px 20px;
        text-align: left;
    }
    .btn-donate {
        margin: 10px 20px;
        text-align: center;
    }

    /* 4. Show the menu when the 'open' class is applied by JS */
    .nav-links.open {
        display: flex;
    }

    /* --- FOOTER FIX (Stacking) --- */
    .footer-grid {
        /* Stack columns vertically on mobile */
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    .footer-col {
        padding: 10px 0;
    }
    .footer-col h4 {
        margin-left: auto;
        margin-right: auto;
    }
    .footer-col ul {
        width: max-content;
        margin: 0 auto;
    }
    .contact-row {
        /* Center contact rows horizontally */
        justify-content: center;
    }
}

/* ===================================================
   DESKTOP: Keep header/nav on a single line
   =================================================== */
@media (min-width: 992px) {
    .navbar {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 5%;
    }

    .logo {
        flex: 0 0 auto;
        max-width: 220px;
    }
    .logo img { height: 46px; }

    /* Center nav and prevent wrapping */
    .nav-links {
        display: flex;
        flex: 1 1 auto;
        justify-content: center;
        gap: 18px;
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: visible;
        align-items: center;
    }
    .nav-links li { flex: 0 0 auto; }
    .nav-links li a { white-space: nowrap; padding: 8px 12px; }

    /* Ensure donate button doesn't push nav down */
    .btn-donate {
        flex: 0 0 auto;
        margin-left: 12px;
        padding: 8px 12px !important;
    }

    /* Hide mobile toggle on desktop */
    .menu-toggle { display: none; }

    /* Slightly reduce nav spacing for very long menus */
    .nav-links.long-menu li a { padding: 6px 8px; }
}

/* Styles for the overflow 'more' menu */
.nav-links { position: relative; }
.nav-links .more { position: relative; display: none; }
.nav-links .more .more-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 10px;
    color: var(--secondary-color);
    font-size: 1rem;
}
/* Count bubble next to the more icon */
.nav-links .more .more-toggle .more-count {
    margin-left: 6px;
    font-size: 0.85rem;
    color: var(--secondary-color);
    background: rgba(0,0,0,0.06);
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1;
}
.nav-links .more .more-list {
    display: none;
    position: absolute;
    /* align dropdown inside the navbar padding so it doesn't force overflow */
    right: 5%;
    top: calc(100% + 6px);
    background: var(--white);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    border-radius: 6px;
    list-style: none;
    padding: 8px 6px;
    min-width: 180px;
    z-index: 50;
}
.nav-links .more .more-list.open { display: block; }
.nav-links .more .more-list li { display: block; }
.nav-links .more .more-list li a { display: block; padding: 8px 12px; color: var(--secondary-color); }

/* Ensure donate button stays visible and not moved into more */
/* Ensure donate button stays visible and not moved into more (nav item) */
.nav-links .donate-li { flex: 0 0 auto; margin-left: 12px; }
.nav-links .donate-li .btn-donate { padding: 8px 12px; }

/* Hide the more-list on small screens (mobile uses full menu) */
@media (max-width: 900px) {
    .nav-links .more { display: none !important; }
}

/* Mobile adjustments for donate as a nav item */
@media (max-width: 900px) {
    .nav-links .donate-li { order: 2; margin-left: 8px; }
    .navbar { align-items: center; }
}

/* Desktop: ensure nav links take available space and donate sits to the right of the list */
@media (min-width: 992px) {
    .navbar { position: relative; }
    .nav-links { flex: 1 1 auto; }
    .nav-links .donate-li { margin-left: 12px; }
}

/* ===================================================
   PERFORMER CARDS GRID
   =================================================== */
.performers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.performer-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    scroll-margin-top: 120px;
}

.performer-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.14);
}

.performer-card:target {
    animation: highlight-performer 2s ease;
    box-shadow: 0 0 0 3px var(--accent-color);
}

@keyframes highlight-performer {
    0%, 100% { box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
    50% { box-shadow: 0 0 0 3px var(--accent-color), 0 12px 28px rgba(0,0,0,0.14); }
}

.performer-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 8px 8px 0 0;
}

.performer-card-content {
    padding: 18px;
}

.performer-card h4 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.performer-role {
    margin: 0 0 10px;
    font-size: 0.88rem;
    color: var(--primary-color);
    font-weight: 600;
}

.performer-card p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .performers-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    .performer-card img { height: 180px; }
    .performer-card-content { padding: 14px; }
    .performer-card h4 { font-size: 1rem; }
}

@media (max-width: 480px) {
    .performers-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .performer-card img { height: 160px; }
}

/* ===================================================
     PARTICIPANTS (Event cards) - moved from event page
     =================================================== */
.participants { margin-top: 36px; }
.participants h3 { margin-bottom: 8px; color: var(--secondary-color); }
.participants p.lead { color: var(--text-light); margin-bottom: 18px; }
.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 12px;
}
.participant {
    background: var(--white);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
}
.participant:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(0,0,0,0.12); }
.participant-logo {
    width: 64px; height: 64px; border-radius: 8px; background: #fafafa;
    display:flex; align-items:center; justify-content:center; font-size:1.6rem; color: var(--secondary-color);
    flex: 0 0 64px;
}
.participant-info h4 { margin: 0; font-size: 1rem; color: var(--secondary-color); }
.participant-info p { margin: 4px 0 0; font-size: 0.92rem; color: var(--text-light); }
.participant .external { margin-left: 8px; color: var(--primary-color); font-size: 0.95rem; }

@media (max-width: 520px) {
    .participant { padding: 10px; gap: 10px; }
    .participant-logo { width: 56px; height: 56px; flex: 0 0 56px; }
}

/* ===================================================
     Event page responsive layout and poster rules
     =================================================== */
.event-layout {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 360px);
    gap: 30px;
    align-items: start;
    margin-top: 20px;
}
.event-layout aside { text-align: center; }
.event-layout aside img {
    width: 100%;
    max-width: 360px; /* prevents huge poster from forcing layout */
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .event-layout { grid-template-columns: 1fr; }
    .event-layout aside { order: 0; }
}

/* ===================================================
   QUICK NAVIGATION & ACCORDION
   =================================================== */
.quick-nav {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px 24px;
    border-radius: 12px;
    margin: 32px 0 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.quick-nav-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 10px;
}

.quick-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-nav-links a {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
}

.quick-nav-links a:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Accordion */
.accordion {
    margin-top: 24px;
}

.accordion-item {
    margin-bottom: 16px;
    border: 2px solid #e6e6e6;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s, border-color 0.3s;
}

.accordion-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.accordion-header {
    width: 100%;
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    border: none;
    padding: 18px 24px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    transition: all 0.3s;
}

.accordion-header:hover {
    background: linear-gradient(to right, #e9ecef, #f8f9fa);
}

.accordion-header[aria-expanded="true"] {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    box-shadow: inset 0 -2px 0 rgba(255,255,255,0.1);
}

.accordion-header span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.accordion-header span i {
    font-size: 1.2rem;
    opacity: 0.9;
}

.accordion-icon {
    transition: transform 0.3s;
    font-size: 1rem;
    opacity: 0.7;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
    opacity: 1;
}

.accordion-content {
    display: none;
    padding: 28px 24px;
    line-height: 1.7;
    background: #fafbfc;
    border-top: 1px solid #e6e6e6;
}

.accordion-content h3 {
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.accordion-content h4 {
    color: var(--secondary-color);
    margin-top: 20px;
    margin-bottom: 12px;
}

.accordion-content p {
    margin-bottom: 14px;
}

.accordion-content ul {
    margin: 14px 0;
    padding-left: 24px;
}

.accordion-content ul li {
    margin-bottom: 8px;
}

/* Section-specific styling */
.accordion-content .event-layout {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Back to top link */
.back-to-top {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e6e6e6;
}

.back-to-top a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
}

.back-to-top a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.back-to-top a i {
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .quick-nav {
        padding: 16px 18px;
        margin: 24px 0 20px;
    }
    
    .quick-nav-title {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    
    .quick-nav-links {
        gap: 8px;
    }
    
    .quick-nav-links a {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .accordion-header {
        padding: 16px 18px;
        font-size: 1rem;
    }
    
    .accordion-header span i {
        font-size: 1rem;
    }
    
    .accordion-content {
        padding: 20px 18px;
    }
    
    .accordion-content h3 {
        font-size: 1.15rem;
    }
}