/* ZRK Master Calendar V74.0 - Fix: Year alignment kept inline for standalone shortcode, but block for main cards */

/* --- 1. FILTER CONTROLS --- */
.zrk-filter-container { 
    text-align: center; 
    margin-bottom: 40px; 
}

.zrk-month-buttons { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 5px; 
    margin-bottom: 15px; 
}

.filter-btn { 
    padding: 8px 12px; 
    border: 1px solid #333; 
    background: transparent; 
    cursor: pointer; 
    /*text-transform: uppercase; */
    font-size: 14px; 
    transition: all 0.2s; 
    font-family: 'Roboto', sans-serif; /* Set explicitly */
}

.filter-btn:hover, 
.filter-btn.active { 
    background: #333; 
    color: #fff; 
}

/* Accessibility: Visible focus state */
.filter-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.zrk-filter-row { 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    align-items: center; 
}

.zrk-select-group { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 600; 
    font-family: 'Oswald', sans-serif; /* Set explicitly */
}

.zrk-select-group select { 
    padding: 5px; 
    border: 1px solid #ccc; 
    min-width: 100px; 
    /* Inherits Oswald from parent */
    background-color: rgba(0, 0, 0, 0) !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    border-radius: 0px !important;
    text-transform: lowercase;
}

/* Fix for Select Arrow Color (Browser dependent, but helps) */
.zrk-select-group select {
    -webkit-text-fill-color: #000000;
}

/* Accessibility: Focus state for selects */
.zrk-select-group select:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
}

/* --- DISABLED STATE (V31.0) --- */
.zrk-select-group select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #888 !important;
}

/* Screen reader only class for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --- 2. GROUP TITLES --- */
.zrk-group-title {
    font-size: 28px;
    font-style: normal; /* REMOVED ITALIC */
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
    color: #333;
    font-family: 'Pattaya', sans-serif; /* Set explicitly */
}

/* --- 3. THE CARD GRID --- */
.zrk-grid-wrapper { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    max-width: 1200px; 
    margin: 0 auto 30px auto; 
}

/* Card Wrapper (Anchor Tag) */
.zrk-grid-wrapper .zrk-event-card {
    display: flex; 
    flex-direction: row;
    align-items: stretch;
    color: #fff; 
    text-decoration: none;
    min-height: 140px;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    font-family: 'Oswald', sans-serif; /* Set explicitly */
}

