/* EN.CSS - COMPLETE ACADEMIC/EDUCATIONAL THEME 
    Target: en.php (Article Page)
    Author: Professional Academic Portal
    Full Responsive Logic: Fluid Typography, Responsive Icons, & Adaptive Layouts
*/

/* --- 1. CORE DEFAULTS & ROOT VARIABLES --- */
:root {
    /* Fluid Typography Scale (Min, Preferred, Max) */
    --ft-h1: clamp(1.9rem, 6vw, 2.6rem);
    --ft-h2: clamp(1.6rem, 5vw, 2.1rem);
    --ft-h3: clamp(1.4rem, 4vw, 1.75rem);
    --ft-h4: clamp(1.2rem, 3vw, 1.45rem);
    --ft-body: clamp(1.05rem, 1.2vw, 1.18rem);
    
    /* Fluid Spacing and Gaps */
    --fluid-padding: clamp(20px, 5vw, 40px);
    --fluid-gap: clamp(20px, 4vw, 40px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f1f5f9; /* Slate 100 */
    color: #1e293b; /* Slate 800 */
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.3;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- 2. LAYOUT WRAPPERS --- */
.edu-wrapper {
    max-width: 1240px;
    margin: 0 auto;
    padding: var(--fluid-padding) 20px;
}

.edu-grid {
    display: flex;
    gap: var(--fluid-gap);
    align-items: flex-start;
}

.edu-main {
    flex: 2;
    min-width: 0; /* Prevents flex-child overflow */
}

.edu-sidebar {
    flex: 1;
    position: sticky;
    top: 85px; 
}

/* --- 3. BREADCRUMBS --- */
.edu-breadcrumb {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 25px;
    font-weight: 500;
}

.edu-breadcrumb a {
    text-decoration: none;
    color: #1e3a8a;
    transition: color 0.2s;
}

.edu-breadcrumb a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.edu-breadcrumb svg {
    width: 14px;
    height: 14px;
}

/* --- 4. ARTICLE BOX & ACADEMIC HEADINGS --- */
.edu-article {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 30px;
}

.edu-header {
    padding: var(--fluid-padding) var(--fluid-padding) 0 var(--fluid-padding);
}

/* Fluid Heading Tags */
.edu-main-title, h1 {
    font-size: var(--ft-h1);
    color: #0f172a;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: "inter", serif;
}

.edu-content-body h1 { font-size: var(--ft-h1); font-family: "inter", serif; }
.edu-content-body h2 { font-size: var(--ft-h2); color: #0f172a; margin: 1.6em 0 0.8em; font-weight: 700; line-height: 1.3; font-family: "inter", serif; }
.edu-content-body h3 { font-size: var(--ft-h3); color: #1e293b; margin: 1.4em 0 0.7em; font-weight: 700; font-family: "inter", serif; }
.edu-content-body h4 { font-size: var(--ft-h4); color: #1e3a8a; margin: 1.2em 0 0.6em; font-weight: 700; font-family: "inter", serif; }
.edu-content-body h5, .edu-content-body h6 { font-size: 1.1rem; color: #334155; margin: 1em 0 0.5em; font-weight: 700; text-transform: uppercase;font-family: "inter", serif;  }

.edu-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(12px, 3vw, 24px);
    padding-bottom: 25px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #64748b;
}

.meta-item svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.author-link {
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid transparent;
}

.author-link:hover {
    border-bottom: 1px solid #1e3a8a;
}

/* --- 5. RESPONSIVE SOCIAL SHARE BAR --- */
.edu-share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eeeeee;
}

.share-btn {
    width: clamp(32px, 5vw, 36px); 
    height: clamp(32px, 5vw, 36px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.share-btn i, 
.share-btn svg {
    width: 18px;
    height: 18px;
    color: #ffffff;
    fill: #ffffff;
}

.share-btn:hover {
    transform: scale(1.15);
}

.whatsapp { background: #25D366; }
.facebook { background: #1877F2; }
.twitter { background: #000000; }
.copy { background: #64748b; }
.telegram { background-color: #0088cc; }
.linkedin { background-color: #0077b5; }

/* --- 6. CONTENT BODY --- */
.edu-content-body {
    padding: 10px var(--fluid-padding);
    font-family: 'Merriweather', serif;
    font-size: var(--ft-body);
    line-height: 1.85;
    color: #334155;
}

.edu-content-body p, 
.content-para {
    margin-bottom: 1.25rem;
    display: block;
}

.edu-content-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.edu-content-body a {
    color: #1877F2;
    font-weight: 600;
    text-decoration: none;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.edu-content-body a:hover {
    text-decoration: underline;
}

/* ADS PLACEHOLDER */
.edu-content-body div[id*="ad"], 
.edu-content-body .ad-container {
    margin: 40px 0;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Academic Lists */
.edu-content-body ul, 
.edu-content-body ol {
    margin: 15px 0 15px clamp(20px, 5vw, 40px);
    color: #334155;
}

.edu-content-body li {
    margin-bottom: 8px;
    padding-left: 5px;
}

/* Responsive Tables */
.edu-content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #a5c5f0;
}

.edu-content-body th {
    background-color: #1e3a8a;
    color: #ffffff;
    text-align: left;
    padding: 12px 15px;
    font-weight: 700;
}

.edu-content-body td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
}

.edu-content-body hr {
    border: none;
    height: 1px;
    background-color: var(--border-color, #e5e7eb);
    margin: 10px 0;
}

.edu-content-body tr:last-child td { border-bottom: none; }
.edu-content-body tr:nth-child(even) { background-color: #f8fafc; }
.edu-content-body p:empty { display: none; }

/* --- 7. DISCUSSION & COMMENTS --- */
.edu-comments {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: var(--fluid-padding);
}

.edu-comments a { text-decoration: none; color: #3b82f6; word-break: break-word; overflow-wrap: anywhere;}
.edu-comments a:hover { text-decoration: underline; }

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 5px;
    color: #0f172a;
}

.detailed{
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.edu-comment-form {
    background: #f8fafc;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 40px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.edu-comment-form input, 
.edu-comment-form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.edu-comment-form input:focus, 
.edu-comment-form textarea:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.05);
}

.edu-btn-primary {
    background: #1e3a8a;
    color: #ffffff;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

.edu-btn-primary:hover { background: #172e6d; }
.edu-btn-primary:active { transform: scale(0.98); }

/* Comment Items Responsive */
.comment-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid #f1f5f9;
}


.comment-avatar {
    width: 42px;
    height: 42px;
    background: #1e3a8a;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 2px; /* slight alignment adjustment */
}

.comment-main { flex: 1; min-width: 0; }

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    justify-content: space-between;
}

.comment-user {
    font-weight: 700;
    color: #1e293b;
}

.comment-date {
    font-size: 0.85rem;
    color: #94a3b8;
}

.comment-text { font-size: 1rem; color: #475569; line-height: 1.5; }

/* Voting Actions */
.comment-footer {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(10px, 3vw, 20px);
    margin-top: 5px;
}

@media (max-width: 640px) {

    .comment-item {
        gap: 12px;
    }

    .comment-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }

    .comment-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 4px;
        align-items: center;
    }

    .comment-text {
        font-size: 0.9rem;
    }

    .comment-footer {
        gap: 12px;
    }
}


.vote-action {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.vote-action:hover { color: #1e3a8a; background: #f1f5f9; }
.vote-action svg { width: 18px; height: 18px; }

.active-like { color: #059669 !important; background: #ecfdf5; }
.active-dislike { color: #dc2626 !important; background: #fff1f2; }

.edu-load-more {
    width: 100%;
    margin-top: 30px;
    padding: 15px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    color: #1e3a8a;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.5s ease;
    font-weight: 600;
    font-family: "Poppins", sans-serif;
}

.edu-load-more:hover {
    background-color: #1e3a8a;
    color: #f8fafc;
}

/* --- 8. SIDEBAR STYLING --- */
.sidebar-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.sidebar-label {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 20px;
    border-left: 4px solid #1e3a8a;
    padding-left: 12px;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-item {
    display: flex;
    gap: 15px;
    text-decoration: none;
    align-items: flex-start;
    transition: opacity 0.2s;
}

.sidebar-thumb {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.1;
    display: inline;
    position: relative;
    text-decoration: none;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    background-image: linear-gradient(rgba(30, 58, 138, 0.1), rgba(30, 58, 138, 0.1));
    background-repeat: no-repeat;
    background-position: 0 100%; 
    background-size: 0% 100%; 
    transition: background-size 0.3s ease-in-out;
    padding: 2px 0;
}

.sidebar-item:hover .sidebar-text {
    background-size: 100% 100%;
}

.dark-mode .sidebar-text {
    background-image: linear-gradient(rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15));
    color: #ffffff;
}
/* --- 9. DARK MODE & TOAST --- */
.dark-mode { background: #0f172a !important; border-color: #1e293b; }
.text-white { color: #ffffff !important; }
.white-link { color: #cbd5e1 !important; }

.edu-toast {
    position: fixed;
    bottom: -70px; /* Hidden initially */
    left: 50%;
    transform: translateX(-50%);
    background: #1e3a8a;
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 600;
    transition: bottom 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 9999;
}

.edu-toast.show { bottom: 30px; }

/* --- 10. ADVANCED MEDIA QUERIES --- */

@media (max-width: 1024px) {
    .edu-grid { flex-direction: column; }
    .edu-sidebar { width: 100%; position: static; }
    
    /* Sidebar turns into a multi-column grid on tablets */
    .sidebar-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .edu-wrapper { padding: 15px 12px; }
    
    .edu-meta-bar { gap: 12px; }
    
    .form-row { flex-direction: column; }
    
    .edu-btn-primary { width: 100%; } /* Full width mobile button */

    /* Tables become scrollable on small screens */
    .edu-content-body { overflow-x: auto; }
    .edu-content-body table { min-width: 500px; display: block; overflow-x: auto; }

    .meta-item {
        font-size: 0.7rem;
    }

    .meta-item svg {
        width: 13px;
        height: 13px;
    }
}

.post-tags {
    margin-top: 8px;
}

.tag-badge {
    display: inline-block;
    padding: 4px 10px;
    margin: 4px 6px 0 0;
    font-size: 13px;
    background: #f1f3f5;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    transition: 0.2s ease;
    font-family: "Roboto", sans-serif;
    font-weight: 600;
}

.tag-badge:hover {
    background: #e0e3e7;
}
