/**
 * Out & About Lafayette - Main Stylesheet
 * ========================================
 * A community website for Lafayette, LA meetups and events
 * 
 * Table of Contents:
 * 1. CSS Custom Properties (Variables)
 * 2. Reset & Base Styles
 * 3. Typography
 * 4. Navigation
 * 5. Hero Section
 * 6. Buttons
 * 7. Section Layouts
 * 8. Event Cards
 * 9. About Section
 * 10. Gallery
 * 11. Local Spots
 * 12. Join/CTA Section
 * 13. Footer
 * 14. Utilities
 * 15. Responsive Design
 */

/* ===========================================
   1. CSS Custom Properties (Variables)
   =========================================== */
:root {
    /* Brand Colors */
    --primary: #E63946;      /* Cajun red */
    --secondary: #1D3557;    /* Deep blue */
    --accent: #F4A261;       /* Warm orange */
    --light: #F1FAEE;        /* Off-white */
    --dark: #2B2D42;         /* Near black */
    --gold: #D4A03C;         /* Louisiana gold */
    
    /* Semantic Colors */
    --text-primary: var(--dark);
    --text-muted: #666666;
    --bg-primary: var(--light);
    --bg-white: #ffffff;
    
    /* Typography */
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 5rem;
    
    /* Border Radius */
    --radius-sm: 5px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --radius-pill: 50px;
    
    /* Shadows */
    --shadow-sm: 0 3px 15px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    /* Layout */
    --max-width: 1200px;
    --nav-height: 70px;
}

/* ===========================================
   2. Reset & Base Styles
   =========================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* ===========================================
   3. Typography
   =========================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--space-md);
    color: var(--secondary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

/* ===========================================
   4. Navigation
   =========================================== */
.nav {
    background: var(--secondary);
    padding: var(--space-md) var(--space-lg);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--light);
    text-decoration: none;
}

.nav__logo span {
    color: var(--accent);
}

.nav__links {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
}

.nav__links a {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-normal);
}

.nav__links a:hover {
    color: var(--accent);
}

.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.nav__toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--light);
    margin: 5px 0;
    transition: var(--transition-normal);
}

/* Nav — Member / Facebook Login */
.nav__member {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: var(--space-md);
    flex-shrink: 0;
}

.nav__member-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.nav__member-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    font-size: 0.95rem;
}

.nav__member-name {
    color: var(--light);
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav__member-profile {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav__member-profile:hover .nav__member-name {
    color: var(--accent);
}

.nav__member-logout {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.2rem 0.35rem;
    border-radius: 50%;
    transition: color var(--transition-normal), background var(--transition-normal);
}

.nav__member-logout:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.nav__fb-login {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 1rem;
    background: #1877F2;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.85rem;
    margin-left: var(--space-md);
    flex-shrink: 0;
    transition: background var(--transition-normal);
}

.nav__fb-login:hover {
    background: #1565C0;
}

.nav__fb-icon {
    font-size: 1rem;
}

/* Checkin box on event detail */
.checkin-box .btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: opacity var(--transition-normal);
}

.checkin-box .btn:hover {
    opacity: 0.9;
}

/* ===========================================
   5. Hero Section
   =========================================== */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-height) + var(--space-lg)) var(--space-lg) var(--space-xl);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.05)"/></svg>') repeat;
    background-size: 50px 50px;
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero__title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--light);
    margin-bottom: var(--space-md);
}

.hero__title span {
    color: var(--accent);
}

.hero__subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-lg);
}

.hero__buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===========================================
   6. Buttons
   =========================================== */
.btn {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn--primary {
    background: var(--accent);
    color: var(--dark);
}

.btn--secondary {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--light);
}

.btn--secondary:hover {
    background: var(--light);
    color: var(--secondary);
}

.btn--white {
    background: white;
    color: var(--primary);
}

/* ===========================================
   7. Section Layouts
   =========================================== */
section {
    padding: var(--space-2xl) var(--space-lg);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ===========================================
   8. Event Cards
   =========================================== */
.events {
    background: var(--bg-white);
}

.events__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
}

.event-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
}

.event-card:hover {
    transform: translateY(-5px);
}

.event-card__date {
    background: var(--primary);
    color: white;
    padding: var(--space-md);
    text-align: center;
}

.event-card__day {
    font-size: 2rem;
    font-weight: 700;
}

.event-card__month {
    text-transform: uppercase;
    font-size: 0.9rem;
}

.event-card__info {
    padding: 1.5rem;
}

.event-card__title {
    color: var(--secondary);
    margin-bottom: var(--space-sm);
}

.event-card__description {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.event-card__location {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    color: var(--accent);
    font-weight: 500;
}

/* Events CTA Button */
.events__more {
    text-align: center;
    margin-top: var(--space-xl);
}

/* ===========================================
   8.5 Tag Badges (shared across pages)
   =========================================== */
.tag-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.tag-badges--md {
    gap: 0.5rem;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag-badges--md .tag-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
}

/* ===========================================
   8.6 Support Local & Try Something New Sections
   =========================================== */
.support-local {
    background: linear-gradient(135deg, #FFF5F5 0%, #FFF0F0 100%);
}

.support-local .section-title {
    color: var(--primary);
}

.support-local__grid,
.try-new__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
}

.try-new {
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
}

.try-new .section-title {
    color: #7B68EE;
}

.event-card__time-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===========================================
   9. About Section
   =========================================== */
.about {
    background: var(--secondary);
    color: var(--light);
}

.about .section-title {
    color: var(--light);
}

.about__grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.about-card {
    text-align: center;
    padding: var(--space-lg);
}

.about-card__icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.about-card__title {
    color: var(--accent);
    margin-bottom: var(--space-md);
    font-family: var(--font-body);
    font-weight: 600;
}

.about-card__text {
    color: rgba(255, 255, 255, 0.85);
}

/* ===========================================
   10. Gallery
   =========================================== */
.gallery {
    background: var(--bg-white);
}

.gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    max-width: var(--max-width);
    margin: 0 auto;
}

