/**
 * Shared Archive Layout Styles
 *
 * This file contains all styling for archive pages (events, courses, etc.):
 *
 * ARCHIVE LAYOUT:
 * - Two-column layout: 25% sidebar with filters + 75% content area with events
 * - Responsive layout that stacks on mobile devices
 * - Theme-agnostic layout fixes with !important declarations
 *
 * SIDEBAR STYLING:
 * - Filter dropdown buttons with hover and active states
 * - Expandable dropdown menus with smooth transitions
 * - Checkbox styling within filter dropdowns
 * - Responsive sidebar that stacks on mobile devices
 *
 * EVENT GRID LAYOUT:
 * - 3-column responsive grid for event tiles
 * - Event tile styling with hover effects and shadows
 * - EVENT badge positioning and semi-transparent styling
 * - Image, title, description, and button layout within tiles
 *
 * PAGINATION STYLING:
 * - Centered pagination buttons with proper spacing
 * - Active page highlighting and disabled button states
 * - Previous/Next button styling with hover effects
 *
 * RESPONSIVE DESIGN:
 * - Mobile-first approach with tablet and desktop breakpoints
 * - Sidebar collapses to full-width on smaller screens
 * - Grid adjusts from 3 columns to 2 to 1 based on screen size
 * - Touch-friendly button sizes and spacing on mobile
 *
 * @package MemberPulse
 * @subpackage Assets
 */

/* Archive Page Layout */

/* Main archive container removed - now using API-based events */

/* Archive page headings - add more margin top */
.site-main .page-header,
.container .page-header {
    margin-top: 2.5rem !important;
    padding-top: 0.625rem !important;
}

.page-title {
    margin-top: 0 !important;
}


/* Archive Layout - Theme-agnostic fixes */
.memberpulse-archive-layout {
    display: flex !important;
    gap: 2.5rem !important;
    margin-top: 2.5rem !important;
    font-family: inherit;
}

/* Sidebar Filters */
.memberpulse-archive-sidebar {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    padding: 1.25rem;
    position: sticky;
    top: 1.25rem;
}

.memberpulse-archive-sidebar h3 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--memberpulse-accent, #211d62);
    padding-bottom: 0.5rem;
}

.filter-section {
    margin-bottom: 0.9375rem;
}

.filter-group {
    margin-bottom: 0.9375rem;
}

.filter-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0.25rem 0.25rem 0 0;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    margin-bottom: 0;
}

.filter-toggle:hover {
    background: #f5f5f5;
    border-color: var(--memberpulse-accent, #211d62);
}

.filter-toggle.collapsed {
    border-radius: 0.25rem;
    background: white;
}

.filter-toggle.expanded {
    background: var(--memberpulse-accent, #211d62);
    color: white;
    border-color: var(--memberpulse-accent, #211d62);
}

.toggle-arrow {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.filter-toggle.collapsed .toggle-arrow {
    transform: rotate(-90deg);
}

.filter-content {
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 18.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.3s ease, border 0.3s ease, padding 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-content.collapsed {
    max-height: 0;
    border: none;
    overflow: hidden;
    box-shadow: none;
    padding: 0;
}

.filter-content.expanded {
    max-height: 18.75rem;
    border: 1px solid #ddd;
    border-top: none;
}

.no-options {
    padding: 0.75rem 1rem;
    color: #999;
    font-style: italic;
    text-align: center;
}

.filter-content .filter-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.filter-content .filter-item:last-child {
    border-bottom: none;
}

.filter-content .filter-item:hover {
    background: #f8f8f8;
}

.filter-content .filter-checkbox {
    margin-right: 0.5rem;
    margin-top: 0;
}

.filter-content .filter-item label {
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    margin: 0;
    flex: 1;
    user-select: none;
}

.filter-content .filter-item:hover label {
    color: var(--memberpulse-accent, #211d62);
}

/* Date Range Filter Styling Updates */
.filter-content .date-range-inputs {
    padding: 0.75rem 1rem;
}

.clear-filters-btn {
    width: 100%;
    padding: 0.625rem;
    background: var(--memberpulse-accent, #211d62);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.clear-filters-btn:hover {
    background: var(--memberpulse-accent-hover, #005a87);
}

/* Date Range Filter Styles */
.date-range-inputs {
    padding: 0.75rem;
    min-width: 12.5rem;
    box-sizing: border-box;
}

.date-input-group {
    margin-bottom: 0.625rem;
}

.date-input-group:last-child {
    margin-bottom: 0;
}

.date-input-group label {
    display: block;
    margin-bottom: 0.1875rem;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.date-input-group input[type="date"] {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    background: white;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.date-input-group input[type="date"]:focus {
    outline: none;
    border-color: var(--memberpulse-accent, #211d62);
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.3);
}

.date-input-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 0.125rem;
    border-radius: 0.125rem;
    transition: background-color 0.2s;
}

.date-input-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-color: rgba(0, 115, 170, 0.1);
}

/* Items Grid - Used by all archive pages (events, courses, etc.) */
.memberpulse-items-grid,
.memberpulse-events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.875rem;
}


/* Pagination */
.memberpulse-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.875rem;
    padding: 1.25rem 0;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.page-btn:hover {
    background: #f5f5f5;
    border-color: var(--memberpulse-accent, #211d62);
    color: var(--memberpulse-accent, #211d62);
}

.page-btn.active {
    background: var(--memberpulse-accent, #211d62);
    border-color: var(--memberpulse-accent, #211d62);
    color: white;
}

.page-btn.prev,
.page-btn.next {
    font-weight: 600;
}

.page-btn:disabled {
    background: #f0f0f0;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.page-btn:disabled:hover {
    background: #f0f0f0;
    color: #ccc;
    border-color: #e0e0e0;
}

/* Loading and No Results */
.loading {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: #666;
    font-size: 1rem;
}

.no-items,
.no-events {
    text-align: center;
    padding: 2.5rem 1.25rem;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    color: #666;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .memberpulse-items-grid,
    .memberpulse-events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .memberpulse-archive-layout {
        flex-direction: column !important;
        gap: 1.25rem !important;
    }

    .memberpulse-filter-sidebar {
        flex: none !important;
        min-width: auto !important;
    }

    .wp-block-columns {
        flex-direction: column !important;
    }

    .wp-block-column[style*="25%"],
    .wp-block-column[style*="75%"] {
        flex-basis: 100% !important;
        width: 100% !important;
    }

    .memberpulse-archive-sidebar {
        position: static;
        margin-bottom: 1.25rem;
    }

    .memberpulse-items-grid,
    .memberpulse-events-grid {
        grid-template-columns: 1fr;
    }

    .filter-list {
        max-height: 9.375rem;
    }
}

@media (max-width: 480px) {

    .memberpulse-archive-sidebar {
        padding: 0.9375rem;
    }

    .memberpulse-event-tile {
        padding: 0.75rem;
    }

    .filter-section {
        margin-bottom: 1.25rem;
    }

    .memberpulse-pagination {
        flex-wrap: wrap;
    }

    .page-btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.85rem;
    }
}