/* =================================================================
   Main Stylesheet (style.css)
   ================================================================= */

/* --- Google Font Imports --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Anek+Bangla:wght@400;500;600;700;800&display=swap');

/* --- Bengali numeral counter style (for ordered lists in article content) --- */
@counter-style bengali-digits {
    system: numeric;
    symbols: "০" "১" "২" "৩" "৪" "৫" "৬" "৭" "৮" "৯";
    suffix: ". ";
}

/* --- CSS Variables (Root) --- */
:root {
    --font-family: 'Anek Bangla', 'Roboto', sans-serif;
    --text-color: #1a1a1a;
    --background-color: #ffffff;
    --off-white: #f8f9fa;
    --accent-color: #39b549; 
    --accent-hover: #2d8c3a;
    --border-color: #e9ecef;
    --header-height: 70px;
}

/* --- General Reset & Body --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-top: var(--header-height);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
    margin-bottom: 4rem;
}

/* A standard and balanced max-width */
.container {
    max-width: 1400px; 
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover, a:focus {
    color: var(--accent-color);
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Header & Navigation --- */
.site-header {
    width: 100%;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}
.site-header .container {
    height: 100%;
}
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}
.header-nav .logo img {
    height: 40px;
    margin-top: 10px;
}
.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}
.nav-links a {
    color: var(--text-color);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 5px;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}
.mobile-menu-toggle {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* --- Dropdown Menu --- */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}
.nav-dropdown-toggle i {
    font-size: 0.6rem;
    transition: transform 0.3s ease;
}
.nav-dropdown:hover .nav-dropdown-toggle i {
    transform: rotate(180deg);
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    list-style: none;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    z-index: 1001;
}
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
}
.dropdown-menu::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav-dropdown:hover .nav-dropdown-toggle i,
.nav-dropdown.open .nav-dropdown-toggle i {
    transform: rotate(180deg);
}
.dropdown-menu li a {
    display: block;
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
.dropdown-menu li a::after {
    display: none;
}
.dropdown-menu li a:hover {
    background-color: var(--off-white);
    color: var(--accent-color);
    padding-left: 1.5rem;
}
.dropdown-divider {
    height: 1px;
    margin: 0.4rem 1rem;
    background-color: var(--border-color);
}

/* --- Dropdown Menu: 2-column variant (long menus like Courses / AI Courses) --- */
.dropdown-menu--split {
    display: flex;
    flex-wrap: wrap;
    width: 560px;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem 0;
}
.dropdown-menu--split .dropdown-col {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 50%;
    min-width: 0;
    max-width: 50%;
}
.dropdown-menu--split .dropdown-col li a {
    white-space: normal;
    line-height: 1.35;
}
.dropdown-menu--split .dropdown-menu-head,
.dropdown-menu--split .dropdown-menu-foot {
    flex: 1 0 100%;
}
.dropdown-menu--split .dropdown-menu-head {
    order: -1;
}
.dropdown-menu--split .dropdown-menu-foot {
    order: 3;
}
.dropdown-menu--split .dropdown-menu-head a,
.dropdown-menu--split .dropdown-menu-foot a {
    display: block;
    padding: 0.55rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
.dropdown-menu--split .dropdown-menu-head a:hover,
.dropdown-menu--split .dropdown-menu-foot a:hover {
    background-color: var(--off-white);
    color: var(--accent-color);
    padding-left: 1.5rem;
}
.dropdown-menu--split .dropdown-menu-foot .dropdown-divider {
    margin: 0.4rem 1rem 0.5rem;
}

/* --- Header Search --- */
.header-search {
    display: flex;
    align-items: center;
    position: relative;
    margin-left: 0.75rem;
}
.search-toggle {
    background-color: var(--accent-color);
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-family);
    color: #fff;
    cursor: pointer;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.search-toggle i {
    font-size: 0.8rem;
}
.search-toggle:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}
.header-search.active .search-toggle {
    display: none;
}
.header-search-wrapper {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 0;
    opacity: 0;
    visibility: hidden;
    transition: width 0.35s ease, opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1002;
}
.header-search.active .header-search-wrapper {
    width: 400px;
    opacity: 1;
    visibility: visible;
}
.header-search-form {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.header-search-form input {
    border: none;
    outline: none;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font-family);
    width: 100%;
    background: transparent;
}
.header-search-form button {
    background: var(--accent-color);
    border: none;
    color: #fff;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}
.header-search-form button:hover {
    background: var(--accent-hover);
}

/* --- Live Search Results Dropdown --- */
.live-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 100%;
    min-width: 400px;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    z-index: 1003;
}
.live-search-results.visible {
    display: block;
}
.live-search-group {
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-color);
}
.live-search-group:last-of-type {
    border-bottom: none;
}
.live-search-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6c757d;
    padding: 0.6rem 1rem 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.live-search-label i {
    color: var(--accent-color);
    font-size: 0.75rem;
}
.live-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    transition: background-color 0.15s ease;
    cursor: pointer;
}
.live-search-item:hover {
    background-color: var(--off-white);
}
.live-search-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.live-search-thumb.live-search-avatar {
    border-radius: 50%;
}
.live-search-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--off-white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-color);
    font-size: 1rem;
}
.live-search-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.live-search-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.live-search-title mark {
    background-color: rgba(57, 181, 73, 0.2);
    color: var(--accent-color);
    font-weight: 700;
    padding: 0 2px;
    border-radius: 2px;
}
.live-search-meta {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.live-search-viewall {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color) !important;
    border-top: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}
