/*
 * ===================================================================
 * CSS für die IPC Post Table - Adaptiert von ipc-ajax.css
 * ===================================================================
*/

/* === GLOBALE CONTAINER & TOP-BAR === */
#ipc-post-table-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
#ipc-top-bar { display: flex; margin-bottom: 15px; gap: 10px; align-items: center; }
.ipc-search-wrapper { flex-grow: 1; }
.ipc-search-wrapper input[name="search"] { width: 100%; height: 40px; padding: 0 15px; border-radius: 8px; border: 1px solid #ccc; font-size: 15px; }
.ipc-view-switcher { display: flex; flex-shrink: 0; gap: 0; }
.ipc-view-switcher button, #ipc-open-filters-btn { width: 40px; height: 40px; border: 1px solid #ccc; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.ipc-view-switcher button img, #ipc-open-filters-btn img { height: 20px; width: 20px; }
.ipc-view-switcher button:first-child { border-radius: 8px 0 0 8px; }
.ipc-view-switcher button:last-child { border-radius: 0 8px 8px 0; border-left: none; }
.ipc-view-switcher button.active { background-color: #0073aa; border-color: #0073aa; }
.ipc-view-switcher button.active img { filter: brightness(0) invert(1); }
#ipc-open-filters-btn { display: none; border-radius: 8px; }

/* === DESKTOP FILTER-BEREICH === */
#ipc-filter-form-desktop { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 2em; align-items: center; }
.ipc-filter-pills-container { display: flex; flex-wrap: wrap; gap: 10px; }
.ipc-filter-pill { display: flex; align-items: center; background-color: #f5f5f5; border: 1px solid transparent; border-radius: 20px; height: 36px; font-size: 14px; padding: 0; }
.ipc-filter-pill:hover { border-color: #ccc; }
.ipc-filter-pill select { border: none; background: transparent; -webkit-appearance: none; appearance: none; font-size: 14px; font-weight: 500; cursor: pointer; padding: 0 15px; height: 100%; border-radius: 20px; }
.ipc-filter-pill select:focus { outline: none; }
.ipc-controls-container { margin-left: auto; display: flex; gap: 6px; }
.ipc-reset-button { height: 36px; border-radius: 20px; border: 1px solid #ccc; background: #fff; padding: 0 15px; cursor: pointer; font-size: 14px; }
.ipc-reset-button:hover { background-color: #f0f0f0; }

/* === MOBILER FILTER-SIDEBAR === */
#ipc-post-table-container.ipc-sidebar-is-open #ipc-filter-sidebar { transform: translateX(0); }
#ipc-post-table-container.ipc-sidebar-is-open #ipc-filter-overlay { opacity: 1; visibility: visible; }
#ipc-filter-sidebar { position: fixed; top: 0; right: 0; width: 300px; max-width: 85%; height: 100%; background: #fff; z-index: 1002; box-shadow: -5px 0 15px rgba(0,0,0,0.1); transform: translateX(100%); transition: transform 0.3s ease-in-out; display: flex; flex-direction: column; }
#ipc-filter-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1001; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.ipc-sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid #eee; flex-shrink: 0; }
.ipc-sidebar-header h3 { margin: 0; font-size: 18px; }
#ipc-close-filters-btn { font-size: 28px; font-weight: 300; background: none; border: none; cursor: pointer; line-height: 1; padding: 0; color: #555; }
.ipc-sidebar-content { padding: 20px; overflow-y: auto; flex-grow: 1; }
#ipc-filter-form-mobile { display: flex; flex-direction: column; gap: 15px; }
#ipc-filter-form-mobile label { font-weight: 600; font-size: 14px; margin-bottom: -10px; color: #333; }
#ipc-filter-form-mobile select, #ipc-filter-form-mobile input { width: 100%; height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid #ccc; font-size: 15px; background-color: #f5f5f5; -webkit-appearance: none; appearance: none; }
.ipc-sidebar-footer { display: flex; gap: 10px; padding: 15px 20px; border-top: 1px solid #eee; flex-shrink: 0; }
.ipc-sidebar-footer .ipc-reset-button, .ipc-sidebar-footer .ipc-submit-button { width: 100%; height: 44px; font-size: 16px; font-weight: 600; border-radius: 8px; }
.ipc-sidebar-footer .ipc-reset-button { background-color: #6c757d; color: #fff; border-color: #6c757d; }
.ipc-sidebar-footer .ipc-submit-button { background-color: #0073aa; color: #fff; border-color: #0073aa; }

/* === ALLGEMEINE BUTTON-STILE === */
.ipc-action-button { font-size: 13px; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-weight: 600; text-align: center; }
.ipc-button-offer { background-color: #0073aa; color: #fff !important; border: 1px solid #0073aa; }

/* === GRID-ANSICHT für Beiträge === */
#ipc-post-table-results.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.grid-view .ipc-post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; overflow: hidden; }
.grid-view .ipc-post-image { height: auto; aspect-ratio: 16 / 10; display: block; overflow:hidden; }
.grid-view .ipc-post-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.grid-view .ipc-post-card:hover .ipc-post-image img { transform: scale(1.05); }
.grid-view .ipc-post-info { padding: 16px; flex-grow: 1; display: flex; flex-direction: column; }
.grid-view .ipc-post-title { font-weight: 600; font-size: 1.1em; line-height: 1.4; margin:0 0 10px 0; }
.grid-view .ipc-post-title a { color: inherit; text-decoration: none; }
.grid-view .ipc-post-excerpt { font-size: 0.9em; color: #555; flex-grow: 1; }
.grid-view .ipc-post-footer { padding: 0 16px 16px; margin-top: 15px; }

/* === LISTEN-ANSICHT für Beiträge === */
#ipc-post-table-results.list-view { display: flex; flex-direction: column; gap: 16px; }
.ipc-post-list-item { display: flex; gap: 16px; background: #fff; border: 1px solid #ddd; border-radius: 12px; padding: 16px; align-items: center; }
.ipc-post-list-item .ipc-post-list-image a { width: 150px; height: 100px; display:flex; align-items:center; justify-content:center; flex-shrink: 0; overflow:hidden; border-radius: 8px; }
.ipc-post-list-item .ipc-post-list-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.ipc-post-list-item:hover .ipc-post-list-image img { transform: scale(1.05); }
.ipc-post-list-item .ipc-post-list-info { flex: 1; min-width: 0; }
.ipc-post-list-item .ipc-post-list-name { font-weight: 700; font-size: 1.2em; margin-bottom: 8px; }
.ipc-post-list-item .ipc-post-list-name a { text-decoration: none; color: inherit; }
.ipc-post-list-item .ipc-post-list-excerpt { font-size: 0.9em; color: #555; }
.ipc-post-list-item .ipc-post-list-right-col { margin-left: auto; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

/* PAGINIERUNG */
#ipc-pagination-container { margin-top: 2.5em; text-align: center; }
#ipc-pagination-container .page-numbers { display: inline-block; padding: 8px 14px; margin: 0 2px; border: 1px solid #ddd; background: #fff; color: #333; text-decoration: none; border-radius: 4px; }
#ipc-pagination-container .page-numbers.current { background-color: #0073aa; color: #fff; border-color: #0073aa; font-weight: 600; }

/* === RESPONSIVE ANPASSUNGEN & MOBILE UX === */
@media (max-width: 768px) {
    #ipc-filter-form-desktop { display: none; }
    #ipc-open-filters-btn { display: flex; }
    .ipc-view-switcher button:first-child { border-radius: 0; border-right: none; }
    .ipc-view-switcher button:last-child { border-radius: 0 8px 8px 0; }
    
    #ipc-post-table-results.grid-view { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
    
    #ipc-post-table-results.list-view { gap: 1px; background-color: #e0e0e0; border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; }
    .list-view .ipc-post-list-item { border-radius: 0; flex-wrap: wrap; }
    .list-view .ipc-post-list-image a { width: 100px; height: 75px; }
    .list-view .ipc-post-list-info { order: 1; width: calc(100% - 115px); }
    .list-view .ipc-post-list-name { font-size: 1.05em; margin-bottom: 4px; }
    .list-view .ipc-post-list-excerpt { display: none; } /* Excerpt auf Mobile in Liste ausblenden */
    .list-view .ipc-post-list-right-col { order: 2; width: 100%; margin-top: 10px; align-items: flex-start; }
    .list-view .ipc-post-list-actions .ipc-action-button { width: 100%; }
}