/* =========================================
   Bethlehem Alive - Main Stylesheet
   Dark celestial theme with accessibility focus
   ========================================= */

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

:root {
    /* Color Palette (BRF-4.2) */
    --bg-dark: #0d1117;
    --bg-mid: #161b22;
    --star-gold: #f6c945;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --warm-highlight: #d4a574;
    --angelic-white: #ffffff;
    --deep-shadow: #010409;
    
    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
    --font-accent: 'Cormorant Garamond', serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    
    /* Layout */
    --max-width: 800px;
    --content-padding: 2rem;
    
    /* Z-index layers */
    --z-background: 1;
    --z-silhouette: 2;
    --z-content: 10;
    --z-header: 20;
}

/* === Base Typography & Body === */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-dark);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* === Starry Background Effect === */
/* Layer 1: Small, distant stars (most numerous) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    background: 
        radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.3) 0%, transparent 0.5%) 0 0 / 180px 220px,
        radial-gradient(circle at 73% 28%, rgba(255, 255, 255, 0.25) 0%, transparent 0.4%) 20px 40px / 240px 190px,
        radial-gradient(circle at 42% 67%, rgba(246, 201, 69, 0.3) 0%, transparent 0.6%) 50px 80px / 210px 280px,
        radial-gradient(circle at 88% 45%, rgba(255, 255, 255, 0.2) 0%, transparent 0.3%) 30px 20px / 260px 240px,
        radial-gradient(circle at 28% 89%, rgba(246, 201, 69, 0.2) 0%, transparent 0.5%) 70px 50px / 190px 210px,
        radial-gradient(circle at 91% 78%, rgba(255, 255, 255, 0.3) 0%, transparent 0.4%) 10px 90px / 230px 200px,
        radial-gradient(circle at 56% 34%, rgba(246, 201, 69, 0.25) 0%, transparent 0.3%) 40px 30px / 270px 250px,
        radial-gradient(circle at 7% 56%, rgba(255, 255, 255, 0.25) 0%, transparent 0.5%) 60px 10px / 200px 270px;
    background-color: var(--bg-dark);
    pointer-events: none;
    animation: starfield-drift 120s linear infinite;
}

/* Layer 2: Medium-sized stars */
html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    background: 
        radial-gradient(circle at 22% 41%, rgba(246, 201, 69, 0.4) 0%, transparent 1%) 0 0 / 340px 380px,
        radial-gradient(circle at 68% 73%, rgba(255, 255, 255, 0.35) 0%, transparent 0.8%) 80px 120px / 420px 360px,
        radial-gradient(circle at 45% 18%, rgba(246, 201, 69, 0.35) 0%, transparent 0.9%) 120px 40px / 380px 420px,
        radial-gradient(circle at 82% 92%, rgba(255, 255, 255, 0.3) 0%, transparent 0.7%) 40px 160px / 360px 340px,
        radial-gradient(circle at 13% 88%, rgba(255, 255, 255, 0.4) 0%, transparent 1%) 160px 80px / 400px 380px;
    pointer-events: none;
    animation: starfield-drift 180s linear infinite reverse;
}

/* Layer 3: Larger, brighter accent stars */
html::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    background: 
        radial-gradient(circle at 38% 25%, rgba(246, 201, 69, 0.5) 0%, transparent 1.5%) 0 0 / 520px 480px,
        radial-gradient(circle at 77% 61%, rgba(255, 255, 255, 0.45) 0%, transparent 1.2%) 100px 80px / 560px 540px,
        radial-gradient(circle at 19% 72%, rgba(246, 201, 69, 0.4) 0%, transparent 1.3%) 60px 120px / 500px 520px;
    pointer-events: none;
    opacity: 0.4;
}

/* Star of Bethlehem - Bright star in upper right */
body::after {
    content: '';
    position: fixed;
    top: 10%;
    right: 15%;
    width: 4px;
    height: 4px;
    background: var(--star-gold);
    border-radius: 50%;
    z-index: var(--z-background);
    box-shadow: 
        0 0 10px 2px var(--star-gold),
        0 0 20px 4px rgba(246, 201, 69, 0.8),
        0 0 30px 6px rgba(246, 201, 69, 0.5),
        0 0 40px 8px rgba(246, 201, 69, 0.3);
    animation: twinkle 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

@keyframes starfield-drift {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-10px) translateY(-10px); }
}

