/* ========================================
   Category Page - Modern Catalog Design
   ======================================== */

/* إلغاء الأنيميشن من صفحة التصنيف */
.category-page,
.category-page.post {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Category Layout */
.category-layout {
    max-width: 1200px;
    margin: 0 auto;
}

/* Category Main Wrapper */
.category-main-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

/* Category Container */
.category-page {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    min-width: 0;
}

@media (max-width: 767px) {
    .category-page {
        border-radius: 16px;
    }
}

/* Category Header */
.category-page .heading {
    padding: 50px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 3px solid #3498db;
}

.category-page .heading h1 {
    font-size: 2.5rem;
}

@media (max-width: 767px) {
    .category-page .heading {
        padding: 25px 18px;
    }
    
    .category-page .heading h1 {
        font-size: 1.75rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .category-page .heading {
        padding: 30px 20px;
    }
    
    .category-page .heading h1 {
        font-size: 2rem;
    }
}

.category-page .entry-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
    font-weight: 700;
    text-align: right;
}

/* Category Description */
.category-page .postcontent {
    padding: 0;
}

.category-page .postcontent [itemprop="articleBody"] {
    display: block;
    padding: 50px;
    font-size: 1.125rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

@media (max-width: 767px) {
    .category-page .postcontent [itemprop="articleBody"] {
        padding: 25px 18px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .category-page .postcontent [itemprop="articleBody"] {
        padding: 30px 20px;
    }
}

.category-page .postcontent [itemprop="articleBody"] p {
    margin-bottom: 1rem;
    text-align: justify;
    line-height: 1.8;
}

/* Category Images Grid */
.category-images-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 50px;
    background: #f8f9fa;
    margin-top: 0;
}

@media (max-width: 767px) {
    .category-images-grid {
        padding: 25px 18px;
        gap: 30px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .category-images-grid {
        padding: 30px 20px;
        gap: 30px;
    }
}

@media (min-width: 768px) {
    .category-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (min-width: 1024px) {
    .category-images-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

.category-images-grid .grid-item {
    position: relative;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (max-width: 767px) {
    .category-images-grid .grid-item {
        border-radius: 12px;
    }
}

.category-images-grid .grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.category-images-grid .wp-caption {
    margin: 0 !important;
    position: relative;
}

.category-images-grid img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

@media (min-width: 768px) {
    .category-images-grid img {
        height: 280px;
    }
}

@media (min-width: 1024px) {
    .category-images-grid img {
        height: 320px;
    }
}

.category-images-grid .grid-item:hover img {
    transform: scale(1.05);
}

.category-images-grid .image-caption {
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.5)) !important;
    padding: 1.25rem !important;
    margin-top: -80px !important;
    position: relative !important;
    z-index: 2 !important;
    text-align: right !important;
}

.category-images-grid .image-caption a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-images-grid .image-caption h3 {
    margin: 0 0 0.5rem 0 !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    transition: color 0.3s ease !important;
}

.category-images-grid .image-caption a:hover h3 {
    color: #ffd700 !important;
}

.category-images-grid .image-caption p {
    margin: 0 !important;
    font-size: 0.875rem !important;
    color: #f0f0f0 !important;
    line-height: 1.5 !important;
}

/* Breadcrumb */
.category-breadcrumb {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

@media (max-width: 767px) {
    .category-breadcrumb {
        padding: 15px 18px;
        border-radius: 12px;
        margin-bottom: 20px;
    }
}

.category-breadcrumb a {
    color: #0056b3;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.category-breadcrumb a:hover {
    color: #c82333;
}

.category-breadcrumb span {
    color: #495057;
    margin: 0 0.5rem;
    font-weight: 500;
}

/* Category Stats */
.category-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 20px 50px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
    color: #495057;
}

@media (max-width: 767px) {
    .category-stats {
        padding: 15px 18px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .category-stats {
        padding: 20px;
    }
}

.category-stats-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-stats-item span {
    color: #212529;
    font-weight: 500;
}

.category-stats-item i {
    color: #0056b3;
    font-size: 1rem;
}

/* No Images Message */
.no-images-message {
    text-align: center;
    padding: 50px;
    color: #6c757d;
    font-size: 1rem;
    background: #f8f9fa;
}

@media (max-width: 767px) {
    .no-images-message {
        padding: 30px 18px;
    }
}

.no-images-message i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
    display: block;
}

/* Category Featured Image (same as article) */
.category-page .postcontent > img:first-of-type {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* Responsive Grid Adjustments */
@media (max-width: 767px) {
    .category-images-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .category-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print Styles */
@media print {
    .category-stats,
    #featured.sliderwidget {
        display: none;
    }
    
    .category-page {
        box-shadow: none;
    }
}

/* Loading State */
.category-images-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty State */
.category-empty {
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    border-radius: 16px;
}

.category-empty i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1.5rem;
    display: block;
}

.category-empty h3 {
    font-size: 1.5rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.category-empty p {
    color: #adb5bd;
    font-size: 1rem;
}

/* ========================================
   Related Articles Blog Cards
   ======================================== */

.related-articles {
    margin-top: 40px;
    padding: 50px;
    background: #f8f9fa;
    border-radius: 24px;
}

@media (max-width: 767px) {
    .related-articles {
        padding: 25px 18px;
        border-radius: 16px;
        margin-top: 30px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .related-articles {
        padding: 30px 20px;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 700;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #3498db;
}

@media (max-width: 767px) {
    .section-title {
        font-size: 1.5rem;
    }
}

/* Blog Grid Layout */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Blog Card Design */
.blog-card {
    display: block;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

@media (max-width: 767px) {
    .blog-card {
        border-radius: 12px;
    }
}

/* Blog Card Image */
.blog-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

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

.blog-card:hover .blog-image img,
.blog-card:hover .blog-image picture {
    transform: scale(1.08);
}

@media (min-width: 768px) {
    .blog-image {
        height: 200px;
    }
}

@media (min-width: 1024px) {
    .blog-image {
        height: 240px;
    }
}

/* Blog Date Badge */
.blog-date {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

.blog-date .icon {
    font-size: 0.9rem;
    color: #3498db;
}

/* Blog Card Content */
.blog-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 767px) {
    .blog-content {
        padding: 1.25rem;
    }
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-title {
    color: #3498db;
}

@media (max-width: 767px) {
    .blog-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
}

.blog-excerpt {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 767px) {
    .blog-excerpt {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
        -webkit-line-clamp: 2;
    }
}

/* Blog Card Footer */
.blog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.blog-read-more {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3498db;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-read-more {
    color: #2980b9;
}

.blog-icon {
    width: 32px;
    height: 32px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.blog-icon .icon {
    color: #fff;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-icon {
    background: #2980b9;
    transform: translateX(-4px);
}

.blog-card:hover .blog-icon .icon {
    transform: translateX(-2px);
}

/* Loading Animation */
.blog-grid.loading .blog-card {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Adjustments for Category Page */
@media (max-width: 767px) {
    .related-articles {
        margin-top: 30px;
    }
    
    .blog-grid {
        gap: 1.5rem;
    }
}
