/**
 * Dapeng Portfolio Manager — Frontend Styles
 * Styles for the new portfolio layout system
 * Compatible with the Continal theme structure
 */

/* ============================
   Common Portfolio Styles
   ============================ */
.dpm-portfolio {
    padding: 30px 0;
}

.dpm-project-details {
    margin-bottom: 24px;
}

.dpm-details-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c8a45c;
    display: inline-block;
}

.dpm-project-details p {
    margin: 6px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

.dpm-project-details p strong {
    color: #333;
    font-weight: 600;
}

.dpm-project-description {
    margin-top: 24px;
}

.dpm-project-description p {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}

/* ============================
   Layout 1: Split layout (current site style)
   ============================ */
.dpm-layout-1 .dpm-content-left {
    padding-right: 20px;
}

.dpm-layout-1 .dpm-main-image {
    margin-bottom: 20px;
}

.dpm-layout-1 .dpm-main-image img,
.dpm-layout-1 .dpm-main-image picture img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.dpm-layout-1 .dpm-gallery-grid-frontend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.dpm-layout-1 .dpm-gallery-item-frontend {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    height: 100%;
}

.dpm-layout-1 .dpm-gallery-item-frontend img,
.dpm-layout-1 .dpm-gallery-item-frontend picture img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.dpm-layout-1 .dpm-gallery-item-frontend:hover img,
.dpm-layout-1 .dpm-gallery-item-frontend:hover picture img {
    transform: scale(1.05);
}

/* ============================
   Layout 2: Full-width hero
   ============================ */
.dpm-layout-2 .dpm-hero-image {
    margin-bottom: 40px;
    border-radius: 6px;
    overflow: hidden;
}

.dpm-layout-2 .dpm-hero-image img,
.dpm-layout-2 .dpm-hero-image picture img {
    width: 100%;
    height: auto;
    display: block;
}

.dpm-layout-2 .dpm-content-center {
    text-align: center;
    padding: 30px 0;
}

.dpm-layout-2 .dpm-content-center .dpm-details-title {
    display: inline-block;
}

.dpm-layout-2 .dpm-gallery-masonry {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 30px;
}

.dpm-layout-2 .dpm-masonry-item {
    display: block;
    overflow: hidden;
    border-radius: 6px;
    position: relative;
}

.dpm-layout-2 .dpm-masonry-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.3s ease;
}

.dpm-layout-2 .dpm-masonry-item:hover::after {
    background: rgba(0,0,0,0.15);
}

.dpm-layout-2 .dpm-masonry-item img,
.dpm-layout-2 .dpm-masonry-item picture img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.dpm-layout-2 .dpm-masonry-item:hover img,
.dpm-layout-2 .dpm-masonry-item:hover picture img {
    transform: scale(1.08);
}

/* ============================
   Layout 3: Slider
   ============================ */
.dpm-layout-3 .dpm-slider-container {
    position: relative;
    margin-bottom: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
}

.dpm-layout-3 .dpm-slide {
    display: none;
}

.dpm-layout-3 .dpm-slide:first-child {
    display: block;
}

.dpm-layout-3 .dpm-slide img,
.dpm-layout-3 .dpm-slide picture img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
}

.dpm-slider-prev,
.dpm-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.dpm-slider-prev { left: 16px; }
.dpm-slider-next { right: 16px; }

.dpm-slider-prev:hover,
.dpm-slider-next:hover {
    background: rgba(200, 164, 92, 0.9);
}

.dpm-slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dpm-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dpm-dot.active {
    background: #c8a45c;
    transform: scale(1.2);
}

.dpm-layout-3 .dpm-content-center {
    padding: 30px 0;
}

/* ============================
   Video Thumbnail (in gallery grid)
   ============================ */
.dpm-video-thumb {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    aspect-ratio: 4/3;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

/* CSS triangle play icon — avoids WordPress emoji conversion */
.dpm-video-thumb::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-38%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 22px 0 22px 40px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.85);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.dpm-video-thumb:hover::before {
    border-color: transparent transparent transparent #c8a45c;
    transform: translate(-38%, -50%) scale(1.15);
}

/* ============================
   Video Modal
   ============================ */
#dpm-video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

#dpm-video-modal.dpm-modal-open {
    display: block;
}

#dpm-video-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1;
}

#dpm-video-modal-inner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 90vw;
    max-width: 960px;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}

#dpm-video-modal-player {
    display: block;
    width: 100%;
    max-height: 80vh;
    background: #000;
}

#dpm-video-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    line-height: 36px;
    text-align: center;
    padding: 0;
    transition: background 0.2s ease;
}

#dpm-video-modal-close:hover {
    background: #c8a45c;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 991px) {
    .dpm-layout-1 .dpm-content-left {
        padding-right: 0;
        margin-bottom: 30px;
    }
    
    .dpm-layout-2 .dpm-gallery-masonry {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .dpm-layout-3 .dpm-slide img,
    .dpm-layout-3 .dpm-slide picture img {
        height: 350px;
    }
}

@media (max-width: 767px) {
    .dpm-layout-1 .dpm-gallery-grid-frontend {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dpm-layout-2 .dpm-gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dpm-layout-3 .dpm-slide img,
    .dpm-layout-3 .dpm-slide picture img {
        height: 250px;
    }
    
    .dpm-slider-prev,
    .dpm-slider-next {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .dpm-layout-1 .dpm-gallery-grid-frontend,
    .dpm-layout-2 .dpm-gallery-masonry {
        grid-template-columns: 1fr;
    }
}
