/**
 * Editorial Feed Stylesheet v6.1 — Fresh White UI
 */

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&display=swap');

/* ===== VARIABLES & BASE ===== */
.ef-container {
    --ef-bg: #ffffff;
    --ef-surface: #f4f5f7;
    --ef-text: #111827;
    --ef-text-secondary: #6b7280;
    --ef-border: #e9f0ff;
    --ef-accent: #1877f2;
    --ef-accent-hover: #166fe5;
    --ef-like: #1877f2;
    --ef-radius: 20px; 
    --ef-shadow-card: 0 4px 20px -4px rgba(0,0,0,0.05), 0 1px 4px -1px rgba(0,0,0,0.03);
    
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Hind Siliguri', 'Times New Roman', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--ef-text);
    line-height: 1.6;
    background: transparent;
    box-sizing: border-box;
}

.ef-container *, .ef-container *::before, .ef-container *::after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

/* ===== FRESH WHITE HERO SECTION ===== */
.ef-seo-header {
    position: relative;
    padding: 48px 32px;
    border-radius: var(--ef-radius);
    margin: 0 8px 32px;
    color: var(--ef-text);
    overflow: hidden;
    box-shadow: var(--ef-shadow-card);
    text-align: center;
    background: #ffffff;
    border: none;
}

.ef-seo-header-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(circle at 10% 50%, rgba(24, 119, 242, 0.04), transparent 50%),
        radial-gradient(circle at 90% 30%, rgba(56, 189, 248, 0.04), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.ef-seo-header-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ef-seo-badge {
    background: rgba(24, 119, 242, 0.1);
    color: var(--ef-accent);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.ef-seo-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
    line-height: 1.2;
    color: var(--ef-text);
}

.ef-seo-header .ef-seo-subtitle {
    font-size: 16px;
    color: var(--ef-text-secondary);
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.5;
}

.ef-seo-meta-grid {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--ef-surface);
    padding: 16px 40px;
    border-radius: 20px;
    border: 1px solid var(--ef-border);
}

.ef-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ef-meta-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: var(--ef-text);
}

.ef-meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ef-text-secondary);
    font-weight: 600;
}

.ef-meta-divider {
    width: 1px;
    height: 30px;
    background: var(--ef-border);
}

/* ===== ADMIN POSTING PANEL ===== */
.ef-create-post {
    background: var(--ef-bg);
    padding: 28px;
    border-radius: var(--ef-radius);
    margin: 0 8px 32px;
    box-shadow: var(--ef-shadow-card);
    border: 1px solid var(--ef-border);
    position: relative;
    overflow: hidden;
}

.ef-create-post::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #1877f2, #38bdf8);
}

.ef-admin-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ef-text-secondary);
    margin-bottom: 20px;
}

.ef-form-group { margin-bottom: 18px; }

.ef-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ef-text);
    margin-bottom: 8px;
}

.ef-form-input, .ef-form-select, .ef-form-textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--ef-border);
    border-radius: 12px;
    font-size: 14.5px;
    background: var(--ef-surface);
    color: var(--ef-text);
    transition: all 0.2s ease;
    outline: none;
}

.ef-form-input:focus, .ef-form-select:focus, .ef-form-textarea:focus {
    background: var(--ef-bg);
    border-color: var(--ef-accent);
    box-shadow: 0 0 0 4px rgba(24,119,242,0.1);
}

.ef-form-textarea { resize: vertical; min-height: 100px; }

.ef-source-selector { display: flex; gap: 12px; }
.ef-source-selector .ef-form-select { flex: 1; }

