/* Content Blocks Styles - White blocks with rounded corners like greeting-section */

.content-section {
    width: 100%;
    max-width: 100%;
    margin: 80px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Project Block - White container with rounded corners */
.project-block {
    width: 100%;
    background: #FFFFFF;
    box-shadow: 0px 5px 32px rgba(39, 39, 39, 0.02);
    box-shadow: 0px 5px 32px color(display-p3 0.153 0.153 0.153 / 0.02);
    border-radius: 56px;
    padding: 60px 80px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    overflow: hidden;
}

.project-block.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Inner container with flex layout */
.project-block-inner {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

/* Center content when images are hidden */
.project-block-inner:has(.project-image-left:empty):has(.project-image-right:empty) {
    grid-template-columns: 1fr;
}

.project-block-inner:has(.project-image-left:empty):has(.project-image-right:empty) .project-content {
    grid-column: 1;
}

/* Project Images */
.project-image {
    width: 100%;
    height: 300px;
    border-radius: 24px;
    overflow: hidden;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image:empty {
    display: none;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

.project-image-left {
    justify-self: start;
}

.project-image-right {
    justify-self: end;
}

/* Project Content - Centered */
.project-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
}

.project-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.project-title {
    font-family: 'Inria Serif', Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    color: #1A1A1A;
    margin: 0;
    letter-spacing: -0.02em;
}

.project-meta {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #8e8c8c;
    letter-spacing: 0;
}

.project-description {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #1A1A1A;
    margin: 0;
    max-width: 600px;
}

/* Project Button - Centered (стиль как в AI-Assistant) */
.project-button {
    display: inline-flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 13px 24px;
    gap: 16px;
    width: fit-content;
    min-width: fit-content;
    height: 47px;
    background: #262626f5;
    border-radius: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.project-button:hover {
    background: #1a1a1af5;
    transform: translateY(-2px);
}

.project-button .button-text {
    width: auto;
    height: 21px;
    display: flex;
    align-items: center;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.015em;
    font-size: 16px;
    line-height: 132%;
    color: #FFFFFF;
}

/* Если текст не обернут в span, применяем стили напрямую к кнопке */
.project-button:not(:has(.button-text)) {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.015em;
    font-size: 16px;
    line-height: 132%;
    color: #FFFFFF;
}

/* Responsive Styles */
@media (max-width: 1440px) {
    .project-block {
        padding: 50px 60px;
        border-radius: 48px;
    }

    .project-block-inner {
        gap: 40px;
    }

    .project-image {
        height: 250px;
    }

    .project-title {
        font-size: 32px;
    }
}

@media (max-width: 1024px) {
    .project-block {
        padding: 40px 40px;
        border-radius: 40px;
    }

    .project-block-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .project-image {
        height: 200px;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .project-image:empty {
        display: none;
    }

    .project-image-left,
    .project-image-right {
        justify-self: center;
    }

    .project-title {
        font-size: 28px;
    }

    .project-description {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .content-section {
        margin: 64px 0 0 0;
        gap: 32px;
    }

    .project-block {
        padding: 32px 24px;
        border-radius: 32px;
    }

    .project-block-inner {
        gap: 24px;
    }

    .project-image {
        height: 180px;
        border-radius: 16px;
    }

    .project-image img {
        border-radius: 16px;
    }

    .project-content {
        gap: 20px;
    }

    .project-title {
        font-size: 24px;
    }

    .project-meta {
        font-size: 13px;
    }

    .project-description {
        font-size: 15px;
        line-height: 1.6;
    }

    .project-button {
        font-size: 15px;
        padding: 12px 24px;
        height: 44px;
        border-radius: 20px;
    }

    .project-button .button-text {
        font-size: 15px;
        height: 20px;
    }
}

/* Projects Grid Section - Сетка блоков одинакового размера */
.projects-grid-section {
    width: 100%;
    margin: 72px 0 0 0;
    padding: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
    width: 100%;
}

/* Базовые стили для всех блоков проектов */
.project-grid-item {
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 64px;
    min-height: 400px;
    height: 400px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    overflow: hidden;
    position: relative;
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

/* Убираем глобальную прозрачность и смену цвета для элементов проектов */
.project-grid-item:hover {
    opacity: 1;
    color: inherit;
    transform: translateY(-2px) scale(1.01);
    filter: brightness(1.03);
}

.project-grid-item img,
.project-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 64px;
    display: block;
}

.project-grid-item.project-cloud video {
    width: calc(100% + 24px);
    height: calc(100% + 24px);
    margin: -12px;
    object-fit: cover;
    object-position: center;
}

/* Все блоки одинакового размера */
.project-navorina,
.project-stake,
.project-bitsgap,
.project-3commas,
.project-craftum,
.project-cloud,
.project-growfood,
.project-ui,
.project-code {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 400px;
    height: 400px;
    margin-top: 0;
}

/* Responsive Styles для сетки */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
    }
    
    .project-grid-item {
        border-radius: 32px;
        min-height: 360px;
        height: 360px;
    }
    
    .project-grid-item img,
    .project-grid-item video {
        border-radius: 32px;
    }
    
    .project-navorina,
    .project-stake,
    .project-bitsgap,
    .project-3commas,
    .project-craftum,
    .project-cloud,
    .project-growfood,
    .project-ui,
    .project-code {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 360px;
        height: 360px;
        margin-top: 0;
    }
}

@media (max-width: 767px) {
    .projects-grid-section {
        margin: 64px 0 0 0;
    }
    
    .projects-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 16px;
    }
    
    .project-grid-item {
        border-radius: 32px;
        min-height: 300px;
        height: 300px;
    }
    
    .project-grid-item img,
    .project-grid-item video {
        border-radius: 32px;
    }
    
    .project-navorina,
    .project-stake,
    .project-bitsgap,
    .project-3commas,
    .project-craftum,
    .project-cloud,
    .project-growfood,
    .project-ui,
    .project-code {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        min-height: 300px;
        height: 300px;
        margin-top: 0;
    }
}
