/* Projects Page Styles */

:root {
    --bg-color: #FFFDF5;
    --primary-color: #1a1a1a;
    --accent-color: #d4af37;
    --white: #ffffff;
    --black: #1a1a1a;
    --text-gray: #666666;
    --border-color: rgba(26, 26, 26, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-color);
    overflow-x: hidden;
}

/* Projects Page Section */
.projects-page-section {
    padding: 180px 0 120px;
    min-height: 100vh;
    background: var(--bg-color);
    position: relative;
}

.projects-page-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
}

/* Page Header */
.projects-page-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 0 40px;
}

.projects-page-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(48px, 6vw, 96px);
    font-weight: 300;
    color: var(--primary-color);
    line-height: 1.2;
    letter-spacing: -2px;
    margin-bottom: 20px;
}

.projects-page-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(16px, 1.5vw, 20px);
    font-weight: 300;
    color: var(--text-gray);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.projects-page-divider {
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    margin: 0 auto;
}

/* Filter Buttons */
.projects-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 40px;
}

.filter-btn {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.3s ease;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transition: left 0.3s ease;
    z-index: -1;
}

.filter-btn:hover {
    color: var(--white) !important;
    border-color: var(--primary-color);
    background: var(--primary-color) !important;
}

.filter-btn:hover::before {
    left: 0;
    background: var(--primary-color);
}

.filter-btn.active {
    color: var(--white);
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.filter-btn.active::before {
    left: 0;
}

/* Projects Grid - Organized Layout */
/* Normal view: 3 columns (1 rectangular + 1 square per row) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 0;
    width: 100%;
    padding: 0 40px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    grid-auto-flow: row;
}

/* Zoomed out view: 4 columns (1 rectangular + 2 squares per row) */
.projects-grid.zoomed-out {
    grid-template-columns: repeat(4, 1fr);
}

.project-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    aspect-ratio: 1;
}

.project-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-item.hidden {
    display: none;
}

/* Different sizes for organized layout */
/* Rectangular: 2 columns wide, 1 row tall */
.project-item.size-rectangular {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 2 / 1;
}

/* Square: 1 column wide, 1 row tall */
.project-item.size-square {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 1 / 1;
}

/* Legacy size classes for compatibility */
.project-item.size-wide {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 2 / 1;
}

.project-item.size-medium {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 2 / 1;
}

.project-item.size-small {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 1 / 1;
}

.project-item-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.project-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: 12px;
}

.project-item:hover .project-item-image {
    transform: scale(1.1);
}

.project-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.project-item:hover .project-item-overlay {
    opacity: 1;
}

.project-item-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, transparent 100%);
    z-index: 2;
    transform: translateY(20px);
    transition: transform 0.5s ease;
}

.project-item:hover .project-item-content {
    transform: translateY(0);
}

.project-item-category {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.project-item-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 300;
    color: var(--white);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.project-item-description {
    font-size: 14px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-top: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease 0.1s;
}

.project-item:hover .project-item-description {
    opacity: 1;
    transform: translateY(0);
}

.project-item-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--white);
    text-decoration: none;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-item:hover .project-item-link {
    opacity: 1;
    transform: translateY(0);
}

.project-item-link:hover {
    gap: 12px;
    color: var(--accent-color);
}

.project-item-link i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.project-item-link:hover i {
    transform: translateX(4px);
}

