/**
 * 올댓이미지 갤러리 포스팅 - 프론트엔드 스타일
 * @package ATI_Gallery_Post
 * @since 1.0.0
 */

/* ==========================================================================
   갤러리 그리드
   ========================================================================== */

.ati-hair-gallery,
.ati-video-gallery {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

/* 그리드 컬럼 설정 */
.ati-gallery-columns-1 { grid-template-columns: repeat(1, 1fr); }
.ati-gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ati-gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ati-gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.ati-gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.ati-gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }

/* 반응형 그리드 */
@media (max-width: 1200px) {
    .ati-gallery-columns-5,
    .ati-gallery-columns-6 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .ati-gallery-columns-4,
    .ati-gallery-columns-5,
    .ati-gallery-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ati-gallery-columns-3,
    .ati-gallery-columns-4,
    .ati-gallery-columns-5,
    .ati-gallery-columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ati-hair-gallery,
    .ati-video-gallery {
        grid-template-columns: repeat(1, 1fr);
        gap: 15px;
    }
}

/* ==========================================================================
   갤러리 아이템
   ========================================================================== */

.ati-gallery-item {
    position: relative;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ati-gallery-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ati-gallery-item.sold-out {
    opacity: 0.7;
}

.ati-gallery-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ==========================================================================
   갤러리 이미지
   ========================================================================== */

.ati-gallery-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 비율 */
    overflow: hidden;
    background: #f5f5f5;
}

.ati-gallery-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ati-gallery-item:hover .ati-gallery-image img {
    transform: scale(1.05);
}

/* 비디오 재생 아이콘 */
.ati-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.ati-gallery-item:hover .ati-video-play-icon {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

/* 비디오 재생시간 */
.ati-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

/* 상태 뱃지 */
.ati-status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ati-status-badge.sold-out {
    background: #ff4444;
    color: #fff;
}

/* ==========================================================================
   갤러리 정보
   ========================================================================== */

.ati-gallery-info {
    padding: 15px;
}

.ati-gallery-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ati-gallery-style {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #666;
}

.ati-gallery-price {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #2271b1;
}

/* ==========================================================================
   에러 메시지
   ========================================================================== */

.ati-gallery-error,
.ati-gallery-no-items {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    text-align: center;
}

/* ==========================================================================
   단일 페이지 스타일
   ========================================================================== */

.single-ati_hair .ati-single-product,
.single-ati_video .ati-single-product {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.ati-product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .ati-product-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.ati-product-gallery {
    position: relative;
}

.ati-product-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ati-product-image img {
    width: 100%;
    height: auto;
    display: block;
}

.ati-product-details {
    padding: 20px 0;
}

.ati-product-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #333;
}

.ati-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.ati-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ati-meta-label {
    font-weight: 600;
    color: #666;
}

.ati-meta-value {
    color: #333;
}

.ati-product-price {
    font-size: 32px;
    font-weight: 700;
    color: #2271b1;
    margin: 20px 0;
}

.ati-product-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.ati-product-status.active {
    background: #d4edda;
    color: #155724;
}

.ati-product-status.sold-out {
    background: #f8d7da;
    color: #721c24;
}

.ati-product-description {
    margin-top: 20px;
    line-height: 1.8;
    color: #555;
}

.ati-product-actions {
    margin-top: 30px;
}

.ati-btn-gallery {
    display: inline-block;
    padding: 12px 30px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.ati-btn-gallery:hover {
    background: #135e96;
    color: #fff;
}

/* ==========================================================================
   아카이브 페이지
   ========================================================================== */

.post-type-archive-ati_hair .site-main,
.post-type-archive-ati_video .site-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.ati-archive-header {
    margin-bottom: 40px;
    text-align: center;
}

.ati-archive-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 15px 0;
}

.ati-archive-description {
    font-size: 16px;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

/* ==========================================================================
   필터 및 정렬
   ========================================================================== */

.ati-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.ati-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ati-filter-label {
    font-weight: 600;
    color: #555;
}

.ati-filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
}

/* ==========================================================================
   페이지네이션
   ========================================================================== */

.ati-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.ati-pagination a,
.ati-pagination span {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.ati-pagination a:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.ati-pagination .current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* ==========================================================================
   로딩 상태
   ========================================================================== */

.ati-loading {
    text-align: center;
    padding: 40px;
}

.ati-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #2271b1;
    border-radius: 50%;
    animation: ati-spin 1s linear infinite;
}

@keyframes ati-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   유틸리티
   ========================================================================== */

.ati-text-center {
    text-align: center;
}

.ati-mt-20 {
    margin-top: 20px;
}

.ati-mb-20 {
    margin-bottom: 20px;
}

.ati-hidden {
    display: none;
}

/* ==========================================================================
   다크모드 지원 (선택사항)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .ati-gallery-item {
        background: #1e1e1e;
        border-color: #333;
    }
    
    .ati-gallery-title {
        color: #e0e0e0;
    }
    
    .ati-gallery-style {
        color: #999;
    }
    
    .ati-gallery-image {
        background: #2a2a2a;
    }
}