.zrk-grid-wrapper .zrk-event-card:hover { 
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Accessibility: Focus state */
.zrk-grid-wrapper .zrk-event-card:focus {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

/* --- 4. CARD COLUMNS (Desktop) --- */
/* DATE CONTAINER (Base) */
.zrk-card-date { 
    width: 100px; 
    flex-shrink: 0; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    padding: 10px; 
    line-height: 1; 
    gap: 0 !important;
    
    /* Base Font Definition (Pattaya) */
    font-family: 'Pattaya', cursive !important;
}

/* DATE CHILDREN (No italics, No inherited bold/italics) */
.zrk-card-date *,
.zrk-card-date .zrk-date-line,
.zrk-card-date .zrk-date-line * {
    font-style: normal !important; 
    font-weight: 400 !important; 
}

.zrk-c-day { 
    font-size: 42px; 
    font-weight: 700; 
}

.zrk-c-month { 
    font-size: 18px; 
    font-weight: 700; 
    text-transform: lowercase; 
}

/* V73.0 FIX: Added display:block and width:100% to force year to new line and center it properly */
.zrk-c-year {
    font-size: 14px;
    margin-top: 0 !important;
    line-height: 1;
    display: block; 
    width: 100%;
}

/* Weekday Override (Oswald) */
.zrk-c-weekday {
    font-family: 'Oswald', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase;
}

/* Special Text Sizes */
.zrk-small-text {
    white-space: nowrap; 
    font-size: 16px !important;
    line-height: 1.2;
    display: inline-block;
}

.zrk-sep {
    margin: 0 !important;
    font-weight: 400;
}

/* IMAGE (Object Fit Cover) */
.zrk-card-img {
    width: 180px;
    margin: 6px 0;
    overflow: hidden;
    position: relative;
    display: flex; 
}

.zrk-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Keeps image sharp */
    object-position: center;
    border-radius: 4px;
}

/* CONTENT */
.zrk-card-content { 
    flex-grow: 1; 
    padding: 15px 25px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
}

.zrk-card-title { 
    margin: 0 0 10px 0; 
    font-size: 24px; 
    color: #fff; 
    /*text-transform: uppercase; */
}

/* META */
.zrk-card-meta { 
    display: flex; 
    gap: 20px; 
    font-size: 13px; 
    flex-wrap: wrap; 
    opacity: 0.9; 
    margin-bottom: 10px; 
}

.zrk-card-meta span { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    /*text-transform: uppercase; */
    font-weight: 600; 
}

/* PRICES */
.zrk-price-box { 
    font-size: 14px; 
    line-height: 1.4; 
    border-top: 1px solid rgba(255,255,255,0.3); 
    padding-top: 8px; 
}

.zrk-price-info { 
    margin-bottom: 5px; 
    font-weight: bold; 
}

.zrk-price-row { 
    margin-bottom: 2px; 
}

.zrk-free-label { 
    font-size: 16px; 
    font-weight: bold; 
    margin: 5px 0; 
    /*text-transform: uppercase; */
}

/* --- 5. MOBILE LAYOUT ("Sandwich" Style) V37.0 --- */
@media (max-width: 768px) {
    .zrk-event-card { 
        flex-direction: column !important; 
        height: auto !important; 
        padding: 0; 
    }
    
    /* Top: Date */
    .zrk-card-date { 
        width: 100% !important; 
        flex-direction: row !important; 
        justify-content: center; 
        align-items: baseline; 
        gap: 0 !important;
        padding: 10px 0; 
        background: rgba(0,0,0,0.1);
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.2); 
    }
    
    .zrk-c-day { 
        font-size: 28px; 
    }
    
    .zrk-c-year { 
        font-size: 20px; 
        margin: 0 !important; 
        display: inline !important;
        width: auto;
    }

    /* Middle: Image (Full Natural Height) */
    .zrk-card-img { 
        width: auto !important; 
        height: auto !important; /* Let image dictate height */
        aspect-ratio: auto !important; /* Remove square constraint */
        min-height: 0 !important; 
        max-height: none !important;
        margin: 0 6px !important; 
    }
    
    .zrk-card-img img { 
        width: 100%;
        height: auto !important;
        object-fit: contain; /* Ensure the full poster is visible */
        border-radius: 0; 
    }

    /* Bottom: Content */
    .zrk-card-content { 
        width: 100% !important; 
        padding: 20px; 
        text-align: left; 
    }
    
    .zrk-card-title { 
        font-size: 22px; 
        margin-bottom: 15px; 
    }
    
    .zrk-card-meta { 
        justify-content: flex-start; 
        gap: 15px; 
    }
    
    /* Mobile filter adjustments */
    .zrk-filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .zrk-select-group {
        width: 100%;
        max-width: 300px;
    }
    
    .zrk-select-group select {
        flex: 1;
    }
    
    .zrk-mob-sp {
        display: inline;
    }
}

/* --- DESKTOP FIX (Hide Mobile Spaces) --- */
@media (min-width: 769px) {
    .zrk-mob-sp {
        display: none;
    }
}

/* --- 6. PRINT STYLES --- */
@media print {
    .zrk-filter-container {
        display: none;
    }
    
    .zrk-event-card {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }
}

