/* ===================================
 * Graphin8 - Blog Modern (2-Column Layout)
 * File: pages/blog/assets/css/blog.css
 * =================================== */

:root {
  --blog-navy:        #070D59;
  --blog-blue:        #1F3C88;
  --blog-cyan:        #5893D4;
  --blog-orange:      #F7B633;
  --blog-orange-hover:#e69a2b;
  --blog-white:       #ffffff;
  
  --bg-dark: #060a20;
  --bg-card: #0f1738;
  --text-main: #e6eefb;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(15, 23, 56, 0.7);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

/* 1. Page Wrapper */
.blog-page-wrapper {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(180deg, #060a20 0%, #080e28 100%);
    padding-top: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 2. Hero Section */
.blog-hero-section {
    width: 100%;
    max-width: 900px;
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
}

/* Breadcrumbs */
.blog-breadcrumbs {
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}
.breadcrumb-nav { background: transparent; padding: 0; margin: 0; }
.breadcrumb-list { display: flex; flex-wrap: wrap; justify-content: center; list-style: none; padding: 0; margin: 0; }
.breadcrumb-item { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; }
.breadcrumb-item a { color: var(--blog-orange); text-decoration: none; transition: color 0.2s ease; }
.breadcrumb-item a:hover { color: var(--blog-orange-hover); text-decoration: underline; }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; color: var(--text-main); padding: 0 10px; font-weight: 400; }
.breadcrumb-item.active { color: var(--text-muted); cursor: default; }

.post-title {
    font-size: 48px;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--blog-white);
    font-weight: 800;
    font-family: 'Inter', sans-serif;
}

.post-meta-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 40px;
}
.meta-item { display: flex; align-items: center; gap: 8px; }
.meta-item img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--blog-orange); }
.meta-item i { width: 16px; height: 16px; color: var(--blog-orange); }

/* Hero Image */
.hero-image-container {
    width: 100%;
    max-width: 1100px;
    height: 500px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.hero-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   3. MAIN LAYOUT GRID (1276px) - NEW
   ============================================ */
.blog-main-container {
    width: 100%;
    max-width: 1276px; /* As requested */
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 60px; /* Adjust gap to control Sidebar spacing */
    align-items: flex-start; /* Keep sidebar top-aligned */
    position: relative;
}

/* LEFT COLUMN: Content (Fixed 760px) */
.blog-content-column {
    flex: 0 0 760px;
    width: 760px; /* Ensure it stays 760px */
    max-width: 100%;
}

/* RIGHT COLUMN: Sidebar (Remaining Space) */
.blog-sidebar-column {
    flex: 1;
    min-width: 300px; /* Prevent sidebar from getting too squished */
    position: sticky;
    top: 120px; /* Stick when scrolling */
}


/* --- Article Styles --- */
/* (Styles formerly on .blog-reading-container can now apply here or directly to content) */
.article-lead {
    font-size: 22px;
    line-height: 1.6;
    color: var(--blog-white);
    margin-bottom: 40px;
    font-weight: 300;
    border-left: 4px solid var(--blog-orange);
    padding-left: 20px;
}

.rich-text {
    font-size: 18px;
    line-height: 1.8;
    color: #cbd5e1;
}
.rich-text h2, .rich-text h3 { color: var(--blog-white); margin-top: 48px; margin-bottom: 20px; font-weight: 700; }
.rich-text p { margin-bottom: 28px; }
.rich-text img { border-radius: 12px; max-width: 100%; height: auto; margin: 20px 0; }
.rich-text blockquote {
    font-size: 24px;
    font-style: italic;
    color: var(--blog-orange);
    text-align: center;
    margin: 40px 0;
}

/* 4. Footer / Author / Share */
.article-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}
.share-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-card);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid var(--border);
}
.share-btn, .like-btn {
    background: transparent;
    border: none;
    color: var(--blog-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.like-btn.liked { color: var(--blog-orange); }

/* Container for Bio and Comments - Centered and Readable Width */
.blog-end-container {
    width: 100%;
    /* Constrain this to match your article width (approx 800-900px) 
       so bio and comments don't stretch too wide */
    max-width: 1276px; 
    margin: 0 auto;
    padding: 0 24px 60px;
    position: relative;
}

.author-bio-box {
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 16px;
    margin-top: 40px;
    display: flex;
    gap: 20px;
    align-items: center;
}
.bio-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.bio-text h4 { margin: 0 0 8px 0; color: var(--blog-white); }
.bio-text p { margin: 0; color: var(--text-muted); font-size: 15px; }

/* =========================================
   MEDIUM-STYLE COMMENTS (Clean & Threaded)
   ========================================= */

.comments-wrapper {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    max-width: 800px; /* Constrain width for readability like Medium */
    margin-left: auto;
    margin-right: auto;
}

.comments-header-row h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--blog-white);
    margin-bottom: 24px;
}

