/* ================================================================
   SpringGalaxy Blog Custom Styles  v1.4.9
   Covers: Category Filter Tabs, Meta Bar, TOC, FAQ,
           CTA Banner, Share On label, Sidebar Categories
   ================================================================ */

/* ---------- Global variables ---------- */
:root {
    --sg-primary:   #005f9e;
    --sg-accent:    #e8430a;
    --sg-text:      #333;
    --sg-muted:     #666;
    --sg-border:    #e2e8f0;
    --sg-bg-light:  #f7f9fc;
    --sg-radius:    6px;
    --sg-trans:     0.25s ease;
}

/* ================================================================
   BLOG LISTING — Category Filter Wrap
   ================================================================ */

.sg-cat-filter-wrap {
    padding: 18px 0 4px;
    background: #fff;
}

/* ================================================================
   BLOG LISTING — Category Filter Tabs  (Change 2)
   ================================================================ */

.sg-cat-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px;
}

.sg-cat-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    background: #fff;
    border: 2px solid var(--sg-border);
    border-radius: 30px;
    color: var(--sg-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sg-trans);
    line-height: 1.4;
    text-decoration: none;
}
.sg-cat-filter-btn:hover {
    border-color: var(--sg-primary);
    color: var(--sg-primary);
    text-decoration: none;
}
.sg-cat-filter-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
    text-decoration: none;
}
.sg-cat-filter-btn.active .sg-cat-count {
    color: rgba(255,255,255,0.75);
}

/* Count badge inside each tab */
.sg-cat-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--sg-accent);
    line-height: 1;
}

/* Posts hidden during filtering — handles both PHP-loop and Elementor posts widget */
.masonry-post-item.sg-filtered-hide,
article.elementor-post.sg-filtered-hide {
    display: none;
}

/* ================================================================
   BLOG DETAIL — Meta Bar  (Change 4)
   ================================================================ */

.sg-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin: 14px 0 28px;
    padding: 16px 20px;
    background: var(--sg-bg-light);
    border-left: 4px solid var(--sg-primary);
    border-radius: 0 var(--sg-radius) var(--sg-radius) 0;
    font-size: 14px;
    color: var(--sg-muted);
}

.sg-meta-bar .sg-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.sg-meta-bar svg {
    flex-shrink: 0;
    color: var(--sg-primary);
}

.sg-meta-bar a {
    color: var(--sg-primary);
    text-decoration: none;
}
.sg-meta-bar a:hover {
    text-decoration: underline;
}

.sg-meta-cat .sg-meta-cat-badge {
    display: inline-block;
    padding: 3px 12px;
    background: var(--sg-primary);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--sg-trans);
}
.sg-meta-cat .sg-meta-cat-badge:hover {
    background: var(--sg-accent);
}

/* ================================================================
   BLOG DETAIL — Two-column layout  (Change 3)
   ================================================================ */

.sg-blog-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

.sg-blog-main  { min-width: 0; }
.sg-blog-sidebar {}

@media (max-width: 991px) {
    .sg-blog-layout {
        grid-template-columns: 1fr;
    }
    .sg-blog-sidebar {
        order: -1;
    }
}

/* ================================================================
   BLOG DETAIL — Sidebar widgets: border & radius
   ================================================================ */

.sg-sidebar-widget,
.sg-toc-widget,
.sg-cats-widget {
    border: 1px solid var(--sg-border);
    border-radius: 10px;
    padding: 20px;
    background: #fff;
}

/* ================================================================
   BLOG DETAIL — TOC & Categories: match Recent Posts widget heading
   ================================================================ */

.sg-toc-widget,
.sg-cats-widget {
    position: sticky;
    top: 100px;
    margin-bottom: 40px;
}

/* Heading: exactly same as theme's widget-title (Recent Posts),
   but with border-bottom removed */
.sg-toc-widget .widget-title,
.sg-cats-widget .widget-title {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 14px;
}

/* TOC list — no bullets, clean links */
.sg-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.sg-toc-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--sg-border);
}
.sg-toc-item:last-child { border-bottom: none; }

.sg-toc-item a {
    display: block;
    padding: 9px 4px 9px 0;
    color: var(--sg-text);
    font-size: 14px;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all var(--sg-trans);
    line-height: 1.4;
}
.sg-toc-item a:hover,
.sg-toc-item.sg-toc-active a {
    color: var(--sg-primary);
    border-left-color: var(--sg-primary);
    padding-left: 6px;
    font-weight: 600;
    text-decoration: none;
}

.sg-toc-sub a {
    padding-left: 14px;
    font-size: 14px;
    color: var(--sg-muted);
}
.sg-toc-sub a:hover {
    color: var(--sg-primary);
}

/* Categories list — same style as recent-news list items */
.sg-cats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sg-cats-list li {
    border-bottom: 1px solid var(--sg-border);
}
.sg-cats-list li:last-child { border-bottom: none; }
.sg-cats-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 4px;
    color: var(--sg-text);
    font-size: 14px;
    text-decoration: none;
    transition: color var(--sg-trans);
}
.sg-cats-list a:hover {
    color: var(--sg-primary);
    text-decoration: none;
}
.sg-cat-check {
    color: var(--sg-primary);
    font-size: 14px;
}

