/* ========================================
   API NEWS READER - CARD LAYOUT
   ======================================== */

/* Container principal */
.api-news-wrapper {
    width: 100%;
}

.api-news-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========================================
   CARD DE NOTÍCIA
   ======================================== */

.api-news-item {
    position: relative;
    height: 153px;
    border-radius: 6px;
    box-shadow: 0px 6px 5.9px rgba(0, 0, 0, 0.17);
    overflow: hidden;
    cursor: pointer;
    background-color: #ebebeb;
    background-size: cover;
    background-position: left center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Gradiente que funde a foto (esquerda) no fundo cinza */
.api-news-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(235, 235, 235, 0) 30.1%, #ebebeb 61.25%);
    z-index: 1;
    pointer-events: none;
}

/* Hover */
.api-news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0px 10px 16px rgba(0, 0, 0, 0.22);
}

/* ========================================
   OVERLAY AZUL-ESCURO (lado direito)
   ======================================== */

.api-news-overlay {
    position: absolute;
    left: 40%;       /* ~268px de 671px no Figma */
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 69, 0.8);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 2;
    display: flex;
    align-items: center;
}

/* ========================================
   CONTEÚDO (dentro do overlay)
   ======================================== */

.api-news-content {
    padding: 0 36px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* Categoria */
.api-news-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1;
}

/* Título */
.api-news-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 150%;
    color: #ffffff;
}

/* Descrição */
.api-news-description {
    margin: 0;
    font-size: 20px;
    font-weight: 400;
    line-height: 150%;
    color: #ffffff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Data */
.api-news-date {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 600px) {
    .api-news-item {
        height: auto;
        min-height: 120px;
    }

    .api-news-overlay {
        left: 35%;
    }

    .api-news-content {
        padding: 16px 20px;
        gap: 6px;
    }

    .api-news-title {
        font-size: 15px;
    }

    .api-news-description {
        font-size: 13px;
    }
}

/* ========================================
   PAGINAÇÃO
   ======================================== */

.api-news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.api-news-pagination a,
.api-news-pagination span {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.api-news-pagination a {
    background: #0f1745 !important;
    color: #ffffff !important;
    border: 1px solid #0f1745 !important;
}

.api-news-pagination a:hover {
    background: #1a2566 !important;
    border-color: #1a2566 !important;
    color: #ffffff !important;
}

.api-news-pagination .disabled {
    background: #d1d5db;
    color: #6b7280;
    border: 1px solid #d1d5db;
    cursor: not-allowed;
}

.api-news-pagination .page-info {
    color: #374151;
    font-weight: 600;
}

/* ========================================
   LAYOUT: GRADE (CARDS)
   ======================================== */

.api-news-container.grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-layout .api-news-item {
    height: 280px;
    background-position: center center;
}

/* Remove o gradiente cinza da listagem */
.grid-layout .api-news-item::before {
    display: none;
}

/* Overlay azul translúcido na parte inferior do card */
.grid-layout .api-news-overlay {
    position: absolute;
    left: 0;
    top: auto;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 69, 0.8);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    align-items: center;
}

.grid-layout .api-news-content {
    padding: 16px 20px;
    gap: 6px;
}

.grid-layout .api-news-title {
    font-size: 16px;
    line-height: 140%;
}

.grid-layout .api-news-description {
    font-size: 13px;
    line-height: 140%;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

@media (max-width: 900px) {
    .api-news-container.grid-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .api-news-container.grid-layout {
        grid-template-columns: 1fr;
    }

    .grid-layout .api-news-item {
        height: 220px;
    }
}

/* ========================================
   LAYOUT: TEMA ESCURO
   ======================================== */

.api-news-container.dark-theme .api-news-item {
    background-color: #1a1a2e;
}

.api-news-container.dark-theme .api-news-item::before {
    background: linear-gradient(90deg, rgba(26, 26, 46, 0) 30.1%, #1a1a2e 61.25%);
}

.api-news-container.dark-theme .api-news-overlay {
    background: rgba(10, 15, 50, 0.85);
}

.api-news-container.dark-theme .api-news-pagination {
    border-top-color: #2a2a4a;
}

.api-news-container.dark-theme .api-news-pagination a {
    background: #1a1a2e;
    color: #ffffff;
    border-color: #2a2a4a;
}

.api-news-container.dark-theme .api-news-pagination a:hover {
    background: #3a3a6a;
    border-color: #3a3a6a;
}

.api-news-container.dark-theme .api-news-pagination .disabled {
    color: #555;
    border-color: #2a2a4a;
}

.api-news-container.dark-theme .api-news-pagination .page-info {
    color: #8888aa;
}
