/* ==========================================================================
   Zenith Events - Shared Template Styles (Minimal Elegant)
   ========================================================================== */

/* Fix for Twenty Twenty-Five theme (and similar) that applies fixed dimensions to body */
body:has(.ze-calendar-wrapper) {
    width: auto !important;
    height: auto !important;
    min-height: 100vh !important;
}

/* Defensive CSS for day headers - prevents theme interference (especially Mesmerize) */
/* Maximum specificity to override aggressive theme CSS */
.ze-calendar-wrapper .ze-day-headers-row {
    grid-template-columns: repeat(7, 1fr) !important;
}

.ze-calendar-wrapper .ze-day-headers-row > div {
    display: flex !important;
    position: relative !important;
    width: auto !important;
    float: none !important;
    clear: none !important;
    min-width: 0 !important;  /* Prevent flex items from overflowing */
    max-width: none !important;  /* Prevent theme max-width restrictions */
}

/* CRITICAL: Prevent long event titles from expanding grid columns */
.ze-calendar-wrapper > div > div[style*="display: grid"] > div {
    min-width: 0 !important;     /* Allow grid items to shrink below content size */
    overflow: hidden !important; /* Prevent content overflow */
}

/* Ensure event links respect cell boundaries */
.ze-event-item-link {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Tablet-specific fix: Ensure all day columns are equal width */
@media (min-width: 600px) and (max-width: 1024px) {
    .ze-calendar-wrapper .ze-day-headers-row {
        grid-template-columns: repeat(7, 1fr) !important;
    }
    
    .ze-calendar-wrapper .ze-day-headers-row > div {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    
    /* Also fix the calendar grid itself on tablets */
    .ze-calendar-wrapper > div > div[style*="display: grid"] {
        grid-template-columns: repeat(7, 1fr) !important;
    }
    
    /* CRITICAL: Force grid cells to respect boundaries on tablets */
    .ze-calendar-wrapper > div > div[style*="display: grid"] > div {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
}

/* --------------------------------------------------
   1. Calendar Wrapper & Universal Styles
   -------------------------------------------------- */

.ze-calendar-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    margin-bottom: 80px !important; /* Increased space to prevent footer overlap */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    /* Remove position: relative and z-index to fix footer stacking */
}

/* --------------------------------------------------
   2. Universal Header Style
   -------------------------------------------------- */

.ze-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    min-height: 80px;
}

.ze-calendar-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 300;
    color: #333;
    letter-spacing: -0.5px;
}

/* Navigation Buttons */
.ze-prev-nav,
.ze-next-nav {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #999;
    text-decoration: none;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.ze-prev-nav:hover,
.ze-next-nav:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #f8fbfd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,115,170,0.1);
}

.ze-prev-nav:active,
.ze-next-nav:active {
    transform: translateY(0);
    box-shadow: none;
}

/* --------------------------------------------------
   3. Universal Event Item Styles
   -------------------------------------------------- */

.ze-event-item-link {
    display: block;
    text-decoration: none;
    color: #666;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ze-event-item-link:hover {
    color: #0073aa;
}

/* Event item in list contexts */
.ze-event-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #fafafa;
    border-left: 3px solid transparent;
    border-radius: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ze-event-item:hover {
    border-left-color: #0073aa;
    background: #f5f5f5;
    transform: translateX(3px);
}

/* --------------------------------------------------
   4. Universal Footer / iCal Button
   -------------------------------------------------- */

.ze-calendar-footer {
    padding: 30px 40px;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
}

.ze-ical-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #666;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 400;
    border-radius: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* iCal Subscribe Section - Prevent theme interference */
.ze-ical-subscribe-section {
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px 0 !important;
    margin-bottom: 60px !important; /* Increased for footer clearance */
    padding: 20px 0 !important;
    padding-bottom: 60px !important; /* Increased for footer clearance */
    text-align: center !important;
    display: block !important;
    float: none !important;
    background: #fff !important;
    /* Remove position: relative and z-index to fix footer issue */
}