.live-search-viewall:hover {
    background-color: var(--off-white);
}
.live-search-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.live-search-empty i {
    color: #adb5bd;
}

/* --- General Content Styles --- */
.bg-off-white {
    background-color: var(--off-white);
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}
.section-heading, .page-header {
    border-bottom: 3px solid var(--accent-color);
    margin-bottom: 2.5rem;
    padding-bottom: 0.75rem;
}
.section-heading h2, .page-header h1 {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-color);
}

/* --- Style for Search Page Title --- */
.search-query {
    color: var(--accent-color);
}

/* --- Homepage & Category Page Top Grid --- */
.top-stories-section {
    padding: 2.5rem 0;
}
.top-stories-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2.5rem;
}
#main-story-container {
    grid-column: 1 / span 8;
}
#secondary-stories-container {
    grid-column: 9 / span 4;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.main-story-card {
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}
.main-story-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.main-story-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
}
.main-story-card .card-category {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
}
.main-story-card .card-title {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1px;
    margin: 0.5rem 0 0;
    color: #fff;
}
.secondary-story-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.secondary-story-item .card-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 8px;
}
.secondary-story-item .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}
.secondary-story-item .card-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

/* --- Category Sections (Homepage) --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.story-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    height: 380px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.story-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-in-out;
}
.story-card:hover .card-image {
    transform: scale(1.1);
}
.story-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
}
.story-card .card-category {
    background-color: var(--accent-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}
.story-card .card-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
}

/* =================================================================
   MERGED ARTICLE STYLES
   ================================================================= */

/* --- Article Layout --- */
.article-container {
    padding-top: 2.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem; 
}

/* A balanced two-column grid for larger screens */
@media (min-width: 992px) {
    .article-container {
        grid-template-columns: minmax(0, 2.5fr) minmax(320px, 1fr);
        gap: 4rem;
    }
}

