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

.pe-grid > .pe-card {
    grid-column: span 2;
    width: auto;
    max-width: none;
    margin: 0;
}

.pe-grid > .pe-card:last-child:nth-child(3n+1) {
    grid-column: 3 / span 2;
}

.pe-grid > .pe-card:nth-last-child(2):nth-child(3n+1) {
    grid-column: 2 / span 2;
}

.pe-grid > .pe-card:last-child:nth-child(3n+2) {
    grid-column: 4 / span 2;
}

.pe-card {
    position: relative;
    aspect-ratio: 1 / 1;
    min-height: 320px;
    border-radius: 16px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.pe-card.active {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(10, 88, 202, 0.2);
}

@media (hover: hover) and (pointer: fine) {
    .pe-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(10, 88, 202, 0.2);
    }
    .pe-card:hover .pe-card-img {
        opacity: 0;
    }
    .pe-card:hover .pe-card-overlay {
        opacity: 0;
    }
    .pe-card:hover .pe-card-title-normal {
        opacity: 0;
        transform: translateY(10px);
    }
    .pe-card:hover .pe-card-panel {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .pe-card:hover .pe-card-panel-title,
    .pe-card:hover .pe-card-panel-sub,
    .pe-card:hover .pe-card-panel-client {
        animation: pe-panel-fade-up 0.4s ease forwards;
    }
    .pe-card:hover .pe-card-panel-title {
        animation-delay: 0.10s;
    }
    .pe-card:hover .pe-card-panel-sub {
        animation-delay: 0.18s;
    }
    .pe-card:hover .pe-card-panel-client {
        animation-delay: 0.26s;
    }
}

.pe-card-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.pe-card.active .pe-card-img {
    opacity: 0;
}

.pe-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 20, 50, 0.88) 0%, rgba(6, 20, 50, 0.55) 38%, rgba(6, 20, 50, 0) 72%);
    transition: opacity 0.4s ease;
    z-index: 2;
}

.pe-card.active .pe-card-overlay {
    opacity: 0;
}

.pe-card-title-normal {
    position: absolute;
    bottom: 22px;
    left: 22px;
    right: 22px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    line-height: 1.3;
    z-index: 3;
    transition: opacity 0.3s ease, transform 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pe-card-title-normal::before {
    content: "";
    display: block;
    width: 34px;
    height: 3px;
    border-radius: 3px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #9fd0ff, #3f8cff);
}

.pe-card.active .pe-card-title-normal {
    opacity: 0;
    transform: translateY(10px);
}

.pe-card-panel {
    position: absolute;
    inset: 0;
    background: #fff;
    border-radius: 16px;
    padding: 30px 26px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    height: 100%;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    z-index: 4;
    overflow-y: auto;
    max-height: 100%;
}

.pe-card-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(135deg, #0b2a5b 0%, #1746a2 45%, #2f7de1 100%);
    border-radius: 16px 16px 0 0;
}

.pe-card.active .pe-card-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pe-card-head {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.pe-card-panel-title {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0a58ca !important;
    margin: 0 0 10px 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pe-card-panel-sub {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.88rem;
    font-weight: 500;
    color: #475569 !important;
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pe-card-panel-client {
    width: 100%;
    padding-top: 16px;
    border-top: 1px solid rgba(10, 88, 202, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: auto;
}

.pe-card-client-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0b2a5b 0%, #1746a2 45%, #2f7de1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pe-card-client-icon i {
    color: #fff !important;
    font-size: 0.85rem;
}

.pe-card-client-text {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0b2a6b !important;
    line-height: 1.45;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 6em;
    overflow-y: auto;
}

.pe-card.active .pe-card-panel-title,
.pe-card.active .pe-card-panel-sub,
.pe-card.active .pe-card-panel-client {
    animation: pe-panel-fade-up 0.4s ease forwards;
}

.pe-card.active .pe-card-panel-title {
    animation-delay: 0.10s;
}

.pe-card.active .pe-card-panel-sub {
    animation-delay: 0.18s;
}

.pe-card.active .pe-card-panel-client {
    animation-delay: 0.26s;
}

@keyframes pe-panel-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .pe-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .pe-grid > .pe-card {
        grid-column: span 2;
    }

    .pe-grid > .pe-card:last-child:nth-child(odd) {
        grid-column: 2 / span 2;
    }
}

@media (min-width: 577px) and (max-width: 992px) {
    .pe-card-title-normal {
        font-size: 1.15rem;
    }
}

@media (max-width: 767.98px) {
    .pe-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
    .pe-grid > .pe-card,
    .pe-grid > .pe-card:last-child:nth-child(3n+1),
    .pe-grid > .pe-card:nth-last-child(2):nth-child(3n+1),
    .pe-grid > .pe-card:last-child:nth-child(3n+2),
    .pe-grid > .pe-card:last-child:nth-child(odd) {
        grid-column: auto !important;
    }
    .pe-card {
        aspect-ratio: 4 / 3;
        min-height: 220px;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .pe-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
    .pe-grid > .pe-card {
        grid-column: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .pe-grid > .pe-card:last-child:nth-child(odd) {
        grid-column: 1 / -1 !important;
        justify-self: center;
        width: calc(50% - 12px) !important;
        max-width: calc(50% - 12px) !important;
    }
}

@media (max-width: 575.98px) {
    .pe-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }

    .pe-grid > .pe-card,
    .pe-grid > .pe-card:last-child:nth-child(odd),
    .pe-grid > .pe-card:last-child:nth-child(3n+1),
    .pe-grid > .pe-card:nth-last-child(2):nth-child(3n+1),
    .pe-grid > .pe-card:last-child:nth-child(3n+2) {
        grid-column: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .pe-card {
        aspect-ratio: 4 / 3;
        min-height: 220px;
    }

    .pe-card-title-normal {
        font-size: 1.05rem;
        bottom: 18px;
        left: 20px;
        right: 20px;
    }

    .pe-card-panel {
        padding: 24px 22px;
    }

    .pe-card-panel-title {
        font-size: 1.1rem;
    }

    .pe-card-panel-sub {
        font-size: 0.85rem;
    }

    .pe-card-panel-client {
        gap: 10px;
    }

    .pe-card-client-icon {
        width: 32px;
        height: 32px;
    }

    .pe-card-client-icon i {
        font-size: 0.85rem;
    }

    .pe-card-client-text {
        font-size: 0.78rem;
    }
}