/* ==========================================================================
   CHURCH CALENDAR - SIDEBAR OPTIMIZED (DOT VERSION)
   ========================================================================== */

/* 1. Sidebar Widget Override */
.sidebar-widget:has(.calendar-container) {
    padding: 8px !important;
    margin-bottom: 20px;
}

/* 2. Main Calendar Box */
.calendar-container {
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    padding: 5px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* 3. Dropdowns - Month and Year */
.calendar-header {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    width: 100%;
}

.calendar-header select {
    flex: 1;
    min-width: 0;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #cccccc;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    background-color: #fff;
}

/* 4. Weekdays Row */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    font-size: 0.65rem;
    color: #800020;
    margin-bottom: 5px;
}

/* 5. Days Grid */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

/* Individual Day Styling */
.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 4px;
    position: relative;
    color: #333;
    z-index: 1;
}

/* Today's Highlight (Jan 22, 2026) */
.calendar-day.today {
    background-color: #800020 !important;
    color: #ffffff !important;
    font-weight: bold;
}

/* Feast Day Highlight - Single Dot, No Underline */
.calendar-day.has-feast {
    color: #800020;
    font-weight: bold;
    text-decoration: none !important;
    /* Removes underlines */
}

.calendar-day.has-feast::after {
    content: '●';
    font-size: 8px;
    position: absolute;
    bottom: 2px;
    color: #800020;
}

.calendar-day.today.has-feast::after {
    color: #ffffff;
}

/* Ensure no other dots or underlines appear */
.calendar-day.has-feast {
    border-bottom: none !important;
}

/* 6. Modal Popup Styling */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    width: 85%;
    max-width: 350px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    right: 12px;
    top: 8px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

#modalDate {
    font-size: 1.1rem;
    color: #800020;
    margin-bottom: 10px;
    font-weight: 600;
}

#modalBody {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
}

/* 7. Mobile Specific Optimization */
@media (max-width: 480px) {
    .sidebar-widget:has(.calendar-container) {
        padding: 4px !important;
    }

    .calendar-container {
        padding: 3px;
    }

    .calendar-day {
        font-size: 0.7rem;
    }

    .calendar-weekdays {
        font-size: 0.55rem;
    }

    .calendar-day.has-feast::after {
        font-size: 6px;
        bottom: 1px;
    }
}

/* Modern Masonry Container */
.gallery-grid {
    column-count: 3;
    /* 3 columns on desktop */
    column-gap: 15px;
    /* Space between columns */
    padding: 10px 0;
}

/* Individual Item Styling */
.gallery-item {
    position: relative;
    margin-bottom: 15px;
    /* Space between photos vertically */
    break-inside: avoid;
    /* Prevents images from splitting across columns */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
    background: #fff;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    display: block;
    /* Removes the small gap at the bottom of images */
    height: auto;
    transition: transform 0.5s ease;
}

/* Hover Interactions */
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(128, 0, 32, 0.25);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Modern Glass Overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(128, 0, 32, 0.4);
    /* Maroon tint */
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: white;
    font-size: 1.8rem;
    border: 2px solid white;
    border-radius: 50%;
    padding: 15px;
}

/* Responsive: 2 columns for tablets, 1 for mobile */
@media (max-width: 992px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        column-count: 1;
    }
}