/* ===========================================
   Springboard India - Knowledge Base Styles
   =========================================== */

:root {
    --primary: #EC1D24;
    --primary-dark: #b5141a;
    --primary-light: #f04048;
    --bg: #fff8f8;
    --bg-tint: #fff5f5;
    --white: #ffffff;
    --text: #1a1a1a;
    --text-muted: #555;
    --text-light: #777;
    --border: #f0d0d0;
    --border-light: #ffe8e8;
    --shadow: 0 2px 8px rgba(236, 29, 36, 0.07);
    --shadow-hover: 0 4px 16px rgba(236, 29, 36, 0.14);
    --radius: 8px;
    --font-heading: 'Merriweather', Georgia, serif;
    --font-body: 'Open Sans', 'Segoe UI', sans-serif;
}

/* ========== Reset ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); color: var(--text); line-height: 1.7; background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
button { font-family: var(--font-body); }

/* ========== Container ========== */
.container { max-width: 92%; margin: 0 auto; padding: 0 20px; }

/* ========== Header ========== */
.site-header {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 89px;
    gap: 12px;
    position: relative;
}
.logo {
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    flex-shrink: 0;
    gap: 10px;
}
.logo img { height: 67px; width: auto; }
.logo-text { color: #fff; font-family: var(--font-heading); font-size: 20px; font-weight: 700; line-height: 1.2; }
.logo:hover .logo-text { color: #fff; }

/* Hamburger toggle (mobile only) */
.nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 7px 12px;
    margin-left: auto;
    flex-shrink: 0;
    transition: background 0.2s;
}
.nav-toggle:hover { background: rgba(255,255,255,0.25); }
.toggle-label {
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
}
.toggle-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.toggle-bars span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.25s;
}

/* Header right (nav + search) */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.main-nav { display: flex; gap: 20px; align-items: center; }
.main-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}
.main-nav a:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.5); }

/* ===== Dropdown nav item ===== */
.nav-item { position: relative; }
.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 600;
    padding: 4px 0;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: color 0.2s;
}
.nav-dropdown-toggle:hover { color: #fff; }
.nav-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.nav-item.open .nav-arrow,
.nav-item:hover .nav-arrow { transform: rotate(180deg); }

/* Dropdown panel */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 230px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    padding: 6px 0;
    list-style: none;
    margin: 0;
    z-index: 2000;
    border-top: 3px solid var(--primary);
    /* padding-top creates an invisible bridge so the hover zone
       is continuous between the button and the visible panel */
    padding-top: 12px;
}
/* Show on hover (desktop only) */
.nav-item:hover .nav-dropdown { display: block; }

.nav-dropdown li a {
    display: block;
    padding: 9px 18px;
    color: #222;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-bottom: none !important;
    transition: background 0.15s, color 0.15s;
    white-space: normal;
}
.nav-dropdown li a:hover { background: #fef2f2; color: var(--primary); }
.nav-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Search bar */
.header-search { position: relative; }
.header-search form { display: flex; align-items: center; }
.header-search input {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    color: #fff;
    padding: 7px 36px 7px 14px;
    font-size: 13px;
    width: 180px;
    outline: none;
    transition: all 0.2s;
    font-family: var(--font-body);
}
.header-search input::placeholder { color: rgba(255,255,255,0.6); }
.header-search input:focus {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.7);
    width: 220px;
}
.header-search button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.85);
    padding: 0;
    display: flex;
    align-items: center;
}
.header-search button:hover { color: #fff; }
.header-search button svg { width: 15px; height: 15px; }

/* ========== Category Filter ========== */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}
.filter-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    background: #fff;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}
.filter-tag:hover { border-color: var(--primary); color: var(--primary); }
.filter-tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== Listing Page ========== */
.listing-page { padding: 32px 0 60px; }
.listing-header { text-align: center; margin-bottom: 28px; }
.listing-header h1 { font-family: var(--font-heading); font-size: 32px; color: var(--primary); margin-bottom: 6px; }
.listing-header p { font-size: 15px; color: var(--text-muted); }

