/**
 * Agency Portfolio Front-end Styles
 * Final v2 Design
 *
 * @package Agency_Works
 * @since 1.1.0
 */

:root {
    --portfolio-primary: #4F8EF7;
    --portfolio-bg: #ffffff;
    --portfolio-text: #1a1a1a;
    --portfolio-text-secondary: #666666;
    --portfolio-border: #e5e5e5;
    --portfolio-hover-bg: #f8f9fa;
}

/* 갤러리 그리드 – 콘텐츠 너비 */
/* Astra ast-page-builder-template 오버라이드: !important 필수 */
.agency-portfolio-gallery {
    max-width: 1200px !important;
    margin: 40px auto 0 !important;
    padding: 0 20px 60px !important;
    box-sizing: border-box;
    width: auto !important;
    position: static !important;
    transform: none !important;
}

.agency-portfolio-gallery .portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

/* 포트폴리오 카드 */
.agency-portfolio-gallery .portfolio-card {
    background: white;
    border: 1px solid var(--portfolio-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.agency-portfolio-gallery .portfolio-card:hover {
    box-shadow: 0 12px 40px rgba(79, 142, 247, 0.15);
    transform: translateY(-4px);
}

.agency-portfolio-gallery .card-cover img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.agency-portfolio-gallery .card-body {
    padding: 24px;
}

.agency-portfolio-gallery .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.agency-portfolio-gallery .client-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--portfolio-hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: var(--portfolio-primary);
    flex-shrink: 0;
}

.agency-portfolio-gallery .card-title h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.agency-portfolio-gallery .card-industry {
    font-size: 13px;
    color: var(--portfolio-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agency-portfolio-gallery .card-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--portfolio-border);
}

.agency-portfolio-gallery .meta-item {
    flex: 1;
    text-align: center;
}

.agency-portfolio-gallery .meta-label {
    font-size: 12px;
    color: var(--portfolio-text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.agency-portfolio-gallery .meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--portfolio-text);
}

/* 상세 페이지 */
.agency-portfolio-detail {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agency-portfolio-detail .back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    background: white;
    border: 1px solid var(--portfolio-border);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.agency-portfolio-detail .back-button:hover {
    background: var(--portfolio-primary);
    color: white;
    border-color: var(--portfolio-primary);
}

/* Portfolio v3 스타일 헤더 */
.agency-portfolio-detail .portfolio-hero {
    width: 100%;
    max-width: 700px;
    margin: 0 auto 40px;
    border-radius: 12px;
    overflow: hidden;
}

.agency-portfolio-detail .portfolio-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.agency-portfolio-detail .portfolio-header {
    max-width: 700px;
    margin: 0 auto 60px;
    text-align: center;
}

.agency-portfolio-detail .portfolio-client {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.agency-portfolio-detail .portfolio-client-logo {
    width: 48px;
    height: 48px;
    background: var(--portfolio-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.agency-portfolio-detail .portfolio-client-info h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 2px 0;
    text-align: left;
}

.agency-portfolio-detail .portfolio-client-info p {
    font-size: 13px;
    color: var(--portfolio-text-secondary);
    text-align: left;
    margin: 0;
}

.agency-portfolio-detail .portfolio-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.agency-portfolio-detail .portfolio-period {
    font-size: 14px;
    color: var(--portfolio-text-secondary);
    margin: 0 0 24px 0;
}

/* 프로젝트 개요 박스 */
.agency-portfolio-detail .project-overview {
    max-width: 700px;
    margin: 0 auto 40px;
    background: var(--portfolio-hover-bg);
    border-radius: 8px;
    padding: 24px;
}

.agency-portfolio-detail .overview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--portfolio-text);
}

.agency-portfolio-detail .overview-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--portfolio-text);
    margin: 0;
}

/* 운영 채널 박스 */
.agency-portfolio-detail .channels-box {
    max-width: 700px;
    margin: 0 auto 60px;
    background: white;
    border: 1px solid var(--portfolio-border);
    border-radius: 8px;
    padding: 24px;
}

.agency-portfolio-detail .channels-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--portfolio-text);
}

.agency-portfolio-detail .channels-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.agency-portfolio-detail .channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--portfolio-hover-bg);
    border-radius: 6px;
}

.agency-portfolio-detail .channel-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.agency-portfolio-detail .channel-info {
    flex: 1;
}

.agency-portfolio-detail .channel-name {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px 0;
}

.agency-portfolio-detail .channel-desc {
    font-size: 11px;
    color: var(--portfolio-text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* 디자인 보드 이미지 */
.agency-portfolio-detail .design-boards-section {
    max-width: 1200px;
    margin: 0 auto 100px;
}

.agency-portfolio-detail .design-board-image {
    width: 100%;
    margin-bottom: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.agency-portfolio-detail .design-board-image:last-child {
    margin-bottom: 0;
}

.agency-portfolio-detail .design-board-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Works 섹션 */
.agency-portfolio-detail .works-section {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 80px;
    border-top: 2px solid var(--portfolio-border);
}

.agency-portfolio-detail .section-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-align: center;
}

.agency-portfolio-detail .section-subtitle {
    font-size: 16px;
    color: var(--portfolio-text-secondary);
    text-align: center;
    margin: 0 0 48px 0;
}

.agency-portfolio-detail .works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.agency-portfolio-detail .work-card {
    background: white;
    border: 1px solid var(--portfolio-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.agency-portfolio-detail .work-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

.agency-portfolio-detail .work-thumbnail {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.agency-portfolio-detail .work-info {
    padding: 20px;
}

.agency-portfolio-detail .work-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.agency-portfolio-detail .work-type.youtube {
    background: #ff0000;
    color: white;
}

.agency-portfolio-detail .work-type.instagram {
    background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
    color: white;
}

.agency-portfolio-detail .work-type.design {
    background: #9333ea;
    color: white;
}

.agency-portfolio-detail .work-type.video {
    background: #0ea5e9;
    color: white;
}

.agency-portfolio-detail .work-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--portfolio-text);
}

.agency-portfolio-detail .work-date {
    font-size: 13px;
    color: var(--portfolio-text-secondary);
    margin: 0;
}

/* 반응형 */
@media (max-width: 768px) {
    .agency-portfolio-gallery .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .agency-portfolio-detail .portfolio-title {
        font-size: 24px;
    }
    
    .agency-portfolio-detail .channels-list {
        grid-template-columns: 1fr;
    }
    
    .agency-portfolio-detail .works-grid {
        grid-template-columns: 1fr;
    }
    
    .agency-portfolio-detail .design-board-image {
        margin-bottom: 24px;
    }
}
