/* Traditional Music Events - Shortcode Styles (Using Archive Card Design) */

/* Remove empty p tags around shortcodes */
p:empty {
    display: none;
}

.tme-upcoming-events {
    margin: 1rem 0 3rem 0;
}

.tme-upcoming-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--wp--preset--color--custom-primary-shade);
}

.tme-upcoming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 0 auto;
    justify-content: center;
    max-width: 1200px;
}

/* Use the same card styling as archive page */
.tme-upcoming-grid .tme-archive-event-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    height: fit-content;
}

.tme-upcoming-grid .tme-archive-event-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Event Card Content */
.tme-upcoming-grid .tme-archive-event-card .tme-archive-event-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 0px;
}

/* Calendar Icon - Styled to Match Archive */
.tme-upcoming-grid .tme-calendar-icon {
    display: flex;
    flex-direction: column;
    width: 70px;
    height: 70px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tme-upcoming-grid .tme-cal-month {
    background: var(--wp--preset--color--custom-primary-shade);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 0;
    text-align: center;
    line-height: 1;
    letter-spacing: 0.5px;
}

.tme-upcoming-grid .tme-cal-day {
    background: #fff;
    color: var(--wp--preset--color--custom-primary-shade);
    font-size: 28px;
    font-weight: 700;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Event Content Area */
.tme-upcoming-grid .tme-event-details {
    flex: 1;
    min-width: 0;
}

/* Event Title */
.tme-upcoming-grid .tme-event-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--wp--preset--color--custom-primary-shade);
    line-height: 1.3;
}

.tme-upcoming-grid .tme-event-title a {
    color: var(--wp--preset--color--custom-primary-shade);
    text-decoration: none;
}

.tme-upcoming-grid .tme-event-title a:hover {
    text-decoration: underline;
}

/* Event Date Range */
.tme-upcoming-grid .tme-event-date {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Location */
.tme-upcoming-grid .tme-event-location {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
    font-style: italic;
}

/* Meta Information (Cost, Category) */
.tme-upcoming-grid .tme-event-meta {
    margin: 8px 0 12px 0;
    line-height: 1.5;
}

/* Cost and Category Styling */
.tme-upcoming-grid .tme-event-meta-text {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Event Website Link */
.tme-upcoming-grid .tme-event-link {
    margin-top: auto;
    /* margin-left: 85px; /* Align with text content, accounting for calendar icon width + gap */
}

.tme-upcoming-grid .tme-event-link a {
    color: var(--wp--preset--color--custom-primary-shade);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.tme-upcoming-grid .tme-event-link a:hover {
    color: var(--wp--preset--color--primary);
    text-decoration: underline;
}

/* External link icon */
.tme-upcoming-grid .tme-event-link a::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%238B4513'%3E%3Cpath d='M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 12px 12px;
    background-position: center;
    vertical-align: middle;
}

.tme-upcoming-empty {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tme-upcoming-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tme-upcoming-grid .tme-archive-event-card {
        padding: 15px;
    }
    
    .tme-upcoming-grid .tme-archive-event-header {
        gap: 12px;
    }
    
    .tme-upcoming-grid .tme-calendar-icon {
        width: 60px;
        height: 60px;
    }
    
    .tme-upcoming-grid .tme-cal-day {
        font-size: 24px;
    }
    
    .tme-upcoming-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .tme-upcoming-grid .tme-archive-event-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .tme-upcoming-grid .tme-calendar-icon {
        align-self: flex-start;
        width: 50px;
        height: 50px;
    }
    
    .tme-upcoming-grid .tme-cal-day {
        font-size: 20px;
    }
    
}

/* Print styles */
@media print {
    .tme-upcoming-grid .tme-archive-event-card {
        border: 1px solid #333 !important;
        margin-bottom: 20px !important;
        page-break-inside: avoid;
    }
    
    .tme-upcoming-grid .tme-calendar-icon {
        border: 1px solid #333 !important;
        box-shadow: none !important;
    }
    
    .tme-upcoming-grid .tme-cal-month {
        background: #333 !important;
        color: white !important;
    }
    
    .tme-upcoming-grid .tme-event-link a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
        background: none;
    }
}