/**
 * Project Page Improvements
 * Addresses feedback: gallery grid, better layout, portfolio feel
 */

/* ==========================================================================
   Single Project Page - Portfolio Landing Page Style
   ========================================================================== */

/* Hero - Make it more impactful */
.single-project .single-project-hero {
    width: 100%;
    height: 75vh;
    min-height: 550px;
    max-height: 850px;
    position: relative;
    margin-bottom: 0;
    background: var(--color-primary);
}

.single-project .single-project-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Content Layout - Two columns for text + sidebar */
.single-project .single-project-content {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 3rem;
    align-items: flex-start;
}

.single-project .project-main-content {
    min-width: 0;
    max-width: 760px;
}

/* Entry Content - Better typography, fix code block issue */
.single-project .entry-content {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--color-text);
}

.single-project .entry-content p {
    margin-bottom: 1.5rem;
}

.single-project .entry-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-size: 1.875rem;
    font-weight: 400;
}

.single-project .entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 400;
}

/* FIX: Remove code block styling - make it normal text */
.single-project .entry-content pre,
.single-project .entry-content code,
.single-project .entry-content .wp-block-code {
    font-family: var(--font-primary);
    font-size: inherit;
    background: none;
    padding: 0;
    margin: 0;
    white-space: normal;
    word-wrap: break-word;
    border: none;
}

.single-project .entry-content pre code {
    display: inline;
}

/* Sidebar - Make it feel like project data, not blog meta */
.single-project .project-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
    background: var(--color-background-alt);
    padding: 2rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.single-project .project-sidebar h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.75rem;
    font-weight: 600;
    color: var(--color-primary);
}

.single-project .project-meta-item {
    margin-bottom: 1.5rem;
}

.single-project .project-meta-item:last-of-type {
    margin-bottom: 0;
}

.single-project .project-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-light);
    margin-bottom: 0.375rem;
    font-weight: 600;
}

.single-project .project-meta-value {
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.6;
    font-weight: 500;
}

/* Share & CTA */
.single-project .project-share {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.single-project .share-buttons {
    display: flex;
    gap: 0.5rem;
}

.single-project .share-buttons a {
    padding: 0.75rem;
    background: var(--color-primary);
    color: white !important;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.single-project .share-buttons a:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    opacity: 1;
}

.single-project .project-cta {
    margin-top: 2.5rem;
    padding: 2rem;
    background: var(--color-primary);
    color: white;
    border-radius: 8px;
    text-align: center;
}

.single-project .project-cta h4 {
    color: white !important;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.single-project .project-cta p {
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
    opacity: 0.95;
    line-height: 1.6;
}

.single-project .project-cta .btn {
    background: white;
    color: var(--color-primary);
    border-color: white;
    width: 100%;
    display: inline-block;
    padding: 1rem 1.5rem;
    font-weight: 600;
    text-align: center;
}

.single-project .project-cta .btn:hover {
    background: var(--color-background-alt);
    border-color: var(--color-background-alt);
    color: var(--color-primary);
}

/* ==========================================================================
   Gallery - GRID LAYOUT (No More Scroll Parade!)
   ========================================================================== */

.single-project .project-gallery-section {
    margin-top: 4rem;
    grid-column: 1 / -1; /* Span full width across both columns */
}

.single-project .project-gallery-section h2 {
    font-size: clamp(1.875rem, 3vw, 2.5rem);
    margin-bottom: 2rem;
    font-weight: 300;
}

/* THE FIX: Proper grid instead of vertical scroll */
.single-project .project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.single-project .project-gallery-item {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-background-alt);
    border-radius: 8px;
}

.single-project .project-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.single-project .project-gallery-item:hover img {
    transform: scale(1.06);
}

/* Optional: "Show more" toggle for large galleries */
.project-gallery-more {
    margin-top: 2.5rem;
    cursor: pointer;
}

.project-gallery-more > summary {
    list-style: none;
    font-weight: 600;
    font-size: 1.0625rem;
    text-decoration: underline;
    margin-bottom: 1.75rem;
    color: var(--color-primary);
    cursor: pointer;
    display: inline-block;
}

/* Remove browser default summary markers */
.project-gallery-more > summary::-webkit-details-marker {
    display: none;
}

.project-gallery-more > summary:hover {
    color: var(--color-secondary);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 968px) {
    .single-project .single-project-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        margin-top: 2rem;
    }

    .single-project .project-sidebar {
        position: relative;
        top: 0;
        order: 2;
    }

    .single-project .project-main-content {
        order: 1;
        max-width: 100%;
    }

    .single-project .project-gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.25rem;
    }

    .single-project .single-project-hero {
        height: 55vh;
        min-height: 450px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .single-project .entry-content {
        font-size: 1rem;
    }

    .single-project .single-project-content {
        padding: 0 var(--spacing-sm);
        margin-top: 1.5rem;
        gap: 2rem;
    }

    .single-project .project-sidebar {
        padding: 1.5rem;
    }

    .single-project .project-cta {
        padding: 1.5rem;
    }

    .single-project .project-gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .single-project .project-gallery-section {
        margin-top: 3rem;
    }

    .single-project .single-project-hero {
        height: 45vh;
        min-height: 350px;
    }
}
