/* ─────────────────────────────────────────────────────────────
   Custom Portfolio Widget - portfolio.css
   Clean, modern, professional portfolio styling
───────────────────────────────────────────────────────────── */

.cp-portfolio-wrapper {
    width: 100%;
}

/* ── Filter Bar ────────────────────────────────────────────── */
.cp-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
    list-style: none;
    padding: 0;
}

.cp-filter-item {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 16px;
    transition: all 0.3s ease;
    color: #666;
    position: relative;
}

.cp-filter-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.cp-filter-item.active {
    color: #000;
}

.cp-filter-item.active::after {
    width: 60%;
}

/* Vertical Separator Line */
.cp-filter-item:not(:last-child)::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    /* Controlled by Elementor */
    height: 0;
    /* Controlled by Elementor */
    background-color: transparent;
    /* Controlled by Elementor */
    pointer-events: none;
}

/* ── Portfolio Grid ─────────────────────────────────────────── */
.cp-portfolio-grid {
    width: 100%;
}

.cp-portfolio-grid .container {
    display: grid;
    gap: 30px;
    width: 100%;
    transition: opacity 0.3s ease;
}

.cp-portfolio-grid.is-loading {
    pointer-events: none;
}

/* ── Portfolio Item (Screenshot Style) ───────────────────────── */
.cp-portfolio-item {
    position: relative;
    overflow: visible;
    border-radius: 20px;
    background: #f8f8f8;
    cursor: pointer;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
}

.cp-portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.cp-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit;
    flex-grow: 1;
    overflow: hidden;
}

/* Image container */
.cp-item-img-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 0;
}

.cp-item-img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cp-portfolio-item:hover .cp-item-img {
    transform: scale(1.1);
}

/* Gradient overlay to make text readable - Top transparent, Bottom dynamic color */
.cp-item-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--cp-overlay-color, rgba(0, 0, 0, 0.8)) 0%, transparent 100%);
    z-index: 1;
}

/* Content Area */
.cp-item-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    z-index: 2;
    color: #fff;
    pointer-events: none;
}

.cp-item-content>* {
    pointer-events: auto;
}

.cp-item-title {
    font-weight: 700;
    margin: 0 0 5px;
    text-transform: uppercase;
    line-height: 1.1;
    color: inherit;
}

.cp-item-cat {
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
    margin-bottom: 15px;
    display: block;
}

/* Read More Button — defaults; all props overridable via Elementor controls */
.cp-item-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #ffffff;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.cp-item-inner:hover .cp-item-read-more {
    background: rgba(255, 255, 255, 0.3);
}

.cp-item-read-more .cp-rm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.cp-item-inner:hover .cp-item-read-more .cp-rm-icon {
    transform: translateX(3px);
}

/* Top-right Icon */
.cp-item-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 52px;
    height: 52px;
    background: var(--cp-overlay-color, #ff4d4d);
    border: 4px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;

    /* Initially hidden */
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cp-portfolio-item:hover .cp-item-icon {
    opacity: 1;
    transform: scale(1);
}

.cp-item-icon svg {
    width: 20px;
    height: 20px;
}

/* ── Pagination ────────────────────────────────────────────── */
.cp-pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.cp-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #f1f1f1;
    color: #000;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cp-pagination .page-numbers.current,
.cp-pagination .page-numbers:hover {
    background: #000;
    color: #fff;
}

/* ── Load More ──────────────────────────────────────────────── */
.cp-load-more-container {
    text-align: center;
    margin-top: 50px;
}

.cp-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    border-radius: 10px;
}

.cp-load-more-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.cp-load-more-btn .cp-btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 12px;
    animation: cp-spin 0.8s linear infinite;
    display: none;
}

.cp-load-more-btn.is-loading .cp-btn-loader {
    display: inline-block;
}

@keyframes cp-spin {
    to {
        transform: rotate(360deg);
    }
}

.cp-pagination .page-numbers svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.5px;
    display: block;
    transition: transform 0.3s ease;
}

.cp-pagination .page-numbers.prev:hover svg {
    transform: translateX(-3px);
}

.cp-pagination .page-numbers.next:hover svg {
    transform: translateX(3px);
}

/* ══ Card entrance animation (stagger) ═══════════════════════ */
@keyframes cp-slide-up {
    from {
        opacity: 0;
        transform: translateY(32px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cp-card--animate {
    opacity: 0;
    will-change: opacity, transform;
}

.cp-card--animate.cp-card--in {
    animation: cp-slide-up 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Ensure hover translations still work after stagger animation */
.cp-portfolio-item.cp-card--animate.cp-card--in:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cp-portfolio-grid .container {
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .cp-filter-bar {
        justify-content: center;
    }

    .cp-item-title {
        font-size: 20px;
    }

    .cp-portfolio-item {
        aspect-ratio: 1;
    }
}