/* ============================================================
   EMXS News Feeds — Front-end Styles v2.4
   ============================================================ */

/* ── Widget ─────────────────────────────────────────────── */
.emxs-nf-widget {
    margin: 0 0 40px;
}

.emxs-nf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.emxs-nf-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.emxs-nf-icon {
    font-size: 1.4rem;
}

.emxs-nf-view-all {
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: #0073aa;
    white-space: nowrap;
    transition: color 0.2s;
}

.emxs-nf-view-all:hover {
    color: #005a87;
    text-decoration: underline;
}

/* ── Card Grid (Widget) ─────────────────────────────────── */
.emxs-nf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.emxs-nf-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.emxs-nf-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.emxs-nf-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f0f0f0;
}

.emxs-nf-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.emxs-nf-card:hover .emxs-nf-thumb img {
    transform: scale(1.04);
}

.emxs-nf-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.emxs-nf-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.emxs-nf-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.78rem;
    color: #666;
    flex-wrap: wrap;
}

.emxs-nf-source {
    background: #f0f4f8;
    color: #0073aa;
    padding: 2px 7px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.75rem;
}

.emxs-nf-date {
    color: #888;
}

.emxs-nf-ai-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    cursor: default;
}

.emxs-nf-item-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.4;
}

.emxs-nf-item-title a {
    text-decoration: none;
    color: #1a1a1a;
    transition: color 0.2s;
}

.emxs-nf-item-title a:hover {
    color: #0073aa;
}

.emxs-nf-excerpt {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.5;
    margin: 0 0 12px;
    flex: 1;
}

/* Widget card action row — two buttons */
.emxs-nf-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    flex-wrap: wrap;
}

.emxs-nf-read-summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.emxs-nf-read-summary:hover {
    color: #005a87;
    text-decoration: underline;
}

.emxs-nf-full-article {
    font-size: 0.82rem;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.emxs-nf-full-article:hover {
    color: #555;
    text-decoration: underline;
}

.emxs-nf-empty {
    color: #888;
    font-style: italic;
    padding: 20px 0;
}

/* ── Archive Page ───────────────────────────────────────── */
.emxs-nf-archive-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.emxs-nf-archive-header {
    padding: 48px 24px;
    margin: 0 -20px 40px;
    color: #fff;
    text-align: center;
}

.emxs-nf-archive-header-inner {
    max-width: 700px;
    margin: 0 auto;
}

.emxs-nf-archive-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.emxs-nf-archive-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0 0 10px;
    color: #fff;
}

.emxs-nf-archive-subtitle {
    font-size: 1rem;
    opacity: 0.85;
    margin: 0;
}

.emxs-nf-archive-container {
    max-width: 1160px;
    margin: 0 auto;
}

.emxs-nf-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.emxs-nf-archive-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.emxs-nf-archive-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.emxs-nf-archive-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f0f0f0;
}

.emxs-nf-archive-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.emxs-nf-archive-card:hover .emxs-nf-archive-thumb img {
    transform: scale(1.04);
}

.emxs-nf-archive-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.emxs-nf-archive-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.78rem;
    color: #666;
    flex-wrap: wrap;
}

.emxs-nf-archive-source {
    background: #f0f4f8;
    color: #0073aa;
    padding: 2px 7px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.75rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

a.emxs-nf-archive-source:hover {
    background: #0073aa;
    color: #fff;
}

.emxs-nf-archive-date {
    color: #888;
}

.emxs-nf-archive-item-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.4;
}

.emxs-nf-archive-item-title a {
    text-decoration: none;
    color: #1a1a1a;
    transition: color 0.2s;
}

.emxs-nf-archive-item-title a:hover {
    color: #0073aa;
}

.emxs-nf-archive-excerpt {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.55;
    margin: 0 0 14px;
    flex: 1;
}

/* Archive action row — two buttons side by side */
.emxs-nf-archive-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    flex-wrap: wrap;
}

.emxs-nf-archive-read-summary {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}

.emxs-nf-archive-read-summary:hover {
    color: #005a87;
    text-decoration: underline;
}

