/* --- Sub Page Styles --- */

/* Sub Banner */
.sub-banner {
    background-color: var(--primary-color);
    background-image: linear-gradient(rgba(42, 59, 92, 0.8), rgba(42, 59, 92, 0.8)), url('../img/BG.png');
    background-size: cover;
    background-position: center;
    padding: 160px 0 80px; /* Extra top padding for fixed header */
    text-align: center;
    color: var(--text-white);
}

.sub-banner .sub-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-white);
}

.sub-banner .sub-desc {
    font-size: 1.1rem;
    opacity: 0.9;
    color: var(--text-white);
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.portfolio-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.portfolio-img-wrap {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff4757;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.05);
}

.portfolio-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.portfolio-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.portfolio-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.portfolio-date {
    font-size: 0.85rem;
    color: #999;
    display: block;
    text-align: right;
    margin-top: auto;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.page-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: var(--text-dark);
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.page-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #333;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: #eee;
}

#modalBody {
    display: flex;
    flex-direction: column;
}

.modal-img-wrap {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    background: #f5f5f5;
}

.modal-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-info {
    padding: 30px;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-details {
    list-style: none;
    margin-bottom: 25px;
}

.modal-details li {
    margin-bottom: 10px;
    font-size: 1.05rem;
    color: #444;
}

.modal-details li strong {
    display: inline-block;
    width: 100px;
    color: #222;
}

.modal-content-text {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    line-height: 1.6;
    color: #555;
}

.modal-content-text strong {
    color: #333;
    display: block;
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .sub-banner {
        padding: 120px 0 60px;
    }
    .sub-banner .sub-title {
        font-size: 2rem;
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .modal-info {
        padding: 20px;
    }
    .modal-title {
        font-size: 1.3rem;
    }
    .modal-details li {
        font-size: 0.95rem;
    }
    .modal-details li strong {
        width: 80px;
    }
}