/* ================================================================
   BLOG DETAIL — FAQ Section  (eael-adv-accordion structure)
   ================================================================ */

.sg-faq-section {
    margin-top: 0;
    margin-bottom: 36px;
    padding: 40px 32px;
    border-top: none;
    background: #ede8ff;
    border-radius: 16px;
}

/* Centered heading with gradient pill */
.sg-faq-heading {
    text-align: center;
    margin: 0 0 28px;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: 1;
}

.sg-faq-title-pill {
    display: inline-block;
    background: linear-gradient(135deg, #7c3aed 0%, #3bc4d4 100%);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    padding: 14px 52px;
    border-radius: 50px;
    letter-spacing: 0.02em;
}

.sg-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── EAEL accordion item — pill shape ── */
.sg-faq-section .eael-accordion-list {
    border: 2px solid #c4b5fd;
    border-radius: 50px;
    background: #fff;
    overflow: hidden;
    transition: border-radius 0.2s;
}

.sg-faq-section .eael-accordion-list:has(.eael-accordion-header.active) {
    border-radius: 20px;
}

/* ── Header row ── */
.sg-faq-section .eael-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 20px;
    background: transparent !important;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background var(--sg-trans);
    color: inherit;
    justify-content: flex-start;
}
.sg-faq-section .eael-accordion-header:hover {
    background: #f5f0ff !important;
}

.sg-faq-section .eael-accordion-header.active {
    background: transparent !important;
    color: inherit;
}
.sg-faq-section .eael-accordion-header.active .sg-faq-icon {
    transform: rotate(90deg);
    color: #7c3aed;
}

/* Numbered gradient circle */
.sg-faq-num {
    min-width: 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #3bc4d4 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* Question text */
.sg-faq-q-text {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.5;
}

/* Chevron icon */
.sg-faq-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    color: #7c3aed;
    transition: transform var(--sg-trans);
}

/* ── Answer panel — hidden by default, visible when .active ── */
.sg-faq-section .eael-accordion-content {
    display: none;
    padding: 0 20px 18px 70px;
    background: #fff;
    animation: sg-faq-open 0.2s ease;
}
.sg-faq-section .eael-accordion-content.active {
    display: block;
}
.sg-faq-section .eael-accordion-content p {
    margin: 0;
    font-size: 16px;
    color: #444;
    line-height: 1.3;
    border-top: 1px solid #e9d5ff;
    padding-top: 12px;
}

@keyframes sg-faq-open {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   HOME PAGE — EAEL FAQ accordion: 900px wide, centred
   ================================================================ */

.home .eael-adv-accordion {
    max-width: 900px;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ================================================================
   BLOG DETAIL — CTA Banner  (Change 7)
   ================================================================ */

.sg-cta-banner {
    margin: 36px 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--sg-primary) 0%, #003f6c 100%);
    padding: 40px 36px;
    color: #fff;
}

.sg-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
}

.sg-cta-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
}

.sg-cta-desc {
    font-size: 0.92rem;
    margin: 0;
    color: rgba(255,255,255,0.88);
    max-width: 560px;
    line-height: 1.6;
}

.sg-cta-action { flex-shrink: 0; }

.sg-cta-btn {
    display: inline-block;
    padding: 14px 30px;
    background: #fff;
    color: var(--sg-primary);
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: 30px;
    text-decoration: none;
    transition: all var(--sg-trans);
    white-space: nowrap;
}
.sg-cta-btn:hover {
    background: var(--sg-accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    text-decoration: none;
}

@media (max-width: 600px) {
    .sg-cta-inner { flex-direction: column; text-align: center; }
    .sg-cta-banner { padding: 28px 20px; }
}

/* ================================================================
   BLOG DETAIL — Share On  (Change 8)
   ================================================================ */

.sg-share-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.sg-share-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--sg-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    line-height: 1;
    display: flex;
    align-items: center;
}

.sg-share-icons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Remove margin-bottom from theme's share-post inside blog-post */
.blog-post .share-post {
    margin-bottom: 0 !important;
}

/* ================================================================
   BLOG DETAIL — hide original comments, hide old share-post block
   ================================================================ */
#comments,
.comment-section {
    display: none !important;
}

/* ================================================================
   Misc utility — breadcrumb improvements
   ================================================================ */

.custom-breadcrumb {
    font-size: 14px;
    color: var(--sg-muted);
    margin-bottom: 14px;
}
.custom-breadcrumb .separator {
    margin: 0 6px;
    color: var(--sg-border);
}
.custom-breadcrumb a {
    color: var(--sg-primary);
    text-decoration: none;
}
.custom-breadcrumb a:hover { text-decoration: underline; }

/* ================================================================
   WP Latest Posts block — force black title colour
   ================================================================ */

.wp-block-latest-posts__post-title,
.wp-block-latest-posts__post-title:visited {
    color: #111 !important;
}
.wp-block-latest-posts__post-title:hover {
    color: var(--sg-primary) !important;
}
