/**
 * WTE Latest Posts Slider Styles
 *
 * Desktop: Grid layout (1 large card left + 4 small cards right)
 * Mobile: Swiper slider (1 post per slide)
 */

/* ===== WRAPPER ===== */
.wte-latest-posts-wrapper {
    position: relative;
    width: 100%;
    padding: 20px 0;
    font-family: 'Poppins', sans-serif;
}

/* ===== DESKTOP: GRID LAYOUT (> 768px) ===== */
@media (min-width: 769px) {
    .wte-latest-posts-swiper {
        overflow: visible !important;
    }

    .wte-latest-posts-swiper .swiper-wrapper {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        transform: none !important;
    }

    /* Slide grande ocupa coluna esquerda e todas as linhas */
    .wte-latest-posts-slide-large {
        grid-column: 1;
        grid-row: 1 / span 4;
    }

    /* Slides pequenos na coluna direita */
    .wte-latest-posts-slide-small {
        grid-column: 2;
    }

    /* Garantir que os slides não tenham width do Swiper */
    .wte-latest-posts-swiper .swiper-slide {
        width: auto !important;
    }

    /* Ocultar navegação no desktop */
    .wte-latest-posts-nav {
        display: none !important;
    }
}

/* ===== TABLET: GRID AJUSTADO (769px - 992px) ===== */
@media (min-width: 769px) and (max-width: 992px) {
    .wte-latest-posts-swiper .swiper-wrapper {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }

    .wte-latest-posts-slide-large {
        grid-column: 1;
        grid-row: auto;
    }

    .wte-latest-posts-slide-small {
        grid-column: 1;
    }
}

/* ===== MOBILE: SWIPER SLIDER (<= 768px) ===== */
@media (max-width: 768px) {
    .wte-latest-posts-wrapper .swiper-wrapper {
        display: block;    
    }

    .wte-latest-posts-wrapper {
        padding: 10px 15px;
    }

    .wte-latest-posts-swiper {
        overflow: hidden;
    }

    .wte-latest-posts-swiper .swiper-wrapper {
        display: flex !important;
        flex-wrap: nowrap;
    }

    .wte-latest-posts-swiper .swiper-slide {
        width: 100% !important;
        flex-shrink: 0;
        padding: 0 5px;
        box-sizing: border-box;
    }

    /* Navegação visível no mobile */
    .wte-latest-posts-nav {
        display: block;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 35px !important;
        height: 35px !important;
        background: #8ea1b2;
        border-radius: 50%;
        z-index: 10;
    }

    .wte-latest-posts-nav::after {
        font-size: 14px !important;
        color: #fff;
    }

    .wte-latest-posts-nav.swiper-button-prev {
        left: 0;
    }

    .wte-latest-posts-nav.swiper-button-next {
        right: 0;
    }

    .wte-latest-posts-nav:hover {
        background: var(--wte-white, #ffffff);
    }

    .wte-latest-posts-nav:hover::after {
        color: var(--wte-text-dark, #1b4264);
    }
}

/* Setas menores em telas muito pequenas (mantém visíveis) */
@media (max-width: 480px) {
    .wte-latest-posts-nav {
        display: block !important;
        width: 30px !important;
        height: 30px !important;
    }

    .wte-latest-posts-nav::after {
        font-size: 12px !important;
    }
}

/* ===== LARGE CARD STYLES ===== */

.wte-blog-card-large {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Large Card Image */
.wte-blog-card-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 aspect ratio */
    overflow: hidden;
    background: var(--wte-primary, #00c7e4);
    border-radius: 8px;
}

.wte-blog-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wte-blog-card-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00c7e4 0%, #00bcd4 100%);
}

/* Large Card Content */
.wte-blog-card-content {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wte-blog-card-content .wte-blog-card-date-small {
    margin-bottom: 15px;
    margin-top: 15px;
}

.wte-blog-card-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--wte-text-dark, #1b4264);
}

.wte-blog-card-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--wte-transition, all 0.3s ease);
}

