/* Cafeex Events General Styles */
.cafeex-current-events-slider,
.cafeex-upcoming-events-grid {
    font-family: inherit;
}

/* =======================================
   Current Events Slider
   ======================================= */
.cafeex-current-events-slider {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: hidden; /* For carousel */
}

.cafeex-current-event-item {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 30px;
}

.cafeex-current-event-item .event-image {
    flex: 0 0 55%;
    max-width: 55%;
}

.cafeex-current-event-item .event-image img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 999px; /* Perfect pill shape */
}

.cafeex-current-event-item .event-content {
    flex: 0 0 45%;
    max-width: 45%;
    padding-right: 40px;
}

.cafeex-current-event-item .event-subtitle {
    color: #9c27b0; /* Purple */
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.cafeex-current-event-item .event-title {
    font-size: 46px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
    margin-bottom: 20px;
}

.cafeex-current-event-item .event-desc {
    color: #888;
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.cafeex-current-event-item .event-meta {
    margin-bottom: 25px;
}

.cafeex-current-event-item .meta-item {
    font-size: 16px;
    color: #555;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cafeex-current-event-item .meta-item i {
    color: #9c27b0;
}

.cafeex-current-event-item .event-btn {
    display: inline-block;
    background-color: #512da8; /* Dark purple */
    color: #fff;
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.cafeex-current-event-item .event-btn i {
    margin-left: 8px;
}

.cafeex-current-event-item .event-btn:hover {
    background-color: #311b92;
}

/* Dots */
.cafeex-slider-dots {
    text-align: center;
    margin-top: 20px;
}

.cafeex-slider-dots .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
}

.cafeex-slider-dots .dot.active {
    background-color: #9c27b0;
}

/* =======================================
   Upcoming Events Grid
   ======================================= */
.cafeex-upcoming-events-grid {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Strictly 2 columns */
    gap: 40px;
}

.cafeex-upcoming-card .card-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin-bottom: 20px;
}

.cafeex-upcoming-card .card-meta {
    font-size: 16px;
    margin-bottom: 15px;
}

.cafeex-upcoming-card .card-meta .date {
    color: #888;
}

.cafeex-upcoming-card .card-meta .time {
    color: #888;
}

.cafeex-upcoming-card .card-meta .sep {
    color: #ccc;
    margin: 0 5px;
}

.cafeex-upcoming-card .card-location {
    color: #e74c3c;
    font-size: 16px;
    line-height: 1.4;
    margin: -10px 0 15px;
}
.cafeex-grid-flex .card-location { font-size: 15px; margin: -4px 0 10px; }
.cafeex-grid-flex.cafeex-cols-4 .card-location,
.cafeex-grid-flex.cafeex-cols-5 .card-location,
.cafeex-grid-flex.cafeex-cols-6 .card-location { font-size: 14px; }

.cafeex-upcoming-card .card-meta .location {
    color: #e74c3c; /* Redish */
}

.cafeex-upcoming-card .card-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.3;
}

.cafeex-upcoming-card .card-desc {
    color: #666;
    font-size: 18px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 992px) {
    .cafeex-current-event-item {
        flex-direction: column;
        gap: 30px;
    }
    
    .cafeex-current-event-item .event-image,
    .cafeex-current-event-item .event-content {
        flex: 0 0 100%;
        max-width: 100%;
        padding-right: 0;
    }
    
    .cafeex-current-event-item .event-image img {
        height: auto;
        border-radius: 50px;
    }
    
    /* Classic layout only; the flexible grid uses the Columns settings (tablet / mobile). */
    .cafeex-upcoming-events-grid:not(.cafeex-grid-flex) {
        grid-template-columns: 1fr !important; /* Stack on mobile */
    }
}

/* =======================================
   Status labels on event cards
   ======================================= */
