/* Layout & Container Structure */
.hp-project-wrapper {
    display: flex;
    height: 541px; /* Forced 541px height per requirements */
    padding: 28px 0 var(--space-m) 0;
    align-items: stretch;
    gap: 40px;
    align-self: stretch;
    border-bottom: 1px solid var(--bordercolor);
    box-sizing: border-box;
    overflow: hidden;
}

.hp-project-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Ensures products attach to the bottom of the 541px container */
    flex: 1 1 0%;
    height: 100%;
}

.hp-project-top-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
}

.hp-project-featured-image {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    height: 100%;
}

/* Typography & Content Elements */
.hp-project-title {
    margin: 0;
}

.hp-project-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size:var(--text-l);
}

/* Title Hover Effect tied to the whole wrapper */
.hp-project-wrapper:hover .hp-project-title a {
    color: var(--primary);
}

.hp-project-location {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hp-flag-icon {
    width: 32px;
    height: auto;
    object-fit: contain;
}

.hp-country-name {
    color: var(--primary);
    font-weight: 500;
}

.hp-project-excerpt {
    color: var(--text-color);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 6; /* Limits to exactly 6 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Related Products Slider */
.hp-related-products-section {
    width: 100%;
    margin-top: var(--space-m);
}

.hp-related-label {
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 500;
}

.hp-related-carousel-container {
    width: 680px;
    max-width: 100%;
    height: 50px;
    border-bottom: 1px solid var(--primary);
    background: var(--bgcolor);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-sizing: border-box;
}

.hp-related-items-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.hp-related-item-link {
    display: none;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    transition: opacity 0.3s ease;
}

.hp-related-item-link.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

.hp-slider-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: color 0.3s ease;
}

.hp-slider-btn:hover {
    color: var(--primary);
}

/* Image Wrapper & Animations */
.hp-image-link-wrapper {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.hp-feat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

/* Trigger scale on wrapper hover */
.hp-project-wrapper:hover .hp-feat-img {
    transform: scale(1.03); 
}

.hp-hover-animation-group {
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 140px;
    height: 140px;
    z-index: 2;
    pointer-events: none;
}

.hp-svg-shape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: auto;
    height: auto;
    transform-origin: bottom left;
    transition: all 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.hp-icon-state {
    position: absolute;
    bottom: 24px;
    left: 24px;
    z-index: 3;
    transition: all 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

/* State Settings */
.hp-shape-normal { opacity: 1; transform: scale(1); }
.hp-shape-hover { opacity: 0; transform: scale(0.9); }

.hp-icon-plus {
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    opacity: 1;
}

.hp-icon-arrow {
    width: 24px;
    opacity: 0;
    transform: translateX(-10px);
}

/* SVG Hover Triggers (Now bound to .hp-project-wrapper) */
.hp-project-wrapper:hover .hp-shape-normal {
    opacity: 0;
    transform: scale(0.9);
}

.hp-project-wrapper:hover .hp-shape-hover {
    opacity: 1;
    transform: scale(1);
}

.hp-project-wrapper:hover .hp-icon-plus {
    opacity: 0;
    transform: translateX(10px) rotate(90deg);
}

.hp-project-wrapper:hover .hp-icon-arrow {
    opacity: 1;
    transform: translateX(0);
}


.hp-project-title{
   color: var(--secondary);
font-family: Inter;
font-size: var(--text-l);
font-style: normal;
font-weight: 600;
line-height: 28px; /* 116.715% */ 
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------
   Responsive Breakpoints 
--------------------------------------- */

/* iPad / Tablet Landscape Layout */
@media (max-width: 1024px) {
    .hp-project-wrapper {
        height: auto; /* Removes the 541px lock so the image doesn't stretch vertically to 9:16 */
        min-height: 400px;
    }
    
    .hp-project-featured-image {
        aspect-ratio: 4 / 3; /* Restores a natural landscape rectangle for the image column */
        height: auto;
    }
    
    .hp-project-excerpt {
        -webkit-line-clamp: 3; /* Reduces text to 3 rows automatically */
    }
}

/* Mobile Layout */
@media (max-width: 767px) {
    .hp-project-wrapper {
        flex-direction: column-reverse; /* Puts image on top */
        height: auto;
        gap: 20px;
        padding: var(--space-m) 0;
    }

    .hp-project-featured-image {
        width: 100%;
        aspect-ratio: 3 / 2; /* Ensures image maintains original rectangle ratio, eliminating the square look */
        height: auto;
    }

    .hp-project-excerpt {
        -webkit-line-clamp: 3; /* Limits to 3 rows on mobile */
    }

    .hp-related-carousel-container {
        width: 100%;
    }
}