/**
 * 포트폴리오 페이지 스타일
 * 매거진 스타일 갤러리 레이아웃
 */

/* ========================================
   기본 레이아웃
   ======================================== */
.portfolios-page {
    min-height: 100vh;
    background: var(--white);
}

/* ========================================
   히어로 섹션
   ======================================== */
.portfolio-hero {
    position: relative;
    min-height: 75vh;
    /* Reverted to original height */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 0 80px;
    /* Nanobanana Theme Variant: Cool & Creative (Purple/Blue/Mint) */
    background: linear-gradient(135deg, #f3e5f5 0%, #e8eaf6 50%, #e0f2f1 100%);
    overflow: hidden;
}

/* 배경 패턴 - Nanobanana Style: Soft Geometric Beams (Distinct from Creators) */
.portfolio-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg at 50% 50%,
            rgba(233, 30, 140, 0.05) 0deg,
            rgba(0, 210, 255, 0.05) 120deg,
            rgba(233, 30, 140, 0.05) 240deg,
            rgba(0, 210, 255, 0.05) 360deg);
    animation: rotate 60s linear infinite;
    pointer-events: none;
}

.portfolio-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.5) 50%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(255, 255, 255, 0.5) 50%, transparent 52%);
    background-size: 60px 60px;
    opacity: 0.1;
    pointer-events: none;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 30px);
    }
}

.portfolio-hero .container {
    position: relative;
    z-index: 1;
    width: 100%;
}

.portfolio-hero .hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 64px;
}

.portfolio-hero .hero-label {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(233, 30, 140, 0.2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--primary);
    /* Darker text for bright bg */
    margin-bottom: 32px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-hero .hero-title {
    font-size: 72px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--gray-900);
    /* Dark text */
    margin: 0 0 32px 0;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.portfolio-hero .hero-title .highlight {
    background: linear-gradient(135deg, #E91E8C 0%, #FF4DA6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.portfolio-hero .hero-title .highlight::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    height: 8px;
    background: rgba(233, 30, 140, 0.3);
    filter: blur(10px);
}

.portfolio-hero .hero-desc {
    font-size: 20px;
    color: var(--gray-600);
    /* Darker muted text */
    line-height: 1.7;
    margin: 0;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 검색 (크리에이터 페이지 스타일과 동일) */
.hero-search {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto 48px;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.search-form {
    position: relative;
    background: white;
    border-radius: 60px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    padding: 8px;
}

.search-input-wrap {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #a3a3a3;
}

.search-input {
    width: 100%;
    padding: 18px 24px 18px 56px;
    border: none;
    border-radius: 60px;
    background: transparent;
    color: #171717;
    font-size: 17px;
    font-weight: 500;
}

.search-input::placeholder {
    color: #a3a3a3;
}

.search-input:focus {
    outline: none;
}

.search-btn {
    padding: 18px 40px;
    background: linear-gradient(135deg, #E91E8C 0%, #FF4DA6 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(233, 30, 140, 0.4);
}

/* 카테고리 태그 (크리에이터 페이지 스타일과 동일) */
.category-tags {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.6);
    /* More visible on bright bg */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    color: var(--gray-700);
    /* Dark text */
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.category-tag:hover {
    background: rgba(233, 30, 140, 0.2);
    border-color: rgba(233, 30, 140, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.category-tag .tag-count {
    background: rgba(233, 30, 140, 0.1);
    /* Colored bg for count */
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s;
    color: var(--primary);
}

/* ========================================
   섹션 레이아웃
   ======================================== */
.portfolio-section {
    padding: 80px 0;
}

.portfolio-section.alt-bg {
    background: var(--gray-50);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header.with-link {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
}

.section-label {
    display: inline-block;
    background: linear-gradient(135deg, #E91E8C, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.section-desc {
    font-size: 1rem;
    color: var(--gray-600);
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.view-all-link:hover {
    color: #E91E8C;
    gap: 10px;
}

/* ========================================
   작품 그리드
   ======================================== */
.works-grid {
    display: grid;
    gap: 30px;
    align-items: start;
}

.works-grid.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.works-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ========================================
   작품 카드
   ======================================== */
.work-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: fit-content;
}

.work-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.work-card .card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.work-card .card-image {
    /* main.css의 .card-image 리셋 */
    width: auto;
    height: auto;
    object-fit: unset;
    /* 실제 스타일 */
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--gray-100);
}

.work-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.work-card:hover .card-image img {
    transform: scale(1.05);
}

/* 배지 */
.work-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #E91E8C, #FF6B6B);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

/* 카드 콘텐츠 */
.work-card .card-content {
    /* main.css의 .card-content 스타일 완전 리셋 */
    position: static !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
    flex-direction: unset !important;
    align-items: unset !important;
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
    overflow: visible !important;
    /* 실제 스타일 - 하단 여백 최소화 */
    padding: 12px 14px;
}

.work-card .card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 6px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-card .card-desc {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin: 0 0 8px 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.32em; /* 2줄 높이 (line-height 1.45 * 2 * font-size) */
}

/* 카드 푸터 */
.work-card .card-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
}

.creator-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.creator-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.creator-avatar-placeholder {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

.creator-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.work-card .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--gray-500);
    /* main.css 오버라이드 */
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    text-align: left;
}

.work-card .stat-item:hover {
    border-color: transparent;
}

.work-card .stat-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    flex-shrink: 0;
}

.work-card .stat-likes svg {
    color: #E91E8C;
    opacity: 1;
}

/* ========================================
   빈 상태
   ======================================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    margin-bottom: 24px;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--gray-600);
}

/* ========================================
   CTA 섹션
   ======================================== */
.portfolio-cta {
    background: linear-gradient(135deg, #643287 0%, #9144b8 100%);
    padding: 100px 0;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-label {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.3;
    margin-bottom: 20px;
}

.cta-desc {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    line-height: 1.6;
}

.cta-btn {
    display: inline-block;
    padding: 16px 40px;
    background: var(--white);
    color: var(--primary-color);
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ========================================
   반응형
   ======================================== */
@media (max-width: 1200px) {
    .works-grid.grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {

    .works-grid.grid-4,
    .works-grid.grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-hero .hero-title {
        font-size: 56px;
    }
}

@media (max-width: 768px) {
    .portfolio-hero {
        min-height: auto;
        padding: 100px 0 60px;
    }

    .portfolio-hero .hero-title {
        font-size: 42px;
    }

    .portfolio-hero .hero-desc {
        font-size: 17px;
    }

    .search-form {
        flex-direction: column;
        border-radius: 24px;
        padding: 12px;
    }

    .search-input {
        padding: 16px 20px 16px 48px;
        font-size: 16px;
    }

    .search-btn {
        width: 100%;
        padding: 16px;
        border-radius: 16px;
    }

    .portfolio-section {
        padding: 60px 0;
    }

    .section-header.with-link {
        flex-direction: column;
        gap: 16px;
    }

    .cta-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .portfolio-hero .hero-title {
        font-size: 32px;
    }

    .portfolio-hero .hero-label {
        padding: 6px 16px;
        font-size: 10px;
        letter-spacing: 2px;
    }

    .portfolio-hero .hero-desc {
        font-size: 15px;
    }

    .category-tag {
        padding: 10px 18px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {

    .works-grid.grid-4,
    .works-grid.grid-3 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .work-card .card-content {
        padding: 14px;
    }

    .work-card .card-title {
        font-size: 0.95rem;
    }

    .work-card .card-desc {
        margin-bottom: 10px;
    }

    .category-tags {
        justify-content: flex-start;
    }

    .section-title {
        font-size: 1.5rem;
    }
}