/* ============================================
   SINGLE GUIDE PAGE - REDESIGNED LAYOUT
   Professional, Minimal, SEO-Optimized
   ============================================ */

/* ========== ROOT VARIABLES FOR CONSISTENCY ========== */
:root {
    --guide-max-width: 1200px;
    --guide-content-width: 860px;
    --guide-blue: #1e40af;
    --guide-blue-light: #3b82f6;
    --guide-dark: #0f172a;
    --guide-gray: #64748b;
    --guide-gray-light: #f1f5f9;
    --guide-border: #e2e8f0;
}

/* ========== HERO SECTION - FULL WIDTH ========== */
.guide-hero-section {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding: 0 0 48px;
}

.guide-hero-container {
    max-width: var(--guide-max-width);
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 3rem);
}

/* Hero Header Row - Tag & Meta */
.guide-hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-top: 16px;
}

.guide-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--guide-blue) 0%, var(--guide-blue-light) 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.guide-category-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    color: #fff;
}

.guide-meta-badges {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.guide-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--guide-gray);
}

.guide-meta-badge i {
    color: var(--guide-blue-light);
}

/* Hero Title */
.guide-hero-title {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--guide-dark);
    margin: 0 0 24px;
    letter-spacing: -0.025em;
    max-width: 900px;
}

/* Hero Subtitle/Excerpt */
.guide-hero-excerpt {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    line-height: 1.7;
    color: var(--guide-gray);
    max-width: 800px;
    margin: 0 0 32px;
}

/* Author Block */
.guide-author-block {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.guide-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--guide-border);
}

.guide-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guide-author-name {
    font-weight: 600;
    color: var(--guide-dark);
    font-size: 0.9375rem;
}

.guide-author-date {
    font-size: 0.8125rem;
    color: var(--guide-gray);
}

/* ========== HERO IMAGE - FULL WIDTH ========== */
.guide-hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: var(--guide-max-width);
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.15);
    background: var(--guide-gray-light);
}

.guide-hero-image {
    width: 100%;
    height: auto;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    display: block;
}

/* Fallback if no image */
.guide-hero-image-placeholder {
    width: 100%;
    aspect-ratio: 21 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--guide-blue) 0%, #667eea 100%);
    color: #fff;
    font-size: 64px;
}

/* ========== TLDR / SUMMARY SECTION ========== */
.guide-tldr-section {
    max-width: var(--guide-max-width);
    margin: -150px auto 0;
    padding: 0 clamp(1.5rem, 5vw, 3rem);
    position: relative;
    z-index: 10;
}

.guide-tldr-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

/* Decorative Gradient Line on top */
.guide-tldr-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
}

.guide-tldr-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 32px 16px;
}

.guide-tldr-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-radius: 8px;
    font-size: 0.9375rem;
}

.guide-tldr-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
}

.guide-tldr-content {
    padding: 0 32px 24px;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #334155;
}

.guide-tldr-content p {
    margin: 0;
}

.guide-tldr-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    padding: 12px 32px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
}

.guide-tldr-footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.guide-tldr-footer i {
    color: #3b82f6;
}

@media (max-width: 768px) {
    .guide-tldr-card {
        border-radius: 8px;
    }

    .guide-tldr-header {
        padding: 20px 20px 12px;
    }

    .guide-tldr-content {
        padding: 0 20px 20px;
        font-size: 1rem;
    }

    .guide-tldr-footer {
        padding: 12px 20px;
        justify-content: space-between;
    }
}

/* ========== MAIN CONTENT AREA - WIDE ========== */
.guide-content-wrapper {
    max-width: var(--guide-max-width);
    margin: 0 auto;
    padding: 60px clamp(1.5rem, 5vw, 3rem);
}

.guide-content-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    align-items: start;
}

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

/* Main Content Column */
.guide-main-content {
    max-width: var(--guide-content-width);
}

.guide-article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--guide-dark);
}

.guide-article-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--guide-dark);
    margin: 48px 0 20px;
    padding-top: 24px;
    border-top: 1px solid var(--guide-border);
}

.guide-article-body h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.guide-article-body h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--guide-dark);
    margin: 32px 0 16px;
}

.guide-article-body p {
    margin-bottom: 20px;
    max-width: 72ch;
}

.guide-article-body ul,
.guide-article-body ol {
    margin-bottom: 24px;
    padding-left: 24px;
    max-width: 72ch;
}

.guide-article-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.guide-article-body a {
    color: var(--guide-blue-light);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.guide-article-body a:hover {
    color: var(--guide-blue);
}

.guide-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px 0;
}

.guide-article-body blockquote {
    margin: 32px 0;
    padding: 20px 24px;
    background: var(--guide-gray-light);
    border-left: 4px solid var(--guide-blue-light);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #475569;
}

/* ========== SIDEBAR - STICKY TOC ========== */
.guide-sidebar {
    position: sticky;
    top: 24px;
}

.guide-toc-wrapper {
    background: #fff;
    border: 1px solid var(--guide-border);
    border-radius: 12px;
    overflow: hidden;
}

.guide-toc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: var(--guide-gray-light);
    border-bottom: 1px solid var(--guide-border);
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--guide-dark);
}

.guide-toc-header i {
    color: var(--guide-blue-light);
}

.guide-toc-list {
    padding: 16px 20px;
    max-height: 400px;
    overflow-y: auto;
}

