/**
 * Project Listing Styles
 */

.project-listing {
    padding: 2em 0;
}

.project-listing-header {
    margin-bottom: 2em;
    text-align: center;
}

/* List View Styles */
.project-list {
    margin: 0;
    padding: 0;
    max-width: 1650px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.project-list-item {
    display: flex;
    align-items: stretch;
    margin-bottom: 0;
    position: relative;
    min-height: 400px;
}

/* Image takes 50% width and extends to viewport edge */
.project-list-image {
    flex: 0 0 50%;
    position: relative;
    overflow: hidden;
}

.project-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content wrapper takes 50% width */
.project-list-content-wrapper {
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    padding: 3em 0;
    position: relative;
    z-index: 1;
}

.project-list-content {
    width: 100%;
    max-width: 670px;
    padding: 0 30px;
}

/* Image left (odd items) - Image extends to left viewport edge */
.project-list-item.image-left {
    flex-direction: row;
}

.project-list-item.image-left .project-list-image {
    margin-left: calc((100vw - 1650px) / -2);
}

.project-list-item.image-left .project-list-content-wrapper {
    justify-content: flex-end;
}

.project-list-item.image-left .project-list-content {
    margin-left: auto;
}

/* Image right (even items) - Image extends to right viewport edge */
.project-list-item.image-right {
    flex-direction: row-reverse;
}

.project-list-item.image-right .project-list-image {
    margin-right: calc((100vw - 1650px) / -2);
}

.project-list-item.image-right .project-list-content-wrapper {
    justify-content: flex-start;
}

.project-list-item.image-right .project-list-content {
    margin-right: auto;
}

/* Fallback for smaller viewports */
@media screen and (max-width: 1680px) {
    .project-list-item.image-left .project-list-image {
        margin-left: 0;
    }
    
    .project-list-item.image-right .project-list-image {
        margin-right: 0;
    }
}

.project-list-title {
    font-size: 2em;
    font-weight: 700;
    margin: 0 0 0.5em 0;
    color: #000;
    line-height: 1.2;
}

.project-list-subheader {
    /* font-size: 1.2em; */
    /* color: #555; */
    margin-bottom: 1.5em;
    /* line-height: 1.5; */
}

/* .project-list-link {
    margin-top: 2em;
} */

/* Responsive: Stack on smaller screens */
@media screen and (max-width: 1023px) {
    .project-list-item {
        flex-direction: column !important;
        min-height: auto;
    }
    
    .project-list-image {
        flex: 0 0 auto;
        height: 300px;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .project-list-content-wrapper {
        flex: 0 0 auto;
        padding: 2em 0;
    }
    
    .project-list-content {
        padding: 0 1.5em;
    }
    
    .project-list-title {
        font-size: 1.6em;
    }
    
    .project-list-subheader {
        font-size: 1.1em;
    }
}

/* Detail View Styles */
.project-detail {
    max-width: 1650px;
    margin: 0 auto;
}

.project-detail-image {
    margin-bottom: 2em;
}

.project-detail-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.project-detail-content {
    padding: 1em 0;
}

.project-detail-title {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0.5em 0;
    color: #000;
}

.project-bodytext {
    margin: 2em 0;
    line-height: 1.8;
    font-size: 1.1em;
}

.project-numbered-list {
    margin: 2em 0;
    padding: 1.5em;
    background: #f9f9f9;
    border-left: 4px solid #000;
    line-height: 1.8;
}

.project-gallery {
    margin: 3em -15px 2em;
}

.project-gallery-item {
    margin: 15px;
    position: relative;
}

.project-gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.project-gallery-caption {
    margin-top: 0.5em;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

.project-downloads {
    margin: 3em 0;
    padding: 2em;
    background: #f9f9f9;
    border-radius: 8px;
}

.project-downloads h3 {
    margin-top: 0;
    margin-bottom: 1.5em;
}

.project-download-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-download-item {
    margin-bottom: 1em;
}

.project-download-link {
    display: flex;
    align-items: center;
    padding: 1em;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #000;
    transition: background-color 0.3s ease;
}

.project-download-link:hover {
    background-color: #f0f0f0;
}

.project-download-name {
    flex: 1;
    font-weight: 600;
}

.project-download-type,
.project-download-size {
    margin-left: 1em;
    color: #666;
    font-size: 0.9em;
}

.project-link {
    margin: 3em 0;
    text-align: center;
}

/* Responsive adjustments */
@media screen and (max-width: 767px) {
    .project-detail-title {
        font-size: 2em;
    }
    
    .project-gallery-item img {
        height: 200px;
    }
    
    .project-download-link {
        flex-wrap: wrap;
    }
    
    .project-download-type,
    .project-download-size {
        margin-left: 0;
        width: 100%;
        margin-top: 0.5em;
    }
}
