/**
 * Homepage V2 Styles
 * Styles for the redesigned homepage preview
 */

/* ==========================================================================
   Tags Carousel
   ========================================================================== */

.tags--carousel .tags-carousel {
    position: relative;
    padding: 0 40px;
}

.tags--carousel .swiper-slide {
    width: auto;
    flex-shrink: 0;
}

.tags--carousel .tag {
    display: inline-block;
    white-space: nowrap;
}

.tags--carousel .swiper-button-prev,
.tags--carousel .swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    width: 30px;
    height: 30px;
    z-index: 10;
    cursor: pointer;
}

.tags--carousel .swiper-button-prev::after,
.tags--carousel .swiper-button-next::after {
    font-size: 18px;
}

.tags--carousel .swiper-button-prev {
    left: 0;
}

.tags--carousel .swiper-button-next {
    right: 0;
}

/* ==========================================================================
   Featured Posts 3x2 Grid
   ========================================================================== */

.posts--grid-3x2 .cards--equal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.posts--grid-3x2 .card--grid-item {
    width: 100%;
    flex: none;
}

/* Override the flex classes for grid items */
.posts--grid-3x2 .flex__1-3 {
    flex: none;
    width: 100%;
}

/* Stacked card layout - image on top, content below */
.posts--grid-3x2 .card--stacked {
    background: #fff;
    position: relative;
}

.posts--grid-3x2 .card--stacked .card__inner {
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
}

/* Image container - full width, at top */
.posts--grid-3x2 .card--stacked .card__thumbnail {
    position: relative !important;
    width: 100% !important;
    flex-shrink: 0;
    aspect-ratio: 16/10;
    overflow: hidden;
    order: -1; /* Force thumbnail to top */
}

.posts--grid-3x2 .card--stacked .card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content area below image */
.posts--grid-3x2 .card--stacked .card__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 15px 20px 20px;
    width: 100% !important;
    position: relative;
}

.posts--grid-3x2 .card--stacked .card__content h3 {
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 8px;
    order: 1;
}

/* Move category tag to overlay bottom-left of image */
.posts--grid-3x2 .card--stacked .card__metas {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 10px;
    padding-left: 20px;
    z-index: 2;
}

.posts--grid-3x2 .card--stacked .card__metas .tag {
    margin-right: 0;
}

/* Hide date in metas - only show category */
.posts--grid-3x2 .card--stacked .card__metas .card__date {
    display: none;
}

.posts--grid-3x2 .card--stacked .card__excerpt {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    order: 2;
}

/* Smaller Read More button, no overlap */
.posts--grid-3x2 .card--stacked .button--more {
    order: 3;
    align-self: flex-start;
    font-size: 0.75rem;
    padding: 8px 16px;
    margin-top: auto;
    position: relative;
    background: #fff;
}

/* Responsive: 2 columns on tablet */
@media (max-width: 1024px) {
    .posts--grid-3x2 .cards--equal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive: 1 column on mobile */
@media (max-width: 600px) {
    .posts--grid-3x2 .cards--equal-grid {
        grid-template-columns: 1fr;
    }

    .tags--carousel .tags-carousel {
        padding: 0 30px;
    }
}