/* Year/Quarter views: Break out of grid context */
.ze-year-grid + .ze-ical-subscribe-section,
.ze-quarter-months + .ze-ical-subscribe-section {
    grid-column: 1 / -1 !important; /* Span all columns if still in grid */
    display: block !important;
    width: 100% !important;
}

/* Force the iCal section to be outside grid flow entirely */
.ze-calendar-wrapper > .ze-ical-subscribe-section {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Clearfix after calendar wrapper to ensure footer stays below */
.ze-calendar-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

.ze-ical-url-display {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 15px auto !important;
    max-width: 600px !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Year/Quarter specific fixes */
.ze-year-grid + .ze-ical-subscribe-section .ze-ical-url-display,
.ze-quarter-months + .ze-ical-subscribe-section .ze-ical-url-display {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.ze-ical-url-display label {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

.ze-ical-url-input {
    flex: 1 1 auto !important;
    min-width: 200px !important;
    max-width: 400px !important;
}

.ze-copy-button {
    flex: 0 0 auto !important;
}

.ze-ical-button:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #f8fbfd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,115,170,0.1);
}

.ze-ical-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------
   5. Typography
   -------------------------------------------------- */

.ze-event-title {
    font-size: 1.1em;
    font-weight: 400;
    color: #333;
    line-height: 1.4;
    margin: 0;
}

.ze-event-time {
    font-size: 0.85em;
    color: #999;
    font-weight: 400;
}

.ze-event-location {
    font-size: 0.85em;
    color: #999;
}

.ze-day-header {
    font-size: 1em;
    font-weight: 400;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 0;
    margin: 30px 0 15px 0;
    border-bottom: 1px solid #e8e8e8;
}

/* --------------------------------------------------
   6. Utility Classes
   -------------------------------------------------- */

.ze-today {
    position: relative;
}

.ze-today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid #0073aa;
    pointer-events: none;
    border-radius: 2px;
}

.ze-no-events {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    font-size: 0.95em;
}

/* --------------------------------------------------
   7. Loading States
   -------------------------------------------------- */

.ze-calendar-wrapper.loading-calendar {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* --------------------------------------------------
   8. Responsive Design
   -------------------------------------------------- */

@media (max-width: 768px) {
    .ze-calendar-wrapper {
        margin: 20px auto;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .ze-calendar-header {
        padding: 20px 15px;
        min-height: 60px;
    }
    
    .ze-calendar-header h2 {
        font-size: 1.3em;
    }
    
    .ze-prev-nav,
    .ze-next-nav {
        width: 36px;
        height: 36px;
        font-size: 1em;
    }
    
    .ze-calendar-footer {
        padding: 20px 15px;
    }
    
    .ze-ical-button {
        padding: 10px 20px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .ze-calendar-header h2 {
        font-size: 1.1em;
    }
    
    .ze-prev-nav,
    .ze-next-nav {
        width: 32px;
        height: 32px;
    }
}
/* ==========================================================================
   Day Events Modal (Year & Quarter Views)
   ========================================================================== */

.ze-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ze-modal[style*="display: block"] {
    display: flex; /* When shown via JavaScript, use flex layout */
}

.ze-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
}

.ze-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    z-index: 10002;
    overflow: hidden;
}

.ze-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ze-modal-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.ze-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.ze-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.ze-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Modal content alignment - Option 3: Center title & meta, left description */
.ze-modal-title {
    text-align: center;
}

#ze-modal-title-new {
    text-align: center;
}

.ze-modal-header-info {
    text-align: center;
}

.ze-modal-header-info p {
    text-align: center;
}

.ze-modal-post-content {
    text-align: left;
}

.ze-modal-thumbnail {
    text-align: center;
    display: block;
}

.ze-modal-thumbnail img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Also center any images within modal content */
.ze-modal-body img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
}

.ze-modal-event-item {
    padding: 15px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #fafafa;
    transition: all 0.2s;
}

.ze-modal-event-item:hover {
    background: #fff;
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.ze-modal-event-item:last-child {
    margin-bottom: 0;
}

.ze-modal-event-time {
    font-size: 0.85em;
    color: #0073aa;
    font-weight: 600;
    margin-bottom: 5px;
}

.ze-modal-event-title {
    font-size: 1em;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
}

.ze-modal-event-link {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    transition: color 0.2s;
}

.ze-modal-event-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.ze-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e8e8e8;
    text-align: right;
}

.ze-modal-close-btn {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: background 0.2s;
}

.ze-modal-close-btn:hover {
    background: #005a87;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ze-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .ze-modal-header,
    .ze-modal-body,
    .ze-modal-footer {
        padding: 15px;
    }
    
    .ze-modal-event-item {
        padding: 12px;
    }
}

/* ==========================================================================
   Year View Specific Styles
   ========================================================================== */

/* Year view event dots */
.ze-event-dot {
    display: block;
    width: 16px;
    height: 16px;
    background: #0073aa;
    border-radius: 50%;
    margin: 4px auto;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,115,170,0.3);
    position: relative;
    z-index: 1;
}