/* === Skip Link (Accessibility) === */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--star-gold);
    color: var(--deep-shadow);
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 700;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* === Typography Styles === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 600;
}

p {
    margin-bottom: var(--spacing-sm);
}

.lead {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.emphasis {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.125rem;
    color: var(--warm-highlight);
}

/* === Links === */
a {
    color: var(--star-gold);
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover,
a:focus {
    color: var(--warm-highlight);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--star-gold);
    outline-offset: 3px;
}

/* === Floating Action Buttons === */
.floating-actions {
    position: fixed;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    z-index: 100;
}

.floating-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(139, 148, 158, 0.3);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.floating-button svg {
    color: var(--star-gold);
    flex-shrink: 0;
}

.floating-button:hover,
.floating-button:focus {
    background: rgba(22, 27, 34, 1);
    border-color: var(--star-gold);
    color: var(--text-primary);
    transform: translateX(-4px);
}

.floating-button:focus {
    outline: 2px solid var(--star-gold);
    outline-offset: 2px;
}

/* Mobile adjustments for floating buttons */
@media (max-width: 767px) {
    .floating-actions {
        bottom: var(--spacing-sm);
        right: var(--spacing-sm);
    }
    
    .floating-button span {
        display: none;
    }
    
    .floating-button {
        padding: 0.625rem;
        justify-content: center;
        width: 44px;
        height: 44px;
    }
}

/* === Container & Layout === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
}

/* === Hero Section === */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl) var(--content-padding);
    z-index: var(--z-content);
    margin-bottom: 200px; /* Space for silhouette */
}

