/* rbb-post-list.css — Karten-Übersicht für [rbb_post_list] */

/* Brand-Farben (überschreibbar per Theme-CSS) */
:root {
    --rbb-btn-primary:   #2271b1;
    --rbb-btn-secondary: #50575e;
    --rbb-btn-danger:    #b32d2e;
}

.rbb-post-list {
    margin: 0;
}

.rbb-post-list-empty {
    color: #646970;
    font-style: italic;
    margin: 0;
}

/* Grid */

.rbb-post-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Card */

.rbb-post-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: visible; /* Tooltip darf aus der Karte herausragen */
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease, opacity 0.3s ease;
}

.rbb-post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rbb-post-card--removing {
    opacity: 0;
    pointer-events: none;
}

/* Thumbnail */

.rbb-post-card-thumb {
    aspect-ratio: 16 / 9;
    background: #f1f5f9;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 7px 7px 0 0; /* Obere Ecken zur Karte passend abgerunden */
}

.rbb-post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rbb-post-card-thumb--placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

/* Body */

.rbb-post-card-body {
    padding: 12px 14px 10px;
    flex: 1;
}

.rbb-post-card-title {
    font-size: 0.9375em;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px;
    color: #1d2327;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rbb-post-card-event {
    font-size: 0.8em;
    color: #646970;
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status badges */

.rbb-post-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.6;
}

.rbb-post-status--publish { background: #dcfce7; color: #166534; }
.rbb-post-status--draft   { background: #fef9c3; color: #854d0e; }
.rbb-post-status--pending { background: #dbeafe; color: #1e40af; }
.rbb-post-status--private { background: #f3f4f6; color: #374151; }
.rbb-post-status--trash   { background: #fee2e2; color: #991b1b; }
.rbb-post-status--other   { background: #f3f4f6; color: #374151; }

/* Actions */

.rbb-post-card-actions {
    padding: 8px 10px 10px;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    border-top: 1px solid #f1f5f9;
    overflow: visible;
}

.rbb-post-card-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: var(--rbb-btn-primary, #2271b1);
    color: #fff;
    transition: opacity 0.15s;
    font-family: inherit;
    flex-shrink: 0;
}

/* Override theme button styles that inflate <button> elements */
.rbb-post-card-actions .rbb-post-card-btn {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: unset;
    min-height: unset;
    padding: 0;
    line-height: 1;
    color: #fff;
    border: none;
}

.rbb-post-card-btn:hover,
.rbb-post-card-btn:focus {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

.rbb-post-card-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rbb-post-card-btn svg {
    flex-shrink: 0;
    display: block;
}

/* Tooltip */

.rbb-post-card-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 7px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 200;
}

.rbb-post-card-btn:hover::after,
.rbb-post-card-btn:focus-visible::after {
    opacity: 1;
}

.rbb-post-card-btn--secondary {
    background: var(--rbb-btn-secondary, #50575e);
}

.rbb-post-card-btn--trash {
    background: var(--rbb-btn-danger, #b32d2e);
    color: #fff;
}

/* Responsive: 1 Spalte auf kleinen Screens */

@media (max-width: 480px) {
    .rbb-post-list-grid {
        grid-template-columns: 1fr;
    }
}
