/* Estilos para páginas de notícias */

.news-page,
.news-detail-page {
    --content: 60rem;
    --breakout: 80rem;
    position: relative;
}

.news {
    padding-block-start: var(--spacing-14);
    padding-block-end: var(--spacing-12);
    background-image: url('/assets/images/news/news_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.news-detail {
    padding-block-start: var(--spacing-14);
    padding-block-end: var(--spacing-12);
    background-image: url('/assets/images/news/news_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (width >= 60rem) {
    .news,
    .news-detail {
        padding-block-start: var(--spacing-16);
        padding-block-end: var(--spacing-14);
    }
}

/* Header */
.news__header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.news__title {
    color: var(--clr-bronze-100);
    font-family: var(--heading-font);
    font-size: 3rem;
    font-weight: 700;
    line-height: 3rem;
    letter-spacing: -0.125rem;
    text-transform: uppercase;
    text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.4);
    margin-bottom: 0.5rem;
}

.news__subtitle {
    font-size: 1.25rem;
    color: var(--clr-onSurface-02--subtle);
    margin: 0;
}

/* Loading e Error */
.news__loading,
.news__error,
.news-detail__loading,
.news-detail__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    background: var(--clr-surface-02);
    border-radius: var(--radius-3);
    border: 1px solid var(--clr-forSurface-02);
    margin: 2rem auto;
    max-width: 600px;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--clr-border);
    border-top: 3px solid var(--clr-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.news__error h3,
.news-detail__error h3 {
    color: var(--clr-white);
    margin-bottom: 0.5rem;
}

.news__error p,
.news-detail__error p {
    color: var(--clr-onSurface-02--subtle);
    margin-bottom: 1.5rem;
}

/* Grid de notícias */
.news__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Card de notícia */
.news-card {
    background: var(--clr-surface-02);
    border-radius: var(--radius-3);
    border: 1px solid var(--clr-forSurface-02);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--clr-bronze-400);
}

.news-card__image {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: var(--clr-surface-03);
}

.news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card__image img {
    transform: scale(1.05);
}

.news-card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--clr-white);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card__excerpt {
    color: var(--clr-onSurface-02--subtle);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--clr-forSurface-03);
}

.news-card__date {
    font-size: 0.875rem;
    color: var(--clr-onSurface-02--subtle);
}

.news-card__cta {
    font-size: 0.875rem;
    color: var(--clr-bronze-200);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.news-card__cta svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.news-card:hover .news-card__cta svg {
    transform: translateX(2px);
}

/* Paginação */
.news__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-3);
    border: 1px solid var(--clr-forSurface-02);
}

.pagination__info {
    color: var(--clr-white);
    font-weight: 600;
}

/* Estado vazio */
.news__empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--clr-surface-02);
    border-radius: var(--radius-3);
    border: 1px solid var(--clr-forSurface-02);
}

.news__empty h3 {
    color: var(--clr-white);
    margin-bottom: 1rem;
}

.news__empty p {
    color: var(--clr-onSurface-02--subtle);
}

/* Responsividade */
@media (max-width: 768px) {
    .news__title {
        font-size: 2rem;
        line-height: 2rem;
    }
    
    .news__subtitle {
        font-size: 1.125rem;
    }
    
    .news__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .news__pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .news__loading,
    .news__error,
    .news-detail__loading,
    .news-detail__error {
        padding: 2rem 1rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .news__title {
        font-size: 1.75rem;
        line-height: 1.75rem;
    }
    
    .news-card__content {
        padding: 1rem;
    }
    
    .news-card__title {
        font-size: 1.125rem;
    }
}