.cafeex-upcoming-card .card-image { position: relative; }
.cafeex-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: #ffffff;
    color: #7b1fa2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: none;
}
.cafeex-card-badge--past { background: #555555; color: #ffffff; }
.cafeex-card-badge--full { background: #c62828; color: #ffffff; }
.cafeex-card-badge--closed { background: #ef6c00; color: #ffffff; }
.cafeex-card-badge--soon { background: #9c27b0; color: #ffffff; border: 2px solid #ffffff; }
.cafeex-upcoming-card.is-past .card-image img { filter: grayscale(35%); opacity: 0.9; }

/* =======================================
   Flexible event grid ([cafeex_events], [cafeex_home_events], widget column settings)
   ======================================= */
.cafeex-upcoming-events-grid.cafeex-grid-flex {
    grid-template-columns: repeat(var(--cx-cols, 3), minmax(0, 1fr));
    gap: 30px;
    padding: 0;
}
@media (max-width: 1024px) {
    .cafeex-upcoming-events-grid.cafeex-grid-flex { grid-template-columns: repeat(var(--cx-cols-t, 2), minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .cafeex-upcoming-events-grid.cafeex-grid-flex { grid-template-columns: repeat(var(--cx-cols-m, 1), minmax(0, 1fr)); gap: 24px; }
}
.cafeex-grid-flex .cafeex-upcoming-card { display: flex; flex-direction: column; min-width: 0; }
.cafeex-grid-flex .card-content { display: flex; flex-direction: column; flex: 1; }
.cafeex-grid-flex .card-image a { display: block; position: relative; overflow: hidden; border-radius: 12px; }
.cafeex-grid-flex.cafeex-ratio-square .card-image img,
.cafeex-grid-flex.cafeex-ratio-portrait .card-image img,
.cafeex-grid-flex.cafeex-ratio-landscape .card-image img { width: 100%; height: auto; object-fit: cover; }
.cafeex-grid-flex.cafeex-ratio-square .card-image img { aspect-ratio: 1 / 1; }
.cafeex-grid-flex.cafeex-ratio-portrait .card-image img { aspect-ratio: 4 / 5; }
.cafeex-grid-flex.cafeex-ratio-landscape .card-image img { aspect-ratio: 16 / 9; }
.cafeex-grid-flex .cafeex-card-noimg { display: block; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #9c27b0, #e91e63); }
.cafeex-grid-flex.cafeex-ratio-square .cafeex-card-noimg { aspect-ratio: 1 / 1; }
.cafeex-grid-flex.cafeex-ratio-portrait .cafeex-card-noimg { aspect-ratio: 4 / 5; }
.cafeex-grid-flex.cafeex-ratio-landscape .cafeex-card-noimg { aspect-ratio: 16 / 9; }
.cafeex-grid-flex .card-meta { font-size: 15px; margin: 14px 0 8px; }
.cafeex-grid-flex .card-title { font-size: 26px; line-height: 1.25; margin: 0 0 8px; }
.cafeex-grid-flex .card-desc { font-size: 16px; }
.cafeex-grid-flex.cafeex-cols-3 .card-title { font-size: 22px; }
.cafeex-grid-flex.cafeex-cols-4 .card-title,
.cafeex-grid-flex.cafeex-cols-5 .card-title,
.cafeex-grid-flex.cafeex-cols-6 .card-title { font-size: 18px; }
.cafeex-grid-flex.cafeex-cols-4 .card-desc,
.cafeex-grid-flex.cafeex-cols-5 .card-desc,
.cafeex-grid-flex.cafeex-cols-6 .card-desc,
.cafeex-grid-flex.cafeex-cols-4 .card-meta,
.cafeex-grid-flex.cafeex-cols-5 .card-meta,
.cafeex-grid-flex.cafeex-cols-6 .card-meta { font-size: 14px; }
.cafeex-grid-flex.cafeex-cols-5 .cafeex-card-badge,
.cafeex-grid-flex.cafeex-cols-6 .cafeex-card-badge { font-size: 10px; padding: 4px 10px; top: 10px; left: 10px; }
.cafeex-card-actions { margin-top: auto; padding-top: 14px; }
.cafeex-card-btn {
    display: inline-block;
    background: #9c27b0;
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    transition: background .2s;
}
.cafeex-card-btn:hover { background: #7b1fa2; }
.cafeex-events-empty { text-align: center; color: #777; padding: 20px 0; }

/* =======================================
   Events calendar filter ([cafeex_events_calendar])
   ======================================= */
.cafeex-cal { position: relative; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.cafeex-cal *, .cafeex-cal *::before, .cafeex-cal *::after { box-sizing: border-box; }
.cafeex-cal .cafeex-cal-quick, .cafeex-cal .cafeex-cal-pick { min-width: 0; max-width: 100%; }
.cafeex-cal .cafeex-cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cafeex-cal .cafeex-cal-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.cafeex-cal .cafeex-cal-quick button, .cafeex-cal .cafeex-cal-toggle {
    font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
    padding: 10px 18px; border-radius: 30px; cursor: pointer;
    border: 1px solid #d8c6df; background: #fff; color: #4a148c; text-transform: none; letter-spacing: normal; box-shadow: none; transition: background .15s, color .15s, border-color .15s;
}
.cafeex-cal .cafeex-cal-quick button:hover, .cafeex-cal .cafeex-cal-quick button:focus,
.cafeex-cal .cafeex-cal-toggle:hover, .cafeex-cal .cafeex-cal-toggle:focus { border-color: #9c27b0; background: #fff; color: #4a148c; }
.cafeex-cal .cafeex-cal-quick button.is-active:hover, .cafeex-cal .cafeex-cal-quick button.is-active:focus,
.cafeex-cal .cafeex-cal-toggle.has-date:hover, .cafeex-cal .cafeex-cal-toggle.has-date:focus { background: #9c27b0; color: #fff; }
.cafeex-cal .cafeex-cal-clear:hover, .cafeex-cal .cafeex-cal-clear:focus { background: none; color: #4a148c; border: 0; }
.cafeex-cal .cafeex-cal-head button:hover, .cafeex-cal .cafeex-cal-head button:focus { background: #f3e5f5; color: #9c27b0; }
.cafeex-cal .cafeex-cal-quick button.is-active { background: #9c27b0; border-color: #9c27b0; color: #fff; }
.cafeex-cal .cafeex-cal-pick { position: relative; }
.cafeex-cal .cafeex-cal-toggle { display: inline-flex; align-items: center; gap: 8px; }
.cafeex-cal .cafeex-cal-toggle.has-date { background: #9c27b0; border-color: #9c27b0; color: #fff; }
.cafeex-cal .cafeex-cal-toggle .caret { font-size: 12px; opacity: .8; }
.cafeex-cal .cafeex-cal-pop {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 310px;
    background: #fff; border: 1px solid #e2d4e8; border-radius: 14px; padding: 14px;
    box-shadow: 0 14px 40px rgba(74, 20, 140, .18);
}
.cafeex-cal .cafeex-cal-pop[hidden] { display: none; }
.cafeex-cal .cafeex-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cafeex-cal .cafeex-cal-head strong { color: #2d2a32; font-size: 16px; }
.cafeex-cal .cafeex-cal-head button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #e2d4e8; background: #fff; color: #9c27b0; font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.cafeex-cal .cafeex-cal-head button:disabled { opacity: .3; cursor: default; }
.cafeex-cal .cafeex-cal-week, .cafeex-cal .cafeex-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cafeex-cal .cafeex-cal-week span { font-size: 12px; font-weight: 700; color: #999; padding: 4px 0; }
.cafeex-cal .cafeex-cal-days button {
    position: relative; height: 38px; border: 0; border-radius: 8px; background: transparent;
    font: inherit; font-size: 14px; color: #bbb; cursor: default; padding: 0;
}
.cafeex-cal .cafeex-cal-days button:hover, .cafeex-cal .cafeex-cal-days button:focus { background: transparent; color: #bbb; border: 0; }
.cafeex-cal [hidden] { display: none !important; }
.cafeex-cal .cafeex-cal-days button.has-events { color: #2d2a32; font-weight: 700; cursor: pointer; }
.cafeex-cal .cafeex-cal-days button.has-events::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #9c27b0; }
.cafeex-cal .cafeex-cal-days button.has-events.is-past { color: #888; }
.cafeex-cal .cafeex-cal-days button.has-events.is-past::after { background: #bbb; }
.cafeex-cal .cafeex-cal-days button.has-events:hover, .cafeex-cal .cafeex-cal-days button.has-events:focus { background: #f3e5f5; color: #2d2a32; }
.cafeex-cal .cafeex-cal-days button.is-today { box-shadow: inset 0 0 0 1px #ce93d8; }
.cafeex-cal .cafeex-cal-days button.is-selected { background: #9c27b0 !important; color: #fff !important; }
.cafeex-cal .cafeex-cal-days button.is-selected::after { background: #fff; }
.cafeex-cal .cafeex-cal-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #777; margin-top: 8px; }
.cafeex-cal .cafeex-cal-legend .dot { width: 6px; height: 6px; border-radius: 50%; background: #9c27b0; display: inline-block; }
.cafeex-cal .cafeex-cal-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0 18px; border-bottom: 1px solid #eee; margin-bottom: 26px; color: #555; font-size: 15px; }
.cafeex-cal .cafeex-cal-clear { font: inherit; font-size: 14px; background: none; border: 0; color: #7b1fa2; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; border-radius: 0; box-shadow: none; text-transform: none; }
.cafeex-cal .cafeex-cal-empty { text-align: center; color: #777; padding: 30px 10px; background: #faf6fb; border-radius: 12px; }
@media (max-width: 767px) {
    .cafeex-cal .cafeex-cal-bar { display: block; }
    .cafeex-cal .cafeex-cal-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
    .cafeex-cal .cafeex-cal-quick button { width: 100%; min-width: 0; padding: 10px 8px; font-size: 14px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cafeex-cal .cafeex-cal-pick { width: 100%; }
    .cafeex-cal .cafeex-cal-toggle { width: 100%; justify-content: center; font-size: 14px; }
    .cafeex-cal .cafeex-cal-status { font-size: 14px; padding: 6px 0 14px; margin-bottom: 20px; }
    .cafeex-cal .cafeex-cal-pop { left: 0; right: 0; width: auto; }
}
