/* ============================================
   News Feed - Single Column Compact Layout
   Reddit/Wykop.pl Style
   ============================================ */

.news-feed-container {
    /*max-width: 800px;*/
    margin: 0 auto;
    padding: 0 1rem;
}

.news-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.news-feed-item {
    width: 100%;
}

.news-feed-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.news-feed-card:hover {
    border-color: var(--btn-primary);
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Compact News Item */
.news-compact {
    width: 100%;
}

.news-compact-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
}

/* Thumbnail */
.news-compact-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background-color: rgba(0, 0, 0, 0.1);
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.2s ease;
}

.news-compact-thumb:hover .thumb-img {
    transform: scale(1.05);
}

.thumb-youtube,
.thumb-media,
.thumb-link {
    width: 100%;
    height: 100%;
    position: relative;
}

.thumb-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FF0000;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.thumb-play-video {
    color: var(--btn-primary);
}

.thumb-link-icon {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 3px;
}

.thumb-count {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: var(--font-weight-semibold);
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--border-color), var(--card-background));
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* Content */
.news-compact-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.news-compact-title {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    line-height: 24px;
    margin: 0;
}

.news-compact-title .title-link {
    color: var(--text-primary);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-compact-title .title-link:hover {
    color: var(--btn-primary);
}

/* Mobile/Desktop title visibility */
.news-compact-title-mobile {
    display: none;
}

.news-compact-title-desktop {
    display: block;
}

.news-compact-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 19.6px;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-compact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 12px;
    /*font-size: 0.75rem;*/
    color: var(--text-muted);
    margin-top: auto;
}

.news-compact-meta i {
    margin-right: 0.2rem;
    opacity: 0.7;
}

    .news-compact-meta .badge {
        font-size: 10.4px;
        /*font-size: 0.65rem;*/
        padding: 0.15em 0.4em;
        margin-right: 0.15rem;
    }

/* Actions */
.news-compact-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-expand-media,
.btn-external-link,
.btn-comments {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--button-background);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-expand-media:hover,
.btn-external-link:hover,
.btn-comments:hover {
    background: var(--btn-primary);
    border-color: var(--btn-primary);
    color: white;
}

.btn-expand-media[aria-expanded="true"] {
    background: var(--btn-primary);
    border-color: var(--btn-primary);
    color: white;
}

/* Expandable Media Container */
.news-compact-media-expand {
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.media-expand-youtube {
    padding: 0;
}

.youtube-player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.youtube-placeholder-expand {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.youtube-play-btn {
    width: 68px;
    height: 48px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.youtube-play-btn:hover {
    transform: scale(1.1);
}

.youtube-play-btn svg {
    width: 100%;
    height: 100%;
}

.youtube-iframe-embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Gallery Expand */
.media-expand-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
}

.gallery-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
    aspect-ratio: 4/3;
}

/* Gallery item inner wrapper for proper centering */
.gallery-item > a,
.gallery-item > .media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-item > a > div,
.gallery-item > .media-link > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-img:hover {
    transform: scale(1.02);
}

.gallery-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: background 0.2s ease;
}

.video-play-overlay:hover {
    background: rgba(0, 0, 0, 0.2);
}

.video-play-overlay i {
    font-size: 3rem;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.media-expand-footer {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.media-expand-footer .btn {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
}

/* Highlighted Comments in Feed */
.news-feed-highlights {
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.02);
}

/* Light Theme Adjustments */
.light-theme .news-feed-card {
    background-color: rgba(255, 255, 255, 0.95);
}

.light-theme .news-compact-media-expand {
    background: rgba(0, 0, 0, 0.02);
}

.light-theme .thumb-placeholder {
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
}

/* Responsive */
@media (max-width: 576px) {
    .news-feed-container {
        padding: 0 0rem;
    }

    /* Show mobile title, hide desktop title */
    .news-compact-title-mobile {
        display: block;
        padding: 0.5rem 0.5rem 0 0.5rem;
        font-size: 16px;
        line-height: 20px;
    }

    .news-compact-title-desktop {
        display: none;
    }

    .news-compact-header {
        display: grid;
        grid-template-columns: 100px 1fr;
        grid-template-rows: auto auto;
        padding: 0.3rem;
        gap: 0.5rem;
    }

    .news-compact-thumb {
        grid-column: 1;
        grid-row: 1;
        width: 100px;
        height: 75px;
    }

    .news-compact-content {
        grid-column: 2;
        grid-row: 1 / 3;
    }

    .news-compact-actions {
        grid-column: 1;
        grid-row: 2;
        flex-direction: row;
        justify-content: center;
        align-self: start;
    }

/*    .news-compact-meta {
        font-size: 0.7rem;
    }*/

    .btn-expand-media,
    .btn-external-link,
    .btn-comments {
        width: 32px;
        height: 32px;
    }

    .media-expand-gallery {
        grid-template-columns: repeat(2, 1fr);
        padding: 0.5rem;
    }
}

@media (min-width: 768px) {
    .news-compact-thumb {
        width: 120px;
        height: 80px;
    }

    .news-compact-header {
        gap: 1rem;
        padding: 1rem;
    }

    .media-expand-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Adult Content Compact */
.adult-content-warning.compact .adult-content-overlay {
    border-radius: 6px;
}

.adult-content-warning.compact .adult-content-message {
    padding: 0.5rem;
}

.adult-content-warning.compact .adult-content-message i {
    font-size: 1.5rem;
}

.adult-content-warning.compact .adult-content-message span {
    font-size: 0.85rem;
}