html {
    scroll-behavior: smooth;
}
body.page-template-page-portfolio-php .page-header.flex-middle {
    display: none !important;
}

/* ================= PORTFOLIO PAGE ================= */
.portfolio-page {
    padding: 80px 0;
    background: #f8f9fb;
    font-family: "Poppins", sans-serif;
    max-width: 1320px;   /* creates left & right empty space */
    margin: auto;
    /* padding: 0 30px; */
    padding: 30px;
}

.portfolio-section {
    margin-bottom: 90px;
}

.section-title {
    font-size: 42px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title:after {
    content: "";
    width: 80px;
    height: 3px;
    background: #111;
    display: block;
    margin: 15px auto 0;
}

/* ================= PROJECT HEADINGS ================= */
.portfolio-grid h3 {
    grid-column: 1 / -1;
    font-size: 26px;
    font-weight: 500;
    margin: 40px 0 10px;
    color: #222;
}

/* ================= GRID ================= */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* FORCE 4 in one row */
    gap: 40px;
}

/* ================= ITEM ================= */
.portfolio-item {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    transition: all 0.35s ease;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.portfolio-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.portfolio-item h4,
.portfolio-item h3 {
    padding: 18px;
    margin: 0;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #111;
}

/* ================= LINK ================= */
.portfolio-link {
    text-decoration: none;
    color: inherit;
}

/* ================= POPUP ================= */
.portfolio-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.portfolio-popup:target {
    display: flex;
    align-items: center;
    justify-content: center;
}


.popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1;
}

.popup-content {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    width: 90%;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    animation: fadeIn 0.35s ease;
     max-height: 90vh;
    overflow: hidden;

}

@keyframes fadeIn {
    from {opacity: 0; transform: scale(0.95);}
    to {opacity: 1; transform: scale(1);}
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 30px;
    color: #000;
    cursor: pointer;
}

/* ================= SLIDER ================= */
.slider {
    position: relative;
    height: 65vh;           /* controls image height */
    display: flex;
    align-items: center;
    justify-content: center;
}
.slider-images {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-images img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;   /* IMPORTANT */
    display: none;
}
/* .slider-images img {
    display: none;
} */
.slider-images img:first-child {
    display: block;
}
.slider-images img {
    width: 100%;
    border-radius: 10px;
    display: none;
}

.slider-images img:first-child {
    display: block;
}

.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    border: none;
    padding: 14px 18px;
    cursor: pointer;
    font-size: 22px;
    border-radius: 50%;
}

.slider-prev { left: 15px; }
.slider-next { right: 15px; }

.popup-content h3 {
    margin-top: 20px;
    text-align: center;
    font-size: 22px;
    font-weight: 500;
}
/* ================= RESPONSIVE ================= */
@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 550px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}
.fancy-hr {
    width: 140px;
    height: 2px;
    background: #111;
    margin: 60px auto;
    position: relative;
}

.fancy-hr::before,
.fancy-hr::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 50px;
    height: 1px;
    background: #bbb;
}

.fancy-hr::before {
    left: -65px;
}

.fancy-hr::after {
    right: -65px;
}