.gallery__item {
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    text-align: center;
    padding: var(--space-md);
    cursor: pointer;
    transition: transform var(--transition-normal);
}

.gallery__item:hover {
    transform: scale(1.05);
}

.gallery__placeholder {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--text-muted);
    font-style: italic;
}

/* ===========================================
   10.5. Member Spotlights
   =========================================== */
.spotlights {
    background: linear-gradient(135deg, var(--secondary) 0%, #2a4a7a 100%);
    color: var(--light);
}

.spotlights .section-title {
    color: var(--light);
}

.spotlights .section-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

.spotlights__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.spotlight-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform var(--transition-normal), background var(--transition-normal);
}

.spotlight-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.spotlight-card__avatar {
    width: 80px;
    height: 80px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.spotlight-card__name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--light);
    margin-bottom: 0.25rem;
}

.spotlight-card__role {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.spotlight-card__quote {
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 1rem;
    position: relative;
    padding: 0 1rem;
}

.spotlight-card__quote::before {
    content: '"';
    font-size: 3rem;
    color: var(--accent);
    position: absolute;
    top: -1rem;
    left: -0.5rem;
    opacity: 0.5;
    font-family: Georgia, serif;
}

.spotlight-card__events {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.spotlight-card__events strong {
    color: var(--accent);
}

.spotlights__cta {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

/* ===========================================
   11. Local Spots
   =========================================== */
.spots {
    background: var(--bg-primary);
}

.spots__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.spot-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.spot-card:hover {
    transform: translateY(-3px);
}

.spot-card__category {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: var(--space-xs) 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.spot-card__title {
    color: var(--secondary);
    margin-bottom: var(--space-sm);
    font-family: var(--font-body);
    font-weight: 600;
}

.spot-card__description {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===========================================
   12. Join/CTA Section
   =========================================== */
.join {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    text-align: center;
    color: white;
}

.join .section-title {
    color: white;
}

.join__text {
    max-width: 600px;
    margin: 0 auto var(--space-lg);
    font-size: 1.1rem;
}

/* ===========================================
   13. Footer
   =========================================== */
.footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer__social {
    margin-top: var(--space-md);
}

.footer__social a {
    display: inline-block;
    margin: 0 var(--space-sm);
    font-size: 1.5rem;
}

/* ===========================================
   14. Utilities
   =========================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-lg); }
.mt-3 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-lg); }
.mb-3 { margin-bottom: var(--space-xl); }

/* ===========================================
   15. Responsive Design
   =========================================== */
@media (max-width: 768px) {
    .nav__links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--secondary);
        flex-direction: column;
        padding: var(--space-md);
        gap: var(--space-md);
    }
    
    .nav__links.active {
        display: flex;
    }
    
    .nav__toggle {
        display: block;
    }

    .nav__member-name {
        display: none;
    }

    .nav__member {
        margin-left: var(--space-sm);
    }

    .nav__fb-login {
        margin-left: var(--space-sm);
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .hero__title {
        font-size: 2.5rem;
    }
    
    .hero__subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    section {
        padding: var(--space-xl) var(--space-md);
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 2rem;
    }
    
    .hero__buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
}

/* ===========================================
   Skip-to-Content (Accessibility)
   =========================================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary, #1D3557);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

/* ===========================================
   Mobile Bottom Tab Bar
   =========================================== */
.bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: var(--bg-white, #fff);
    border-top: 1px solid var(--gray-200, #E9ECEF);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-bar__tab,
.bottom-bar__more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0.45rem 0 0.35rem;
    text-decoration: none;
    color: var(--text-muted, #6C757D);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: none;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease;
}

.bottom-bar__tab--active,
.bottom-bar__tab:hover {
    color: var(--primary, #E63946);
}

.bottom-bar__icon {
    font-size: 1.25rem;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.bottom-bar__label {
    display: block;
}

/* More menu flyout */
.bottom-bar__flyout {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--bg-white, #fff);
    border: 1px solid var(--gray-200, #E9ECEF);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 9001;
}

.bottom-bar__flyout--open {
    display: block;
}

.bottom-bar__flyout a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--secondary, #1D3557);
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.15s ease;
}

.bottom-bar__flyout a:hover {
    background: var(--gray-50, #F8F9FA);
}

@media (max-width: 768px) {
    .bottom-bar {
        display: flex;
    }

    /* Add padding to bottom of page so footer isn't hidden */
    body {
        padding-bottom: 4.5rem;
    }
    
    /* Adjust footer margin */
    .footer {
        margin-bottom: 0;
    }
}

/* ===========================================
   Focus Indicators (Accessibility)
   =========================================== */
*:focus-visible {
    outline: 3px solid var(--accent, #F4A261);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* ===========================================
   Performance — Paint Containment
   =========================================== */

/* Below-fold sections: let the browser skip rendering until they scroll near */
.about,
.spots,
.join,
.support-local,
.try-new {
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
}
