/* ============================================
   CHAMPION GUIDE LAYOUT — /guides/{slug}
   Dark mode is default. Light mode overrides below.
   ============================================ */

/* ---------- Loading ---------- */
.cg-loading {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 16px;
    color: rgba(255,255,255,0.6) !important;
}
.cg-loading__spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: cg-spin 0.8s linear infinite;
}
@keyframes cg-spin { to { transform: rotate(360deg); } }

/* ---------- Hero ---------- */
.cg-hero {
    position: relative;
    width: 100%;
    min-height: 340px;
    background-size: cover !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.cg-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 17, 21, 0.97) 0%,
        rgba(15, 17, 21, 0.8) 40%,
        rgba(15, 17, 21, 0.3) 100%
    ) !important;
    z-index: 1;
}
.cg-hero__content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 24px 32px;
}
.cg-hero__name {
    font-size: 3rem !important;
    font-weight: 800 !important;
    color: #fff !important;
    margin: 8px 0 4px !important;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.cg-hero__subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.7) !important;
    margin: 0 0 12px !important;
    font-style: italic;
}
.cg-hero__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.cg-hero__badge {
    background: rgba(0, 212, 255, 0.15) !important;
    color: #00d4ff !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(0, 212, 255, 0.3);
}
.cg-hero__read-time {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255,255,255,0.5) !important;
    font-size: 0.85rem;
}

/* ---------- Body Layout ---------- */
.cg-body {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    gap: 40px;
}

/* ---------- Sidebar ---------- */
.cg-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.cg-toc {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    padding: 20px;
}
.cg-toc__title {
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4) !important;
    margin: 0 0 14px !important;
    font-weight: 600;
}
.cg-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cg-toc__item { margin: 0; }
.cg-toc__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    color: rgba(255,255,255,0.6) !important;
    text-decoration: none !important;
    font-size: 0.82rem;
    transition: all 0.2s ease;
    line-height: 1.3;
}
.cg-toc__link:hover {
    background: rgba(0, 212, 255, 0.08) !important;
    color: #00d4ff !important;
}
.cg-toc__num {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.06) !important;
    color: rgba(255,255,255,0.35) !important;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}
.cg-toc__link:hover .cg-toc__num {
    background: rgba(0, 212, 255, 0.15) !important;
    color: #00d4ff !important;
}

/* Sidebar CTA */
.cg-sidebar-cta {
    margin-top: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(168, 85, 247, 0.08)) !important;
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    text-align: center;
}
.cg-sidebar-cta__text {
    color: rgba(255,255,255,0.7) !important;
    font-size: 0.85rem;
    margin: 0 0 12px !important;
}
.cg-sidebar-cta__btn {
    display: inline-block;
    padding: 8px 24px;
    background: linear-gradient(135deg, #00d4ff, #a855f7) !important;
    color: #fff !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
}
.cg-sidebar-cta__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

/* ---------- Content ---------- */
.cg-content {
    flex: 1;
    min-width: 0;
}

/* Mobile TOC */
.cg-toc-mobile {
    display: none;
    margin-bottom: 24px;
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px;
    overflow: hidden;
}
.cg-toc-mobile__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    cursor: pointer;
    color: rgba(255,255,255,0.7) !important;
    font-weight: 600;
    font-size: 0.9rem;
}
.cg-toc-mobile__list {
    list-style: none;
    padding: 0 16px 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cg-toc-mobile__list a {
    display: block;
    padding: 8px 12px;
    color: rgba(255,255,255,0.6) !important;
    text-decoration: none !important;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.cg-toc-mobile__list a:hover {
    background: rgba(0, 212, 255, 0.08) !important;
    color: #00d4ff !important;
}

/* ---------- Prose (article content) ---------- */
.cg-prose {
    color: rgba(255,255,255,0.85) !important;
    font-size: 1.05rem;
    line-height: 1.75;
}
.cg-prose h2 {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 2.5rem 0 1rem !important;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.2);
}
.cg-prose h3 {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    color: rgba(255,255,255,0.9) !important;
    margin: 1.8rem 0 0.8rem !important;
}
.cg-prose p {
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.8) !important;
}
.cg-prose a {
    color: #00d4ff !important;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    transition: border-color 0.2s;
}
.cg-prose a:hover {
    border-bottom-color: #00d4ff;
}
.cg-prose strong {
    color: #fff !important;
    font-weight: 600;
}
.cg-prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color) !important;
}
.cg-prose table th,
.cg-prose table td {
    padding: 12px 16px;
    border: 1px solid var(--border-color) !important;
}
.cg-prose table th {
    background: rgba(255,255,255,0.05) !important;
    color: rgba(255,255,255,0.9) !important;
    font-weight: 600;
}
.cg-prose table td {
    color: rgba(255,255,255,0.75) !important;
}
.cg-prose .badge {
    font-size: 0.9em !important;
    padding: 0.35em 0.7em !important;
}
/* Override Bootstrap .btn-primary inside guide prose (markdown CTA buttons) */
.cg-prose .btn-primary {
    background: linear-gradient(135deg, #00d4ff, #a855f7) !important;
    border: none !important;
    color: #fff !important;
}

/* ---------- Footer ---------- */
.cg-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.cg-footer__cta {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.06), rgba(168, 85, 247, 0.06)) !important;
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
}
.cg-footer__cta-inner p {
    color: rgba(255,255,255,0.7) !important;
    margin: 8px 0 20px !important;
    font-size: 1rem;
}
.cg-footer__cta-inner a:not(.cg-footer__back-btn) {
    color: #00d4ff !important;
}
.cg-footer__cta-label {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff !important;
}
.cg-footer__cta-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.cg-footer__cta-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #00d4ff, #a855f7) !important;
    color: #fff !important;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}
