/**
 * Events Display Block Styles
 * Responsive design matching the target coveredbridges.com layout
 */

/* Block Container */
.events-display-block {
    margin: 2rem 0;
    padding: 2rem;
    background-color: #F8F9FA;
    border-radius: 8px;
}

.events-display-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
    font-family: "Playfair Display", Georgia, serif;
}

.events-display-description {
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Container */
.events-search-container {
    margin-bottom: 2rem;
    text-align: center;
}

.events-search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.events-search-input:focus {
    outline: none;
    border-color: #b82330;
    box-shadow: 0 0 0 3px rgba(184, 35, 48, 0.1);
}

/* Main Content Layout */
.events-display-content {
    display: grid;
    gap: 3rem;
    align-items: start;
}

.events-display-content.layout-side-by-side {
    grid-template-columns: 1fr 1fr;
}

.events-display-content.layout-side-by-side.calendar-left {
    grid-template-columns: 0.6fr 1.4fr;
}

.events-display-content.layout-side-by-side.calendar-right {
    grid-template-columns: 1.4fr 0.6fr;
}

.events-display-content.layout-stacked {
    grid-template-columns: 1fr;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .events-display-content.layout-side-by-side {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .events-display-content.layout-side-by-side.calendar-left {
        grid-template-columns: 1fr;
    }
    
    .events-display-content.layout-side-by-side.calendar-right {
        grid-template-columns: 1fr;
    }
    
    /* Ensure calendar appears first on mobile */
    .events-display-content.layout-side-by-side.calendar-left .events-calendar-section {
        order: 1;
    }
    
    .events-display-content.layout-side-by-side.calendar-left .events-list-section {
        order: 2;
    }
    
    .events-display-content.layout-side-by-side.calendar-right .events-calendar-section {
        order: 1;
    }
    
    .events-display-content.layout-side-by-side.calendar-right .events-list-section {
        order: 2;
    }
    
    /* Mobile responsive event items */
    .event-item {
        flex-direction: column;
        text-align: center;
    }
    
    .event-featured-image {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .event-featured-image img {
        height: 200px;
    }
    
    .event-content {
         text-align: left;
     }
     
     /* Mobile responsive calendar */
     .events-calendar-container {
         padding: 1rem;
     }
     
     .calendar-day {
         min-height: 35px;
         font-size: 0.9rem;
     }
     
     .weekday {
         padding: 6px 2px;
         font-size: 0.7rem;
     }
}

/* Events List Section */
.events-list-section {
    padding: 0;
}

.events-list-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #b82330;
    padding-bottom: 0.5rem;
    font-family: "Montserrat", sans-serif;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-item {
    background: #F9F9F9;
    border: none;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.event-item:hover {
    transform: translateY(-2px);
}

.event-featured-image {
    flex-shrink: 0;
    width: 250px;
}

.event-featured-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
}

.event-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: "Montserrat", sans-serif;
}

.event-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.event-title a:hover {
    color: #b82330;
}

.event-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.event-read-more {
    display: inline-block;
    background-color: #b82330;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.event-read-more:hover {
    background-color: #a01e2a;
    transform: translateY(-1px);
}

/* Calendar Section */
.events-calendar-section {
    padding: 0;
    position: relative;
}

.events-calendar-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #b82330;
    padding-bottom: 0.5rem;
    font-family: "Montserrat", sans-serif;
}

.events-calendar-container {
    background: #F9F9F9;
    border: none;
    border-radius: 8px;
    padding: 1.5rem;
}

.calendar-month {
    margin-bottom: 2rem;
}

.calendar-month:last-child {
    margin-bottom: 0;
}

.calendar-header {
    text-align: center;
    margin-bottom: 1rem;
}

.calendar-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    font-family: "Montserrat", sans-serif;
}

.calendar-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e0e0e0;
}

.calendar-weekdays {
    display: contents;
}

