/* Portfolio Page Specific Styles */

/* --- Portfolio Page Hero --- */
.portfolio-hero {
    padding: clamp(2rem, 5vw + 1rem, 6rem) 0 clamp(4rem, 5vw + 2rem, 6rem);
    background-color: var(--color-bg-body);
}

.portfolio-hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.portfolio-eyebrow {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

.portfolio-hero-content h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.portfolio-hero-content h1 span {
    color: #94a3b8; /* Subtle slate contrast */
}

.portfolio-hero-content p {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--color-text-muted);
    max-width: 650px;
    margin: 0 auto;
}

/* --- Premium Portfolio Grid --- */
.premium-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6rem 4rem;
    padding: 2rem 0;
}

.ppc-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 6rem 0;
}

.ppc-empty-state h3 {
    font-size: 1.75rem;
    color: #0f172a;
    margin-bottom: 1rem;
}

.ppc-empty-state p {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

.premium-project-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    group: hover; /* Conceptual, implemented via descendant selectors */
}

.ppc-image-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 1rem;
    overflow: hidden;
    background-color: var(--color-gray-100);
    margin-bottom: 2rem;
}

.ppc-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-project-card:hover .ppc-image-box img {
    transform: scale(1.05);
}

.ppc-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-weight: 500;
}

.ppc-hover-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.premium-project-card:hover .ppc-hover-overlay {
    opacity: 1;
}

.ppc-hover-btn {
    background-color: #ffffff;
    color: #0f172a;
    padding: 1rem 2rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1rem;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-project-card:hover .ppc-hover-btn {
    transform: translateY(0);
}

/* --- Metadata Editorial --- */
.ppc-meta {
    display: flex;
    flex-direction: column;
}

.ppc-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.ppc-title {
    font-size: 1.75rem;
    font-weight: 500;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.01em;
    word-break: break-word;
}

.ppc-category {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    background-color: rgba(37, 99, 235, 0.08);
    padding: 0.35rem 1rem;
    border-radius: 2rem;
    white-space: nowrap;
}

.ppc-desc {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin: 0;
}

/* --- Portfolio Detail Page --- */
.detail-hero {
    padding: clamp(2rem, 5vw + 1rem, 6rem) 0 clamp(4rem, 5vw + 2rem, 6rem);
    background-color: var(--color-bg-body);
}

.detail-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4rem;
    align-items: center;
}

.detail-hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.detail-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(37, 99, 235, 0.08); /* Light blue background */
    color: var(--color-primary);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.detail-hero h1 {
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1.15;
    margin-bottom: 1.5rem;
    color: #0f172a;
    letter-spacing: -0.02em;
    max-width: 100%;
}

.detail-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
}

.detail-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.meta-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
}

.detail-hero-visual {
    width: 100%;
}

.detail-hero-image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.1);
}

.detail-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dh-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 500;
}

/* --- Detail Content --- */
.detail-content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 4rem;
}

.detail-main {
    font-size: 1.125rem;
}

.detail-main h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.detail-main h2:first-child {
    margin-top: 0;
}

.detail-main p {
    color: var(--color-text-main);
    margin-bottom: 1.5rem;
}

.detail-sidebar {
    background-color: #f8fafc;
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    height: max-content;
    position: sticky;
    top: 100px;
}

.sidebar-box {
    margin-bottom: 2rem;
}
.sidebar-box:last-child {
    margin-bottom: 0;
}

.sidebar-box h4 {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.sidebar-box p, .sidebar-box ul {
    font-size: 1.125rem;
    color: #0f172a;
    font-weight: 500;
}

.sidebar-box ul li {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
}
.sidebar-box ul li::before {
    content: '•';
    color: var(--color-primary);
}

/* --- Project Gallery --- */
.project-gallery {
    margin-top: 5rem;
}

.project-gallery h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.gallery-item {
    width: 100%;
    aspect-ratio: 4/3;
    background: #e2e8f0;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 500;
}
.gallery-item.full-width {
    grid-column: 1 / -1;
    aspect-ratio: 21/9;
}

/* --- Portfolio Premium CTA (Typographic Climax) --- */
.portfolio-premium-cta {
    background-color: var(--color-bg-footer); /* Seamless fusion with footer */
    color: #ffffff;
    padding: 12rem 0 10rem;
    text-align: center;
}

.ppcta-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ppcta-eyebrow {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 2rem;
}

.ppcta-content h2 {
    font-size: clamp(3rem, 6.5vw, 6rem);
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    color: #ffffff;
}

.ppcta-content h2 em {
    font-style: italic;
    color: #94a3b8; /* Faded slate for editorial feel */
    font-family: Georgia, 'Times New Roman', Times, serif;
}

.ppcta-content p {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.btn-portfolio-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: var(--color-primary);
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
    padding: 1.25rem 3.5rem;
    border-radius: 4rem; /* Pill shape */
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-portfolio-cta:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5);
}

.btn-portfolio-cta .arrow {
    transition: transform 0.3s ease;
}

.btn-portfolio-cta:hover .arrow {
    transform: translateX(6px);
}

/* --- Portfolio Detail CTA & Back Nav --- */
.portfolio-detail-cta {
    padding-top: 4rem;
    max-width: 1100px;
    margin: 0 auto;
}

.pd-cta-box {
    background-color: var(--color-bg-footer); /* Deep Navy */
    border-radius: 1.5rem;
    padding: 5rem 4rem;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.4);
    margin-bottom: 2rem;
}

.pd-cta-eyebrow {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.pd-cta-box h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #ffffff;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.pd-cta-box p {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #cbd5e1;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.btn-pd-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: var(--color-primary);
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
    padding: 1.25rem 3rem;
    border-radius: 4rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-pd-cta:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5);
}

.btn-pd-cta .arrow {
    transition: transform 0.3s ease;
}

.btn-pd-cta:hover .arrow {
    transform: translateX(6px);
}

.pd-back-nav {
    text-align: center;
    padding-bottom: 4rem; /* Gap to the global footer */
}

.pd-back-nav .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.pd-back-nav .back-link .arrow {
    transition: transform 0.3s ease;
}

.pd-back-nav .back-link:hover {
    color: var(--color-primary);
}

.pd-back-nav .back-link:hover .arrow {
    transform: translateX(-4px);
}

/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    .premium-portfolio-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 5rem;
    }

    .detail-content-wrapper {
        grid-template-columns: minmax(0, 1fr);
        gap: 3rem;
    }
    
    .detail-sidebar {
        position: relative;
        top: 0;
    }
    
    .detail-hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 3rem;
    }
    
    .detail-hero h1 {
        font-size: 2.5rem;
    }
    
    .detail-meta-grid {
        gap: 2rem;
    }
}

@media (max-width: 767px) {
    .detail-hero h1 {
        font-size: 2.25rem;
    }
    
    .detail-description {
        font-size: 1.125rem;
    }
    
    .gallery-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    
    .gallery-item.full-width {
        aspect-ratio: 16/9;
    }

    .portfolio-premium-cta {
        padding: 8rem 0 6rem;
    }

    .btn-portfolio-cta {
        width: 100%;
        padding: 1rem 2rem;
    }
    
    .pd-cta-box {
        padding: 3rem 1.5rem;
        border-radius: 1rem;
    }
    
    .pd-cta-box p {
        font-size: 1.125rem;
    }
    
    .btn-pd-cta {
        width: 100%;
        padding: 1rem 1.5rem;
    }
}
