/* ========================================
   GUIDE ARTICLE CSS - All article styling
   ======================================== */

/* ─── Layout & Grid ──────────────────────── */

.guide-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 2rem;
}

.guide-main {
    padding: 1.5rem;
}

.guide-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
    max-width: 220px;
    width: 100%;
}

.guide-layout-section {
    margin: 2rem 0;
}

/* ─── Breadcrumbs ────────────────────────── */

.guide-breadcrumbs {
    border-bottom: 1px solid var(--black-border, #e0e0e0);
    margin-bottom: 2rem;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 1rem 0;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
    content: "→";
    margin: 0 0.75rem;
    color: var(--text-muted, #6b7280);
}

.breadcrumb-list a {
    color: var(--link-color, #3b82f6);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-list a:hover {
    color: var(--link-hover, #1d4ed8);
    text-decoration: underline;
}

.breadcrumb-list .active {
    color: var(--text-primary, #0f172a);
    font-weight: 600;
}

/* ─── Page Hero (in frontend.php) ────────── */

.page-hero {
    border-bottom: 1px solid var(--glass-border, rgba(180, 210, 255, 0.95));
    margin-bottom: 2rem;
}

.page-hero h1 {
    margin: 0 0 1rem 0;
    font-size: clamp(2rem, 6vw, 3rem);
    color: var(--text-primary, #0f172a);
}

.page-hero p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-secondary, #334155);
    max-width: 700px;
    line-height: 1.6;
}

.guide-meta-line {
    font-size: 0.9rem;
    color: var(--text-muted, #6b7280);
    margin-top: 1rem !important;
    padding-top: 1rem;
    border-top: 1px solid var(--black-border, #e0e0e0);
}

/* ─── Sidebar Sections ───────────────────── */

.sidebar-section {
    background: var(--black-card, #ffffff);
    border: 1px solid var(--black-border, #e0e0e0);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.sidebar-section h4 {
    color: var(--text-primary, #0f172a);
    font-size: 1rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--violet-main, #a855f7);
}

.sidebar-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-section li {
    margin-bottom: 0.5rem;
}

.sidebar-section a {
    color: var(--link-color, #3b82f6);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.sidebar-section a:hover {
    color: var(--link-hover, #1d4ed8);
    text-decoration: underline;
}

/* ─── Top Action Buttons (Full Width Bar) ── */

.guide-top-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--black-border, #e0e0e0);
}

.guide-top-actions button {
    flex: 1;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    border: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    min-height: 44px;
}

/* ─── Sidebar Action Buttons (kept for backward compatibility) ── */

.sidebar-action-buttons {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--black-border, #e0e0e0);
    display: none; /* Hidden since buttons moved to top */
}

.sidebar-action-buttons button {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    border: none;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-share {
    background: var(--btn-primary-bg, linear-gradient(135deg, #3b82f6, #1e40af));
    color: white;
}

.btn-share:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-bookmark {
    background: var(--black-card2, #ffffff);
    color: var(--text-primary, #0f172a);
    border: 1px solid var(--black-border, #e0e0e0);
}

.btn-bookmark:hover {
    background: var(--black-card, #f8f9fa);
    border-color: var(--violet-main, #a855f7);
}

/* ─── TOC Box ────────────────────────────── */

.toc-box {
    background: var(--black, #08041a);
    padding: 0.75rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--black-border, #e0e0e0);
}

.toc-box h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #0f172a);
    font-size: 0.85rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--violet-main, #a855f7);
}

.toc-box ol {
    margin: 0;
    padding-left: 1rem;
    list-style: none;
    counter-reset: item;
}

.toc-box li {
    margin-bottom: 0.3rem;
    counter-increment: item;
    line-height: 1.3;
}

.toc-box li::before {
    content: counter(item) ". ";
    font-weight: 600;
    color: var(--violet-main, #a855f7);
    font-size: 0.75rem;
}

.toc-box a {
    color: var(--link-color, #3b82f6);
    text-decoration: none;
    font-size: 0.8rem;
    display: inline;
    padding: 0;
    transition: color 0.2s ease;
    line-height: 1.3;
    word-break: break-word;
}

.toc-box a:hover {
    color: var(--link-hover, #1d4ed8);
    text-decoration: underline;
}

.toc-box a.toc-active {
    color: var(--violet-main, #a855f7);
    font-weight: 600;
    padding-left: 0.5rem;
}

/* ─── Guide Content ──────────────────────── */

.guide-section {
    margin: 2.5rem 0;
}

.guide-section h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: var(--text-primary, #0f172a);
    border-bottom: 2px solid var(--violet-main, #a855f7);
    padding-bottom: 0.75rem;
}

.guide-section h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    color: var(--text-primary, #0f172a);
}

.guide-section h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: var(--text-primary, #0f172a);
}

.guide-section p {
    color: var(--text-secondary, #334155);
    line-height: 1.8;
    margin: 1rem 0;
    font-size: 1rem;
}

.guide-section ul,
.guide-section ol {
    padding-left: 2rem;
    color: var(--text-secondary, #334155);
    margin: 1rem 0;
}

.guide-section li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.guide-section strong {
    color: var(--text-primary, #0f172a);
    font-weight: 700;
}

.guide-section em {
    color: var(--text-secondary, #334155);
    font-style: italic;
}

.guide-section blockquote {
    border-left: 4px solid var(--violet-main, #a855f7);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--black-card, #ffffff);
    border-radius: 4px;
}

.guide-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border: 1px solid var(--black-border, #e0e0e0);
}

.guide-section th,
.guide-section td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--black-border, #e0e0e0);
}

.guide-section th {
    background: var(--black, #08041a);
    color: var(--text-primary, #0f172a);
    font-weight: 700;
}

/* ─── Disclaimer Boxes ───────────────────── */

.guide-top-disclaimer {
    background: rgba(251, 191, 36, 0.1);
    border-left: 4px solid var(--accent-color, #fbbf24);
    padding: 1.5rem;
    border-radius: 6px;
    margin: 2rem 0;
}

.guide-top-disclaimer h4 {
    margin-top: 0;
    color: var(--text-primary, #0f172a);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-top-disclaimer p {
    color: var(--text-secondary, #334155);
    margin: 0.5rem 0;
    line-height: 1.6;
}

.disclaimer-box {
    background: var(--black, #08041a);
    border-left: 4px solid var(--accent-color, #3b82f6);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid var(--black-border, #e0e0e0);
}

.disclaimer-box h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary, #0f172a);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disclaimer-box p {
    color: var(--text-secondary, #334155);
    margin: 0.5rem 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ─── Ad Placement ───────────────────────── */

.ad-placement {
    margin: 2rem 0;
    text-align: center;
    padding: 1rem;
}

/* ─── Key Takeaways Box ──────────────────── */

.key-takeaways {
    background: #fffbeb;
    border: 2px solid #f59e0b;
    border-left: 5px solid #f59e0b;
    border-radius: var(--r-md, 12px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
}

.key-takeaways__heading {
    color: #92400e;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.key-takeaways__list {
    margin: 0;
    padding-left: 1.25rem;
}

.key-takeaways__list li {
    font-size: 0.97rem;
    line-height: 1.6;
    margin-bottom: 0.4rem;
}

/* ─── Related Articles Section ──────────── */

.related-articles-section {
    background: var(--black-card, #ffffff);
    padding: 3rem 0;
}

.related-articles__heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0 0 1.5rem 0;
}

.related-articles__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.related-card {
    display: flex;
    flex-direction: column;
    background: var(--black-card2, #ffffff);
    border: 1px solid var(--black-border, #e0e0e0);
    border-radius: var(--r-md, 12px);
    padding: 1.25rem;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.15);
}

.related-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--violet-main, #a855f7);
    display: block;
    margin-bottom: 0.5rem;
}

.related-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.related-card__summary {
    font-size: 0.85rem;
    color: var(--text-secondary, #334155);
    opacity: 0.8;
    flex: 1;
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.related-card__read-time {
    font-size: 0.8rem;
    color: var(--violet-main, #a855f7);
    font-weight: 500;
}

/* ─── Dark Mode ──────────────────────────── */

[data-theme="dark"] .guide-section h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .guide-section h3,
[data-theme="dark"] .guide-section h4 {
    color: #cbd5e1;
}

[data-theme="dark"] .guide-section p {
    color: #cbd5e1;
}

[data-theme="dark"] .guide-section strong {
    color: #e2e8f0;
}

[data-theme="dark"] .sidebar-section {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .sidebar-section h4 {
    color: #e2e8f0;
    border-bottom-color: #8b5cf6;
}

[data-theme="dark"] .toc-box {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .toc-box h3 {
    color: #e2e8f0;
    border-bottom-color: #8b5cf6;
}

[data-theme="dark"] .disclaimer-box {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .guide-top-disclaimer {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
}

[data-theme="dark"] .key-takeaways {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

[data-theme="dark"] .key-takeaways__heading {
    color: #fbbf24;
}

[data-theme="dark"] .related-articles-section {
    background: #1e293b;
}

[data-theme="dark"] .related-card {
    background: #0f1629;
    border-color: #334155;
}

[data-theme="dark"] .related-card__title {
    color: #e2e8f0;
}

[data-theme="dark"] .related-card__summary {
    color: #cbd5e1;
}

/* ─── Responsive Design ──────────────────── */

@media (max-width: 768px) {
    .guide-content-wrapper {
        grid-template-columns: 1fr;
    }

    .guide-sidebar {
        position: static;
        margin-top: 2rem;
    }

    .guide-main {
        padding: 1.5rem;
    }

    .guide-top-actions {
        flex-direction: row;
    }

    .guide-top-actions button {
        flex: 1;
    }

    .page-hero h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .guide-section h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }

    .guide-section h3 {
        font-size: 1.2rem;
    }

    .breadcrumb-list li:not(:last-child)::after {
        content: "/";
        margin: 0 0.5rem;
    }
}

@media (max-width: 640px) {
    .guide-main {
        padding: 1rem;
    }

    .guide-top-actions {
        flex-direction: column;
    }

    .guide-top-actions button {
        width: 100%;
    }

    .sidebar-section {
        padding: 1rem;
    }

    .toc-box {
        padding: 1rem;
    }

    .disclaimer-box {
        padding: 1rem;
    }

    .guide-section h2 {
        font-size: 1.3rem;
    }

    .guide-section ul,
    .guide-section ol {
        padding-left: 1.5rem;
    }

    .guide-section table {
        font-size: 0.9rem;
    }

    .guide-section th,
    .guide-section td {
        padding: 0.75rem;
    }

    .page-hero p {
        font-size: 1rem;
    }
}
