/*
 * PSM Social Feed – Frontend-Styles
 * Minimal, themeable, mobile-first
 */

/* ============================================================
   Wrapper & Grid
   ============================================================ */
.psm-sf-wrap {
    container-type: inline-size;
}

.psm-sf-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@container (min-width: 480px) {
    .psm-sf-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container (min-width: 768px) {
    .psm-sf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   Feed-Item (Karte)
   ============================================================ */
.psm-sf-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    transition: box-shadow .2s ease, transform .2s ease;
}

.psm-sf-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    transform: translateY(-2px);
}

/* Plattform-Farben als dezente linke Border */
.psm-sf-item--facebook  { border-top: 3px solid #1877f2; }
.psm-sf-item--instagram { border-top: 3px solid #e1306c; }

/* ============================================================
   Media
   ============================================================ */
.psm-sf-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f7f7f7;
}

.psm-sf-media a {
    display: block;
    height: 100%;
}

.psm-sf-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.psm-sf-item:hover .psm-sf-img {
    transform: scale(1.03);
}

.psm-sf-media--video {
    aspect-ratio: 16 / 9;
}

.psm-sf-video {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================================
   Content
   ============================================================ */
.psm-sf-content {
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}

.psm-sf-text {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.6;
    color: #374151;
    flex: 1;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ============================================================
   Meta (Footer)
   ============================================================ */
.psm-sf-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: 0.78em;
    color: #6b7280;
    border-top: 1px solid #f3f4f6;
    padding-top: 0.6rem;
    margin-top: auto;
}

.psm-sf-platform {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75em;
    letter-spacing: 0.3px;
}

.psm-sf-platform--facebook {
    background: #e8f0fe;
    color: #1877f2;
}

.psm-sf-platform--instagram {
    background: #fde8f0;
    color: #e1306c;
}

.psm-sf-source {
    font-weight: 600;
    color: #374151;
}

.psm-sf-date {
    margin-left: auto;
    font-size: 0.9em;
}

.psm-sf-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: color .15s;
    margin-left: auto;
}

.psm-sf-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.psm-sf-link-icon {
    font-size: 0.85em;
}

/* ============================================================
   Leer-Zustand
   ============================================================ */
.psm-sf-empty {
    padding: 2rem;
    text-align: center;
    color: #9ca3af;
    border: 2px dashed #e5e7eb;
    border-radius: 10px;
}

/* ============================================================
   Pagination
   ============================================================ */
.psm-sf-pagination {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.psm-sf-page-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.psm-sf-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
}

.psm-sf-page-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111;
}

.is-active .psm-sf-page-link {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.psm-sf-page-ellipsis span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #9ca3af;
}

.psm-sf-pagination-info {
    margin: 0;
    font-size: 0.82em;
    color: #9ca3af;
}

/* ============================================================
   Barrierefreiheit
   ============================================================ */
.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* High Contrast */
@media (prefers-contrast: high) {
    .psm-sf-item {
        border-width: 2px;
    }
    .psm-sf-page-link {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .psm-sf-item,
    .psm-sf-img,
    .psm-sf-page-link,
    .psm-sf-link {
        transition: none;
    }
    .psm-sf-item:hover {
        transform: none;
    }
    .psm-sf-item:hover .psm-sf-img {
        transform: none;
    }
}