.weekday {
    background-color: #f5f5f5;
    padding: 8px 4px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-days {
    display: contents;
}

.calendar-day {
    background-color: #F9F9F9;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.other-month {
    background-color: #f9f9f9;
    color: #ccc;
}

.calendar-day.today {
    background-color: #b82330;
    color: #ffffff;
    font-weight: 700;
}

.calendar-day.today:hover {
    background-color: #a01e2a;
}

.calendar-day.has-event {
    background-color: #F9F9F9;
    border: none;
}

.calendar-day.has-event:hover {
    background-color: #d1ecf1;
    transform: scale(1.05);
}

.date-number {
    font-size: 0.9rem;
    font-weight: 500;
}

.event-indicator {
    width: 6px;
    height: 6px;
    background-color: #b82330;
    border-radius: 50%;
    margin-top: 2px;
}

.calendar-day.has-event .event-indicator {
    background-color: #3498db;
}

.calendar-day.today .event-indicator {
    background-color: #ffffff;
}

/* Event Preview Popup */
.event-preview-popup {
    position: absolute;
    background: #F9F9F9;
    border: none;
    border-radius: 8px;
    padding: 1rem;
    z-index: 1000;
    max-width: 300px;
    min-width: 250px;
}

.event-preview-content .event-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.event-preview-content .event-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.event-preview-content .event-link {
    color: #b82330;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.event-preview-content .event-link:hover {
    text-decoration: underline;
}

/* Load More Button */
.events-load-more {
    text-align: center;
    margin-top: 2rem;
}

.events-load-more-btn {
    background-color: #3498db;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.events-load-more-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.events-load-more-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* No Events Message */
.no-events-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
    font-style: italic;
}

/* Admin Editor Styles */
.events-display-block-editor {
    border: 2px dashed #e0e0e0;
    padding: 2rem;
    border-radius: 8px;
}

.events-display-preview {
    min-height: 200px;
}

.events-layout-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.events-list-preview ul {
    list-style: none;
    padding: 0;
}

.events-list-preview li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.calendar-placeholder {
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    padding: 2rem;
    text-align: center;
    border-radius: 4px;
    color: #666;
}

/* Calendar Widget in Admin */
.events-calendar-widget {
    border: none;
    border-radius: 4px;
    padding: 1rem;
    background: #F9F9F9;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.month-year {
    font-weight: 600;
    color: #2c3e50;
}

.post-selector {
    margin-bottom: 1rem;
}

.post-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e0e0e0;
}

.day-header {
    background-color: #f5f5f5;
    padding: 8px 4px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
}

.calendar-day.assignable:hover {
    background-color: #e8f4fd;
    cursor: pointer;
}

.hover-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #b82330;
}

.hover-preview h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.hover-preview p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .events-display-content.layout-side-by-side {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .events-display-title {
        font-size: 2rem;
    }
    
    .calendar-day {
        min-height: 35px;
    }
    
    .date-number {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .events-display-block {
        margin: 1rem 0;
    }
    
    .events-display-title {
        font-size: 1.8rem;
    }
    
    .events-list-title,
    .events-calendar-title {
        font-size: 1.5rem;
    }
    
    .event-item {
        padding: 1rem;
    }
    
    .events-calendar-container {
        padding: 1rem;
    }
    
    .calendar-day {
        min-height: 30px;
        font-size: 0.8rem;
    }
    
    .weekday {
        padding: 6px 2px;
        font-size: 0.7rem;
    }
    
    .event-preview-popup {
        max-width: 250px;
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .events-display-content {
        gap: 1.5rem;
    }
    
    .events-display-title {
        font-size: 1.5rem;
    }
    
    .events-list-title,
    .events-calendar-title {
        font-size: 1.3rem;
    }
    
    .event-item {
        padding: 0.75rem;
    }
    
    .event-title {
        font-size: 1.1rem;
    }
    
    .calendar-day {
        min-height: 25px;
        font-size: 0.7rem;
    }
    
    .weekday {
        padding: 4px 1px;
        font-size: 0.6rem;
    }
    
    .events-search-input {
        padding: 10px 12px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .events-display-block {
        border: 2px solid #000000;
    }
    
    .event-item {
        border: 2px solid #000000;
    }
    
    .calendar-day {
        border: 1px solid #000000;
    }
    
    .calendar-day.has-event {
        background-color: #000000;
        color: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .event-item,
    .calendar-day,
    .event-read-more,
    .events-load-more-btn {
        transition: none;
    }
    
    .event-item:hover,
    .calendar-day.has-event:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .events-display-block {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .events-display-title,
    .events-list-title,
    .events-calendar-title {
        color: #ffffff;
    }
    
    .event-item {
        background-color: #2d2d2d;
        border-color: #444444;
        color: #ffffff;
    }
    
    .event-title a {
        color: #ffffff;
    }
    
    .events-calendar-container {
        background-color: #2d2d2d;
        border-color: #444444;
    }
    
    .calendar-day {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .calendar-day.other-month {
        background-color: #1a1a1a;
        color: #666666;
    }
    
    .weekday {
        background-color: #444444;
        color: #cccccc;
    }
    
    .event-preview-popup {
        background-color: #2d2d2d;
        border-color: #444444;
        color: #ffffff;
    }
}