/* --- General & Layouts --- */
.lpf-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; position: relative; }
.lpf-posts-wrapper { transition: opacity 0.3s ease; }
.lpf-loading .lpf-posts-wrapper { opacity: 0.5; }

/* Grid Layout (Default) */
.lpf-layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }

/* List Layout */
.lpf-layout-list .lpf-post { display: flex; align-items: flex-start; margin-bottom: 30px; border-bottom: 1px solid #e0e0e0; padding-bottom: 20px; }
.lpf-layout-list .lpf-post:last-child { margin-bottom: 0; border-bottom: none; }
.lpf-layout-list .lpf-post-thumbnail { flex-shrink: 0; margin-right: 20px; max-width: 200px; }
.lpf-layout-list .lpf-post-content { flex-grow: 1; }

/* --- Post Item --- */
.lpf-post { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.lpf-layout-grid .lpf-post:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.lpf-post-thumbnail img { width: 100%; height: 200px; object-fit: cover; display: block; }
.lpf-layout-list .lpf-post-thumbnail img { height: auto; max-height: 150px; }
.lpf-post-header { padding: 20px 20px 10px 20px; }
.lpf-post-title { font-size: 1.25em; font-weight: 600; margin: 0 0 10px 0; line-height: 1.3; }
.lpf-post-title a { text-decoration: none; color: #333; }
.lpf-post-title a:hover { color: #0073aa; }
.lpf-post-meta { font-size: 0.8em; color: #777; }
.lpf-post-meta span { margin-right: 15px; }
.lpf-post-excerpt { padding: 0 20px 20px 20px; font-size: 0.95em; color: #555; }

/* --- Filters Panel --- */
.lpf-filters-panel { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; margin-bottom: 30px; }
.lpf-filter-group { margin-bottom: 20px; }
.lpf-filter-group:last-child { margin-bottom: 0; }
.lpf-filter-group h4 { margin: 0 0 10px 0; font-size: 1.1em; color: #333; border-bottom: 1px solid #dee2e6; padding-bottom: 5px; }
.lpf-filter-search { display: flex; gap: 10px; }
.lpf-search-input { flex-grow: 1; padding: 10px; border: 1px solid #ced4da; border-radius: 5px; font-size: 1em; }
.lpf-search-button, .lpf-load-more-button { padding: 10px 20px; background: #0073aa; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; transition: background-color 0.2s ease-in-out; }
.lpf-search-button:hover, .lpf-load-more-button:hover { background: #005a87; }
.lpf-filter-options label { display: block; margin-bottom: 5px; cursor: pointer; }
.lpf-filter-options input[type="checkbox"], .lpf-filter-options input[type="radio"] { margin-right: 8px; }
.lpf-author-select, .lpf-year-select, .lpf-month-select { width: 100%; padding: 8px; border: 1px solid #ced4da; border-radius: 5px; }
.lpf-filter-date select { display: inline-block; width: 48%; }
.lpf-filter-date select:first-child { margin-right: 4%; }
.lpf-clear-filters-button { display: block; width: 100%; padding: 10px; background: #6c757d; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; text-align: center; margin-top: 20px; transition: background-color 0.2s ease-in-out; }
.lpf-clear-filters-button:hover { background: #5a6268; }

/* --- UI Elements --- */
.lpf-layout-switcher { margin-bottom: 20px; text-align: right; }
.lpf-layout-btn { background: #f0f0f0; border: 1px solid #ddd; padding: 8px; cursor: pointer; margin-left: 5px; border-radius: 4px; }
.lpf-layout-btn:hover { background: #e0e0e0; }
.lpf-layout-btn.is-active { background: #0073aa; color: white; border-color: #0073aa; }
.lpf-pagination { text-align: center; margin-top: 40px; }

/* --- Loader --- */
.lpf-loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border: 5px solid #f3f3f3; border-top: 5px solid #0073aa; border-radius: 50%; animation: spin 1s linear infinite; z-index: 10; }
@keyframes spin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }


/* Mosaic ratios */
.mosaic-50 { grid-column: span 2; }
.mosaic-25 { grid-column: span 1; }
.mosaic-30 { grid-column: span 1; }
.mosaic-70 { grid-column: span 3; }
 
/* Example responsive adjustments */
@media (max-width: 768px) {
  .lpf-layout-grid { grid-template-columns: 1fr; }
}


/* -------------------------------------------------------
   MOBILE SWIPER MODE — ACTIVATE ONLY WHEN CONTAINER HAS:
   .lpf-swiper-initialized
----------------------------------------------------------*/

@media (max-width: 1024px) {

    /* 1. Disable grid layout when Swiper is active */
    .lpf-swiper-initialized .lpf-posts-wrapper {
        display: block !important;
    }

    .lpf-swiper-initialized .lpf-grid-item {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        margin: 0 !important;
    }

    /* 2. Disable mosaic patterns (these break Swiper widths) */
    .lpf-swiper-initialized [class*="mosaic-"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 3. Ensure Swiper container renders correctly */
    .lpf-mobile-swiper {
        width: 100%;
        overflow: hidden;
        position: relative;
        padding-bottom: 30px; /* space for pagination */
    }

    /* 7. Hide OLD pagination */
    .lpf-swiper-initialized .lpf-pagination {
        display: none !important;
    }
  
}


