/* =========================================
   Guide Page Styles
   ========================================= */

/* --- Header Section --- */
.guide-header {
    padding: var(--space-4xl) 0 var(--space-2xl);
    text-align: center;
    background: linear-gradient(to bottom, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.guide-content {
    max-width: 800px;
    margin: 0 auto;
}

.guide-meta-top {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.article-category {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3em 0.8em;
    border-radius: var(--radius-full);
    background: var(--color-bg-soft);
    color: var(--color-text-light);
}

/* Category Specific Colors (using vars from style.css likely, otherwise defaults) */
.cat-hudpleje {
    background: var(--cat-hudpleje-bg, #fef5ee);
    color: var(--cat-hudpleje-dark, #c47a3f);
}

.cat-haarpleje {
    background: var(--cat-haarpleje-bg, #eef7fb);
    color: var(--cat-haarpleje-dark, #3a8ab0);
}

.cat-kosttilskud {
    background: var(--cat-kosttilskud-bg, #f0f8eb);
    color: var(--cat-kosttilskud-dark, #5a9c32);
}

.cat-wellness {
    background: var(--cat-wellness-bg, #fdf0f0);
    color: var(--cat-wellness-dark, #c45858);
}

.cat-soevn {
    background: var(--cat-soevn-bg, #f2f0fc);
    color: var(--cat-soevn-dark, #6060b0);
}

.article-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25em 0.6em;
    border-radius: 4px;
    border: 1px solid currentColor;
}

.badge-guide {
    color: var(--color-primary);
    background: var(--color-primary-subtle);
    border: none;
}

.badge-vs {
    color: #8e44ad;
    background: #f4ecf7;
    border: none;
}

.badge-anbefaling {
    color: var(--color-best);
    background: var(--color-best-bg);
    border: none;
}

.article-products {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.guide-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    color: var(--color-text);
}

.guide-excerpt {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--color-text-light);
    margin-bottom: var(--space-xl);
}

.guide-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-md);
    margin-top: var(--space-lg);
}

/* --- Content Section --- */
.guide-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: var(--space-4xl);
}

.guide-body h2 {
    font-size: 2rem;
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.guide-body h3 {
    font-size: 1.5rem;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.guide-body p {
    margin-bottom: var(--space-lg);
}

.guide-body ul,
.guide-body ol {
    margin-bottom: var(--space-lg);
    padding-left: var(--space-xl);
}

.guide-body li {
    margin-bottom: var(--space-xs);
}

.guide-body img {
    border-radius: var(--radius-lg);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
}

/* --- Step/Instruction styling (from template) --- */
.step-instruction {
    background: var(--color-bg-alt, #f9f9f9);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin: var(--space-xl) 0;
    border-left: 4px solid var(--color-primary);
}

.pro-tip {
    background: var(--color-primary-subtle, #e8f4fd);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.95em;
    margin-top: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    align-items: start;
}

/* =========================================
   Related Products Section (Copied from product.php) 
   ========================================= */
.related-products-section {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 2px solid var(--color-border-light);
    background: #fff;
    /* Ensure background is white if body is different */
    padding-bottom: 60px;
}

.related-products-section h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
}

.related-products-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 20px;
    padding-bottom: 20px;
    margin: 0 calc(-1 * var(--space-xl));
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.related-products-grid::-webkit-scrollbar {
    height: 8px;
}

.related-products-grid::-webkit-scrollbar-track {
    background: transparent;
}

.related-products-grid::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.related-products-grid::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

.related-products-grid .deal-card {
    min-width: 280px;
    max-width: 280px;
    scroll-snap-align: start;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-products-grid .deal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.deal-image-link {
    display: block;
    text-decoration: none;
}

.deal-image-link:hover .deal-image img {
    transform: scale(1.04);
}

.deal-title-link {
    text-decoration: none;
    color: inherit;
}

.deal-title-link:hover h4 {
    color: var(--color-primary);
}

.deal-image {
    position: relative;
    background: var(--color-bg-soft);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.deal-image img {
    transition: transform 0.3s ease;
}

.deal-discount {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: #dc2626;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9em;
}

.deal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 200px);
}

.deal-shop {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 4px;
}

.deal-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    flex-grow: 1;
    /* Push price/button down */
    color: #1e293b;
}

.deal-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.deal-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0d9488;
}

.deal-original {
    font-size: 0.9rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.deal-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #0f172a;
    color: white;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.deal-btn:hover {
    background: #1e293b;
}

@media (max-width: 1024px) {
    .related-products-grid .deal-card {
        min-width: 260px;
        max-width: 260px;
    }
}

@media (max-width: 640px) {
    .related-products-grid {
        margin: 0 calc(-1 * var(--space-md));
        padding-left: var(--space-md);
        padding-right: var(--space-md);
        gap: 16px;
    }

    .related-products-grid .deal-card {
        min-width: 240px;
        max-width: 240px;
    }

    .guide-header h1 {
        font-size: 2.5rem;
    }
}

/* =========================================
   Step Layout (Split-view) & Product Card
   ========================================= */

/* Step Container */
.guide-step {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 80px;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 40px;
}

/* Desktop view: Text left, Product right */
@media (min-width: 768px) {
    .guide-step {
        grid-template-columns: 3fr 2fr;
        /* 60% text, 40% product */
        align-items: start;
    }
}

/* Step Content Typography */
.step-content h2 {
    font-size: 1.8em;
    color: var(--color-text);
    margin-top: 0;
    font-family: var(--font-serif);
}

/* Product Card Styling (Specific to Guide Steps) */
.product-card-wrapper .product-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card-wrapper .product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Standardize images within step product cards */
.product-card-wrapper .product-image img {
    max-width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    margin-bottom: 20px;
}

.product-card-wrapper .product-brand {
    font-size: 0.85em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.product-card-wrapper .product-title {
    font-size: 1.25em;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--color-text);
    line-height: 1.3;
}

.product-card-wrapper .product-price {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--color-deal);
    margin-bottom: 20px;
}

.product-card-wrapper .btn-buy {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: background 0.2s;
    text-transform: none;
    /* Reset if specific styles interfere */
}

.product-card-wrapper .btn-buy:hover {
    background: var(--color-primary-dark);
}

/* =========================================
   Callout Boxes (Info, Warning, Success)
   ========================================= */
.guide-body .callout {
    padding: 20px 24px;
    margin: 24px 0;
    border-left: 4px solid #3b82f6;
    background: #eff6ff;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.95em;
    line-height: 1.7;
}

.guide-body .callout p:first-child {
    margin-top: 0;
}

.guide-body .callout p:last-child {
    margin-bottom: 0;
}

.guide-body .callout.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.guide-body .callout.success {
    border-left-color: #10b981;
    background: #ecfdf5;
}

/* =========================================
   Product Box (Inline Embed)
   ========================================= */
.guide-body .product-box {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 32px 0;
    background: var(--color-white);
    display: flex;
    gap: 24px;
    align-items: flex-start;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.guide-body .product-box:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.1);
}

.guide-body .product-box-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-alt);
}

.guide-body .product-box-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
}

.guide-body .product-box-content {
    flex: 1;
}

.guide-body .product-box-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--color-text);
    font-family: var(--font-sans);
}

.guide-body .product-box-brand {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0 0 12px 0;
}

.guide-body .product-box-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.guide-body .product-box-current-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.guide-body .product-original-price {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.guide-body .product-discount {
    background: #dc2626;
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.guide-body .product-box-shop {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0 0 16px 0;
}

.guide-body .product-box-button {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-base);
}

.guide-body .product-box-button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(45, 106, 79, 0.3);
}

@media (max-width: 640px) {
    .guide-body .product-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .guide-body .product-box-image {
        width: 100%;
        max-width: 200px;
        height: 200px;
    }

    .guide-body .product-box-price {
        justify-content: center;
    }

    .guide-body .product-box-button {
        display: block;
        width: 100%;
        text-align: center;
    }
}

/* =========================================
   Comparison Table
   ========================================= */
.guide-body .comparison-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0;
}

.guide-body .comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.guide-body .comparison-table th {
    background: var(--color-bg-alt);
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    color: var(--color-text);
}

.guide-body .comparison-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.guide-body .comparison-table tbody tr:hover {
    background: var(--color-bg-alt);
}

/* =========================================
   Pros/Cons Block
   ========================================= */
.guide-body .pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 32px 0;
}

.guide-body .pros-cons .pros-col,
.guide-body .pros-cons .cons-col {
    padding: 24px;
    border-radius: var(--radius-md);
}

.guide-body .pros-cons .pros-col {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
}

.guide-body .pros-cons .cons-col {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.guide-body .pros-cons h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.guide-body .pros-cons ul {
    padding-left: 20px;
    margin: 0;
    list-style: none;
}

.guide-body .pros-cons .pros-col li::before {
    content: '✅ ';
}

.guide-body .pros-cons .cons-col li::before {
    content: '❌ ';
}

.guide-body .pros-cons li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* =========================================
   FAQ Block
   ========================================= */
.guide-body .faq-block {
    margin: 32px 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.guide-body .faq-item {
    border-bottom: 1px solid var(--color-border-light);
}

.guide-body .faq-item:last-child {
    border-bottom: none;
}

.guide-body .faq-question {
    font-weight: 600;
    padding: 18px 24px;
    background: var(--color-bg-alt);
    margin: 0;
    cursor: pointer;
    transition: background var(--transition-base);
    position: relative;
    padding-right: 48px;
    user-select: none;
}

.guide-body .faq-question::after {
    content: '▼';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    font-size: 0.7em;
    color: var(--color-text-muted);
    transition: transform 0.25s ease;
}

.guide-body .faq-item.open .faq-question::after {
    transform: translateY(-50%) rotate(-180deg);
}

.guide-body .faq-question:hover {
    background: var(--color-border-light);
}

.guide-body .faq-answer {
    padding: 18px 24px;
    line-height: 1.7;
    display: none;
}

.guide-body .faq-item.open .faq-answer {
    display: block;
}

.guide-body .faq-answer p:last-child {
    margin-bottom: 0;
}

/* =========================================
   Key Stats Block
   ========================================= */
.guide-body .key-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 32px 0;
}

.guide-body .stat-box {
    text-align: center;
    padding: 28px 20px;
    background: #f0fdf4;
    border-radius: var(--radius-lg);
    border: 1px solid #d1fae5;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.guide-body .stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(45, 106, 79, 0.1);
}

.guide-body .stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-primary);
    display: block;
    font-family: var(--font-sans);
}

