/* ================================
      PP-NEWS-WIDGET Component
   ================================

   news feed widget for dashboard and settings welcome tab

   requires: css/variables.css

   TABLE OF CONTENTS
   -----------------
   1.  CONTAINER
   2.  LIST & ITEMS
   3.  IMAGE
   4.  DETAILS
   5.  TITLE & DATE
   6.  SUMMARY
   7.  READ MORE
   8.  PLAYER
   9.  FOOTER
   10. DASHBOARD OVERRIDES

   BEM Block: .pp-news-widget
   Elements: __item, __image, __details, __title, __date, __summary, __footer
   Modifiers: --dashboard

   ================================ */


/* ===============
     1. CONTAINER
   =============== */

.powerpress-news-dashboard {
    font-size: 14px;
}

.powerpress-news-dashboard ul {
    list-style: none;
    margin: 0;
    padding: 0;
}


/* ===================
     2. LIST & ITEMS
   =================== */

.pp-news-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1.5em;
    padding: 1.25em;
    margin-bottom: 1em;
    border: 1px solid var(--pp-color-gray-300, #ddd);
    border-radius: var(--pp-border-radius-lg, 12px);
    background: var(--pp-color-white, #fff);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.pp-news-item:hover {
    border-color: var(--pp-color-gray-400, #ccc);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pp-news-item:last-child {
    margin-bottom: 0;
}

/* clickable card - title link stretches to cover card */
.pp-news-details-container > .rsswidget {
    position: static;
}

.pp-news-details-container > .rsswidget::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* keep player and read more links clickable above the stretched link */
.pp-news-item .powerpressNewsPlayer,
.pp-news-item .rssSummary a {
    position: relative;
    z-index: 2;
}


/* =============
     3. IMAGE
   ============= */

.pp-news-image {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    object-fit: cover;
    object-position: center;
    border-radius: var(--pp-border-radius, 4px);
}


/* ===============
     4. DETAILS
   =============== */

.pp-news-details-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}


/* ===================
     5. TITLE & DATE
   =================== */

.powerpress-news-dashboard .rsswidget {
    font-size: 110%;
    font-weight: 600;
    color: var(--pp-color-gray-900, #1d2327);
    text-decoration: underline;
}

.powerpress-news-dashboard .rsswidget:hover {
    color: var(--pp-color-primary, #0B43A4);
}

.powerpress-news-dashboard .rss-date {
    font-size: 80%;
    color: var(--pp-color-gray-600, #666);
    margin-top: 0.25em;
}


/* ===============
     6. SUMMARY
   =============== */

.powerpress-news-dashboard .rssSummary {
    font-size: 95%;
    line-height: 1.4;
    margin-top: 0.5em;
    color: var(--pp-color-gray-800, #333);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ================
     7. READ MORE
   ================ */

.pp-news-read-more {
    display: inline-block;
    margin-top: 0.5em;
    font-size: 90%;
    color: var(--pp-wp-link, #0073aa);
    text-decoration: none;
}

.pp-news-read-more:hover {
    text-decoration: underline;
}


/* =============
     8. PLAYER
   ============= */

.powerpress-news-dashboard .powerpressNewsPlayer {
    margin-top: 0.5em;
}


/* =============
     9. FOOTER
   ============= */

.pp-news-footer {
    text-align: center;
    padding: 1em 0 0.5em;
    font-weight: bold;
}

.pp-news-footer a {
    color: var(--pp-wp-link, #0073aa);
    text-decoration: none;
}

.pp-news-footer a:hover {
    text-decoration: underline;
}


/* ===========================
     10. DASHBOARD OVERRIDES
   =========================== */

/* dashboard widget has less space, adjust image size */
#powerpress_dashboard_news .pp-news-image {
    width: 100px;
    height: 100px;
}

/* settings welcome tab can have larger images */
.powerpress-welcome-news .pp-news-image {
    width: 180px;
    height: 180px;
}

/* ===========================
     11. MOBILE (782px)
   =========================== */

@media (max-width: 782px) {
    /* keep row layout with smaller image */
    .pp-news-image {
        width: 80px;
        height: 80px;
    }

    /* title + date inline */
    .pp-news-details-container > .rsswidget {
        display: inline;
    }

    .powerpress-news-dashboard .rss-date {
        display: inline;
        margin-left: 0.5em;
    }

    .powerpress-news-dashboard .rss-date::before {
        content: '·';
        margin-right: 0.5em;
    }

    /* larger summary text */
    .powerpress-news-dashboard .rssSummary {
        font-size: 100%;
        margin-top: 0.75em;
    }

    /* constrain player width on mobile */
    .powerpress-news-dashboard .powerpressNewsPlayer,
    .powerpress-news-dashboard .mejs-container {
        max-width: 100% !important;
        width: 100% !important;
    }

    .powerpress-news-dashboard .mejs-container audio {
        width: 100% !important;
    }
}

