/* mod_socialfeed - Mobile-First Styles (Elfsight-artiges Kartendesign) */

.sf-wrap {
    --sf-gap: 1.1rem;
    --sf-radius: 12px;
    --sf-accent: #1c6dd0;
    --sf-text-muted: #6b7280;
    --sf-border: #e9ebef;
    --sf-ig-color: #d6249f;
    --sf-yt-color: #cc1f1f;
    box-sizing: border-box;
}

.sf-wrap *,
.sf-wrap *::before,
.sf-wrap *::after {
    box-sizing: inherit;
}

/* Tabs */
.sf-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.3rem;
    border-bottom: 1px solid var(--sf-border);
}

.sf-tab-btn {
    appearance: none;
    background: none;
    border: none;
    padding: 0.6rem 0.1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sf-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.sf-tab-btn.is-active {
    color: #111827;
    border-bottom-color: #111827;
}

.sf-panel { display: none; }
.sf-panel.is-active { display: block; }

.sf-section-heading {
    font-size: 1.1rem;
    margin: 1.2rem 0 0.6rem;
}

/* Grid: Mobile-First - eine Spalte, wächst mit Platz */
.sf-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sf-gap);
}

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

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

/* Card */
.sf-card {
    border: 1px solid var(--sf-border);
    border-radius: var(--sf-radius);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

/* Vorschau: standardmaessig quadratisch (einheitliches Raster wie Elfsight).
   Beim Abspielen wechselt JS per Inline-Style auf das echte Video-Format. */
.sf-thumb-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #111;
    overflow: hidden;
}

.sf-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sf-thumb-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border: none;
    background: #000;
}

.sf-thumb--placeholder {
    background: linear-gradient(135deg, #ddd, #eee);
}

/* Kleines Play-Badge oben rechts (statt grossem zentriertem Button) */
.sf-play-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.sf-thumb-wrap {
    cursor: pointer;
}

.sf-body {
    padding: 0.85rem 0.95rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.sf-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.sf-desc {
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.4;
    margin: 0;
}

.sf-toggle-desc {
    appearance: none;
    background: none;
    border: none;
    color: var(--sf-accent);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0;
    margin-left: 0.25rem;
    cursor: pointer;
}

.sf-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--sf-text-muted);
}

.sf-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
}

.sf-badge--instagram {
    background: linear-gradient(135deg, #f58529, #dd2a7b 45%, #8134af 75%, #515bd4);
}

.sf-badge--youtube {
    background: var(--sf-yt-color);
}

.sf-badge--rss {
    background: #f26522;
}

.sf-audio-player {
    width: 100%;
    height: 34px;
    margin-top: 0.1rem;
}

/* RSS-Text/Audio-Kacheln: keine Klick-zum-Abspielen-Optik */
.sf-card[data-media-type="audio"] .sf-thumb-wrap,
.sf-card[data-media-type="text"] .sf-thumb-wrap {
    cursor: default;
}

.sf-readmore-btn {
    appearance: none;
    background: none;
    border: none;
    color: var(--sf-accent);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0;
    margin-left: 0.25rem;
    cursor: pointer;
}

.sf-footer {
    margin-top: 0.3rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--sf-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--sf-text-muted);
}

.sf-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: inherit;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.sf-stat--link:hover,
.sf-stat--share:hover {
    color: var(--sf-accent);
}

.sf-stat--share {
    margin-left: auto;
}

.sf-empty {
    color: var(--sf-text-muted);
    font-size: 0.9rem;
}

/* Popup-Player (optional per Modul-Einstellung "Video-Wiedergabe") */
.sf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}

.sf-modal-overlay.is-open {
    display: flex;
}

.sf-modal-content {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    max-width: 96vw;
    max-height: 90vh;
}

.sf-modal-content video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.sf-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.sf-modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Text-Popup-Variante (RSS "Weiterlesen") - liest sich statt Video-Groesse
   an einer angenehmen Lesebreite, scrollbar bei langen Artikeln */
.sf-modal-content--text {
    width: min(680px, 92vw) !important;
    height: auto !important;
    max-height: 82vh;
    overflow-y: auto;
    background: #fff;
    padding: 1.75rem;
    border-radius: 12px;
}

.sf-modal-article h3 {
    margin: 0 0 1rem;
    font-size: 1.3rem;
    line-height: 1.3;
    color: #111827;
}

.sf-modal-article-body {
    color: #1f2937;
    line-height: 1.6;
    font-size: 0.95rem;
}

.sf-modal-article-body p {
    margin: 0 0 1rem;
}

.sf-modal-article-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--sf-accent);
    font-weight: 600;
    text-decoration: none;
}

.sf-modal-article-link:hover {
    text-decoration: underline;
}
