/* ==========================
   TCM Blog Posts Styles
   ========================== */

/* Base Container Styles */
.tcm-recent-posts,
.tcm-blog-archive {
    width: 100%;
    margin: 0 auto;
}

/* Grid Layout */
.tcm-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    grid-auto-rows: 1fr;
    align-items: stretch;
}

/* Blog Card */
.tcm-blog-card {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    height: 100%;
    min-height: 100%;
}

.tcm-blog-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex: 1;
    width: 100%;
    height: 100%;
}

.tcm-blog-card-inner {
    background: #28293e;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    /* Gradient border effect */
    background: linear-gradient(#28293e, #28293e) padding-box,
                linear-gradient(135deg, #a000ff 0%, #50dcc8 100%) border-box;
    border: 1px solid transparent;
}

/* Card Header */
.tcm-blog-card-header {
    padding: 24px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tcm-blog-header-top {
    display: flex;
    align-items: center;
}

.tcm-blog-label {
    font-size: 15px;
    line-height: 20px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #50dcc8;
    text-transform: uppercase;
}

.tcm-blog-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 20px;
    line-height: 25px;
    color: #ffffff;
}

.tcm-blog-date,
.tcm-blog-reading-time {
    white-space: nowrap;
}

/* Card Image */
.tcm-blog-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    display: block;
    line-height: 0;
}

.tcm-blog-card-image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    display: block;
    vertical-align: middle;
}

/* No Featured Image Fallback */
.tcm-blog-card-image.tcm-no-featured-image {
    background: linear-gradient(135deg, #a000ff 0%, #50dcc8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcm-blog-card-image.tcm-no-featured-image::after {
    content: '';
    /* Empty - just shows the gradient background */
}

/* Card Content */
.tcm-blog-card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tcm-blog-card-title {
    /* font-size and line-height removed - inherits from theme h3 */
    font-weight: 400;
    color: #ffffff;
    margin: 0 0 24px 0;
}

/* Arrow Button */
.tcm-blog-card-arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a000ff 0%, #c060ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcm-blog-card-arrow svg {
    width: 16px;
    height: 16px;
}

/* Visibility Controls */
.tcm-mobile-only {
    display: none;
}

.tcm-desktop-only {
    display: grid;
}

/* Carousel Styles */
.tcm-blog-carousel {
    width: 100%;
    overflow: visible;
}

.tcm-blog-swiper {
    width: 100%;
    padding-bottom: 0;
    overflow: visible;
}

.tcm-blog-swiper .swiper-wrapper {
    overflow: visible;
    max-height: none !important;
    height: auto !important;
}

.tcm-blog-swiper .swiper-slide {
    height: auto;
}

/* Hide pagination */
.tcm-blog-swiper .swiper-pagination {
    display: none !important;
}

.tcm-blog-swiper .swiper-pagination-bullet {
    display: none !important;
}

.tcm-blog-swiper .swiper-pagination-bullet-active {
    display: none !important;
}

/* Hide navigation arrows */
.tcm-blog-swiper .swiper-button-next,
.tcm-blog-swiper .swiper-button-prev {
    display: none !important;
}

/* Pagination */
.tcm-blog-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.tcm-blog-pagination .page-numbers {
    list-style: none;
    display: flex;
    gap: 12px;
    padding: 0;
    margin: 0;
    align-items: center;
}

.tcm-blog-pagination .page-numbers li {
    list-style: none;
}

.tcm-blog-pagination a,
.tcm-blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    padding: 0 16px;
    background: #28293e;
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid #3a3b50;
    transition: all 0.2s ease;
}