.ze-event-dot:hover {
    transform: scale(1.3);
    background: #005a87;
    box-shadow: 0 3px 6px rgba(0,115,170,0.5);
}

.ze-event-dot:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    transform: scale(1.3);
}

.ze-dot-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.ze-event-count {
    font-size: 0.65em;
    color: #0073aa;
    font-weight: 700;
    margin-top: 2px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    padding: 1px 4px;
    display: inline-block;
}

/* Responsive year view */
@media (min-width: 1025px) {
    .ze-year-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .ze-year-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .ze-year-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .ze-year-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================

/* ==========================================================================
   Box Model Consistency (Android alignment fix)
   ========================================================================== */

/* Ensure consistent box model across all browsers */
.ze-calendar-wrapper *,
.ze-calendar-wrapper *::before,
.ze-calendar-wrapper *::after {
    box-sizing: border-box;
}

/* Calendar wrapper - container border and overflow */
.ze-calendar-wrapper {
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    box-sizing: border-box;
    background: #fff;
}

/* Ensure event titles truncate properly */
.ze-event-item-link {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block;
    box-sizing: border-box;
}

/* ==========================================================================
   Mobile Responsive Event Display (Month View)
   ========================================================================== */

/* Desktop: Show event titles in month view, hide mobile badge */
.ze-desktop-events {
    display: block;
}

.ze-mobile-events {
    display: none;
}

/* Year/Quarter badges - show on ALL screen sizes */
.ze-mobile-only {
    display: inline-block !important;
}

/* Year/Quarter old dots/counters - hide on ALL screen sizes */
.ze-desktop-events .ze-event-dot,
.ze-desktop-events .ze-event-count {
    display: none !important;
}

/* Mobile: Show badge for month view, hide titles */
@media (max-width: 768px) {
    /* Month view mobile behavior */
    .ze-desktop-events {
        display: none;
    }
    
    .ze-mobile-events {
        display: block !important;
    }
    
    /* Reduce cell height on mobile */
    .ze-day-cell {
        min-height: 60px !important;
    }
    
    /* UNIFIED MOBILE DESIGN: Remove ALL borders and use gap (like Year view) */
    /* Force remove borders with highest specificity */
    .ze-calendar-wrapper .ze-day-cell,
    .ze-calendar-wrapper .ze-day-cell[style],
    .ze-calendar-wrapper div[class*="ze-day"],
    .ze-calendar-wrapper div[data-date-key] {
        border: none !important;
        border-right: none !important;
        border-bottom: none !important;
        border-left: none !important;
        border-top: none !important;
    }
    
    /* Force gap on grid containers */
    .ze-calendar-wrapper div[style*="display: grid"],
    .ze-calendar-wrapper div[style*="grid-template-columns"] {
        gap: 2px !important;
        background: #e8e8e8 !important;
    }
    
    /* Keep today highlight border */
    .ze-calendar-wrapper .ze-day-cell.ze-today,
    .ze-calendar-wrapper .ze-day-cell.today,
    .ze-calendar-wrapper .ze-today {
        border: 2px solid #0073aa !important;
        background: #fafafa !important;
    }
    
    /* Remove header borders too */
    .ze-calendar-wrapper div[style*="grid-template-columns"] > div {
        border-right: none !important;
        border-bottom: none !important;
    }
}

/* Mobile PORTRAIT: Force equal column widths for month view */
@media (max-width: 768px) and (orientation: portrait) {
    /* Year and Quarter views: Single column layout */
    .ze-year-grid,
    .ze-quarter-months.ze-year-grid {
        grid-template-columns: 1fr !important; /* Single column */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Reset any landscape-specific styles */
    .ze-quarter-months.ze-year-grid > div:nth-child(3) {
        grid-column: auto !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    /* Ensure all month containers fill width */
    .ze-year-grid > div,
    .ze-quarter-months > div {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Month view: Ensure all day cells are equal width */
    .ze-calendar-wrapper .ze-day-cell {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 0 !important;
    }
    
    /* Force header cells equal width too */
    .ze-calendar-wrapper div[style*="grid-template-columns"] > div {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    
    /* Ensure grids use same gap */
    .ze-calendar-wrapper > div > div[style*="grid-template-columns"] {
        gap: 2px !important;
    }
}

/* ==========================================================================
   Mobile Touch Target Improvements
   ========================================================================== */

/* Enhanced tap targets for mobile */
.ze-mobile-tap-target {
    /* Ensure minimum touch target size */
    -webkit-tap-highlight-color: rgba(0, 115, 170, 0.2);
    touch-action: manipulation; /* Disable double-tap zoom */
}

/* Badge hover/active states (simplified mobile badges) */
.ze-event-count.ze-mobile-tap-target:hover {
    background: #e6f7ff !important;
    border-color: #005a87 !important;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,115,170,0.3) !important;
}

.ze-event-count.ze-mobile-tap-target:active {
    background: #cce7ff !important;
    border-color: #004a70 !important;
    transform: scale(0.98);
}

/* Desktop dot styles (unchanged) */
.ze-event-dot:hover {
    transform: scale(2);
    background: #005a87 !important;
}

.ze-event-dot:active {
    transform: scale(1.8);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    /* Month view badges - larger */
    .ze-mobile-events .ze-event-count.ze-mobile-tap-target {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Year/Quarter view badges - compact but tappable */
    .ze-mobile-only.ze-event-count {
        /* Already sized appropriately in inline styles */
        /* Ensure visible and tappable */
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile Landscape: 2 columns for Year and Quarter views */
/* iPhone 12 Pro Max landscape is 926px, so use 1024px breakpoint */
@media (max-width: 1024px) and (orientation: landscape) {
    /* Year view: 2 columns instead of 3 */
    .ze-year-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Quarter view also uses ze-year-grid class: 2 columns */
    /* Center the 3rd month in quarter view (it has 3 months total) */
    .ze-quarter-months.ze-year-grid > div:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 50%;
        margin: 0 auto;
    }
    
    /* Month view: Fix column alignment in landscape */
    /* Force equal column widths for both headers and cells */
    .ze-calendar-wrapper .ze-day-cell {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 0 !important;
    }
    
    /* Force header cells equal width */
    .ze-calendar-wrapper div[style*="grid-template-columns"] > div {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    
    /* Ensure both grids use same gap */
    .ze-calendar-wrapper > div > div[style*="grid-template-columns"] {
        gap: 2px !important;
    }
}

/* Accessibility: Focus states */
.ze-mobile-tap-target:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ze-mobile-tap-target:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================================================
   Week View Desktop - Fit Without Scrolling
   ========================================================================== */

/* Desktop week view - ensure table fits viewport */
@media (min-width: 769px) {
    /* Week view container */
    .ze-calendar-wrapper[data-format="week"] {
        max-width: 100%;
        overflow: hidden;
    }
    
    /* Week table - force fit within viewport */
    .ze-calendar-wrapper[data-format="week"] table {
        width: 100% !important;
        table-layout: fixed !important; /* Equal column widths */
        max-width: 100%;
    }
    
    /* Week table cells - equal width, proper overflow handling */
    .ze-calendar-wrapper[data-format="week"] th,
    .ze-calendar-wrapper[data-format="week"] td {
        width: 14.2857% !important; /* 100% / 7 */
        max-width: 14.2857%;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    /* Event titles in week view - wrap if needed */
    .ze-calendar-wrapper[data-format="week"] .ze-event-item-link {
        white-space: normal !important; /* Allow wrapping */
        word-wrap: break-word;
        overflow-wrap: break-word;
        display: block;
    }
    
    /* Week view wrapper - no horizontal scroll */
    .ze-calendar-wrapper[data-format="week"] > div[style*="overflow-x"] {
        overflow-x: hidden !important;
    }
}

/* ==========================================================================
   Week View Mobile Portrait - Vertical Stack
   ========================================================================== */

/* Mobile portrait week view - stack days vertically */
@media (max-width: 768px) and (orientation: portrait) {
    /* Week view container - no scrolling */
    .ze-calendar-wrapper[data-format="week"] {
        overflow: visible !important;
    }
    
    /* Week view wrapper - no scrolling */
    .ze-calendar-wrapper[data-format="week"] > div[style*="overflow-x"] {
        overflow-x: visible !important;
        overflow: visible !important;
    }
    
    /* Convert table to block layout */
    .ze-calendar-wrapper[data-format="week"] table {
        display: block !important;
        width: 100% !important;
    }
    
    .ze-calendar-wrapper[data-format="week"] thead {
        display: none !important; /* Hide header row */
    }
    
    .ze-calendar-wrapper[data-format="week"] tbody {
        display: block !important;
    }
    
    .ze-calendar-wrapper[data-format="week"] tr {
        display: block !important;
    }
    
    /* Stack each day vertically */
    .ze-calendar-wrapper[data-format="week"] td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e8e8e8 !important;
        margin-bottom: 15px !important;
        padding: 15px !important;
        min-height: auto !important;
    }
    
    /* Add day header before each day's events */
    .ze-calendar-wrapper[data-format="week"] td::before {
        content: attr(data-date-display);
        display: block;
        font-size: 1.1em;
        font-weight: 600;
        color: #333;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 2px solid #e8e8e8;
    }
    
    /* Style events in stacked view */
    .ze-calendar-wrapper[data-format="week"] td > div {
        margin-bottom: 8px !important;
    }
}

/* ==========================================================================
   Android Text Wrapping Fixes - v5.0.4
   Fixes text overflow on older Android devices in list view
   ========================================================================== */

/* List View - Android Text Wrapping Fix */
.ze-list-view-item,
.ze-list-view-item *,
.ze-list-event-description,
.ze-list-event-content {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Aggressive breaking for URLs/emails */
.ze-list-event-description a,
.ze-list-event-content a,
.ze-ticket-link,
.ze-list-view-item a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important;
    display: inline-block !important;
    max-width: 100% !important;
}

/* Ensure all text content wraps properly */
.ze-list-event-title,
.ze-list-event-meta,
.ze-list-event-date,
.ze-list-event-time,
.ze-list-event-location {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

/* Additional wrapping for paragraphs and divs */
.ze-list-event-description p,
.ze-list-event-description div,
.ze-list-event-content p,
.ze-list-event-content div {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Mobile-specific additional fixes */
@media (max-width: 768px) {
    .ze-list-view-item {
        overflow: hidden !important;
        width: 100% !important;
    }
    
    .ze-list-event-description,
    .ze-list-event-content {
        overflow-wrap: break-word !important;
        word-break: break-word !important;
    }
}
