/* Category Sections Styling */

.category-section {
    margin-bottom: 80px;
    padding: 60px 10px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.category-heading {
    font-size: 2.4rem;
    font-weight: 700;
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 4px solid #2563eb;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.view-all-link {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.2s;
}

.view-all-link:hover {
    opacity: 0.8;
}

.category-section .post-feed {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
}

/* Videos section - 2 columns for 2 rows of 2 posts */
.videos-section .videos-feed {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 40px !important;
}

/* Add play button overlay for videos - white circle with blue triangle */
.videos-feed .post-card-image-link::after {
    /* white circular background (override theme padding-based pseudo) */
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 56px !important;
    height: 56px !important;
    padding: 0 !important; /* cancel theme's padding-bottom */
    background: #ffffff !important;
    border-radius: 50% !important;
    display: block !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease !important;
    pointer-events: none !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12) !important;
    z-index: 5 !important;
}

.videos-feed .post-card-image-link::before {
    /* blue triangle play icon centered over the white circle */
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 18px solid #2563eb !important;
    border-top: 12px solid transparent !important;
    border-bottom: 12px solid transparent !important;
    z-index: 6 !important;
    pointer-events: none !important;
}

.videos-feed .post-card:hover .post-card-image-link::after {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

/* Larger video cards */
.videos-feed .post-card {
    height: auto !important;
}

.videos-feed .post-card-image-link {
    padding-bottom: 56.25% !important; /* 16:9 aspect ratio for videos */
}

/* Prevent theme from applying padding-bottom via pseudo on videos (make our circle exact) */
.videos-feed .post-card-image-link::after[style] {
    padding-bottom: 0 !important;
}

.videos-feed .post-card-content {
    min-height: 100px !important;
}

.videos-feed .post-card-title {
    font-size: 1.5rem !important;
    margin-bottom: 8px !important;
}

/* Force all cards in category sections to be same size */
.category-feed .post-card {
    grid-column: span 1 !important;
    display: flex !important;
    flex-direction: column !important;
    grid-gap: 0 !important;
    grid-template-columns: none !important;
    border-top: none !important;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100% !important;
}

.category-feed .post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.category-feed .post-card-large {
    grid-column: span 1 !important;
    display: flex !important;
    flex-direction: column !important;
    grid-gap: 0 !important;
    grid-template-columns: none !important;
}

.category-feed .post-card.dynamic {
    grid-column: span 1 !important;
}

.category-feed .post-card-full {
    grid-column: span 1 !important;
}

/* Reset image link positioning */
.category-feed .post-card-image-link {
    position: relative !important;
    display: block !important;
    overflow: hidden;
    /* use percentage padding to keep aspect ratio and allow card to size naturally */
    padding-bottom: 30% !important;
    margin-bottom: 0 !important;
    grid-column: auto !important;
    border-radius: 0 !important;
}

.category-feed .post-card-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s;
}

.category-feed .post-card:hover .post-card-image {
    transform: scale(1.05);
}

/* Reset content positioning */
.category-feed .post-card-content {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    grid-column: auto !important;
    order: 0 !important;
    padding: 10px 12px 12px 12px !important;
    flex: 1;
    min-height: auto !important;
}

/* Consistent title sizing */
.category-feed .post-card-title {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
    font-size: 1.25rem !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    color: #000 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 1.9rem;
}

/* Consistent excerpt */
.category-feed .post-card-excerpt {
    margin-top: 0 !important;
    margin-bottom: 6px !important;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* allow slightly more excerpt lines */
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    font-size: 1.05rem !important;
    line-height: 1.3 !important;
    color: #666 !important;
    min-height: 3.2rem;
}

/* Responsive: revert to flexible sizing on small screens */
@media (max-width: 650px) {
    .category-feed .post-card {
        height: auto !important;
    }
    .category-feed .post-card-image-link {
        height: auto !important;
        padding-bottom: 35% !important;
    }
    .category-feed .post-card-content {
        min-height: auto !important;
    }
    .videos-feed .post-card-image-link {
        padding-bottom: 56.25% !important;
        height: auto !important;
    }
}

/* Hide tags in category sections */
.category-feed .post-card-tags {
    display: none !important;
}

/* Style the read article button */
.category-feed .post-card-content-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.category-feed .post-card-content::after {
    content: 'Read Article';
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #2563eb;
    margin-top: auto;
    padding-top: 0;
}

.category-feed .post-card-content::after::before {
    content: '\u2192';
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.category-feed .post-card:hover .post-card-content::after {
    gap: 8px;
}

/* Hide meta info */
.category-feed .post-card-meta {
    display: none !important;
}

.no-posts {
    color: #738a94;
    font-style: italic;
    padding: 20px 0;
    grid-column: 1 / -1;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .category-section .post-feed {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 24px !important;
    }
}

@media (max-width: 991px) {
    .category-section .post-feed {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    .category-heading {
        font-size: 2rem;
    }
    
    .category-section {
        padding: 40px 30px;
    }
}

@media (max-width: 650px) {
    .category-section .post-feed {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .category-heading {
        font-size: 1.8rem;
        margin-bottom: 0;
    }
    
    .category-section {
        margin-bottom: 40px;
        padding: 30px 20px;
    }
    
    .category-feed .post-card-title {
        font-size: 1.5rem !important;
    }
    
    .category-feed .post-card-content {
        padding: 20px 16px !important;
    }
}
