﻿/* =============================================
   COLOR VARIABLES & BASE
   ============================================= */
:root {
    --church-navy: #1B2A47;
    --church-gold: #D4AF37;
    --church-bg: #F9F7F3;
    --church-text: #4A4A4A;
}

.announcements-wrapper {
    background-color: var(--church-bg);
    min-height: 100vh;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--church-text);
}

.text-navy {
    color: #1B2A47 !important;
}

.text-gold {
    color: #D4AF37 !important;
}

.bg-navy {
    background-color: #1B2A47 !important;
}

.border-subtle {
    border-color: #E2DED5 !important;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.hero-title, .section-heading {
    font-family: "Lora", "Playfair Display", "Merriweather", Georgia, serif;
    color: #1B2A47;
}

/* =============================================
   HERO BANNER
   ============================================= */
.fellowship-hero {
    background-color: #1B2A47;
    background-image: linear-gradient(135deg, rgba(27, 42, 71, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%), url('/images/church-pattern-bg.jpg');
    background-size: cover;
    background-position: center;
    padding-bottom: 5rem !important; /* Kept tight to reduce the gap */
    border-bottom: 4px solid #D4AF37;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.1rem;
    font-style: italic;
    font-family: "Lora", Georgia, serif;
}

.badge-gold {
    background-color: rgba(212, 175, 55, 0.15);
    color: #D4AF37;
    border: 1px solid rgba(212, 175, 55, 0.5);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

.mt-n5 {
    margin-top: -5rem !important;
}

/* =============================================
   CARDS & LAYOUT
   ============================================= */
.calendar-card {
    background-color: #FFFFFF;
    border-radius: 16px;
    border: none;
    border-top: 6px solid #1B2A47;
}

.announcements-feed-card {
    background-color: #FFFFFF;
    border-radius: 16px;
    border: 1px solid #E2DED5;
    /* max-height purposely removed so it perfectly flexes with the calendar height */
}

/* Mobile-friendly icon navigation buttons */
.btn-nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #F9F7F3;
    color: #1B2A47;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E2DED5;
    transition: all 0.2s ease;
}

    .btn-nav-icon:hover {
        background-color: #1B2A47;
        color: #FFFFFF;
        border-color: #1B2A47;
    }

/* =============================================
   CUSTOM CSS GRID CALENDAR
   ============================================= */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 1rem;
}

.calendar-day-header {
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #A09388;
    text-transform: uppercase;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #F9F7F3;
    margin-bottom: 0.5rem;
}

.calendar-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: #FDFBF7;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

    .calendar-cell.empty {
        background-color: transparent;
        cursor: default;
    }

    .calendar-cell:not(.empty):hover {
        background-color: #FFFFFF;
        border-color: #D4AF37;
        box-shadow: 0 4px 10px rgba(212, 175, 55, 0.15);
        transform: translateY(-2px);
    }

    .calendar-cell .day-number {
        font-size: 1.1rem;
        font-weight: 600;
        color: #1B2A47;
    }

    .calendar-cell.today {
        background-color: rgba(27, 42, 71, 0.05);
        border: 1px dashed #1B2A47;
    }

    .calendar-cell.selected {
        background-color: #1B2A47;
        border-color: #1B2A47;
        box-shadow: 0 8px 15px rgba(27, 42, 71, 0.2);
        transform: scale(1.05);
        z-index: 2;
    }

        .calendar-cell.selected .day-number {
            color: #FFFFFF;
        }

.event-dot {
    width: 6px;
    height: 6px;
    background-color: #D4AF37;
    border-radius: 50%;
    position: absolute;
    bottom: 15%;
}

/* =============================================
   EVENT FEED LIST (Scroll & Height Sync)
   ============================================= */
.feed-list {
    flex-grow: 1;
    overflow-x: hidden !important; /* FIX: Prevents horizontal scrolling */
    overflow-y: auto;
    height: 500px; /* Baseline for mobile/tablets */
}

/* DESKTOP MAGIC: Locks the feed list height strictly to the Calendar's height */
@media (min-width: 992px) {
    .col-lg-5 .feed-list {
        height: 0;
        min-height: 0;
    }
}

/* Custom scrollbar for the feed */
.feed-list::-webkit-scrollbar {
    width: 6px;
}

.feed-list::-webkit-scrollbar-track {
    background: #F9F7F3;
    border-radius: 10px;
}

.feed-list::-webkit-scrollbar-thumb {
    background: #E2DED5;
    border-radius: 10px;
}

.event-card {
    background-color: #FDFBF7;
    border-left: 4px solid #D4AF37;
    border-right: 1px solid #E2DED5;
    border-top: 1px solid #E2DED5;
    border-bottom: 4px solid #D4AF37;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .event-card:hover {
        transform: translateY(-3px);
        background-color: #FFFFFF;
        box-shadow: 0 10px 20px rgba(27, 42, 71, 0.08);
    }

/* =============================================
   EVENT FLYERS & IMAGES (Landscape Optimized)
   ============================================= */
.event-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9; /* Creates a perfect landscape box */
    border-radius: 12px;
    overflow: hidden;
    background-color: #F9F7F3;
    position: relative;
}

.event-featured-image {
    width: 100%;
    height: 100%; /* Stretches vertically to fill the wrapper */
    object-fit: cover; /* Ensures the image completely covers the area */
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.4s ease;
}

.event-card:hover .event-featured-image {
    transform: scale(1.03);
}

/* =============================================
   EXPANDED FEED STATE (The "Maximize" feature)
   ============================================= */
.expand-toggle-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    .expand-toggle-btn:hover {
        transform: scale(1.1) rotate(90deg);
    }

/* When expanded, override the desktop height lock to fill the screen */
.feed-list-expanded {
    height: 75vh !important;
    max-height: none;
}

.layout-transition > div {
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.event-card .bi-arrow-right-circle-fill {
    transition: transform 0.2s ease;
}

.event-card:hover .bi-arrow-right-circle-fill {
    transform: translateX(4px);
}

/* =============================================
   SINGLE EVENT MODAL (Glassmorphism & Slide Up)
   ============================================= */
.event-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.event-modal-card {
    background-color: #FFFFFF;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 24px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #FFFFFF;
    color: #1B2A47;
    border: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .btn-close-modal:hover {
        background-color: #DC3545;
        color: #FFFFFF;
        transform: rotate(90deg);
    }

/* Modal Hero Image Header */
.modal-hero-image {
    width: 100%;
    height: 400px; /* Forces a consistent tall banner height */
    background-color: #1B2A47;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    overflow: hidden;
    position: relative;
}

    .modal-hero-image img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Guarantees edge-to-edge coverage horizontally and vertically */
        display: block;
        position: absolute;
        top: 0;
        left: 0;
    }

/* Fallback Header (If no image is provided) */
.modal-hero-pattern {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.bg-gold {
    background-color: #D4AF37 !important;
}

.bg-linen {
    background-color: #F9F7F3 !important;
}

.icon-ring-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpCenter {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slide-up {
    animation: slideUpCenter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}