.wte-blog-card-title a:hover {
    color: var(--wte-primary, #00c7e4);
}

.wte-blog-card-excerpt {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--wte-text-gray, #6b7280);
    flex: 1;
    text-align: justify;
}

/* Large Card Button */
.wte-blog-card-button {
    display: inline-block;
    padding: 10px 28px;
    background: #00c7e4;
    color: #1b4264;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--wte-transition, all 0.3s ease);
    align-self: flex-start;
}

.wte-blog-card-button:hover {
    background: #00b0c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 199, 228, 0.3);
}

/* ===== SMALL CARD STYLES ===== */

.wte-blog-card-small {
    /* Container */
}

.wte-blog-card-small-inner {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 25px;
}

.ast-single-post .entry-content a {
    text-decoration: none;
}

/* Small Card Image */
.wte-blog-card-image-small {
    position: relative;
    width: 160px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--wte-primary, #00c7e4);
    flex-shrink: 0;
}

.wte-blog-card-image-small img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.wte-blog-card-placeholder-small {
    width: 100%;
    height: 100%;
    background: #00c7e4;
}

/* Small Card Content */
.wte-blog-card-content-small {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.wte-blog-card-date-small {
    background: rgba(27, 66, 100, 0.95);
    color: var(--wte-white, #ffffff);
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 8px;
    align-self: flex-start;
}

.wte-blog-card-title-small {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--wte-text-dark, #1b4264);
}

.wte-blog-card-title-small a {
    color: inherit;
    text-decoration: none;
    transition: var(--wte-transition, all 0.3s ease);
}

.wte-blog-card-title-small a:hover {
    color: var(--wte-primary, #00c7e4);
}

.wte-blog-card-excerpt-small {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--wte-text-gray, #6b7280);
    text-align: justify;
}

/* ===== BOTÃO MOBILE ONLY (Desktop) ===== */
/* IMPORTANTE: Esta regra DEVE vir ANTES das regras mobile */
.wte-blog-card-small .wte-mobile-only {
    display: none;
}

/* ===== MOBILE CARD ADJUSTMENTS ===== */
@media (max-width: 768px) {
    /* ========================================
       PRIMEIRO ITEM: Estilo IDÊNTICO aos cards pequenos
       ======================================== */

    /* Card grande vira layout vertical igual aos pequenos */
    .wte-latest-posts-slide-large .wte-blog-card-large {
        display: block !important;
        height: auto !important;
    }

    /* Imagem do card grande no mobile: igual aos pequenos */
    .wte-latest-posts-slide-large .wte-blog-card-image {
        padding-top: 0 !important;
        width: 100% !important;
        height: 200px !important;
        position: relative !important;
        border-radius: 8px;
        overflow: hidden;
    }

    .wte-latest-posts-slide-large .wte-blog-card-image img {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Conteúdo do card grande igual aos pequenos */
    .wte-latest-posts-slide-large .wte-blog-card-content {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }

    .wte-latest-posts-slide-large .wte-blog-card-content .wte-blog-card-date-small {
        margin-top: 15px !important;
        margin-bottom: 8px !important;
        align-self: flex-start !important;
    }

    /* Título do card grande igual aos pequenos no mobile */
    .wte-latest-posts-slide-large .wte-blog-card-title {
        font-size: 16px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }

    /* Mostrar botão do card grande no mobile */
    .wte-latest-posts-slide-large .wte-blog-card-button {
        display: inline-block !important;
        margin-top: 15px !important;
        align-self: flex-start !important;
    }

    /* ========================================
       CARDS PEQUENOS: Ajustes mobile
       ======================================== */

    .wte-blog-card-title {
        font-size: 20px !important;
    }

    .wte-blog-card-title-small {
        font-size: 16px !important;
    }

    .wte-blog-card-excerpt-small {
        font-size: 14px !important;
        margin-bottom: 0 !important;
    }

    /* Small cards em mobile: layout vertical com imagem maior */
    .wte-blog-card-small-inner {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .wte-blog-card-image-small {
        width: 100% !important;
        height: 200px !important;
    }

    /* Mostrar botão "Leia mais" nos cards pequenos no mobile */
    .wte-blog-card-small .wte-mobile-only {
        display: inline-block !important;
        margin-top: 15px !important;
        align-self: flex-start !important;
    }

    /* Ajustar content-small para flex column */
    .wte-blog-card-content-small {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* ===== EMPTY STATE / NO POSTS ===== */

.wte-sliders-notice {
    padding: 20px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    margin: 20px 0;
    border-radius: 4px;
}

.wte-sliders-notice p {
    margin: 0 0 10px 0;
    color: #856404;
}

.wte-sliders-notice ol {
    margin: 10px 0 0 20px;
    color: #856404;
}

.wte-sliders-notice ol li {
    margin: 5px 0;
}