.guide-body .stat-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 6px;
    display: block;
}

/* =========================================
   Expert Quote Block
   ========================================= */
.guide-body .expert-quote {
    border-left: 4px solid var(--color-primary);
    padding: 28px 32px;
    margin: 32px 0;
    background: #f0fdf4;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-style: italic;
    font-size: 1.1em;
    line-height: 1.7;
    position: relative;
}

.guide-body .expert-quote::before {
    content: '"';
    font-size: 4rem;
    color: var(--color-primary);
    opacity: 0.3;
    position: absolute;
    top: 8px;
    left: 16px;
    font-family: Georgia, serif;
    line-height: 1;
}

.guide-body .expert-quote p {
    margin: 0;
    padding-left: 24px;
}

.guide-body .expert-quote .quote-source {
    font-style: normal;
    font-size: 0.85em;
    color: var(--color-text-muted);
    margin-top: 16px;
    display: block;
    padding-left: 24px;
    font-weight: 600;
}

/* =========================================
   CTA Box
   ========================================= */
.guide-body .cta-box {
    text-align: center;
    padding: 48px 32px;
    margin: 40px 0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0fdf4 100%);
    border: 2px solid #d1fae5;
    border-radius: var(--radius-lg);
}

.guide-body .cta-box h3 {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.guide-body .cta-box p {
    margin: 0 0 20px 0;
    color: var(--color-text-muted);
    font-size: 1.05rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.guide-body .cta-button {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 16px 36px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.2);
}

.guide-body .cta-button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(45, 106, 79, 0.3);
    color: white;
}

