/* =================================================================
   Category Archive Page - Custom Styles
   ================================================================= */

/* --- 1. Category Archive Wrapper --- */
.gp-category-archive-wrapper {
    position: relative;
    width: 100%;
    background-color: #fff;
    z-index: var(--z-content);
}

/* --- 2. Category Header --- */
.gp-category-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
}

.gp-category-header__title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -1px;
    color: #1a1d1f;
    margin: 0 0 12px 0;
}

.gp-category-header__description {
    font-size: 16px;
    line-height: 1.6;
    color: #6b7280;
    margin: 0;
}

/* --- 3. Mobile Filter (hidden on desktop) --- */
.gp-category-archive-mobile-filter {
    display: none;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    /* Mobile에서 표시 */
    .gp-category-archive-mobile-filter {
        display: block;
    }
}

/* --- 3.1 Category Filter Adjustments for Category Pages --- */
/* Category filter styles are inherited from gp-blog-index.css */
/* Only add category-specific overrides here if needed */

/* --- 4. Main Card Styles --- */
.gp-category-main-card {
    margin-bottom: 60px;
}

.gp-category-main-card.uq-post-card {
    background-color: #ffffff !important;
}

/* For segmented mode - direct children layout */
.gp-category-main-card.uq-post-card--card-surface-segmented {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important; 
    align-items: center !important;
    min-height: 320px;
    gap: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e8eb;
}

.gp-category-main-card .uq-post-card__media,
.gp-category-main-card .uq-card-surface--media { 
    padding: 0 !important;
    height: 100%;
    width: 100%;
    aspect-ratio: unset !important;
    margin-right: var(--main-media-right-inset, 8px);
    margin-bottom: 0 !important;
    background-color: transparent;
    display: block;
}

.gp-category-main-card .uq-post-card__media img,
.gp-category-main-card .uq-card-surface--media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gp-category-main-card .uq-post-card__body,
.gp-category-main-card .uq-card-surface--body {
    padding: 32px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    transform: translateY(var(--main-body-offset-y, -6px));
    background-color: white !important;
    width: 100%;
    height: 100%;
}

.gp-category-main-card .uq-post-card__title {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 42px;
    letter-spacing: -1px;
}

.gp-category-main-card .uq-post-card__title a {
    color: #1a1d1f;
    text-decoration: none;
}

.gp-category-main-card .uq-post-card__title a:hover {
    color: #1a1d1f;
    text-decoration: none;
}

.gp-category-main-card .uq-post-card__excerpt {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #6b7280;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 20px;
}

.gp-category-main-card .entry-meta {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #6b7280;
}

/* --- 5. Grid Layout --- */
.gp-category-grid {
    margin-bottom: 40px;
}

.gp-category-grid-cards .uq-post-card {
    background-color: transparent;
}

.gp-category-grid-cards .uq-post-card__media,
.gp-category-grid-cards .uq-card-surface--media {
    aspect-ratio: 305 / 162 !important;
    background-color: #fafafa;
    border-radius: 12px;
    border: 1px solid #e5e8eb;
    overflow: hidden;
}

.gp-category-grid-cards .uq-post-card__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 30px;
    letter-spacing: -0.5px;
}

.gp-category-grid-cards .uq-post-card__excerpt {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #6b7280;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 20px;
}

.gp-category-grid-cards .entry-meta {
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: #6b7280;
}

/* --- 6. Section Divider --- */
.gp-section-divider {
    width: 100%;
    height: 1px;
    background-color: #e5e7eb;
    margin: 40px 0;
    opacity: 0.6;
}

/* --- 7. Pagination --- */
.gp-category-pagination {
    margin: 40px 0;
    text-align: center;
}

.gp-category-pagination ul {
    display: inline-flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gp-category-pagination li {
    margin: 0;
}

.gp-category-pagination a,
.gp-category-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gp-category-pagination a {
    color: #6b7280;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

.gp-category-pagination a:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.gp-category-pagination .current {
    color: #fff;
    background-color: var(--accent, #7c3aed);
    border: 1px solid var(--accent, #7c3aed);
}

.gp-category-pagination .dots {
    color: #9ca3af;
    background-color: transparent;
    border: 1px solid transparent;
}

/* --- 8. No Posts Message --- */
.gp-no-posts {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #6b7280;
}

/* --- 9. Responsive Design --- */
@media (max-width: 1024px) {
    .gp-category-main-card.uq-post-card--card-surface-segmented {
        grid-template-columns: 60% 40%;
    }
    
    .gp-category-main-card .uq-post-card__body,
    .gp-category-main-card .uq-card-surface--body {
        padding: 24px !important;
    }
    
    .gp-category-main-card .uq-post-card__title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .gp-category-header__title {
        font-size: 28px;
    }
    
    /* Main Card - Vertical layout on mobile */
    .gp-category-main-card.uq-post-card--card-surface-segmented {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        min-height: auto;
    }
    
    .gp-category-main-card .uq-post-card__media,
    .gp-category-main-card .uq-card-surface--media {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16/9 !important;
        margin-right: 0 !important;
        padding-top: 0 !important;
        position: static !important;
    }
    
    .gp-category-main-card .uq-post-card__media img,
    .gp-category-main-card .uq-card-surface--media img {
        position: static !important;
        width: 100%;
        height: auto;
    }
    
    .gp-category-main-card .uq-post-card__body,
    .gp-category-main-card .uq-card-surface--body {
        padding: 20px !important;
        transform: none !important;
    }
    
    .gp-category-main-card .uq-post-card__title {
        font-size: 20px;
        line-height: 30px;
    }
    
    /* Grid Posts - 1 Column + Horizontal layout on mobile */
    .gp-category-grid-cards .uq-post-card-group__inner {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Grid Cards - Horizontal layout with media on right (35% width) */
    .gp-category-grid-cards .uq-post-card {
        display: grid !important;
        grid-template-columns: 1fr 35% !important;
        gap: 12px !important;
        align-items: center !important;
    }
    
    /* For segmented mode cards */
    .gp-category-grid-cards .uq-post-card--card-surface-segmented {
        display: grid !important;
        grid-template-columns: 1fr 35% !important;
        gap: 0 !important;
    }
    
    /* Move media to the right on mobile */
    .gp-category-grid-cards .uq-post-card__media,
    .gp-category-grid-cards .uq-card-surface--media {
        order: 2 !important; /* Media on right */
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 1/1 !important; /* Square aspect for mobile */
    }
    
    .gp-category-grid-cards .uq-post-card__body,
    .gp-category-grid-cards .uq-card-surface--body,
    .gp-category-grid-cards .uq-post-card__content {
        order: 1 !important; /* Body on left */
        padding: 12px !important;
    }
    
    /* Adjust title for mobile */
    .gp-category-grid-cards .uq-post-card__title {
        font-size: 16px;
        line-height: 22px;
    }
    
    .gp-category-grid-cards .uq-post-card__excerpt {
        display: none; /* Hide excerpt on mobile */
    }
    
    .gp-category-grid-cards .entry-meta {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .gp-category-header__title {
        font-size: 24px;
    }
    
    .gp-category-main-card .uq-post-card__body,
    .gp-category-main-card .uq-card-surface--body {
        padding: 16px !important;
    }
    
    .gp-category-main-card .uq-post-card__title {
        font-size: 18px;
        line-height: 26px;
    }
    
    .gp-category-grid-cards .uq-post-card__title {
        font-size: 14px;
        line-height: 20px;
    }
}

/* Global excerpt height fix override for category archive */
.gp-category-archive-wrapper .uq-post-card__excerpt {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}