/* ===== Common ===== */
.portfolio-page {
    background: linear-gradient(180deg, #F4FBFF, #ffffff);
    padding: 60px 20px;
}

.portfolio-title {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    color: #062B49;
    margin-bottom: 40px;
}

/* ===== Card Wrapper ===== */
.portfolio-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* ===== Grid (List Page) ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.portfolio-item {
    text-decoration: none;
    color: #062B49;
}

.portfolio-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #eee;
    border-radius: 12px;
    overflow: hidden;
}

.portfolio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-name {
    margin-top: 10px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

/* ===== Pagination ===== */
.pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination button {
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: #999;
    min-width: 26px;
}

.pagination button.active {
    color: #0b5cff;
    font-weight: 600;
}

/* ===== Detail Wrapper ===== */
.detail-wrapper {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* ===== Detail Top ===== */
.detail-top {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.detail-main-img {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.detail-main-img img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

.detail-title {
    font-size: 32px;
    font-weight: 600;
    color: #062B49;
    margin-bottom: 10px;
}

.detail-desc {
    font-size: 22px;
    color: #062B49;
    line-height: 1.6;
}

/* ===== Gallery (Masonry) ===== */
.detail-gallery {
    column-count: 3;
    column-gap: 10px;
}

.detail-gallery img {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 10px;
    display: block;
    break-inside: avoid;
    cursor: pointer;
}

/* ===== Recommend ===== */
.recommend-section {
    margin-top: 50px;
    text-align: center;
}

.recommend-title {
    font-size: 20px;
    font-weight: 600;
    color: #062B49;
    margin-bottom: 16px;
}

/* ===== Slider ===== */
.recommend-slider {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 48px;
}

.recommend-track {
    display: flex;
    gap: 20px;
    overflow: hidden;
}

/* ===== Card ===== */
.recommend-card {
    flex: 0 0 calc(33.333% - 14px);
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    position: relative;
}

.recommend-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.recommend-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #062B49;
    color: #fff;
    padding: 10px;
    font-size: 20px;
    text-align: center;
}

/* ===== Arrows ===== */
.recommend-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 115, 230, 1);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.recommend-arrow img {
    width: 16px;
    height: 16px;
}

.recommend-arrow.left {
    left: 0;
}

.recommend-arrow.right {
    right: 0;
}

/* ===== Dots ===== */
.recommend-dots {
    margin-top: 14px;
    display: none;
    justify-content: center;
    gap: 8px;
}

.recommend-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #aaa;
    cursor: pointer;
}

.recommend-dots span.active {
    background: #000;
}

/* ===== Image Popup ===== */
.image-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.image-popup.active {
    display: flex;
}


.popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
}

.popup-content {
    position: relative;
    z-index: 1;

    max-width: 70vw;
    max-height: 70vh;

    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content img {
    max-width: 100%;
    max-height: 70vh;

    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.popup-close {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.7);
    color: #000000;
    font-size: 16px;
    cursor: pointer;
}

.popup-content {
    position: relative;
}

.popup-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: #fff;
    background: rgba(0,0,0,0);
    border: none;
    cursor: pointer;
    padding: 10px 15px;
    z-index: 10;
}

.popup-arrow.left {
    left: -50px;
}

.popup-arrow.right {
    right: -50px;
}


/* ===== Responsive ===== */
@media (max-width: 1023px) {
    .recommend-card {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 425px) {
    .recommend-arrow {
        display: flex;
    }
    .recommend-dots {
        display: flex;
    }
    .recommend-card {
        flex: 0 0 100%;
    }
    .recommend-slider {
        padding: 0 36px;
    }
    .detail-title {
        font-size: 20px;
    }
    .detail-desc {
        font-size: 12px;
    }
}

@media (max-width: 992px) {
    .detail-top {
        grid-template-columns: 1fr;
    }

    .detail-gallery {
        column-count: 2;
    }
}

@media (max-width: 320px) {
    .detail-gallery {
        column-count: 1;
    }
}