/* =========================================
   Numbered Steps Block
   ========================================= */
.guide-body .numbered-steps {
    margin: 32px 0;
    position: relative;
}

.guide-body .numbered-steps::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: #d1fae5;
}

.guide-body .numbered-step {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
    align-items: flex-start;
    position: relative;
}

.guide-body .numbered-step:last-child {
    margin-bottom: 0;
}

.guide-body .step-number {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.2);
    z-index: 1;
}

.guide-body .step-body {
    flex: 1;
    padding-top: 6px;
}

.guide-body .step-body h4 {
    margin: 0 0 8px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
}

.guide-body .step-body p {
    margin: 0;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* =========================================
   Responsive: New Blocks
   ========================================= */
@media (max-width: 640px) {
    .guide-body .pros-cons {
        grid-template-columns: 1fr;
    }

    .guide-body .key-stats {
        grid-template-columns: 1fr;
    }

    .guide-body .cta-box {
        padding: 32px 20px;
    }

    .guide-body .expert-quote {
        padding: 20px 24px;
    }

    .guide-body .expert-quote::before {
        display: none;
    }

    .guide-body .expert-quote p {
        padding-left: 0;
    }

    .guide-body .expert-quote .quote-source {
        padding-left: 0;
    }
}

/* =========================================
   Table of Contents (ToC)
   ========================================= */
.guide-toc {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    overflow: hidden;
}

.guide-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-base);
}