/* --- Article Header & Content --- */
.article-header { margin-bottom: 2rem; }
.article-header .category-link { font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.9rem; margin-bottom: 0.5rem; display: inline-block; color: var(--accent-color); }
.article-header .article-title { font-size: 3rem; font-weight: 800; line-height: 1.1; letter-spacing: -1.5px; margin-bottom: 1.5rem; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1.5rem; color: #6c757d; font-size: 0.9rem; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); padding: 1rem 0; }
.meta-author-link { color: var(--text-color); font-weight: 500; }
.meta-author-link:hover { color: var(--accent-color); }
.featured-image { margin: 2.5rem 0; }
.featured-image img { border-radius: 8px; }
.featured-image figcaption { font-size: 0.85rem; color: #6c757d; text-align: center; margin-top: 0.75rem; }
.article-body { font-size: 1.1rem; line-height: 1.8; }
.article-body h2, .article-body h3 { font-weight: 700; line-height: 1.3; margin: 2.5rem 0 1rem; }
.article-body h2 { font-size: 1.8rem; }
.article-body h3 { font-size: 1.5rem; }
.article-body p { margin-bottom: 1.5rem; }
.article-body ul, .article-body ol { margin: 1.5rem 0; padding-left: 1.5rem; }
.article-body ol { list-style-type: bengali-digits; }
.article-body li { margin-bottom: 0.75rem; }
.article-body blockquote { margin: 2rem 0; padding-left: 1.5rem; border-left: 3px solid var(--accent-color); font-style: italic; font-size: 1.2rem; color: #6c757d; }
.article-cta { background-color: var(--accent-color); color: #fff; padding: 2.5rem; border-radius: 8px; text-align: center; margin: 3rem 0; }
.article-cta h3 { font-size: 1.8rem; font-weight: 700; margin-bottom: 1rem; }
.article-cta p { margin-bottom: 1.5rem; opacity: 0.9; }
.cta-button { background-color: #fff; color: var(--accent-color); padding: 0.8rem 2rem; border-radius: 50px; font-weight: 700; transition: transform 0.3s, background-color 0.3s; }
.cta-button:hover { color: var(--accent-color); background-color: #e9ecef; transform: translateY(-2px); }

.article-footer { 
    margin-top: 3rem;
    margin-bottom: 3rem;
}
.author-box { background: var(--off-white); padding: 2rem; border-radius: 8px; display: flex; flex-direction: column; align-items: center; text-align: center; border: 1px solid var(--border-color); }
.author-avatar { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 1rem; }
.author-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.author-title { color: #6c757d; font-size: 0.9rem; margin-bottom: 1rem; }
.author-bio { font-size: 0.95rem; max-width: 700px; margin-bottom: 1.5rem; }
.author-social-links { display: flex; gap: 1.5rem; }
.author-social-links a { font-size: 1.2rem; color: #6c757d; }

/* --- SIDEBAR STYLES --- */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    align-self: start;
}
.widget {
    background-color: var(--off-white);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}
.widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}
.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
}
.search-widget-form { position: relative; }
.search-widget-form input { width: 100%; padding: 0.8rem 2.8rem 0.8rem 1rem; border: 1px solid #ced4da; border-radius: 50px; font-size: 0.9rem; transition: border-color 0.3s, box-shadow 0.3s; }
.search-widget-form input:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 4px rgba(57, 181, 73, 0.1); }
.search-widget-form button { position: absolute; top: 0; right: 0; height: 100%; width: 45px; background: transparent; border: none; cursor: pointer; color: #adb5bd; font-size: 1.1rem; transition: color 0.3s; }
.search-widget-form button:hover, .search-widget-form input:focus + button { color: var(--accent-color); }

/* --- IMPROVED: Related Posts Styles --- */
.related-posts-list { 
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.related-post-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.related-post-item:hover .related-post-title {
    color: var(--accent-color);
}
.related-post-image { 
    width: 80px; 
    height: 80px; 
    object-fit: cover; 
    border-radius: 8px; 
    flex-shrink: 0; 
}
.related-post-info {
    flex: 1;
}
.related-post-category {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}
.related-post-title { 
    font-size: 1rem; 
    font-weight: 700; 
    line-height: 1.4; 
    color: var(--text-color);
    margin: 0;
    transition: color 0.3s ease;
}

/* Categories Widget Styles */
.categories-list { list-style: none; padding:0; margin:0; }
.categories-list li { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }
.categories-list li:last-child { border-bottom: none; padding-bottom: 0; }
.categories-list a { font-weight: 500; }
.category-count { color: #6c757d; font-size: 0.9rem; }


/* --- Footer --- */
.site-footer {
    background-color: #111;
    color: #adb5bd;
    padding: 4rem 0 2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}
.footer-column .footer-logo {
    height: 40px;
    margin-bottom: 1.5rem;
}
.footer-column .footer-about-text {
    font-size: 0.98rem;
    line-height: 1.75;
    margin-bottom: 1.1rem;
    color: #ffffff;
    font-weight: 400;
}
.footer-column .footer-about-text strong { color: #ffffff; font-weight: 400; }
.footer-column .footer-about-text em { color: #ffffff; font-style: normal; }
.footer-column .footer-about-text a { color: #ffffff; text-decoration: none; }
.footer-column .footer-about-text a:hover { color: #ffffff; text-decoration: underline; }
.footer-column {
    text-align: left;
}
.footer-column h4 {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-column ul li { margin-bottom: 0.8rem; }
.footer-column ul a {
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.footer-column ul a:hover { color: #ffffff; padding-left: 5px; }
.footer-column ul a strong { color: #ffffff; }
.footer-social-links { display: flex; gap: 1rem; margin-top: 1.5rem; }
.footer-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #343a40;
    color: #fff;
    border-radius: 50%;
    font-size: 1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.footer-social-links a:hover { background-color: #4ade80; color: #0f172a; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid #343a40;
    font-size: 0.85rem;
    color: #ffffff;
}
.footer-bottom .footer-copy { margin: 0; color: #ffffff; }
.footer-bottom .footer-legal {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
}
.footer-bottom .footer-legal li { margin: 0; position: relative; }
.footer-bottom .footer-legal li + li::before {
    content: "·";
    position: absolute;
    left: -0.78rem;
    color: #6b7280;
}
.footer-bottom .footer-legal a {
    color: #ffffff;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.footer-bottom .footer-legal a:hover { color: #4ade80; }
@media (max-width: 600px) {
    .footer-bottom { justify-content: center; text-align: center; flex-direction: column; }
    .footer-bottom .footer-legal { justify-content: center; }
}

/* --- Responsive Design --- */
@media (max-width: 1200px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
    .sidebar { position: static; }
    .article-header .article-title { font-size: 2.2rem; }
    .top-stories-grid { grid-template-columns: 1fr; }
    #main-story-container, #secondary-stories-container { grid-column: auto; }
    .main-story-card .card-title { font-size: 2rem; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height); left: 0; width: 100%;
        background-color: var(--background-color);
        flex-direction: column; text-align: center;
        padding: 1rem 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        max-height: 80vh;
        overflow-y: auto;
    }
    .nav-links.active { display: flex; }
    .mobile-menu-toggle { display: block; }

    /* Mobile dropdowns */
    .nav-dropdown-toggle i {
        transition: transform 0.3s ease;
    }
    .nav-dropdown.open > .nav-dropdown-toggle i {
        transform: rotate(180deg);
    }
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background-color: var(--off-white);
        opacity: 1;
        visibility: visible;
        min-width: 100%;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 0.35s ease, padding 0.35s ease;
    }
    .dropdown-menu::before,
    .dropdown-menu::after { display: none; }
    .nav-dropdown.open .dropdown-menu {
        max-height: 700px;
        padding: 0.5rem 0;
    }
    .dropdown-menu--split {
        flex-direction: column;
        width: auto;
        max-width: none;
        min-width: 100%;
    }
    .dropdown-menu--split .dropdown-col {
        flex-basis: auto;
        max-width: none;
    }
    .dropdown-menu li a {
        padding: 0.5rem 2rem;
        font-size: 0.85rem;
    }
    .dropdown-menu li a:hover {
        padding-left: 2.5rem;
    }
    .dropdown-divider {
        margin: 0.3rem 2rem;
    }

    /* Mobile search */
    .header-search {
        margin-left: auto;
        margin-right: 0.5rem;
    }
    .search-toggle {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }
    .header-search.active .header-search-wrapper {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        padding: 0.75rem;
        background: #fff;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }
    .live-search-results {
        min-width: 100%;
        max-height: 60vh;
        position: relative;
        top: 0;
        margin-top: 0.5rem;
        border-radius: 8px;
    }
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .footer-column { text-align: center; }
    .footer-logo { margin-left: auto; margin-right: auto; }
    .footer-social-links { justify-content: center; }
    .story-card, .category-grid { height: auto; grid-template-columns: 1fr; }

    /* Smaller search on mobile */
    .search-toggle span { display: none; }
    .header-search-form input {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* --- Search & Author Page Results Grid --- */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.search-results-count {
    grid-column: 1 / -1;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}
.search-results-count i {
    color: var(--accent-color);
}
.search-extra-results {
    margin-top: 2.5rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.search-extra-results .live-search-item {
    padding: 0.85rem 1.2rem;
}
.search-extra-results .live-search-title,
.search-extra-results .live-search-meta {
    white-space: normal;
}
.search-card {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}
.search-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.search-card-img {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}
.search-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-in-out;
}
.search-card:hover .search-card-img img {
    transform: scale(1.05);
}
.search-card-img .card-category {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}
.search-card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.search-card-body .card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.6rem;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.search-card-excerpt {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}
.search-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
    color: #adb5bd;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}
.search-card-meta i {
    margin-right: 0.3rem;
}

@media (max-width: 992px) {
    .search-results-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .search-results-grid { grid-template-columns: 1fr; }
}

/* --- Add space above footer on search and author pages --- */
#search-page .posts-grid,
#author-page .posts-grid {
    margin-bottom: 4rem;
}

/* --- NEW: Social Share Buttons in Article Meta --- */
.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Allows items to wrap on smaller screens */
    gap: 0.5rem 1.5rem;
    color: #6c757d;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.social-share-buttons {
    display: flex;
    align-items: center;
    gap: 1.2rem; /* Space between icons */
    margin-left: auto; /* Pushes the buttons to the far right */
}

.social-share-buttons a {
    color: #6c757d; /* Matches the meta text color */
    font-size: 1.1rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-share-buttons a:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

/* Course Card */
.course-card {
    height: auto !important;
    aspect-ratio: 1 / 1;
}

/* --- Glossary Tooltip (blog articles) --- */
.gloss {
    border-bottom: 1px dotted var(--accent-color);
    cursor: help;
    position: relative;
    font-weight: 500;
    color: #1f6e2a;
}
.gloss:hover, .gloss:focus {
    background: #e6f4e8;
}
.gloss .gloss-bubble {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Anek Bangla', sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.6;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    width: max-content;
    max-width: 280px;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 100;
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}
.gloss .gloss-bubble::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0f172a;
}
.gloss .gloss-bubble strong {
    color: #4ade80;
    display: block;
    margin-bottom: 0.2rem;
    font-weight: 700;
}
.gloss:hover .gloss-bubble,
.gloss:focus .gloss-bubble {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
@media (max-width: 640px) {
    .gloss .gloss-bubble {
        max-width: 220px;
        font-size: 0.78rem;
    }
}