/* ============================================================
   Kesten Portfolio Page — Professional Grid Layout
   ============================================================ */

/* --- Fullwidth override for Portfolio page --- */
.page-id-4016 .nm-page-default,
.page-id-4016 .nm-page-default .entry-content {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.page-id-4016 .nm-page-default-col {
    float: none !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.page-id-4016 .entry-content {
    max-width: none !important;
    padding: 0 !important;
}
.page-id-4016 .nm-row {
    max-width: none !important;
    padding: 0 !important;
}
.page-id-4016 .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
}

/* --- Page Header --- */
.kst-portfolio-header {
    text-align: center;
    padding: 48px 24px 32px;
    max-width: 720px;
    margin: 0 auto;
}
.kst-portfolio-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #1a1a1a;
    line-height: 1.2;
}
.kst-portfolio-header p {
    font-size: 1.1rem;
    color: #555;
    margin: 0;
    line-height: 1.6;
}

/* --- Filter Tabs --- */
.kst-portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 0 24px 40px;
    list-style: none;
    margin: 0 auto;
    max-width: 1200px;
}
.kst-portfolio-filters br { display: none; }
.kst-portfolio-filters li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.kst-filter-btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1.5px solid #ccc;
    border-radius: 24px;
    background: transparent;
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}
.kst-filter-btn:hover {
    border-color: #333;
    color: #1a1a1a;
    background: #f5f5f5;
}
.kst-filter-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

/* --- Portfolio Grid --- */
.kst-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 24px;
    max-width: 1200px;
    margin: 0 auto;
}
@media (max-width: 900px) {
    .kst-portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .kst-portfolio-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
    }
}

/* --- Portfolio Card --- */
.kst-portfolio-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.kst-portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}
.kst-portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.kst-portfolio-card:hover img {
    transform: scale(1.05);
}

/* Card Overlay */
.kst-portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 55%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.kst-portfolio-card:hover .kst-portfolio-overlay {
    opacity: 1;
}
.kst-portfolio-overlay h3 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.3;
}
.kst-portfolio-overlay span {
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    font-weight: 400;
}

/* --- Category Section Labels --- */
.kst-portfolio-section {
    padding: 48px 0 0;
}
.kst-portfolio-section:first-of-type {
    padding-top: 0;
}
.kst-portfolio-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
    padding-bottom: 0;
    line-height: 1.3;
}
.kst-portfolio-section .kst-section-desc {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* --- CTA Section --- */
.kst-portfolio-cta {
    text-align: center;
    padding: 56px 24px 48px;
    max-width: 560px;
    margin: 0 auto;
}
.kst-portfolio-cta h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px;
}
.kst-portfolio-cta p {
    font-size: 1rem;
    color: #555;
    margin: 0 0 28px;
    line-height: 1.6;
}

/* --- Lightbox --- */
.kst-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: zoom-out;
}
.kst-lightbox.active { opacity: 1; }
.kst-lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    user-select: none;
}
.kst-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.kst-lightbox-close:hover { background: rgba(255,255,255,0.25); }
.kst-lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    text-align: center;
    max-width: 80vw;
    pointer-events: none;
}
.kst-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.kst-lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.kst-lightbox-prev { left: 16px; }
.kst-lightbox-next { right: 16px; }