.guide-toc-header:hover {
    background: var(--color-border-light);
}

.toc-toggle {
    font-size: 0.7em;
    color: var(--color-text-muted);
    transition: transform var(--transition-base);
}

.guide-toc.collapsed .toc-toggle {
    transform: rotate(-90deg);
}

.guide-toc-list {
    padding: 0 24px 20px;
    margin: 0;
    counter-reset: toc-counter;
    list-style: none;
}

.guide-toc.collapsed .guide-toc-list {
    display: none;
}

.guide-toc-list li {
    counter-increment: toc-counter;
    margin-bottom: 6px;
}

.guide-toc-list li a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.6;
    transition: color var(--transition-base);
    display: block;
    padding: 4px 0;
}

.guide-toc-list li a::before {
    content: counter(toc-counter) '. ';
    color: var(--color-primary);
    font-weight: 600;
}

.guide-toc-list li a:hover {
    color: var(--color-primary);
}

.guide-toc-list li.toc-h3 {
    padding-left: 24px;
}

.guide-toc-list li.toc-h3 a {
    font-size: 0.9rem;
}

/* Smooth scroll for in-page anchors */
html {
    scroll-behavior: smooth;
}

/* Offset for fixed navbar */
.guide-body h2[id],
.guide-body h3[id] {
    scroll-margin-top: 80px;
}

/* =========================================
   Image Gallery
   ========================================= */
.guide-body .image-gallery {
    display: grid;
    gap: 16px;
    margin: 32px 0;
}

.guide-body .gallery-cols-2 {
    grid-template-columns: 1fr 1fr;
}

.guide-body .gallery-cols-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.guide-body .gallery-cols-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.guide-body .gallery-item {
    margin: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-alt);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.guide-body .gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.guide-body .gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-base);
}

.guide-body .gallery-item:hover img {
    transform: scale(1.03);
}

.guide-body .gallery-item figcaption {
    padding: 10px 16px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    background: var(--color-bg-alt);
    text-align: center;
    border-top: 1px solid var(--color-border-light);
}

/* =========================================
   Before/After Comparison
   ========================================= */
.guide-body .image-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 32px 0;
}

.guide-body .compare-side {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.guide-body .compare-side img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.guide-body .compare-label {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    backdrop-filter: blur(4px);
}

.guide-body .compare-before .compare-label {
    background: rgba(239, 68, 68, 0.8);
}

.guide-body .compare-after .compare-label {
    background: rgba(16, 185, 129, 0.8);
}

/* =========================================
   Responsive: Gallery & Compare
   ========================================= */
@media (max-width: 640px) {

    .guide-body .gallery-cols-3,
    .guide-body .gallery-cols-4 {
        grid-template-columns: 1fr 1fr;
    }

    .guide-body .gallery-item img {
        height: 160px;
    }

    .guide-body .image-compare {
        grid-template-columns: 1fr;
    }

    .guide-body .compare-side img {
        height: 200px;
    }
}

/* =========================================
   Reading Progress Bar
   ========================================= */
.reading-progress {
    position: absolute;
    /* Changed from fixed */
    bottom: 0;
    /* Changed from top: 60px */
    left: 0;
    width: 100%;
    height: 4px;
    /* Slightly thicker for visibility */
    background: rgba(0, 0, 0, 0.05);
    z-index: 1001;
    pointer-events: none;
    /* Prevent interference with clicks */
}

.reading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary) 0%, #10b981 100%);
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* =========================================
   Breadcrumbs
   ========================================= */
.guide-breadcrumb {
    padding: 10px 0;
    background: var(--color-bg-alt, #f8fafc);
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    font-size: 0.85rem;
}

.guide-breadcrumb a {
    color: var(--color-text-muted, #64748b);
    text-decoration: none;
    transition: color 0.2s;
}

.guide-breadcrumb a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--color-text-muted, #94a3b8);
    margin: 0 6px;
}

.breadcrumb-current {
    color: var(--color-text, #1e293b);
    font-weight: 500;
}

/* =========================================
   Hero/Featured Image
   ========================================= */
.guide-hero-wrapper {
    padding: var(--space-lg, 20px) 0 0;
}

.guide-hero-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.1));
}

