/* =========================================================
   QnA fy — main stylesheet
   (Consolidated from index/question/answer-comment/sidebar
   partials so there is a single source of truth for styling.)
   ========================================================= */

:root {
    --color-bg:        #f5f5f5;
    --color-surface:    #ffffff;
    --color-text:       #333333;
    --color-text-muted: #4a5568;
    --color-text-soft:  #718096;
    --color-border:     #e2e8f0;
    --color-border-soft:#edf2f7;
    --color-accent:     #317efb;
    --color-accent-alt: #c76c0c;
    --radius: 6px;
    --shadow: 2px 2px 15px rgba(0, 0, 0, 0.06);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
    font-family: 'Purno', sans-serif !important;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    font-size: 1.3em;
}

/* Regular */
@font-face {
    font-family: 'Purno';
    src: url('/fonts/purno/Purno-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Bold */
@font-face {
    font-family: 'Purno';
    src: url('/fonts/purno/Purno-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* Italic */
@font-face {
    font-family: 'Purno';
    src: url('/fonts/purno/Purno-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

/* Bold Italic */
@font-face {
    font-family: 'Purno';
    src: url('/fonts/purno/Purno-Bold-Italic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}
.site-header {
    max-width: 1200px;
    margin: 0 auto 20px;
}

.site-header .logo a {
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
}

/* ---------- Layout ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.main-content {
    flex: 3;
    min-width: 300px;
}

.sidebar-wrapper {
    flex: 1;
    min-width: 260px;
}

/* ---------- Question ---------- */
.question-container {
    background: var(--color-surface);
    padding: 25px;
    margin-bottom: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.q-title {
    font-family: 'Purno', sans-serif !important;
    color: #2d3748;
    font-size: 24px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.3;
}

/* ---------- Shared question/answer content ---------- */
.qa-post-content {
    font-family: 'Purno', sans-serif !important;
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-text-muted);
    text-align: justify;
    word-break: break-word;
}

.qa-post-content p {
    margin-bottom: 15px;
}

.qa-post-content pre {
    background: #f7fafc;
    border: 1px solid var(--color-border);
    padding: 15px;
    border-radius: var(--radius);
    overflow-x: auto;
    white-space: pre-wrap;
}

.qa-post-content img {
    max-width: 100%;
    height: auto;
    display: inline;
}

/* ---------- Tags ---------- */
.tags-container {
    margin-top: 15px;
}

.tag-badge {
    display: inline-block;
    background: var(--color-border-soft);
    color: var(--color-text-muted);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    margin: 2px 4px 2px 0;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.tag-badge:hover {
    background: var(--color-accent);
    color: #ffffff;
}

.cat-badge {
    display: inline-block;
    background: var(--color-accent-alt);
    color: var(--color-text-muted);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    margin: 2px 4px 2px 0;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.cat-badge:hover {
    background: var(--color-accent);
    color: #ffffff;
}

/* ---------- Answers ---------- */
.answers-container {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 20px;
    padding: 25px;
}

.answer-header {
    font-size: 18px;
    color: var(--color-text-muted);
    margin-bottom: 25px;
    font-weight: 600;
    border-bottom: 2px solid var(--color-accent-alt);
    padding-bottom: 8px;
}

.single-answer {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--color-border-soft);
}

.single-answer:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.no-answer-box {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 25px;
    margin-top: 20px;
    color: var(--color-text-soft);
}

.render-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-top: 20px;
}

/* ---------- Tag listing page ---------- */
.tag-page-header {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 25px;
    margin-bottom: 20px;
}

.tag-page-header h1 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #2d3748;
}

.tag-page-header p {
    margin: 0;
    color: var(--color-text-soft);
    font-size: 14px;
}

.tag-question-list {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px 25px;
}

.tag-question-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tag-question-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-soft);
}

.tag-question-list li:last-child {
    border-bottom: none;
}

.tag-question-list a {
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 16px;
}

.tag-question-list a:hover {
    color: var(--color-accent);
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
}

.page-link {
    display: inline-block;
    padding: 8px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 14px;
}

.page-link:hover {
    background: var(--color-border-soft);
}

.page-link.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
}

.page-ellipsis {
    padding: 8px 4px;
    color: var(--color-text-soft);
}

/* ---------- Comments ---------- */
.comments-section {
    margin-top: 20px;
    margin-left: 30px;
    padding-left: 15px;
    border-left: 3px solid var(--color-border);
}

.comment-title {
    color: var(--color-text-soft);
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comment-item {
    font-size: 15px;
    background: #f8fafc;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    color: var(--color-text-muted);
}

/* ---------- Related Q&A ---------- */
.related-qna {
    margin-top: 40px;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 25px;
}

.related-qna h3 {
    margin-top: 0;
}

.related-qna ul {
    margin: 0;
    padding-left: 20px;
}

.related-qna li {
    margin-bottom: 8px;
}

/* ---------- Sidebar ---------- */
.sidebar-widget {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.sidebar-widget h3 {
    margin-top: 0;
}

/* ---------- MathJax / fractions ---------- */
.MathJax {
    font-size: 1.3em !important;
}

span.frac {
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
}

span.frac > sup,
span.frac > sub {
    display: block;
    font: inherit;
    padding: 0 0.3em;
}

span.frac > sup {
    border-bottom: 0.08em solid;
    top: 0;
    bottom: 2.6ex;
}

span.frac > span {
    display: none;
}

/* ---------- Footer ---------- */
footer {
    margin-top: 50px;
    text-align: center;
    border-top: 1px solid #ccc;
    padding: 20px 0;
    color: var(--color-text-soft);
}

/* ---------- Homepage ---------- */
.home-hero {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 25px;
    text-align: center;
    margin-bottom: 25px;
}

.home-hero h1 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #2d3748;
}

.home-hero p {
    margin: 0;
    color: var(--color-text-soft);
    font-size: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px 15px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1.2;
}

.stat-label {
    margin-top: 6px;
    font-size: 14px;
    color: var(--color-text-soft);
}

.recent-questions {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 25px;
}

.recent-questions h2 {
    margin-top: 0;
    font-size: 18px;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-accent-alt);
    padding-bottom: 8px;
}

.recent-questions ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-questions li {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-soft);
}

.recent-questions li:last-child {
    border-bottom: none;
}

.recent-questions a {
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 16px;
}

.recent-questions a:hover {
    color: var(--color-accent);
}

/* =========================================================
   Responsive
   ========================================================= */
@media screen and (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .home-hero {
        padding: 25px 15px;
    }

    .home-hero h1 {
        font-size: 22px;
    }

    .container {
        flex-direction: column;
    }

    .main-content,
    .sidebar-wrapper {
        width: 100%;
        flex: none;
    }

    .sidebar-wrapper {
        order: 2;
        margin-top: 10px;
        padding: 0 10px 0 10px;
    }

    .main-content {
        order: 1;
        padding: 0 10px 0 10px;
    }

    .question-container {
        padding: 15px;
    }

    .q-title {
        font-size: 20px;
    }

    .qa-post-content {
        font-size: 16px;
        padding: 0;
    }

    .comments-section {
        margin-left: 10px;
        padding-left: 10px;
    }

    .MathJax {
        font-size: 1em !important;
    }
}


/* =========================================================
   Attractive & Sticky Header Styles
   ========================================================= */
.site-header.attractive-header {
    position: sticky;     /* হেডারকে ফিক্সড রাখার জন্য */
    top: 0;               /* একদম উপরে থাকার জন্য */
    z-index: 1000;        /* কন্টেন্টের উপরে দেখানোর জন্য */
    background: var(--color-surface);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 15px 25px;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--color-accent);
    border-radius: 0 0 var(--radius) var(--radius);
    max-width: 100%;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* লোগো ইমেজের সাইজ ঠিক রাখার জন্য */
.logo-img {
    max-height: 40px; /* আপনার প্রয়োজন অনুযায়ী সাইজ বাড়াতে বা কমাতে পারেন */
    width: auto;
    display: block;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo .highlight {
    color: var(--color-accent-alt);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--color-accent);
}

/* =========================================================
   Responsive Overrides for Header
   ========================================================= */
@media screen and (max-width: 768px) {
    .header-container {
        flex-direction: row; /* মোবাইলে লোগো ও মেনু পাশাপাশি রাখার জন্য */
    }
    
    .main-nav ul {
        gap: 15px;
    }
}

/* =========================================================
   Attractive Footer Styles
   ========================================================= */
.site-footer {
    background: var(--color-surface);
    margin-top: 20px;
    padding: 20px 20px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
    border-top: 4px solid var(--color-accent);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-col h3 {
    color: var(--color-accent);
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 800;
}

.footer-col h4 {
    color: var(--color-text);
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
}

.footer-col h4::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: var(--color-accent-alt);
}

.footer-col p {
    color: var(--color-text-soft);
    font-size: 15px;
    line-height: 1.7;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s, padding-left 0.2s;
}

.footer-col ul a:hover {
    color: var(--color-accent);
    padding-left: 5px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 20px auto 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-soft);
    font-size: 14px;
}

.footer-bottom strong {
    color: var(--color-accent);
}

/* =========================================================
   Responsive Overrides for Header & Footer
   ========================================================= */
@media screen and (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
}