/* Responsive Design - Zoomed out view: 1 rectangular + 2 squares per row */
/* This is handled by the .zoomed-out class added by JavaScript */
@media (max-width: 1400px) {
    .projects-grid.zoomed-out {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }

    .project-item.size-rectangular,
    .project-item.size-wide,
    .project-item.size-medium {
        grid-column: span 2;
        aspect-ratio: 2 / 1;
    }

    .project-item.size-square,
    .project-item.size-small {
        grid-column: span 1;
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 1024px) {

    /* Keep desktop layout - 3 columns, only change to 4 when zoomed-out class is applied */
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 0 30px;
    }

    .projects-grid.zoomed-out {
        grid-template-columns: repeat(4, 1fr);
    }

    .project-item.size-rectangular,
    .project-item.size-wide,
    .project-item.size-medium {
        grid-column: span 2;
        aspect-ratio: 2 / 1;
    }

    .project-item.size-square,
    .project-item.size-small {
        grid-column: span 1;
        aspect-ratio: 1 / 1;
    }

    .project-item-content {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .projects-page-section {
        padding: 130px 0 80px;
        background: var(--bg-color);
    }

    .projects-page-header {
        margin-bottom: 50px;
        padding: 0 25px;
    }

    .projects-page-title {
        font-size: clamp(40px, 10vw, 56px);
        font-weight: 400;
        letter-spacing: -1.5px;
        margin-bottom: 16px;
    }

    .projects-page-subtitle {
        font-size: clamp(15px, 2.5vw, 17px);
        padding: 0 10px;
        line-height: 1.7;
        color: #666;
    }

    .projects-page-divider {
        width: 80px;
        height: 3px;
        margin-top: 25px;
    }

    /* Mobile Filter - Horizontal Scroll */
    .projects-filter {
        gap: 10px;
        margin-bottom: 35px;
        padding: 0 25px 15px 25px;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-behavior: smooth;
    }

    .projects-filter::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        padding: 12px 24px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
        border-radius: 25px;
        font-weight: 500;
        border: 1.5px solid var(--border-color);
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .filter-btn.active {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    /* Mobile Projects Grid - Modern Card Layout */
    .projects-grid {
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding: 0 20px;
    }

    /* Mobile zoomed out: Still single column */
    .projects-grid.zoomed-out {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    /* All projects - Modern Card Design */
    .project-item {
        width: 100%;
        grid-column: span 1;
        aspect-ratio: auto;
        border-radius: 20px;
        background: white;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        border: 1px solid rgba(0, 0, 0, 0.05);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .project-item.size-rectangular,
    .project-item.size-wide,
    .project-item.size-medium,
    .project-item.size-square,
    .project-item.size-small {
        grid-column: span 1;
        aspect-ratio: auto;
    }

    /* Active state for touch */
    .project-item:active {
        transform: scale(0.98);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    /* Image Container */
    .project-item-image-wrapper {
        width: 100%;
        height: 280px;
        position: relative;
        overflow: hidden;
        border-radius: 20px 20px 0 0;
    }

    .project-item-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 20px 20px 0 0;
        transition: transform 0.6s ease;
    }

    /* Disable image zoom on mobile for better performance */
    .project-item:hover .project-item-image {
        transform: none;
    }

    /* Gradient Overlay - Always visible */
    .project-item-overlay {
        opacity: 1;
        background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
        z-index: 2;
    }

    /* Content Area - Always visible */
    .project-item-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 25px 20px;
        background: transparent;
        z-index: 3;
        transform: translateY(0);
    }

    .project-item-category {
        font-size: 11px;
        font-weight: 600;
        margin-bottom: 8px;
        letter-spacing: 1.5px;
        color: var(--accent-color);
    }

    .project-item-title {
        font-size: 22px;
        font-weight: 400;
        margin-bottom: 8px;
        color: white;
        line-height: 1.3;
        letter-spacing: -0.5px;
    }

    .project-item-description {
        font-size: 14px;
        opacity: 1;
        transform: translateY(0);
        margin-top: 8px;
        line-height: 1.6;
        color: rgba(255, 255, 255, 0.9);
        font-weight: 300;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .project-item-link {
        font-size: 12px;
        opacity: 1;
        transform: translateY(0);
        margin-top: 15px;
        color: white;
        font-weight: 500;
        letter-spacing: 1px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .project-item-link i {
        font-size: 10px;
    }

    /* Add bottom info section outside image */
    .project-item::after {
        content: '';
        display: block;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .projects-page-section {
        padding: 110px 0 60px;
    }

    .projects-page-header {
        margin-bottom: 40px;
        padding: 0 20px;
    }

    .projects-page-title {
        font-size: clamp(36px, 11vw, 48px);
        letter-spacing: -1px;
    }

    .projects-page-subtitle {
        font-size: clamp(14px, 3vw, 16px);
        padding: 0;
        line-height: 1.6;
    }

    .projects-page-divider {
        width: 60px;
        height: 2.5px;
        margin-top: 20px;
    }

    .projects-filter {
        gap: 8px;
        margin-bottom: 30px;
        padding: 0 20px 12px 20px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
        border-radius: 20px;
    }

    /* Small mobile: Single column with smaller cards */
    .projects-grid {
        display: flex;
        flex-direction: column;
        gap: 25px;
        padding: 0 18px;
    }

    /* Small mobile zoomed out: Still single column */
    .projects-grid.zoomed-out {
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    /* All projects - Compact card design */
    .project-item {
        border-radius: 18px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    }

    .project-item.size-rectangular,
    .project-item.size-wide,
    .project-item.size-medium,
    .project-item.size-square,
    .project-item.size-small {
        grid-column: span 1;
        aspect-ratio: auto;
    }

    /* Image Container - Smaller height */
    .project-item-image-wrapper {
        height: 240px;
        border-radius: 18px 18px 0 0;
    }

    .project-item-image {
        border-radius: 18px 18px 0 0;
    }

    /* Disable image zoom on small mobile */
    .project-item:hover .project-item-image {
        transform: none;
    }

    /* Gradient Overlay */
    .project-item-overlay {
        opacity: 1;
        background: linear-gradient(to bottom, transparent 35%, rgba(0, 0, 0, 0.75) 100%);
    }

    /* Content - Compact */
    .project-item-content {
        padding: 20px 18px;
        transform: translateY(0);
        background: transparent;
    }

    .project-item-category {
        font-size: 10px;
        margin-bottom: 6px;
        letter-spacing: 1.2px;
        font-weight: 600;
    }

    .project-item-title {
        font-size: 20px;
        margin-bottom: 6px;
        line-height: 1.25;
    }

    .project-item-description {
        font-size: 13px;
        opacity: 1;
        transform: translateY(0);
        margin-top: 6px;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-clamp: 2;
    }

    .project-item-link {
        font-size: 11px;
        opacity: 1;
        transform: translateY(0);
        margin-top: 12px;
        gap: 5px;
    }

    .project-item-link i {
        font-size: 9px;
    }
}

/* Zoom detection - when zoomed out, use 4-column layout */
/* Applied via JavaScript .zoomed-out class */
.projects-grid.zoomed-out {
    grid-template-columns: repeat(4, 1fr);
}

/* Header visibility control */
body:has(.projects-page-section) .header-black {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure proper spacing and layout */
.project-item-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}