/* Rename .guide-content to .guide-header-content to avoid class conflict */
.guide-header-content {
    max-width: 800px;
    margin: 0 auto;
}

/* =========================================
   3-Column Layout (Matas-Inspired)
   ========================================= */
.guide-layout {
    padding: var(--space-2xl, 40px) 0;
}

.guide-layout-grid {
    display: grid;
    grid-template-columns: 200px 1fr 240px;
    gap: 32px;
    align-items: start;
}

/* --- Guide Main Content --- */
.guide-main {
    min-width: 0;
    /* Prevent overflow */
}

/* --- Sidebars --- */
.guide-sidebar {
    font-size: 0.9rem;
}

.sidebar-sticky {
    position: sticky;
    top: 80px;
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-heading {
    font-family: var(--font-serif, Georgia, serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text, #1e293b);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border, #e2e8f0);
}

/* =========================================
   Left Sidebar: Related Guides
   ========================================= */
.sidebar-guides {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-guide-card {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    border-radius: var(--radius-md, 8px);
    transition: all 0.2s;
}

.sidebar-guide-card:hover {
    background: var(--color-bg-alt, #f8fafc);
    transform: translateX(4px);
}

.sidebar-guide-img {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm, 6px);
    overflow: hidden;
}

.sidebar-guide-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-guide-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-guide-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
}

.sidebar-guide-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-guide-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 2px;
}

/* =========================================
   Left Sidebar: Table of Contents
   ========================================= */
.sidebar-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-toc-list li {
    margin-bottom: 0;
}

.sidebar-toc-list li a {
    display: block;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: var(--color-text-light, #475569);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    line-height: 1.4;
}

.sidebar-toc-list li a:hover {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    background: var(--color-bg-alt, #f8fafc);
}

.sidebar-toc-h3 a {
    padding-left: 24px;
    font-size: 0.8rem;
}

/* =========================================
   Right Sidebar: Social Sharing & Author
   ========================================= */

/* Share Buttons */
.sidebar-share .sidebar-heading {
    font-size: 0.95rem;
    text-align: center;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-border, #e2e8f0);
    background: white;
    color: var(--color-text-muted, #64748b);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: white;
}

.share-twitter:hover {
    background: #0f1419;
    border-color: #0f1419;
    color: white;
}

.share-copy:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.share-copy.copied {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

/* Author Section */
.sidebar-author {
    text-align: center;
    padding: 20px;
    background: var(--color-bg-alt, #f8fafc);
    border-radius: var(--radius-lg, 12px);
}

.author-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #10b981 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-label {
    font-size: 0.8rem;
    color: var(--color-text-muted, #64748b);
}

.author-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text, #1e293b);
}

.author-date {
    font-size: 0.8rem;
    color: var(--color-text-muted, #64748b);
    margin-top: 4px;
}

.author-updated {
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 500;
}

/* =========================================
   Responsive: 3-Column Layout
   ========================================= */

/* Tablet: hide left sidebar, show inline ToC instead */
@media (max-width: 1100px) {
    .guide-layout-grid {
        grid-template-columns: 1fr 240px;
    }

    .guide-sidebar-left {
        display: none;
    }
}

/* Mobile: single column, sidebar below */
@media (max-width: 768px) {
    .guide-layout-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .guide-sidebar-right {
        order: -1;
    }

    .sidebar-sticky {
        position: static;
    }

    .sidebar-share .sidebar-heading {
        font-size: 0.85rem;
    }

    .share-buttons {
        gap: 8px;
    }

    .share-btn {
        width: 38px;
        height: 38px;
    }

    .sidebar-author {
        display: flex;
        text-align: left;
        gap: 16px;
        padding: 16px;
        align-items: center;
    }

    .author-avatar {
        width: 48px;
        height: 48px;
        margin: 0;
        flex-shrink: 0;
        font-size: 1.2rem;
    }

    .guide-hero-image {
        max-height: 280px;
        border-radius: var(--radius-md, 8px);
    }

    .guide-header h1 {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }

    .guide-stats {
        flex-wrap: wrap;
        font-size: 0.8rem;
    }
}

/* Mobile small: Related guide sidebar cards go full-width at bottom */
@media (max-width: 480px) {
    .guide-breadcrumb {
        font-size: 0.75rem;
    }

    .breadcrumb-sep {
        margin: 0 4px;
    }
}