.hero-content {
    max-width: 900px;
    animation: fadeInUp 1.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-title {
    color: var(--star-gold);
    text-shadow: 0 0 20px rgba(246, 201, 69, 0.5);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.05em;
}

.tagline {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* === Scroll Indicator === */
.scroll-indicator {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    color: var(--star-gold);
    opacity: 0.7;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
    cursor: pointer;
    text-decoration: none;
}

.scroll-indicator:hover,
.scroll-indicator:focus {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
    text-decoration: none;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* === Call-to-Action Button === */
.cta-button {
    display: inline-block;
    background: var(--star-gold);
    color: var(--deep-shadow);
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 700;
    padding: 1rem 2.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 44px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(246, 201, 69, 0.3);
}

.cta-button:hover,
.cta-button:focus {
    background: var(--warm-highlight);
    color: var(--deep-shadow);
    text-decoration: none;
    box-shadow: 0 6px 25px rgba(246, 201, 69, 0.5);
    transform: translateY(-2px);
}

/* === Icon Buttons === */
.icon-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 400;
    padding: 0.5rem 1rem;
    border: 1px solid var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 44px;
}

.icon-button svg {
    color: var(--star-gold);
    flex-shrink: 0;
}

.icon-button:hover,
.icon-button:focus {
    border-color: var(--star-gold);
    color: var(--star-gold);
    transform: translateY(-2px);
}

.icon-button:focus {
    outline: 3px solid var(--star-gold);
    outline-offset: 3px;
}

.cta-button:focus {
    outline: 3px solid var(--angelic-white);
    outline-offset: 3px;
}

/* === Content Sections === */
.content-section {
    position: relative;
    background: transparent;
    padding: var(--spacing-xl) 0;
    z-index: var(--z-content);
    margin-bottom: var(--spacing-lg);
}

.content-section:last-of-type {
    margin-bottom: 250px; /* Extra space for silhouette */
}

/* === Journey Stations === */
.journey-stations {
    display: grid;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.station {
    background: var(--bg-dark);
    padding: var(--spacing-md);
    border-radius: 8px;
    border-left: 4px solid var(--star-gold);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.station:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 20px rgba(246, 201, 69, 0.2);
}

.station h3 {
    color: var(--star-gold);
    margin-bottom: var(--spacing-xs);
}

.station p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* === Details Section === */
.details-section {
    background: transparent;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.detail-card {
    background: var(--bg-mid);
    padding: var(--spacing-md);
    border-radius: 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.detail-card-full {
    grid-column: 1 / -1;
    max-width: 100%;
}

.detail-card:hover {
    border-color: var(--star-gold);
    transform: translateY(-4px);
}

.detail-card h3 {
    color: var(--warm-highlight);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.detail-highlight {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--star-gold);
    margin-bottom: var(--spacing-xs);
}

.detail-highlight.free {
    font-size: 2rem;
    color: var(--warm-highlight);
}

.detail-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

.map-link {
    display: inline-block;
    margin-top: var(--spacing-sm);
    font-weight: 700;
    color: var(--star-gold);
}

.calendar-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.calendar-link:hover,
.calendar-link:focus {
    color: var(--warm-highlight);
    text-decoration: underline;
}

.calendar-link:focus {
    outline: 2px solid var(--star-gold);
    outline-offset: 2px;
}

/* === Accessibility Section === */
.accessibility-section {
    background: transparent;
}

.accessibility-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.feature .icon {
    color: var(--star-gold);
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(246, 201, 69, 0.3));
}

.feature-content {
    flex: 1;
}

.feature-content h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.feature-content p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* === Fellowship Section === */
.fellowship-section {
    background: transparent;
}

.fellowship-content {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-mid);
    border-radius: 8px;
    border-left: 4px solid var(--warm-highlight);
}

/* === Contact Section === */
.contact-section {
    background: transparent;
}

.contact-info {
    margin-top: var(--spacing-md);
    font-size: 1.125rem;
}

.contact-info p {
    margin-bottom: var(--spacing-sm);
}

.contact-info strong {
    color: var(--warm-highlight);
}

.contact-info a {
    font-weight: 700;
}

/* === Footer === */
.site-footer {
    position: relative;
    background: var(--deep-shadow);
    color: var(--text-secondary);
    padding: var(--spacing-lg) 0 var(--spacing-md);
    text-align: center;
    z-index: var(--z-content);
    border-top: 2px solid rgba(246, 201, 69, 0.2);
}

.footer-text {
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

.footer-text strong {
    color: var(--star-gold);
}

.copyright {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.accessibility-note {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.accessibility-note a {
    color: var(--warm-highlight);
}

/* === Nativity Silhouette (Fixed Bottom) === */
.nativity-silhouette {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-silhouette);
    pointer-events: none;
    overflow: visible;
    height: 200px;
    display: flex;
    align-items: flex-end;
}

.nativity-silhouette img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.9;
    filter: brightness(0) saturate(100%);
    margin-bottom: 0;
}

/* === Responsive Design === */

/* Tablet (768px+) */
@media (min-width: 768px) {
    :root {
        --content-padding: 3rem;
    }
    
    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nativity-silhouette {
        height: 180px;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    :root {
        --content-padding: 4rem;
    }
    
    .hero-section {
        margin-bottom: 180px;
    }
    
    .journey-stations {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .nativity-silhouette {
        height: 160px;
    }
    
    /* Hover effects more pronounced on desktop */
    .station:hover {
        transform: translateX(12px);
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .nativity-silhouette {
        height: 180px;
    }
}

/* === Reduced Motion Support === */
@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;
    }
    
    body::after {
        animation: none;
    }
}

/* === High Contrast Mode Support === */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #ffffff;
        --star-gold: #ffdf6b;
    }
    
    .cta-button {
        border: 2px solid var(--deep-shadow);
    }
    
    .detail-card,
    .station {
        border-width: 3px;
    }
}

/* === Print Styles === */
@media print {
    body::before,
    body::after,
    .nativity-silhouette {
        display: none;
    }
    
    .content-section {
        background: white;
        color: black;
        page-break-inside: avoid;
    }
    
    .cta-button {
        border: 2px solid black;
        color: black;
        background: white;
    }
}

/* === Focus Visible Enhancement === */
:focus-visible {
    outline: 3px solid var(--star-gold);
    outline-offset: 3px;
}

/* === Selection Styling === */
::selection {
    background: var(--star-gold);
    color: var(--deep-shadow);
}

::-moz-selection {
    background: var(--star-gold);
    color: var(--deep-shadow);
}