.emxs-nf-archive-source-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.emxs-nf-archive-source-link:hover {
    color: #555;
    text-decoration: underline;
}

.emxs-nf-archive-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

/* ── Pagination ─────────────────────────────────────────── */
.emxs-nf-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.emxs-nf-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: #0073aa;
    background: #fff;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.emxs-nf-page-link:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.emxs-nf-page-active {
    background: #0073aa;
    color: #fff !important;
    border-color: #0073aa;
    cursor: default;
    pointer-events: none;
}

.emxs-nf-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    color: #888;
    font-size: 0.9rem;
}

.emxs-nf-prev,
.emxs-nf-next {
    padding: 0 14px;
}

/* ── Single Article Summary Page ────────────────────────── */
.emxs-nf-single-page {
    max-width: 100%;
    margin: 0;
    padding: 0 0 60px;
}

/* Hero */
.emxs-nf-single-hero {
    position: relative;
    min-height: 340px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.emxs-nf-single-hero-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.emxs-nf-single-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.emxs-nf-single-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.15) 0%,
        rgba(0,0,0,0.65) 100%
    );
    z-index: 1;
}

.emxs-nf-single-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 36px;
    color: #fff;
}

/* When no image — hero is just a solid colour block */
.emxs-nf-single-hero:not(:has(.emxs-nf-single-hero-image)) .emxs-nf-single-hero-content {
    padding-top: 48px;
    padding-bottom: 48px;
}

.emxs-nf-single-back-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.emxs-nf-single-back-link:hover {
    color: #fff;
    text-decoration: underline;
}

.emxs-nf-single-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 18px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.emxs-nf-single-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.emxs-nf-single-source-badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.emxs-nf-single-date {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}

.emxs-nf-single-ai-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Body */
.emxs-nf-single-body {
    max-width: 860px;
    margin: 0 auto;
    padding: 40px 24px 0;
}

.emxs-nf-single-body-inner {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Summary block */
.emxs-nf-single-summary-block {
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 0 6px 6px 0;
    padding: 24px 28px;
}

.emxs-nf-single-summary-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #2c2c2c;
    margin: 0;
}

/* Excerpt fallback — slightly muted styling */
.emxs-nf-excerpt-fallback-block {
    border-left-color: #bbb;
    background: #fafafa;
}

.emxs-nf-single-no-ai-note {
    font-size: 0.82rem;
    color: #999;
    margin: 10px 0 0;
    font-style: italic;
}

.emxs-nf-single-no-ai-note a {
    color: #0073aa;
    text-decoration: none;
}

.emxs-nf-single-no-ai-note a:hover {
    text-decoration: underline;
}

/* Attribution */
.emxs-nf-single-attribution {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #666;
    padding: 12px 0;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
}

.emxs-nf-single-attribution-label {
    font-weight: 600;
    color: #444;
}

.emxs-nf-single-attribution-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.emxs-nf-single-attribution-link:hover {
    text-decoration: underline;
}

/* CTA */
.emxs-nf-single-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.emxs-nf-single-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.emxs-nf-single-cta-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.emxs-nf-single-cta-note {
    font-size: 0.82rem;
    color: #888;
    margin: 0;
}

/* Back link */
.emxs-nf-single-back {
    padding-top: 8px;
}

.emxs-nf-single-back-button {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}

.emxs-nf-single-back-button:hover {
    color: #005a87;
    text-decoration: underline;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .emxs-nf-single-hero {
        min-height: 260px;
    }

    .emxs-nf-single-hero-content {
        padding: 28px 16px 24px;
    }

    .emxs-nf-single-body {
        padding: 28px 16px 0;
    }

    .emxs-nf-single-summary-block {
        padding: 18px 20px;
    }

    .emxs-nf-single-cta-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .emxs-nf-grid {
        grid-template-columns: 1fr;
    }

    .emxs-nf-archive-grid {
        grid-template-columns: 1fr;
    }

    .emxs-nf-archive-title {
        font-size: 1.8rem;
    }

    .emxs-nf-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .emxs-nf-archive-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .emxs-nf-card-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