.ef-btn {
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ef-btn-primary { background: var(--ef-accent); color: #fff; }
.ef-btn-primary:hover { background: var(--ef-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(24,119,242,0.25); }

.ef-btn-secondary { background: var(--ef-surface); color: var(--ef-text); border: 1px solid var(--ef-border); }
.ef-btn-secondary:hover { background: #e5e7eb; }

.ef-btn-add-source {
    padding: 14px 18px;
    background: var(--ef-surface);
    color: var(--ef-text);
    border: 1px solid var(--ef-border);
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}
.ef-new-source-input { display: none; margin-top: 10px; }
.ef-new-source-input.active { display: block; }
.ef-create-post-actions { display: flex; justify-content: flex-end; margin-top: 24px; gap: 12px; }

/* ===== FEED POSTS ===== */
.ef-feed-post {
    background: var(--ef-bg);
    border-radius: var(--ef-radius);
    margin: 0 8px 32px;
    box-shadow: var(--ef-shadow-card);
    border: 0px solid var(--ef-border);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ef-feed-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -8px rgba(0,0,0,0.08);
}

.ef-post-header {
    padding: 24px 28px 16px;
}

.ef-post-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space out badge and time */
    margin-bottom: 14px;
}

/* Beautiful Premium Source Badge */
.ef-source-badge {
    display: inline-flex;
    align-items: center;
    background: none;
    color: var(--ef-text);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--ef-border);
}

.ef-post-time {
    font-size: 13px;
    color: var(--ef-text-secondary);
    font-weight: 500;
}

.ef-post-headline {
    font-size: 30px;
    font-weight: 800;
    color: var(--ef-text);
    line-height: 1.35;
    letter-spacing: -0.3px;
    text-align:center;
}

/* ===== POST CONTENT ===== */
.ef-post-content {
    padding: 0 28px 24px;
    font-size: 16px; 
    line-height: 2.0;
    color: #4b5563; 
    font-weight:400;
}

.ef-post-content p { margin-bottom: 14px; }
.ef-post-content p:last-child { margin-bottom: 0; }

/* Lists styling */
.ef-post-content ul,
.ef-post-content ol {
    margin: 12px 0 14px 0;
    padding-left: 3px;
}

.ef-post-content ul li,
.ef-post-content ol li {
    margin-bottom: 8px;
    line-height: 1.75;
}

.ef-post-content ul {
    list-style-type: disc;
}

.ef-post-content ol {
    list-style-type: decimal;
}

.ef-post-content ul ul,
.ef-post-content ol ul {
    list-style-type: circle;
    margin-top: 6px;
}

.ef-post-content ul ol,
.ef-post-content ol ol {
    list-style-type: lower-alpha;
    margin-top: 6px;
}

.ef-content-preview, .ef-content-full { display: inline; }
.ef-post-content.is-collapsed .ef-content-full { display: none; }
.ef-post-content:not(.is-collapsed) .ef-content-preview { display: none; }

.ef-toggle-btn {
    display: inline-block;
    margin: 0;
    padding: 0;
    background: none !important;
    border: none !important;
    outline: none !important;
    color: var(--ef-text-secondary);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none !important;
}
.ef-toggle-btn:hover { 
    color: var(--ef-text); 
    background: none !important;
}
.ef-toggle-btn:active,
.ef-toggle-btn:focus {
    background: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Show More/Less toggle logic */
.ef-toggle-more { display: inline; }
.ef-toggle-less { display: none; }
.ef-post-content:not(.is-collapsed) .ef-toggle-more { display: none; }
.ef-post-content:not(.is-collapsed) .ef-toggle-less { display: inline; }

/* Add space before toggle button when content is expanded */
.ef-post-content:not(.is-collapsed) .ef-toggle-btn::before {
    content: ' ';
    white-space: pre;
}

/* ===== FEATURED IMAGE ===== */
.ef-post-image-wrap {
    display: block;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.ef-post-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ef-post-image-wrap:hover .ef-post-image { transform: scale(1.02); }

/* ===== ENGAGEMENT BAR ===== */
.ef-engagement-bar {
    display: flex;
    width: 100%;
    border-top: 1px solid var(--ef-border); 
    background: #ffffff;
    padding: 4px 16px;
}

.ef-engagement-item {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 0;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    color: var(--ef-text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.ef-engagement-item:hover {
    background: var(--ef-surface) !important;
    color: var(--ef-text);
}

/* Keep text blue, but remove the icon's outline border completely */
.ef-engagement-item.liked { 
    color: var(--ef-like); 
}
.ef-engagement-item.liked .ef-icon {
    stroke: transparent !important;
}
/* Bold Black "Read Article" button styling */
.ef-read-article-btn {
    color: #111827 !important; /* Solid black/dark slate color */
}
.ef-read-article-btn:hover {
    color: #000000 !important; 
    background: var(--ef-surface) !important;
}

.ef-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    pointer-events: none;
}

/* ===== COMMENTS ===== */
.ef-comments-section {
    padding: 20px 28px 24px;
    background: var(--ef-surface);
    border-top: 1px solid var(--ef-border);
}

.ef-comments-section.hidden { display: none; }

.ef-comment {
    background: #ffffff;
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    border: 1px solid var(--ef-border);
    animation: efFadeIn 0.3s ease;
}

@keyframes efFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.ef-comment-author {
    font-weight: 700;
    font-size: 13px;
    color: var(--ef-text);
    margin-bottom: 2px;
}

.ef-comment-text {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.ef-no-comments { color: #9ca3af; font-size: 13px; text-align: center; padding: 8px 0; }

.ef-comment-input-wrapper { margin-top: 16px; }

.ef-comment-input {
    width: 100%;
    border: none;
    background: #ffffff;
    padding: 14px 20px;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    box-shadow: inset 0 0 0 1px var(--ef-border);
    transition: box-shadow 0.2s ease;
    color: var(--ef-text);
}

.ef-comment-input:focus { box-shadow: inset 0 0 0 2px var(--ef-accent); }

/* ===== UTILITIES / PAGINATION ===== */
.ef-view-all { text-align: center; margin: 32px 8px; }
.ef-view-all-link {
    display: inline-block;
    padding: 14px 32px;
    background: var(--ef-text);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}
.ef-view-all-link:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }

.ef-pagination { display: flex; justify-content: center; gap: 8px; margin: 32px 8px; }
.ef-pagination a, .ef-pagination span {
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--ef-text);
    font-weight: 600;
    font-size: 14px;
    background: #ffffff;
    border: 1px solid var(--ef-border);
    transition: all 0.2s;
}
.ef-pagination a:hover { background: var(--ef-surface); }
.ef-pagination .current { background: var(--ef-accent); color: #fff; border-color: var(--ef-accent); }

.ef-empty-feed {
    text-align: center; padding: 60px 20px; color: var(--ef-text-secondary);
    background: transparent; border: 2px dashed var(--ef-border);
    border-radius: var(--ef-radius); margin: 0 8px;
}
.ef-empty-icon { font-size: 32px; margin-bottom: 12px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .ef-seo-header { padding: 40px 20px; }
    .ef-seo-header h1 { font-size: 28px; }
    .ef-seo-meta-grid { flex-direction: row; padding: 12px 24px; gap: 20px; }
    .ef-create-post, .ef-feed-post, .ef-seo-header { margin-left: 0; margin-right: 0; border-radius: 0; }
    .ef-post-headline { font-size: 25px; }
    .ef-post-content { padding: 0 20px 20px; }
    .ef-post-header { padding: 20px 20px 12px; }
}
/* =========================================================
   GRID LAYOUT — 3 columns (no sidebar) / 2 columns (sidebar)
   ========================================================= */

.ef-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    width: 100%;
}

/* Remove default side/bottom margins — grid gap now handles spacing */
.ef-feed .ef-feed-post {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
}

/* Empty state spans all columns */
.ef-empty-feed {
    grid-column: 1 / -1;
}

/* ---------- SIDEBAR ACTIVE: 2 columns ---------- */
body.has-sidebar .ef-feed,
.ef-container.ef-has-sidebar .ef-feed {
    grid-template-columns: repeat(2, 1fr);
}

/* ---------- TABLET ---------- */
@media (max-width: 1024px) {
    .ef-feed,
    body.has-sidebar .ef-feed,
    .ef-container.ef-has-sidebar .ef-feed {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- MOBILE ---------- */
@media (max-width: 768px) {
    .ef-feed,
    body.has-sidebar .ef-feed,
    .ef-container.ef-has-sidebar .ef-feed {
        grid-template-columns: 1fr;
    }
    .ef-feed .ef-feed-post {
        border-radius: 0;
    }
}