/**
 * IPDSA Notícias Carousel - Estilos
 * Cores: Azul #005d86 | Laranja #f89b1e
 * Fonte: Montserrat
 */

/* ============================================
   CAROUSEL WRAPPER
   ============================================ */

.ipdsa-noticias-carousel-wrapper {
    position: relative;
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 60px;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ipdsa-noticias-carousel {
    display: flex;
    gap: 20px;
    overflow: hidden;
    position: relative;
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */

.ipdsa-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: #005d86;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ipdsa-carousel-nav:hover {
    background: #f89b1e;
    transform: translateY(-50%) scale(1.1);
}

.ipdsa-carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.ipdsa-carousel-nav.prev {
    left: 0;
}

.ipdsa-carousel-nav.next {
    right: 0;
}

.ipdsa-carousel-nav svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.ipdsa-carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #ccc;
}

.ipdsa-carousel-nav:disabled:hover {
    transform: translateY(-50%);
}

/* ============================================
   NEWS CARD
   ============================================ */

.ipdsa-noticia-card {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
}

.ipdsa-noticia-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   NEWS IMAGE
   ============================================ */

.noticia-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #e8e8e8;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-size 0.6s ease;
}

.noticia-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(3, 66, 141, 0.8) 0%, rgba(40, 170, 225, 0) 100%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.noticia-image img {
    display: none;
}

.ipdsa-noticia-card:hover .noticia-image {
    background-size: 105%;
}

.ipdsa-noticia-card:hover .noticia-image::before {
    opacity: 0.9;
}

/* Placeholder para imagens ausentes */
.noticia-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #005d86 0%, #0084bb 100%);
    color: white;
    font-size: 48px;
}

/* ============================================
   NEWS CONTENT
   ============================================ */

.noticia-content {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.noticia-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #005d86;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 112px;
}

.noticia-link {
    display: inline-block;
    color: #c9c9c9;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.noticia-link:hover {
    color: #e68a0f;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.ipdsa-noticias-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablets */
@media (max-width: 1199px) {
    .ipdsa-noticias-carousel-wrapper {
        padding: 0 50px;
    }

    .ipdsa-noticia-card {
        min-width: 260px;
        max-width: 260px;
    }

    .ipdsa-carousel-nav {
        width: 45px;
        height: 45px;
    }

    .noticia-image {
        height: 170px;
    }
}

@media (max-width: 991px) {
    .ipdsa-noticia-card {
        min-width: 300px;
        max-width: 300px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .ipdsa-noticias-carousel-wrapper {
        padding: 0 40px;
        margin: 30px auto;
    }

    .ipdsa-noticia-card {
        min-width: 100%;
        max-width: 100%;
    }

    .ipdsa-carousel-nav {
        width: 40px;
        height: 40px;
    }

    .ipdsa-carousel-nav svg {
        width: 20px;
        height: 20px;
    }

    .noticia-image {
        height: 180px;
    }

    .noticia-content {
        padding: 18px;
    }

    .noticia-titulo {
        font-size: 15px;
        min-height: 105px;
    }

    .noticia-link {
        font-size: 13px;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .ipdsa-noticias-carousel-wrapper {
        padding: 0 35px;
    }

    .ipdsa-carousel-nav {
        width: 35px;
        height: 35px;
    }

    .ipdsa-carousel-nav.prev {
        left: -5px;
    }

    .ipdsa-carousel-nav.next {
        right: -5px;
    }
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

.ipdsa-carousel-nav:focus,
.noticia-link:focus {
    outline: 3px solid #f89b1e;
    outline-offset: 2px;
}

.ipdsa-noticia-card:focus-within {
    outline: 2px solid #005d86;
    outline-offset: 4px;
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
    .ipdsa-noticia-card,
    .noticia-image img,
    .ipdsa-carousel-nav,
    .noticia-link {
        transition: none;
    }

    .ipdsa-noticia-card:hover {
        transform: none;
    }

    .ipdsa-noticia-card:hover .noticia-image img {
        transform: none;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */

.ipdsa-noticias-loading {
    text-align: center;
    padding: 60px 20px;
    color: #005d86;
    font-size: 16px;
}

.ipdsa-noticias-loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}