/* --- 7. DESKTOP GRID LAYOUT (V66.0: Includes Grid Fix + Centering Fix) --- */
@media (min-width: 1024px) {
    /* Target the container using both wrapper and type classes 
       to guarantee grid override over the base flex rule. */
    .zrk-calendar-grid.zrk-grid-wrapper.zrk-type-future { 
        display: grid !important; 
        grid-template-columns: 1fr 1fr; 
        gap: 20px; 
        align-items: start;
    }

    /* ... (Rest of media query content) ... */
    .zrk-calendar-grid.zrk-type-future .zrk-event-card {
        height: 100%;
        min-height: 160px;
        margin-bottom: 0;
        align-items: center; 
    }
    
    /* --- DESKTOP IMAGE FIX --- */
    .zrk-event-card .zrk-card-img {
        width: 15% !important; 
        min-width: 120px; 
        height: auto; 
        flex-shrink: 0;
        margin: 6px 0 !important; 
        display: flex;
        justify-content: center;
        background: transparent;
    }
    
    .zrk-event-card .zrk-card-img img {
        max-height: 150px !important; 
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
        border-radius: 4px;
    }
    
    .zrk-calendar-grid.zrk-type-past {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    /* Single Day remains inline */
    .zrk-card-date:not(.zrk-multi-day-date) .zrk-date-line {
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        text-align: center;
        white-space: normal; 
        gap: 0;
        height: 100%;
        /* Ensure content is vertically centered in the full-height container */
        justify-content: center;
    }
    
    .zrk-card-date:not(.zrk-multi-day-date) .zrk-date-line > span {
        display: block;
        width: 100%;
        margin-bottom: 0;
    }
    
    /* Stacking for Multi-Day Events on Desktop (Two lines) */
    .zrk-multi-day-date {
        display: flex;
        flex-direction: column; 
        align-items: center; 
        text-align: center;
    }
    
    .zrk-multi-day-date .zrk-c-weekday {
        display: block; 
        width: 100%;
        margin-bottom: 5px; 
        font-size: 1.2em !important; 
    }
    
    .zrk-multi-day-date .zrk-date-range {
        display: block; 
        width: 100%;
        font-size: 1em; 
    }
}

/* --- NO EVENTS MESSAGE (V30.0) --- */
.zrk-no-events {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    color: #000000;
    text-align: center;
    padding: 20px;
    width: 100%;
    
    /* Ensure it takes full row in a grid */
    grid-column: 1 / -1; 
}

/* --- LOAD MORE / LOAD ALL BUTTONS (V71.0) --- */
.zrk-load-more-btn,
.zrk-load-all-btn {
    background-color: transparent;
    color: #000;
    border: 1px solid #000;
    padding: 10px 30px;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin: 0 5px 20px 5px; /* Add horizontal spacing */
}

.zrk-load-more-btn:hover,
.zrk-load-all-btn:hover {
    background-color: #000;
    color: #fff;
}

/* --- LOADER SPINNER (V39.0) --- */
.zrk-loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #000; /* Black */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: zrk-spin 1s linear infinite;
    margin: 40px auto;
    display: block;
}

@keyframes zrk-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- V51.0/V59.0: Standalone Shortcode Uniform Styling --- */
.zrk-standalone-date {
    /* Set base uniform style */
    font-family: 'Oswald', sans-serif !important;
    font-size: 24px !important;
    font-weight: 500 !important;
    
    /* V53.0 REVERT: Remove badge styling */
    color: inherit !important; 
    background-color: transparent !important; 
    padding: 0 !important; 
    border-radius: 0 !important; 

    /* V57.0: Mobiil/Standalone default is inline flex */
    display: inline-flex; 
    align-items: baseline;
    gap: 0.5em; /* Add spacing between elements on mobile/standalone */
}

/* Ensure all child elements inherit the Oswald font and uniform size */
.zrk-standalone-date *,
.zrk-standalone-date .zrk-c-weekday,
.zrk-standalone-date .zrk-c-day,
.zrk-standalone-date .zrk-small-text {
    font-family: 'Oswald', sans-serif !important;
    font-size: 24px !important; 
    font-weight: 500 !important;
    font-style: normal !important;
    color: inherit !important; 
}

/* Specific class size overrides (ensure they revert to 1em = 24px) */
.zrk-standalone-date .zrk-c-day, 
.zrk-standalone-date .zrk-small-text {
    font-size: 1em !important;
}

/* V74.0 FIX: Override year display for standalone shortcode to keep it inline */
.zrk-standalone-date .zrk-c-year {
    display: inline !important;
    width: auto !important;
    margin-top: 0 !important;
}