.tcm-blog-pagination a:hover {
    background: linear-gradient(135deg, #a000ff 0%, #c060ff 100%);
    border-color: #a000ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(160, 0, 255, 0.3);
}

.tcm-blog-pagination .current {
    background: linear-gradient(135deg, #a000ff 0%, #c060ff 100%);
    border-color: #a000ff;
}

.tcm-blog-pagination .dots {
    background: transparent;
    color: #a0a0a0;
}

/* ==========================
   Tablet Styles
   ========================== */
@media screen and (max-width: 1024px) {
    .tcm-blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .tcm-blog-label {
        font-size: 15px;
        line-height: 20px;
    }
    
    .tcm-blog-meta,
    .tcm-blog-card-title {
        font-size: 18px !important;
        line-height: 23px !important;
    }
    
    .tcm-blog-meta {
        color: #ffffff;
    }
    
    .tcm-blog-card-image {
        height: 240px;
        display: block;
        line-height: 0;
    }
    
    .tcm-blog-card-image img {
        display: block;
        height: 100% !important;
        object-fit: cover;
    }
}

/* ==========================
   Mobile Styles
   ========================== */
@media screen and (max-width: 768px) {
    /* Recent Posts - Show Carousel on Mobile */
    .tcm-recent-posts .tcm-desktop-only {
        display: none;
    }
    
    .tcm-recent-posts .tcm-mobile-only {
        display: block;
    }
    
    /* Carousel overflow fix for peek view */
    .tcm-recent-posts .tcm-blog-carousel {
        overflow: visible;
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .tcm-recent-posts .tcm-blog-swiper {
        overflow: visible;
    }
    
    /* Full Blog - Single Column on Mobile */
    .tcm-blog-archive .tcm-blog-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Adjust card sizing for mobile */
    .tcm-blog-card-header {
        padding: 20px 20px 12px;
    }
    
    .tcm-blog-label {
        font-size: 15px;
        line-height: 20px;
    }
    
    .tcm-blog-meta {
        font-size: 16px;
        line-height: 20px;
        color: #ffffff;
        justify-content: space-between;
        gap: 12px;
    }
    
    .tcm-blog-card-image {
        height: 220px;
        display: block;
        line-height: 0;
    }
    
    .tcm-blog-card-image img {
        display: block;
        height: 100% !important;
        object-fit: cover;
    }
    
    .tcm-blog-card-content {
        padding: 16px 20px 20px 20px;
    }
    
    .tcm-blog-card-title {
        font-size: 18px !important;
        line-height: 23px !important;
        margin: 0 0 20px 0;
    }
    
    .tcm-blog-card-arrow {
        width: 28px;
        height: 28px;
    }
    
    .tcm-blog-card-arrow svg {
        width: 14px;
        height: 14px;
    }
    
    /* Pagination adjustments */
    .tcm-blog-pagination {
        margin-top: 40px;
    }
    
    .tcm-blog-pagination .page-numbers {
        gap: 8px;
    }
    
    .tcm-blog-pagination a,
    .tcm-blog-pagination span {
        min-width: 44px;
        height: 44px;
        padding: 0 12px;
        font-size: 14px;
    }
}

/* ==========================
   Small Mobile
   ========================== */
@media screen and (max-width: 480px) {
    .tcm-blog-card-inner {
        border-radius: 30px;
    }
    
    .tcm-blog-label {
        font-size: 15px;
        line-height: 20px;
    }
    
    .tcm-blog-meta {
        font-size: 14px;
        line-height: 18px;
        color: #ffffff;
    }
    
    .tcm-blog-card-image {
        height: 200px;
        display: block;
        line-height: 0;
    }
    
    .tcm-blog-card-image img {
        display: block;
        height: 100% !important;
        object-fit: cover;
    }
    
    .tcm-blog-card-title {
        font-size: 16px !important;
        line-height: 20px !important;
    }
}

/* ==========================
   Dark Background Support
   ========================== */
body.dark-mode .tcm-blog-card-inner,
.dark-bg .tcm-blog-card-inner {
    background: #28293e;
}

/* ==========================
   Accessibility
   ========================== */
.tcm-blog-card-link:focus {
    outline: 2px solid #a000ff;
    outline-offset: 4px;
    border-radius: 30px;
}

.tcm-blog-card-link:focus-visible {
    outline: 2px solid #a000ff;
    outline-offset: 4px;
}

/* ==========================
   Press Release Cards (No Image, Condensed)
   ========================== */

/* Remove image container from press cards */
.tcm-press-card .tcm-blog-card-image {
    display: none;
}

/* Adjust press card header to be more compact */
.tcm-press-card .tcm-blog-card-header {
    padding: 24px 24px 20px;
}

/* Adjust press card content padding */
.tcm-press-card .tcm-blog-card-content {
    padding: 0 24px 24px;
}

/* Press card title with adjusted spacing */
.tcm-press-card .tcm-blog-card-title {
    margin: 0 0 20px 0;
}

/* ==========================
   Portfolio/Case Study Cards (With Excerpt)
   ========================== */

/* Portfolio card excerpt styling */
.tcm-blog-card-excerpt {
    font-size: 14px;
    line-height: 20px;
    color: #b0b0b0;
    margin: 0 0 20px 0;
}

/* Adjust portfolio title margin to accommodate excerpt */
.tcm-portfolio-card .tcm-blog-card-title {
    margin: 0 0 12px 0;
}