/* ========== Article Cards Grid ========== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.article-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card-link { display: block; text-decoration: none; color: inherit; height: 100%; }
.card-image { height: 180px; overflow: hidden; background: var(--bg-tint); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.card-image-placeholder span { font-size: 48px; color: rgba(255,255,255,0.4); font-family: var(--font-heading); }
.card-body { padding: 16px; }
.card-category { display: inline-block; font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.card-title { font-family: var(--font-heading); font-size: 16px; color: var(--text); line-height: 1.4; margin-bottom: 8px; }
.card-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ========== Pagination ========== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 44px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-ellipsis { border: none; cursor: default; }

/* ========== Article Page ========== */
.article-page { padding: 16px 0 60px; }

/* Breadcrumb */
.breadcrumb { font-size: 12px; color: var(--text-light); margin-bottom: 20px; padding: 10px 0; line-height: 1.5; }
.breadcrumb a { color: var(--primary-light); }
.breadcrumb a:hover { text-decoration: underline; }

/* Article layout */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.article-main { min-width: 0; }
.article-right-sidebar { position: sticky; top: 20px; }

/* ========== TOC Wrapper — sticky below KB header (89px) ========== */
.toc-wrapper {
    position: sticky;
    top: 89px;
    z-index: 200;
    margin-bottom: 22px;
}

/* Article header */
.article-header { margin-bottom: 20px; }
.article-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    background: var(--bg-tint);
    padding: 3px 10px;
    border-radius: 4px;
}
.article-header h1 { font-family: var(--font-heading); font-size: 30px; color: var(--primary-dark); line-height: 1.3; }

/* Featured image */
.article-featured-image { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }
.article-featured-image img { width: 100%; display: block; }

