/**
 * Show Portfolio – Frontend Styles
 *
 * All classes use the sp- prefix to avoid conflicts with theme styles.
 *
 * Sections:
 *   1. Layout primitives
 *   2. Archive grid
 *   3. Pagination
 *   4. Single portfolio view
 *   5. Elementor grid
 *   6. Responsive
 */

/* =============================================================================
   1. Layout primitives
   ============================================================================= */

.sp-section {
    padding: 40px 20px;
}

.sp-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 24px;
}

/* =============================================================================
   2. Archive grid & card design
   ============================================================================= */

.sp-archive {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
}

.sp-archive .sp-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sp-archive .sp-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.13);
}

.sp-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    height: auto;
    overflow: hidden;
}

.sp-card__thumb a {
    display: block;
    height: 100%;
}

.sp-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.4s ease;
}

.sp-card:hover .sp-card__thumb img {
    transform: scale(1.04);
}

.sp-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,.18) 100%);
    pointer-events: none;
}

.sp-card__no-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
}

.sp-card__body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-card__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sp-card__cat-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #eef4ff;
    color: #2563eb;
    border: 1px solid #c7d9fd;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.6;
    transition: background .2s ease, color .2s ease;
}

.sp-card__cat-badge:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.sp-card__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sp-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
    flex: 1;
    min-width: 0;
}

.sp-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sp-card__title a:hover {
    color: #2563eb;
}

.sp-card__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}

.sp-card__btn:hover {
    background: #1d4ed8;
    color: #ffffff;
    transform: scale(1.1);
}

.sp-card__btn svg {
    flex-shrink: 0;
    transition: transform .2s ease;
}

.sp-card__btn:hover svg {
    transform: translateX(2px);
}

.sp-no-items {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    font-size: 15px;
    padding: 40px 0;
}

/* =============================================================================
   3. Pagination
   ============================================================================= */

.sp-pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.sp-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background .2s ease, border-color .2s ease;
}

.sp-pagination .page-numbers.current,
.sp-pagination .page-numbers:hover {
    background: #3a9aff;
    border-color: #3a9aff;
    color: #fff;
}

/* =============================================================================
   4. Single portfolio view
   ============================================================================= */

.sp-single-hero {
    max-width: 900px;
    margin: 0 auto 28px;
    padding: 36px 28px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 18px;
}

.sp-single-hero__title {
    margin: 0;
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
    color: #111827;
    letter-spacing: -.02em;
}

.sp-single-hero__excerpt {
    margin-top: 14px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-size: 16px;
    line-height: 1.8;
    color: #6b7280;
}

.sp-single-hero__excerpt p {
    margin: 0;
}

.sp-single-hero__excerpt p + p {
    margin-top: 12px;
}

.sp-nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.sp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    min-height: 42px;
    min-width: 140px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all .25s ease;
}

.sp-button:hover {
    background: #1d4ed8;
    color: #ffffff;
    transform: translateY(-2px);
}

.sp-single {
    grid-template-columns: 2fr 1fr;
}

.sp-single .sp-card h4 {
    text-align: center;
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #444;
}

.sp-single .sp-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* =============================================================================
   5. Elementor widget grid
   ============================================================================= */

.sp-elementor-grid {
    display: grid;
    gap: 20px;
}

.sp-cols-1 { grid-template-columns: repeat(1,1fr); }
.sp-cols-2 { grid-template-columns: repeat(2,1fr); }
.sp-cols-3 { grid-template-columns: repeat(3,1fr); }
.sp-cols-4 { grid-template-columns: repeat(4,1fr); }

.sp-elementor-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    transition: transform .3s ease, box-shadow .3s ease;
}

.sp-elementor-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,.13);
}

.sp-elementor-card:hover .sp-card__thumb img {
    transform: scale(1.04);
}

/* =============================================================================
   6. Responsive
   ============================================================================= */

@media (max-width: 768px) {

    .sp-section {
        padding: 24px 12px;
    }

    .sp-container {
        gap: 16px;
    }

    .sp-archive {
        grid-template-columns: repeat(2, 1fr);
    }

    .sp-single {
        grid-template-columns: 1fr;
    }

    .sp-cols-3,
    .sp-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sp-single-hero {
        padding: 30px 22px;
    }

    .sp-single-hero__title {
        font-size: 30px;
    }

    .sp-single-hero__excerpt {
        font-size: 15px;
    }
}

@media (max-width: 480px) {

    .sp-section {
        padding: 16px 10px;
    }

    .sp-container {
        gap: 12px;
    }

    .sp-archive {
        grid-template-columns: 1fr;
    }

    .sp-card__thumb {
        height: 200px;
    }

    .sp-cols-2,
    .sp-cols-3,
    .sp-cols-4 {
        grid-template-columns: 1fr;
    }

    .sp-single-hero {
        padding: 24px 16px;
        border-radius: 14px;
        margin-bottom: 20px;
    }

    .sp-single-hero__title {
        font-size: 24px;
    }

    .sp-single-hero__excerpt {
        font-size: 14px;
        line-height: 1.7;
        text-align: justify;
    }
}