/* CATEGORY SECTIONS - Horizontal Scrollable Carousels */

/* Category Section */
.category-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, var(--primary-white) 0%, var(--light-gray) 100%);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.category-section.hidden {
    display: none;
}

.category-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--magenta-subtle), transparent);
}

.category-section:nth-child(even) {
    background: linear-gradient(180deg, var(--light-gray) 0%, rgba(199, 21, 133, 0.03) 50%, var(--light-gray) 100%);
}

/* Category Header */
.category-header {
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.category-title {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

.category-title i {
    color: rgba(199, 21, 133, 0.7);
    font-size: 1.8rem;
}

/* View All Button */
.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.8rem;
    background: rgba(199, 21, 133, 0.1);
    color: var(--magenta);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 8px rgba(199, 21, 133, 0.1);
    white-space: nowrap;
    border: 1px solid rgba(199, 21, 133, 0.2);
}

.view-all-btn:hover {
    background: var(--gradient-magenta);
    color: var(--text-on-magenta);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 15px rgba(199, 21, 133, 0.25);
    border-color: transparent;
}

.view-all-btn i {
    transition: transform 0.3s ease;
}

.view-all-btn:hover i {
    transform: translateX(4px);
}

/* Carousel Container */
.category-carousel {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--magenta) var(--light-gray);
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 1.5rem;
}

/* Rimuovi cursore grab su touch devices */
@media (hover: none) and (pointer: coarse) {
    .category-carousel {
        cursor: auto !important;
    }
}

/* Carousel Track */
.carousel-track {
    display: flex;
    gap: 1.5rem;
    min-width: min-content;
    margin-top: 1rem;
}

/* Category Card */
.category-card {
    flex: 0 0 350px;
    background: var(--primary-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(199, 21, 133, 0.1);
    height: 280px;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 1;
}

.category-card.hidden {
    display: none;
}

.category-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-magenta);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px rgba(199, 21, 133, 0.15);
    border-color: rgba(199, 21, 133, 0.3);
    background: linear-gradient(180deg, var(--primary-white) 0%, rgba(199, 21, 133, 0.02) 100%);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.8rem;
    position: relative;
}

.card-header {
    margin-bottom: 1rem;
}

.card-title {
    font-family: var(--font-primary);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.75rem;
}

.category-card:hover .card-title {
    color: var(--magenta);
}

.card-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.meta-item i {
    color: rgba(199, 21, 133, 0.6);
    font-size: 0.9rem;
}

.card-arrow {
    position: absolute;
    bottom: 1.8rem;
    right: 1.8rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(199, 21, 133, 0.08);
    color: rgba(199, 21, 133, 0.7);
    border-radius: 50%;
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(199, 21, 133, 0.15);
}

.category-card:hover .card-arrow {
    background: var(--gradient-magenta);
    color: var(--text-on-magenta);
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(199, 21, 133, 0.25);
}

/* RECENT POSTS SECTION */
.recent-posts-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, var(--light-gray) 0%, var(--magenta-ultra-light) 50%, var(--light-gray) 100%);
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.recent-card {
    background: var(--primary-white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid var(--border-light);
    position: relative;
}

.recent-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-magenta);
    border-radius: 14px 14px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recent-card:hover::before {
    opacity: 1;
}

.recent-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 40px rgba(199, 21, 133, 0.2);
    border-color: var(--magenta);
    background: linear-gradient(180deg, var(--primary-white) 0%, var(--magenta-ultra-light) 100%);
}

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

.recent-title {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.recent-card:hover .recent-title {
    color: var(--magenta);
}

.recent-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.recent-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tag-badge {
    background: linear-gradient(135deg, var(--magenta-ultra-light), var(--magenta-subtle));
    color: var(--magenta-dark);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--magenta-subtle);
    transition: all 0.3s ease;
}

.recent-card:hover .tag-badge,
.category-full-card:hover .tag-badge {
    background: var(--gradient-magenta);
    color: var(--text-on-magenta);
    border-color: transparent;
}