.cg-footer__cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
}
.cg-footer__back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.5) !important;
    text-decoration: none !important;
    border-bottom: none !important;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.cg-footer__back-btn:hover {
    color: rgba(255,255,255,0.8) !important;
    border-bottom: none !important;
}

/* ---------- Not Found ---------- */
.cg-not-found {
    text-align: center;
    padding: 80px 24px;
    color: rgba(255,255,255,0.6) !important;
}
.cg-not-found h1 {
    color: #fff !important;
    margin-bottom: 8px !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
    .cg-sidebar { display: none; }
    .cg-toc-mobile { display: block; }
    .cg-body { padding: 24px 16px 40px; }
    .cg-hero__name { font-size: 2.2rem !important; }
    .cg-hero__content { padding: 40px 16px 24px; }
    .cg-hero { min-height: 260px; }
}
@media (max-width: 480px) {
    .cg-hero__name { font-size: 1.8rem !important; }
    .cg-hero { min-height: 220px; }
    .cg-prose { font-size: 0.95rem; }
    .cg-prose h2 { font-size: 1.3rem !important; }
    .cg-footer__cta { padding: 24px 16px; }
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
html[data-theme="light"] .cg-loading {
    color: rgba(0,0,0,0.5) !important;
}
html[data-theme="light"] .cg-loading__spinner {
    border-color: rgba(0,0,0,0.1);
    border-top-color: #0a7ea4;
}
html[data-theme="light"] .cg-hero__overlay {
    background: linear-gradient(
        to top,
        rgba(250, 250, 250, 0.97) 0%,
        rgba(250, 250, 250, 0.8) 40%,
        rgba(250, 250, 250, 0.2) 100%
    ) !important;
}
html[data-theme="light"] .cg-hero__name {
    color: #1a1a2e !important;
    text-shadow: none;
}
html[data-theme="light"] .cg-hero__subtitle {
    color: rgba(0,0,0,0.55) !important;
}
html[data-theme="light"] .cg-hero__badge {
    background: rgba(10, 126, 164, 0.1) !important;
    color: #0a7ea4 !important;
    border-color: rgba(10, 126, 164, 0.25);
}
html[data-theme="light"] .cg-hero__read-time {
    color: rgba(0,0,0,0.45) !important;
}

/* Sidebar light */
html[data-theme="light"] .cg-toc {
    background: rgba(0,0,0,0.02) !important;
    border-color: #ddd !important;
}
html[data-theme="light"] .cg-toc__title {
    color: rgba(0,0,0,0.4) !important;
}
html[data-theme="light"] .cg-toc__link {
    color: rgba(0,0,0,0.55) !important;
}
html[data-theme="light"] .cg-toc__link:hover {
    background: rgba(10, 126, 164, 0.06) !important;
    color: #0a7ea4 !important;
}
html[data-theme="light"] .cg-toc__num {
    background: rgba(0,0,0,0.05) !important;
    color: rgba(0,0,0,0.35) !important;
}
html[data-theme="light"] .cg-toc__link:hover .cg-toc__num {
    background: rgba(10, 126, 164, 0.1) !important;
    color: #0a7ea4 !important;
}
html[data-theme="light"] .cg-sidebar-cta {
    background: linear-gradient(135deg, rgba(10, 126, 164, 0.06), rgba(124, 58, 237, 0.06)) !important;
    border-color: rgba(10, 126, 164, 0.15);
}
html[data-theme="light"] .cg-sidebar-cta__text {
    color: rgba(0,0,0,0.6) !important;
}
html[data-theme="light"] .cg-sidebar-cta__btn {
    background: linear-gradient(135deg, #0a7ea4, #7c3aed) !important;
}

/* Content light */
html[data-theme="light"] .cg-toc-mobile {
    background: rgba(0,0,0,0.02) !important;
    border-color: #ddd !important;
}
html[data-theme="light"] .cg-toc-mobile__toggle {
    color: rgba(0,0,0,0.6) !important;
}
html[data-theme="light"] .cg-toc-mobile__list a {
    color: rgba(0,0,0,0.55) !important;
}
html[data-theme="light"] .cg-toc-mobile__list a:hover {
    background: rgba(10, 126, 164, 0.06) !important;
    color: #0a7ea4 !important;
}
html[data-theme="light"] .cg-prose {
    color: rgba(0,0,0,0.8) !important;
}
html[data-theme="light"] .cg-prose h2 {
    color: #1a1a2e !important;
    border-bottom-color: rgba(10, 126, 164, 0.2);
}
html[data-theme="light"] .cg-prose h3 {
    color: rgba(0,0,0,0.85) !important;
}
html[data-theme="light"] .cg-prose p {
    color: rgba(0,0,0,0.75) !important;
}
html[data-theme="light"] .cg-prose a {
    color: #0a7ea4 !important;
    border-bottom-color: rgba(10, 126, 164, 0.3);
}
html[data-theme="light"] .cg-prose a:hover {
    border-bottom-color: #0a7ea4;
}
html[data-theme="light"] .cg-prose strong {
    color: #1a1a2e !important;
}
html[data-theme="light"] .cg-prose table th {
    background: rgba(0,0,0,0.03) !important;
    color: #1a1a2e !important;
}
html[data-theme="light"] .cg-prose table td {
    color: rgba(0,0,0,0.7) !important;
}

/* Footer light */
html[data-theme="light"] .cg-footer__cta {
    background: linear-gradient(135deg, rgba(10, 126, 164, 0.04), rgba(124, 58, 237, 0.04)) !important;
    border-color: rgba(10, 126, 164, 0.12);
}
html[data-theme="light"] .cg-footer__cta-label {
    color: #1a1a2e !important;
}
html[data-theme="light"] .cg-footer__cta-inner p {
    color: rgba(0,0,0,0.6) !important;
}
html[data-theme="light"] .cg-footer__cta-inner a:not(.cg-footer__back-btn) {
    color: #0a7ea4 !important;
}
html[data-theme="light"] .cg-footer__cta-btn {
    background: linear-gradient(135deg, #0a7ea4, #7c3aed) !important;
}
html[data-theme="light"] .cg-footer__back-btn {
    color: rgba(0,0,0,0.4) !important;
}
html[data-theme="light"] .cg-footer__back-btn:hover {
    color: rgba(0,0,0,0.7) !important;
}
html[data-theme="light"] .cg-prose .badge {
    /* badges keep their own colors */
}
html[data-theme="light"] .cg-prose .btn-primary {
    background: linear-gradient(135deg, #0a7ea4, #7c3aed) !important;
}
html[data-theme="light"] .cg-not-found {
    color: rgba(0,0,0,0.5) !important;
}
html[data-theme="light"] .cg-not-found h1 {
    color: #1a1a2e !important;
}