/* --- Input Area --- */
.comment-form-box {
    margin-bottom: 40px;
    background: var(--bg-card); /* Keep minimal card bg for input area only */
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.current-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-form-box textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1); /* Underline style */
    padding: 10px 0;
    color: var(--blog-white);
    min-height: 60px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    transition: border-color 0.2s;
}

.comment-form-box textarea:focus {
    outline: none;
    border-bottom-color: var(--blog-orange);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.submit-btn {
    background: var(--blog-orange); /* Medium uses green, we use Orange */
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 20px; /* Pill shape */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.submit-btn:hover { background: #e58e3c; }

.cancel-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    font-size: 14px;
}
.cancel-btn:hover { color: var(--blog-white); }


/* --- Comment List --- */

/* 1. Reset Base Item (Remove Box/Card look) */
.comment-item {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 24px;
    position: relative;
    width: 100%;
    max-width: 100%;
}

.comment-body {
    padding-bottom: 15px;
    /* Optional: separator line between root comments */
    border-bottom: 1px solid rgba(255,255,255,0.03); 
}

/* 2. Header (Avatar & Name) */
.comment-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-head img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.author-line {
    font-size: 14px;
    color: var(--blog-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-line strong { font-weight: 600; }
.author-line small { color: var(--text-muted); font-weight: 400; }
.dot-separator { color: var(--text-muted); font-size: 12px; }

.you-badge {
    background: rgba(var(--blog-orange-rgb), 0.2);
    color: var(--blog-orange);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* 3. Content */
.comment-content {
    color: #cbd5e1; /* Light gray text */
    font-size: 15px;
    line-height: 1.6;
    margin-top: 5px;
    margin-bottom: 12px;
    padding-left: 0; /* Keep aligned left */
}

/* 4. Footer Actions (Clap & Reply) */
.comment-footer .footer-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.action-btn:hover { color: var(--blog-white); }
.action-btn.clap-btn:hover { color: var(--blog-orange); }

.action-btn i { width: 16px; height: 16px; }

/* 5. Threaded Nested Comments (The Vertical Line) */
.comment-children {
    margin-left: 10px; /* Slight offset */
    padding-left: 20px; /* Space for the line */
    border-left: 2px solid rgba(255,255,255,0.1); /* The Thread Line */
    margin-top: 15px;
}

/* Nested items shouldn't have bottom borders to keep it clean */
.comment-children .comment-body {
    border-bottom: none; 
    margin-bottom: 15px;
}

/* --- Reply Form Styling when moved --- */
.reply-form-placeholder textarea {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    width: 100%;
    color: var(--blog-white);
}

/* --- New Buttons Styles --- */

/* 1. Reply Toggle Button (Screenshots 2 & 3) */
.toggle-replies-btn {
    background: transparent;
    border: none;
    color: var(--blog-orange);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 5px;
    padding: 5px 0;
    transition: opacity 0.2s;
}

.toggle-replies-btn i {
    width: 16px;
    height: 16px;
}

.toggle-replies-btn:hover {
    text-decoration: underline;
}

.toggle-replies-btn:disabled {
    color: var(--text-muted);
    cursor: default;
    opacity: 0.6;
    text-decoration: none;
}

/* 2. "See all responses" Button (Screenshot 4) */
.see-all-wrapper {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
}

.see-all-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--blog-white);
    padding: 10px 24px;
    border-radius: 20px; /* Pill shape */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.see-all-btn:hover {
    background: var(--bg-card);
    border-color: var(--blog-orange);
    color: var(--blog-orange);
}

.clap-btn.liked {
    color: var(--blog-orange); /* Or your preferred active color */
}
.clap-btn.liked i {
    fill: var(--blog-orange); /* Optional: fill the icon */
}

/* ============================================
   6. SIDEBAR WIDGETS - NEW
   ============================================ */
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
}
.widget-title {
    color: var(--blog-white);
    font-size: 20px;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

/* Sidebar Related List */
.sidebar-related-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-post-card {
    display: flex;
    gap: 15px;
    text-decoration: none;
    transition: transform 0.2s ease;
}
.sidebar-post-card:hover {
    transform: translateX(5px);
}
.sidebar-post-card:hover h4 {
    color: var(--blog-orange);
}

.sp-thumb {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.sp-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.sp-info h4 {
    color: var(--blog-white);
    font-size: 15px;
    line-height: 1.4;
    margin: 0 0 5px 0;
    transition: color 0.2s;
}
.sp-info span {
    color: var(--text-muted);
    font-size: 12px;
}

/* Ad Widget */
.ad-widget { text-align: center; }
.ad-label { display: block; color: var(--text-muted); font-size: 11px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.ad-box {
    background: rgba(255,255,255,0.02);
    border: 1px dashed var(--border);
    border-radius: 8px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* 7. Newsletter (No changes needed, essentially) */
.newsletter-cta {
    width: 100%;
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(180deg, #040716 0%, #060a20 100%);
    border-top: 1px solid var(--border);
    /* margin-top: 60px; */
}
.cta-content { max-width: 600px; margin: 0 auto; }
.cta-content h2 { color: var(--blog-white); font-size: 36px; margin-bottom: 16px; }
.cta-content p { color: var(--text-muted); margin-bottom: 30px; }
.newsletter-form { display: flex; gap: 10px; justify-content: center; }
.newsletter-form input {
    flex: 1;
    max-width: 300px;
    padding: 14px 20px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--blog-white);
}
.newsletter-form button {
    background: var(--blog-orange);
    color: #000;
    padding: 14px 30px;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

/* Share Modal Styles */
.share-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.share-modal-container { background: var(--bg-card); padding: 30px; border-radius: 16px; width: 100%; max-width: 500px; border: 1px solid var(--border); }
.share-modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; color: var(--blog-white); }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 20px; }
.share-link { padding: 12px; background: rgba(255,255,255,0.05); color: var(--blog-white); text-align: center; border-radius: 8px; text-decoration: none; }
.share-link:hover { background: var(--blog-orange); color: #000; }
.share-url-input { width: 100%; padding: 10px; background: #000; border: 1px solid var(--border); color: #ccc; border-radius: 6px; margin-bottom: 10px; }
.copy-link-btn { width: 100%; padding: 10px; background: var(--blog-orange); border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }

/* Bookmark active state */
.bookmark-btn.active i,
.bookmark-btn.bookmarked i {
    fill: var(--blog-orange); /* Or gold/black depending on your theme */
    color: var(--blog-orange);
}
.like-btn.liked i {
    fill: #e74c3c;
    color: #e74c3c;
}

/* Responsive adjustments */
@media (max-width: 1100px) {
    .blog-main-container {
        flex-direction: column;
        max-width: 760px;
    }
    .blog-content-column {
        width: 100%;
        flex: none;
    }
    .blog-sidebar-column {
        width: 100%;
        position: static;
    }
    .sidebar-related-list {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2-up grid on tablet when stacked */
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .post-title { font-size: 36px; }
    .hero-image-container { height: 300px; border-radius: 12px; }
    .newsletter-form { flex-direction: column; align-items: center; }
    .newsletter-form input { max-width: 100%; width: 100%; }
}

/* Mobile adjustment */
@media (max-width: 768px) {
    /* Reduce horizontal padding on the nested comment wrapper for small screens */
    .comment-children {
        padding-left: 10px;
    }
}

@media (max-width: 600px) {
    .sidebar-related-list { grid-template-columns: 1fr; } /* Stack related posts on mobile */
}