/* PAGINATION */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 4rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: var(--primary-white);
    color: var(--text-primary);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-subtle);
    border: 2px solid var(--border-light);
}

.pagination-btn:hover:not(.disabled) {
    background: var(--gradient-magenta);
    color: var(--text-on-magenta);
    border-color: var(--magenta);
    transform: scale(1.1);
    box-shadow: var(--shadow-magenta);
}

.pagination-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

/* CATEGORY FILTERED VIEW */
.category-breadcrumb {
    padding: 2rem 0 1rem;
    background: var(--light-gray);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--magenta);
    gap: 1rem;
}

.back-link i {
    transition: transform 0.3s ease;
}

.back-link:hover i {
    transform: translateX(-4px);
}

.category-hero {
    background: var(--light-gray);
    padding: 2rem 0 4rem;
}

.category-hero-content {
    text-align: center;
}

.category-hero-title {
    font-family: var(--font-primary);
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.category-hero-title i {
    color: var(--magenta);
    font-size: 2.5rem;
}

.category-hero-count {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
}

.category-posts-section {
    padding-bottom: 4rem;
    background: linear-gradient(180deg, var(--primary-white) 0%, var(--light-gray) 100%);
}

.category-posts-grid {
    display: grid;
    gap: 2rem;
}

.category-full-card {
    background: var(--primary-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--magenta);
    position: relative;
}

.category-full-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 5px;
    background: var(--gradient-magenta);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-full-card:hover::before {
    opacity: 1;
}

.category-full-card:hover {
    box-shadow: 0 15px 50px rgba(199, 21, 133, 0.2);
    border-color: var(--magenta);
    transform: translateY(-4px);
    background: linear-gradient(90deg, var(--magenta-ultra-light) 0%, var(--primary-white) 20%);
}

.full-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2.5rem;
    gap: 2rem;
}

.full-card-content {
    flex: 1;
}

.full-card-title {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.category-full-card:hover .full-card-title {
    color: var(--magenta);
}

.full-card-excerpt {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.full-card-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.full-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.full-card-arrow {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-magenta);
    color: var(--text-on-magenta);
    border-radius: 50%;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.category-full-card:hover .full-card-arrow {
    transform: scale(1.1) rotate(0deg);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .category-title {
        font-size: 1.6rem;
    }

    .category-hero-title {
        font-size: 2.2rem;
    }

    .category-card {
        flex: 0 0 300px;
        max-height: 200px !important;
    }
}

@media (max-width: 768px) {
    .category-section .container {
        padding: 0 0.75rem !important;
        max-width: 100% !important;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .category-title {
        font-size: 1.4rem;
    }

    .btn-read-more {
        font-size: 0.85rem;
    }

    .view-all-btn {
        align-self: flex-start;
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }

    .category-card {
        flex: 0 0 280px;
        height: 260px;
    }

    .card-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .recent-grid {
        grid-template-columns: 1fr;
    }

    .category-hero-title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .full-card-link {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .full-card-arrow {
        align-self: flex-end;
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .category-section {
        padding: 2.5rem 0;
    }

    .category-title {
        font-size: 1.15rem;
        gap: 0.75rem;
    }
    
    .category-title i {
        font-size: 1.3rem;
    }

    .category-card {
        flex: 0 0 calc(100vw - 3rem);
        max-width: 300px;
        height: 240px;
    }
    
    .card-link {
        padding: 1.5rem;
    }

    .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .card-excerpt {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
    }

    .full-card-title {
        font-size: 1.3rem;
    }

    .full-card-link {
        padding: 1rem;
        gap: 1rem;
    }

    .full-card-arrow {
        align-self: flex-end;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .carousel-track {
        gap: 1rem;
    }
}

/* Extra small devices (320px and below) */
@media (max-width: 320px) {
    .category-section {
        padding: 2rem 0;
    }
    
    .category-title {
        font-size: 1.05rem;
    }
    
    .category-card {
        flex: 0 0 calc(100vw - 2.5rem);
        height: 220px;
    }
    
    .card-link {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .view-all-btn {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}