/* Article content */
.article-content { font-size: 16px; line-height: 1.85; color: var(--text); }
.article-content h2 { font-family: var(--font-heading); font-size: 24px; color: var(--primary); margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border-light); }
.article-content h3 { font-family: var(--font-heading); font-size: 20px; color: var(--primary-dark); margin: 28px 0 10px; }
.article-content h4 { font-size: 17px; color: var(--text); margin: 22px 0 8px; }
.article-content p { margin-bottom: 14px; }
.article-content ul, .article-content ol { margin: 10px 0 14px 22px; }
.article-content li { margin-bottom: 5px; }
.article-content blockquote { border-left: 4px solid var(--primary); background: var(--bg-tint); padding: 14px 18px; margin: 18px 0; font-style: italic; color: var(--text-muted); border-radius: 0 var(--radius) var(--radius) 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 18px 0; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-content th, .article-content td { padding: 9px 12px; border: 1px solid var(--border); text-align: left; font-size: 14px; white-space: nowrap; }
.article-content th { background: var(--primary); color: #fff; font-weight: 600; }
.article-content tr:nth-child(even) { background: var(--bg-tint); }
.article-content img { border-radius: var(--radius); margin: 14px 0; max-width: 100%; }
.article-content pre { background: #2d2d2d; color: #f8f8f2; padding: 14px 18px; border-radius: var(--radius); overflow-x: auto; margin: 14px 0; font-size: 13px; line-height: 1.5; -webkit-overflow-scrolling: touch; }
.article-content code { background: var(--bg-tint); padding: 2px 5px; border-radius: 3px; font-size: 0.9em; }
.article-content pre code { background: none; padding: 0; }

/* ========== Table of Contents ========== */
.toc {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

/* Toggle button — full-width clickable title bar */
.toc-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 16px;
    background: linear-gradient(135deg, #5c060b 0%, #b5141a 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    transition: background 0.2s;
    letter-spacing: 0.2px;
}
.toc-toggle-btn:hover { background: linear-gradient(135deg, #4a0509 0%, #9e1218 100%); }

.toc-title-text {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}
.toc-icon { flex-shrink: 0; opacity: 0.9; }

.toc-chevron {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}
/* Collapsed: chevron points up */
.toc.collapsed .toc-chevron { transform: rotate(180deg); }

/* Animated body */
.toc-body {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.35s ease, padding 0.3s ease;
    padding: 10px 14px 12px;
}
.toc.collapsed .toc-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* List items */
.toc ul { list-style: none; }
.toc li { margin-bottom: 3px; }
.toc li a {
    display: block;
    padding: 5px 8px;
    font-size: 13px;
    color: var(--text-muted);
    border-radius: 4px;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.18s;
    line-height: 1.4;
}
.toc li a:hover,
.toc li a.active {
    color: var(--primary);
    background: var(--bg-tint);
    border-left-color: var(--primary);
}
.toc li.toc-sub a { padding-left: 20px; font-size: 12px; }

/* ========== Social Share ========== */
.social-share { margin: 32px 0; padding: 16px 0; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.share-label { font-size: 13px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 10px; }
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; transition: transform 0.2s, opacity 0.2s; }
.share-btn:hover { transform: scale(1.1); color: #fff; opacity: 0.85; }
.share-twitter { background: #1da1f2; }
.share-facebook { background: #1877f2; }
.share-linkedin { background: #0a66c2; }
.share-whatsapp { background: #25d366; }

/* ========== Article Actions (PDF/Print) ========== */
.article-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-light); }
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--primary);
    text-decoration: none;
    transition: all 0.2s;
    font-family: var(--font-body);
}
.action-btn-print { background: #fff; color: var(--primary); }
.action-btn-print:hover { background: var(--primary); color: #fff; }
.action-btn-pdf { background: var(--primary); color: #fff; }
.action-btn-pdf:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.action-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ========== Related Articles Sidebar ========== */
.related-articles { margin-top: 20px; }
.sidebar-title { font-family: var(--font-heading); font-size: 15px; color: var(--primary); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border-light); }
.related-card { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-light); text-decoration: none; color: inherit; transition: background 0.2s; border-radius: 4px; }
.related-card:last-child { border-bottom: none; }
.related-card:hover { background: var(--bg-tint); padding-left: 6px; }
.related-img { width: 64px; height: 46px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.related-info h4 { font-size: 13px; line-height: 1.35; color: var(--text); }

/* ========== Search Results Page ========== */
.search-page { padding: 32px 0 60px; }
.search-header { margin-bottom: 28px; }
.search-header h1 { font-family: var(--font-heading); font-size: 26px; color: var(--primary); margin-bottom: 16px; }
.search-form-large { display: flex; max-width: 580px; }
.search-form-large input {
    flex: 1;
    padding: 11px 18px;
    font-size: 15px;
    border: 2px solid var(--border);
    border-right: none;
    border-radius: 6px 0 0 6px;
    outline: none;
    font-family: var(--font-body);
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s;
    min-width: 0;
}
.search-form-large input:focus { border-color: var(--primary); }
.search-form-large button {
    padding: 11px 20px;
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-body);
    white-space: nowrap;
    flex-shrink: 0;
}
.search-form-large button:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.search-count { font-size: 14px; color: var(--text-muted); margin-top: 14px; }

/* ========== Footer ========== */
.site-footer { background: var(--primary-dark); color: rgba(255,255,255,0.8); padding: 36px 0 0; margin-top: 60px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); flex-wrap: wrap; gap: 16px; }
.footer-brand strong { color: #fff; font-size: 17px; font-family: var(--font-heading); }
.footer-brand p { font-size: 13px; margin-top: 5px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 14px; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-bottom { padding: 14px 0; text-align: center; font-size: 12px; color: rgba(255,255,255,0.5); }

/* ========== Buttons ========== */
.btn { display: inline-block; padding: 9px 22px; border-radius: 4px; font-weight: 600; font-size: 14px; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); }

/* ========== Not Found / Empty ========== */
.not-found { text-align: center; padding: 60px 20px; }
.not-found h1 { font-family: var(--font-heading); color: var(--primary); margin-bottom: 12px; }
.not-found p { color: var(--text-muted); margin-bottom: 20px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state h2 { font-family: var(--font-heading); color: var(--text); margin-bottom: 8px; }

/* ========== Responsive: Tablet (≤900px) ========== */
@media (max-width: 900px) {
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .article-layout { display: block; }
    .article-right-sidebar { position: static; margin-top: 32px; }
    .toc-wrapper { top: 64px; } /* mobile KB header height */
    .article-header h1 { font-size: 26px; }
}

/* ========== Responsive: Tablet (769px–1024px) ========== */
@media (max-width: 1024px) and (min-width: 769px) {
}

/* ========== Responsive: Mobile (≤768px) — Off-canvas nav ========== */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .header-right { display: none; } /* desktop nav hidden; off-canvas used instead */
    .header-inner { height: 64px; padding: 0 12px; }
    .logo { gap: 8px; }
    .logo img { height: 46px; }
    .logo-text { font-size: 16px; }
}

/* ========== Responsive: Small phones (≤480px) ========== */
@media (max-width: 480px) {
    .header-inner { height: 58px; padding: 0 10px; }
    .logo img { height: 38px; }
    .toc-wrapper { top: 58px; }
    .toc-toggle-btn { font-size: 13px; padding: 10px 13px; }
    .toc-body { max-height: 320px; padding: 8px 12px 10px; }
}

/* ---- Nav overlay ---- */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1100;
    transition: opacity 0.3s;
    opacity: 0;
}
.nav-overlay.open { display: block; opacity: 1; }

/* ---- Off-canvas panel ---- */
.offcanvas-panel {
    position: fixed;
    top: 0;
    left: -80%;
    width: 78%;
    max-width: 320px;
    height: 100%;
    background: #fff;
    z-index: 1200;
    overflow-y: auto;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}
.offcanvas-panel.open { left: 0; }

/* Panel header bar */
.offcanvas-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--primary);
}
.offcanvas-panel-title {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.offcanvas-panel-close {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.offcanvas-panel-close:hover { background: rgba(255,255,255,0.35); transform: rotate(90deg); }
.offcanvas-panel-close svg { width: 18px; height: 18px; stroke: #fff; }

/* Search bar inside panel */
.offcanvas-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
}
.offcanvas-search form {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    padding: 0 8px 0 14px;
}
.offcanvas-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13.5px;
    padding: 8px 0;
    background: transparent;
    color: var(--text);
}
.offcanvas-search button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    display: flex;
    align-items: center;
}
.offcanvas-search button svg { width: 18px; height: 18px; stroke: var(--primary); }

/* Nav list */
.offcanvas-nav-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}
.offcanvas-nav-list > li { border-bottom: 1px solid var(--border-light); }
.offcanvas-nav-list > li:last-child { border-bottom: none; }

.offcanvas-nav-list > li > a {
    display: block;
    padding: 14px 18px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}
.offcanvas-nav-list > li > a:hover { background: #fff5f5; color: var(--primary); }

/* Submenu toggle button */
.offcanvas-sub-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s, color 0.18s;
}
.offcanvas-sub-toggle:hover { background: #fff5f5; color: var(--primary); }
.offcanvas-sub-toggle .sub-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: var(--text-muted);
    transition: transform 0.25s;
}
.offcanvas-sub-toggle.active { color: var(--primary); }
.offcanvas-sub-toggle.active .sub-arrow { transform: rotate(180deg); fill: var(--primary); }

/* Submenu */
.offcanvas-sub {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    background: #fff8f8;
    border-left: 3px solid var(--primary);
    transition: max-height 0.35s ease;
}
.offcanvas-sub.open { max-height: 400px; }
.offcanvas-sub li { border-bottom: 1px solid var(--border-light); }
.offcanvas-sub li:last-child { border-bottom: none; }
.offcanvas-sub li a {
    display: block;
    padding: 11px 18px 11px 20px;
    color: #444;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}
.offcanvas-sub li a:hover { background: #fff0f0; color: var(--primary); }

/* ========== Responsive: Mobile content (≤640px) ========== */
@media (max-width: 640px) {
    .articles-grid { grid-template-columns: 1fr; gap: 14px; }
    .listing-page { padding: 20px 0 40px; }
    .listing-header h1 { font-size: 24px; }
    .article-header h1 { font-size: 22px; }
    .article-content { font-size: 15px; }
    .article-content h2 { font-size: 20px; }
    .article-content h3 { font-size: 18px; }
    .breadcrumb { font-size: 11px; }
    .action-btn { font-size: 13px; padding: 8px 14px; }
    .search-form-large input { font-size: 14px; }
    .search-header h1 { font-size: 22px; }
    .pagination { gap: 4px; }
    .page-link { min-width: 34px; height: 34px; font-size: 13px; }
}

/* ========== Responsive: Small mobile (≤400px) ========== */
@media (max-width: 400px) {
    .container { padding: 0 12px; }
    .article-header h1 { font-size: 20px; }
    .card-image { height: 160px; }
}

/* ========== Main Category Cards (Landing Page) ========== */
.main-category-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}
.main-cat-card {
    display: block;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.main-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.14);
}
.main-cat-card--current { background: linear-gradient(135deg, #EC1D24 0%, #b8161c 100%); }
.main-cat-card--subject { background: linear-gradient(135deg, #1a3a6b 0%, #0f2448 100%); }
.main-cat-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 24px;
    color: #fff;
}
.main-cat-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.main-cat-icon svg { width: 28px; height: 28px; color: #fff; }
.main-cat-text { flex: 1; min-width: 0; }
.main-cat-text h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.3;
}
.main-cat-subs {
    font-size: 12px;
    color: rgba(255,255,255,0.78);
    margin: 0;
    line-height: 1.5;
}
.main-cat-arrow {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
}

/* ========== Section Heading (Latest Articles) ========== */
.section-heading {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}
.section-heading h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--text-dark);
    margin: 0;
    white-space: nowrap;
}
.section-heading::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border);
}

/* ========== Subcategory Filter (Category Page) ========== */
.subcategory-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

/* ========== Language Filter (Hindi / English) ========== */
.lang-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
    padding: 14px 20px;
    background: #f9f9fb;
    border-radius: 12px;
    border: 1px solid #e4e4ee;
}
.lang-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-right: 2px;
}
.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    letter-spacing: 0.04em;
    cursor: pointer;
    min-width: 110px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.lang-btn span {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

/* All button — neutral grey */
.lang-btn--all {
    background: #fff;
    color: #444;
    border-color: #ccc;
}
.lang-btn--all:hover {
    background: #444;
    color: #fff;
    border-color: #444;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}
.lang-btn--all.active {
    background: #333;
    color: #fff;
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Hindi button — saffron/orange */
.lang-btn--hindi {
    background: linear-gradient(135deg, #ff9933 0%, #e65c00 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(230,92,0,0.3);
}
.lang-btn--hindi:hover {
    background: linear-gradient(135deg, #ffad47 0%, #ff6a00 100%);
    box-shadow: 0 6px 18px rgba(230,92,0,0.45);
    transform: translateY(-2px);
}
.lang-btn--hindi.active {
    background: linear-gradient(135deg, #e65c00 0%, #bf3e00 100%);
    box-shadow: 0 6px 18px rgba(180,60,0,0.4);
    transform: translateY(-1px);
}

/* English button — royal blue/green */
.lang-btn--english {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(13,71,161,0.3);
}
.lang-btn--english:hover {
    background: linear-gradient(135deg, #2e86f5 0%, #1a5fc4 100%);
    box-shadow: 0 6px 18px rgba(13,71,161,0.45);
    transform: translateY(-2px);
}
.lang-btn--english.active {
    background: linear-gradient(135deg, #0d47a1 0%, #072e6e 100%);
    box-shadow: 0 6px 18px rgba(7,46,110,0.4);
    transform: translateY(-1px);
}

/* ========== Category Page Breadcrumb ========== */
.breadcrumb-nav {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.breadcrumb-nav a { color: var(--primary); text-decoration: none; }
.breadcrumb-nav a:hover { text-decoration: underline; }
.listing-header--left { text-align: left; }

/* ========== Admin Category Select ========== */
.admin-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #111827;
}
.admin-select:focus { outline: none; border-color: #EC1D24; box-shadow: 0 0 0 2px rgba(236,29,36,0.15); }

/* ========== Responsive: Main category cards ========== */
@media (max-width: 640px) {
    .main-category-cards { grid-template-columns: 1fr; }
    .main-cat-card-inner { padding: 20px 16px; gap: 12px; }
    .main-cat-text h2 { font-size: 15px; }
    .main-cat-subs { display: none; }
    .main-cat-icon { width: 42px; height: 42px; }
    .main-cat-icon svg { width: 22px; height: 22px; }
}

/* ========== Print Styles ========== */
@media print {
    .site-header, .site-footer, .article-right-sidebar, .breadcrumb,
    .social-share, .article-actions, .toc-wrapper,
    .translate-widget, #google_translate_element,
    .category-filter, .pagination { display: none !important; }
    body { background: #fff; color: #000; font-size: 12pt; }
    .article-page { padding: 0; }
    .article-layout { display: block; }
    .article-main { width: 100%; }
    .article-content h2 { color: #000; border-bottom: 1pt solid #ccc; }
    .article-content h3 { color: #333; }
    .article-content a { color: #000; text-decoration: underline; }
    .article-content pre { border: 1pt solid #ccc; background: #f5f5f5; color: #000; }
    .article-header h1 { font-size: 20pt; color: #000; }
    .article-category { display: none; }
    .article-content table { display: table; overflow: visible; }
    .article-content th, .article-content td { white-space: normal; }
}
/* ===== Social Widget — collapsible toggle ===== */
.social-widget {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 8000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.social-toggle-btn {
    width: 34px;
    padding: 14px 0;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 2px 2px 14px rgba(0,0,0,0.25);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.social-toggle-btn:hover {
    background: var(--primary-dark);
    transform: translateX(4px);
    box-shadow: 4px 4px 18px rgba(0,0,0,0.3);
}
.social-toggle-btn i { pointer-events: none; font-size: 15px; }
.soc-btn-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
}

.social-links-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.38s cubic-bezier(0.4,0,0.2,1), opacity 0.28s ease, padding 0.3s;
    padding: 0;
    align-items: flex-start;
}
.social-links-panel.open {
    max-height: 400px;
    opacity: 1;
    padding: 7px 0 0;
}

.soc-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    color: #fff;
    text-decoration: none;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.18);
    transition: width 0.22s ease, transform 0.22s ease, box-shadow 0.22s;
    font-size: 19px;
    font-weight: bold;
}
.soc-link:hover { width: 58px; transform: translateX(4px); box-shadow: 4px 3px 12px rgba(0,0,0,0.25); }
.soc-link i { pointer-events: none; }

.soc-link.x         { background: linear-gradient(135deg, #000 0%, #2c2c2c 100%); font-size: 17px; letter-spacing: -1px; }
.soc-link.instagram { background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%); }
.soc-link.facebook  { background: linear-gradient(135deg, #1877f2 0%, #0d5dbf 100%); }
.soc-link.youtube   { background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%); }
.soc-link.telegram  { background: linear-gradient(135deg, #0088cc 0%, #006699 100%); }
.soc-link.whatsapp  { background: linear-gradient(135deg, #25d366 0%, #1ebe57 100%); }

@media (max-width: 768px) {
    .social-widget {
        left: 24px;
        right: auto;
        top: auto;
        bottom: 28px;
        transform: none;
        flex-direction: column-reverse;
        align-items: flex-start;
    }
    .social-toggle-btn {
        width: auto;
        height: auto;
        padding: 13px 22px;
        flex-direction: row;
        gap: 8px;
        border-radius: 50px;
        font-size: 14px;
        font-weight: 700;
        box-shadow: 0 4px 20px rgba(236,29,36,0.45);
    }
    .social-toggle-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(236,29,36,0.5); }
    .social-toggle-btn i { font-size: 15px; }
    .soc-btn-text {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0.2px;
    }
    .social-links-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        max-width: 140px;
        padding: 0;
        gap: 6px;
    }
    .social-links-panel.open { padding: 0 0 10px; }
    .soc-link { border-radius: 50%; width: 42px; height: 42px; font-size: 17px; }
    .soc-link:hover { width: 42px; transform: translateY(-3px); box-shadow: 0 5px 14px rgba(0,0,0,0.22); }
}

@media (max-width: 480px) {
    .social-widget { left: 14px; bottom: 18px; }
    .social-toggle-btn { padding: 11px 18px; font-size: 13px; }
    .soc-btn-text { font-size: 13px; }
    .social-links-panel { max-width: 130px; }
    .soc-link { width: 38px; height: 38px; font-size: 15px; }
}

/* ===========================================
   RIGHT SIDEBAR
   =========================================== */

/* ---- Page two-column layout ---- */
.page-with-sidebar {
    display: flex;
    gap: 28px;
    align-items: start;
}
.page-with-sidebar-main {
    flex: 1;
    min-width: 0;
}

/* ---- Shared sidebar container ---- */
.right-sidebar {
    width: 270px;
    flex-shrink: 0;
}
/* Sticky on desktop */
aside.right-sidebar,
.article-right-sidebar.right-sidebar {
    position: sticky;
    top: 80px;
}

/* ---- Widget card ---- */
.sb-widget {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.09), 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid transparent;
}

/* ---- Widget header strip ---- */
.sb-widget-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--primary);
    color: #fff;
}
.sb-widget-head h3 {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin: 0;
}
.sb-head-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: rgba(255,255,255,0.9);
}

/* Notifications header — red pulse accent */
.sb-widget--notifications .sb-widget-head {
    background: #c62828;
    position: relative;
}
.sb-widget--notifications .sb-widget-head::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #ffeb3b;
    border-radius: 50%;
    animation: sb-pulse 1.6s ease-in-out infinite;
}
@keyframes sb-pulse {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.4; transform: translateY(-50%) scale(0.7); }
}

/* Current Affairs header */
.sb-widget--current .sb-widget-head { background: #1565c0; }

/* Subjectwise Q&A header */
.sb-widget--qa .sb-widget-head { background: #2e7d32; }

/* ---- Notification list ---- */
.sb-notif-list { overflow: hidden; }

.sb-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 13px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    font-size: 12.5px;
    line-height: 1.45;
    transition: background 0.18s, color 0.18s;
    text-decoration: none;
}
.sb-notif-item:last-child { border-bottom: none; }
.sb-notif-item:hover { background: #fff5f5; color: var(--primary); }

.sb-notif-dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c62828;
    margin-top: 4px;
}
.sb-notif-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Article list (Current Affairs & Q&A) ---- */
.sb-article-list {
    list-style: none;
    padding: 6px 0;
    margin: 0;
}
.sb-article-list li {
    border-bottom: 1px solid var(--border-light);
    counter-increment: sb-counter;
}
.sb-article-list li:last-child { border-bottom: none; }

.sb-article-link {
    display: block;
    padding: 13px 12px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text);
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}
.sb-article-link:hover { background: var(--bg-tint); color: var(--primary-dark); }
.sb-article-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sb-view-all {
    display: block;
    text-align: right;
    padding: 7px 12px 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.3px;
    text-decoration: none;
    border-top: 1px solid var(--border-light);
}
.sb-view-all:hover { color: var(--primary-dark); text-decoration: underline; }

/* ---- Empty state ---- */
.sb-empty {
    padding: 12px 14px;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ---- Banner image widget ---- */
.sb-widget--banner {
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,0.1);
}
.sb-banner-link { display: block; text-decoration: none; }

.sb-banner-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
    transition: transform 0.3s ease;
}
.sb-banner-link:hover .sb-banner-img { transform: scale(1.03); }

/* Placeholder shown when no image file exists */
.sb-banner-placeholder {
    height: 160px;
    background: linear-gradient(135deg, var(--primary) 0%, #7b0408 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: filter 0.3s;
}
.sb-banner-link:hover .sb-banner-placeholder { filter: brightness(1.1); }
.sb-banner-content {
    text-align: center;
    color: #fff;
    padding: 16px;
}
.sb-banner-icon { font-size: 30px; margin-bottom: 6px; }
.sb-banner-content h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #fff;
}
.sb-banner-content p {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 12px;
    letter-spacing: 1px;
}
.sb-banner-btn {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    transition: background 0.2s;
}
.sb-banner-link:hover .sb-banner-btn { background: rgba(255,255,255,0.3); }

/* ===== Article page: keep existing grid but use new sidebar width ===== */
.article-layout { grid-template-columns: 1fr 270px; }

/* ===== Responsive: collapse sidebar on tablet/mobile ===== */
@media (max-width: 900px) {
    .page-with-sidebar { flex-direction: column; }
    .page-with-sidebar-main { width: 100%; }
    .right-sidebar { width: 100%; position: static; }
    aside.right-sidebar,
    .article-right-sidebar.right-sidebar { position: static; }
    .article-right-sidebar.right-sidebar { margin-top: 32px; }
}