/* --- Global Detail Page Styles --- */

.project-header { 
    background-color: #0f172a;
    background-size: cover;
    background-position: center;
    color: white;
    padding: 40px 20px 80px;
    text-align: center;
}
.project-meta { 
    display: flex; 
    justify-content: center; 
    gap: 30px; 
    margin-top: 20px; 
    color: #94a3b8;
    font-size: 0.9rem;
}

.subtitle { 
    color: #94a3b8; 
    font-size: 1.1rem; 
    margin-top: 10px; 
}

/* --- Layout & Container --- */

.content-wrapper {
    margin: 20px auto; /* Centering the container */
    display: grid;
    /* First column fits the sidebar, second takes the rest */
    grid-template-columns: 340px 1fr; 
    gap: 40px; /* This creates the space between sidebar and text */
    max-width: 1400px; /* Limits how far they spread on huge screens */
    padding: 0 40px; 
    align-items: start;
}

/* --- Sidebar Styling --- */

.project-sidebar {
    position: sticky;
    top: 100px; 
    z-index: 10;
    align-self: start;
    width: 340px;
    background: white;
    padding: 24px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}
.sidebar-block { 
    margin-bottom: 25px; 
}

.sidebar-block h4 { 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    color: var(--text-muted); 
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.tool-tags { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
}

.tool-tags span {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.full-width { 
    width: 100%; 
    text-align: center; 
    margin: 5px 0; 
}

/* --- Main Content Area --- */

.project-main-content { 
    width: 100%; /* Take up the full 1fr column */
    max-width: 850px; 
    margin: 0; /* Let the grid gap handle the spacing */
    line-height: 1.7;
    color: #334155;
}

/* Add this to remove extra spacing from the first heading */
.project-main-content .text-block:first-of-type h2 {
    margin-top: 0; 
}

.back-link { 
    display: inline-block; 
    margin-bottom: 10px; /* Reduced from 25px */
    color: var(--primary); 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.back-link:hover { transform: translateX(-5px); }

.project-large-img { 
    width: 100%; 
    height: auto;
    max-height: 500px; /* Prevents vertical images from stretching too far */
    border-radius: 16px; 
    margin-bottom: 40px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
    object-fit: cover;
}

.text-block { 
    margin-bottom: 40px; 
}

.text-block h2 { 
    margin-top: 3rem;
    margin-bottom: 1rem;
    font-size: 1.85rem;
    border-bottom: 2px solid #f1f5f9; /* Subtle separator */
    padding-bottom: 10px;
}

.text-block h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.text-block p {
    margin-bottom: 1.5rem; /* Consistent spacing between paragraphs */
}

/* --- List & Solution Styling --- */

.text-block ul, 
.text-block ol {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.text-block li {
    margin-bottom: 1rem; /* Spacing between list items */
}

.text-block li strong {
    color: #0f172a;
    display: block; /* Moves the bold header to its own line */
    margin-bottom: 0.25rem;
}

/* Specific fix for your "Solution" steps */
.text-block ol > li {
    padding-left: 0.5rem;
}

.text-block ol p {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #475569;
}

/* --- Highlight Box & Stats --- */
.highlight-box {
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    padding: 24px;
    border-radius: 4px;
    margin: 3rem 0;
    font-style: italic;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.impact-stats {
    display: flex;
    gap: 40px;
    margin: 30px 0;
}

.stat-item { text-align: left; }

.stat-num { 
    display: block; 
    font-size: 2.2rem; 
    font-weight: 800; 
    color: var(--primary); 
}

.stat-label { 
    font-size: 0.85rem; 
    color: var(--text-muted); 
}

/* --- Gallery Section --- */

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* --- Responsive Fixes --- */

@media (max-width: 1000px) {
    .content-wrapper { 
        grid-template-columns: 1fr; 
        margin-top: 20px; 
        padding: 0 20px;
    }
    
    .project-sidebar { 
        position: relative; 
        top: 0; 
        border-radius: 15px; /* Restore all rounded corners on mobile */
        border-left: 1px solid #e2e8f0;
        margin: 0 0 40px 0;
        order: 2;
    }
    
    .project-main-content { 
        order: 1; 
    }
    
    .image-gallery { 
        grid-template-columns: 1fr; 
    }
}