.guide-toc-link {
    display: block;
    padding: 8px 0;
    font-size: 0.875rem;
    color: var(--guide-gray);
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -12px;
    transition: all 0.2s;
}

.guide-toc-link:hover {
    color: var(--guide-blue-light);
}

.guide-toc-link.active {
    color: var(--guide-blue);
    font-weight: 600;
    border-color: var(--guide-blue-light);
    background: rgba(59, 130, 246, 0.05);
}

/* Sidebar Stats */
.guide-sidebar-stats {
    margin-top: 20px;
    background: #fff;
    border: 1px solid var(--guide-border);
    border-radius: 12px;
    padding: 20px;
}

.guide-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--guide-border);
}

.guide-stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.guide-stat-item:first-child {
    padding-top: 0;
}

.guide-stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    color: var(--guide-blue-light);
    border-radius: 10px;
    font-size: 1rem;
}

.guide-stat-info strong {
    display: block;
    color: var(--guide-dark);
    font-size: 1rem;
}

.guide-stat-info span {
    font-size: 0.8125rem;
    color: var(--guide-gray);
}

/* ========== FAQ SECTION ========== */
.guide-faq-section {
    margin-top: 60px;
    padding-top: 48px;
    border-top: 1px solid var(--guide-border);
}

.guide-faq-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--guide-dark);
    margin-bottom: 24px;
}

.guide-faq-title i {
    color: var(--guide-blue-light);
}

/* ========== ARTICLE FOOTER ========== */
.guide-article-footer {
    margin-top: 60px;
    padding: 32px;
    background: var(--guide-gray-light);
    border-radius: 16px;
}

.guide-footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.guide-footer-text h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--guide-dark);
    margin: 0 0 4px;
}

.guide-footer-text p {
    font-size: 0.9375rem;
    color: var(--guide-gray);
    margin: 0;
}

.guide-share-buttons {
    display: flex;
    gap: 12px;
}

.guide-share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--guide-border);
    color: var(--guide-gray);
    text-decoration: none;
    transition: all 0.2s;
}

.guide-share-btn:hover {
    background: var(--guide-blue-light);
    border-color: var(--guide-blue-light);
    color: #fff;
    transform: translateY(-2px);
}

/* Tags Section */
.guide-tags-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.guide-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.guide-tags-list i {
    color: var(--guide-gray);
    margin-right: 4px;
}

.guide-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--guide-border);
    border-radius: 100px;
    font-size: 0.8125rem;
    color: var(--guide-gray);
    text-decoration: none;
    transition: all 0.2s;
}

.guide-tag:hover {
    background: var(--guide-blue-light);
    border-color: var(--guide-blue-light);
    color: #fff;
}

/* ========== RELATED POSTS ========== */
.guide-related-section {
    max-width: var(--guide-max-width);
    margin: 0 auto;
    padding: 60px clamp(1.5rem, 5vw, 3rem) 80px;
    border-top: 1px solid var(--guide-border);
}

.guide-related-header {
    text-align: center;
    margin-bottom: 40px;
}

.guide-related-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--guide-dark);
    margin: 0 0 8px;
}

.guide-related-header p {
    font-size: 1rem;
    color: var(--guide-gray);
    margin: 0;
}

.guide-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .guide-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .guide-related-grid {
        grid-template-columns: 1fr;
    }
}

.guide-related-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--guide-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
}

.guide-related-card:hover {
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.12);
    border-color: var(--guide-blue-light);
    transform: translateY(-4px);
}

.guide-related-thumb {
    height: 180px;
    background: var(--guide-gray-light);
    overflow: hidden;
}

.guide-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.guide-related-card:hover .guide-related-thumb img {
    transform: scale(1.05);
}

.guide-related-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.guide-related-date {
    font-size: 0.8125rem;
    color: var(--guide-gray);
    margin-bottom: 8px;
}

.guide-related-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--guide-dark);
    margin: 0;
    line-height: 1.4;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    .guide-hero-title {
        font-size: 2rem;
    }

    .guide-hero-image {
        aspect-ratio: 16 / 9;
    }

    .guide-tldr-section {
        margin-top: -32px;
    }

    .guide-tldr-card {
        border-radius: 8px;
    }

    .guide-content-wrapper {
        padding: 40px clamp(1rem, 4vw, 2rem);
    }

    .guide-article-body {
        font-size: 1.0625rem;
    }

    .guide-article-body h2 {
        font-size: 1.5rem;
    }

    .guide-article-body h3 {
        font-size: 1.25rem;
    }

    .guide-article-footer {
        padding: 24px;
    }

    .guide-sidebar {
        position: static;
        margin-top: 40px;
    }
}

/* ========== READING PROGRESS BAR ========== */
.guide-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--guide-blue) 0%, var(--guide-blue-light) 100%);
    z-index: 9999;
    transition: width 0.1s ease-out;
    border-radius: 0 2px 2px 0;
}

/* Back to top */
.guide-back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--guide-blue-light);
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 9998;
}

.guide-back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.guide-back-to-top:hover {
    background: var(--guide-blue);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.5);
}

/* Print Styles */
@media print {

    .guide-reading-progress,
    .guide-back-to-top,
    .guide-sidebar,
    .guide-share-buttons {
        display: none !important;
    }

    .guide-content-layout {
        grid-template-columns: 1fr;
    }
}