/**
 * News Carousel Styles
 * Carrusel de noticias financieras - BORDES RECTOS
 *
 * @package Foxentrade
 */

/* ============================================ */
/* SECTION CONTAINER                           */
/* ============================================ */

.news-carousel-section {
    width: 100%;
    padding: var(--space-24, 96px) 0;
    background-color: var(--color-bg-body, #ffffff);
    position: relative;
    overflow: hidden;
}

.news-carousel-container {
    max-width: var(--container-max-width, 1240px);
    margin: 0 auto;
    padding: 0 var(--space-6, 24px);
}

/* ============================================ */
/* HEADER                                       */
/* ============================================ */

.news-carousel-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--space-12, 48px);
    gap: var(--space-6, 24px);
}

.news-carousel-titles {
    width: 100%;
}

.news-carousel-title {
    font-family: var(--font-primary, "DM Sans", sans-serif);
    font-size: 40px;
    font-weight: 400;
    color: var(--color-text-primary, #004656);
    line-height: 1.2;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.news-carousel-subtitle {
    font-family: var(--font-primary, "DM Sans", sans-serif);
    font-size: 16px;
    color: var(--color-text-secondary, rgba(0, 70, 86, 0.85));
    line-height: 1.5;
    margin: 0 auto;
    max-width: 700px;
}

/* ============================================ */
/* NAVIGATION ARROWS                           */
/* ============================================ */

.news-carousel-nav {
    display: flex;
    gap: var(--space-4, 16px);
    flex-shrink: 0;
}

.news-carousel-arrow {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border-light, rgba(95, 95, 113, 0.22));
    /* BORDES RECTOS - Sin border-radius */
    border-radius: 0;
    color: var(--color-text-primary, #004656);
    cursor: pointer;
    transition: all var(--transition-fast, 200ms ease);
}

.news-carousel-arrow:hover {
    background-color: var(--color-bg-hover, rgba(4, 120, 178, 0.05));
    border-color: var(--color-primary, #0478b2);
    color: var(--color-primary, #0478b2);
}

.news-carousel-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.news-carousel-arrow svg {
    width: 24px;
    height: 24px;
}

/* ============================================ */
/* SWIPER CONTAINER                            */
/* ============================================ */

.news-carousel-swiper {
    overflow: visible;
    padding-bottom: var(--space-10, 40px);
}

.news-carousel-swiper .swiper-wrapper {
    align-items: stretch;
}

.news-carousel-swiper .swiper-slide {
    height: auto;
}

/* ============================================ */
/* NEWS CARD                                    */
/* ============================================ */

.news-card {
    background: var(--color-bg-card, #ffffff);
    /* BORDES RECTOS - Sin border-radius */
    border-radius: 0;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md, 0 2px 12px rgba(0, 0, 0, 0.08));
    border: 1px solid var(--color-border-light, rgba(95, 95, 113, 0.22));
    transition: all var(--transition-smooth, 400ms ease-out);
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg, 0 4px 24px rgba(0, 0, 0, 0.12));
}

/* ============================================ */
/* CARD IMAGE                                   */
/* ============================================ */

.news-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.news-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.news-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow, 500ms ease);
}

.news-card:hover .news-card-img {
    transform: scale(1.05);
}

/* Category Badge */
.news-card-badge {
    position: absolute;
    top: var(--space-4, 16px);
    left: var(--space-4, 16px);
    padding: 6px 16px;
    /* BORDES RECTOS - Sin border-radius */
    border-radius: 0;
    font-family: var(--font-primary, "DM Sans", sans-serif);
    font-size: var(--font-size-xs, 12px);
    font-weight: var(--font-weight-bold, 700);
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
    z-index: 1;
}

/* ============================================ */
/* CARD CONTENT                                 */
/* ============================================ */

.news-card-content {
    padding: var(--space-8, 32px);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-date {
    display: block;
    font-family: var(--font-primary, "DM Sans", sans-serif);
    font-size: var(--font-size-xs, 12px);
    font-weight: var(--font-weight-medium, 500);
    color: var(--color-text-secondary, rgba(0, 70, 86, 0.85));
    margin-bottom: var(--space-3, 12px);
    text-transform: capitalize;
}

.news-card-title {
    font-family: var(--font-primary, "DM Sans", sans-serif);
    font-size: var(--font-size-xl, 20px);
    font-weight: var(--font-weight-bold, 700);
    line-height: var(--line-height-snug, 1.2);
    color: var(--color-text-primary, #004656);
    margin: 0 0 var(--space-4, 16px) 0;
}

.news-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast, 200ms ease);
}

.news-card-title a:hover {
    color: var(--color-primary, #0478b2);
}

.news-card-excerpt {
    font-family: var(--font-primary, "DM Sans", sans-serif);
    font-size: var(--font-size-sm, 14px);
    color: var(--color-text-secondary, rgba(0, 70, 86, 0.85));
    line-height: var(--line-height-relaxed, 1.5);
    margin: 0 0 var(--space-8, 32px) 0;
    flex-grow: 1;
}

/* ============================================ */
/* CARD LINK                                    */
/* ============================================ */

.news-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary, "DM Sans", sans-serif);
    font-size: 14px;
    font-weight: 400;
    color: var(--color-primary, #0478b2);
    text-decoration: none;
    transition: opacity var(--transition-fast, 200ms ease);
    margin-top: auto;
}

.news-card-link:hover {
    opacity: 0.7;
}

.news-card-link svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast, 200ms ease);
}

.news-card-link:hover svg {
    transform: translate(2px, -2px);
}

/* ============================================ */
/* PAGINATION (Mobile)                          */
/* ============================================ */

.news-carousel-pagination {
    text-align: center;
    margin-top: var(--space-6, 24px);
}

.news-carousel-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    /* BORDES RECTOS - Sin border-radius */
    border-radius: 0;
    background: var(--color-border-light, rgba(95, 95, 113, 0.22));
    opacity: 1;
    margin: 0 6px;
    transition: all var(--transition-fast, 200ms ease);
}

.news-carousel-pagination .swiper-pagination-bullet-active {
    background: var(--color-primary, #0478b2);
    width: 24px;
}

/* ============================================ */
/* FOOTER - VIEW ALL                            */
/* ============================================ */

/* CTA inside news-carousel-section: ensure full width */
.news-carousel-section .contenedor-1b69b2e {
    width: 100%;
    height: 68px;
    position: relative;
}

.news-carousel-section .componente-mhz3u.elemento-1f868ts {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.news-carousel-view-all:hover svg {
    transform: translateX(4px);
}

/* ============================================ */
/* DARK MODE                                    */
/* ============================================ */

[data-theme="dark"] .news-carousel-section {
    background-color: var(--color-bg-body, #141b24);
}

[data-theme="dark"] .news-card {
    background: var(--color-bg-card, #141b24);
    border-color: var(--color-border-light, rgba(255, 255, 255, 0.15));
}

[data-theme="dark"] .news-carousel-title,
[data-theme="dark"] .news-card-title,
[data-theme="dark"] .news-card-title a {
    color: var(--color-text-primary, #ffffff);
}

[data-theme="dark"] .news-carousel-subtitle,
[data-theme="dark"] .news-card-date,
[data-theme="dark"] .news-card-excerpt {
    color: var(--color-text-secondary, rgba(255, 255, 255, 0.9));
}

[data-theme="dark"] .news-carousel-arrow {
    border-color: var(--color-border-light, rgba(255, 255, 255, 0.15));
    color: var(--color-text-primary, #ffffff);
}

[data-theme="dark"] .news-carousel-arrow:hover {
    background-color: var(--color-bg-hover, rgba(61, 173, 219, 0.15));
    border-color: var(--color-primary, #42a5f5);
    color: var(--color-primary, #42a5f5);
}

[data-theme="dark"] .news-carousel-view-all {
    color: var(--color-text-primary, #ffffff);
    border-color: var(--color-primary, #42a5f5);
}

[data-theme="dark"] .news-carousel-view-all:hover {
    background-color: var(--color-primary, #42a5f5);
    color: var(--color-bg-body, #141b24);
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */

@media (max-width: 1024px) {
    .news-carousel-section {
        padding: var(--space-16, 64px) 0;
    }

    .news-carousel-title {
        font-size: 32px;
    }

    /* Flechas centradas en tablet */
    .news-carousel-nav {
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .news-carousel-section {
        padding: var(--space-12, 48px) 0;
    }

    .news-carousel-container {
        padding: 0 var(--space-4, 16px);
    }

    .news-carousel-header {
        margin-bottom: var(--space-8, 32px);
    }

    .news-carousel-title {
        font-size: 24px;
    }

    .news-carousel-subtitle {
        font-size: 14px;
    }

    .news-card-image {
        height: 120px;
    }

    .news-card-content {
        padding: 12px;
    }

    .news-card-title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .news-card-excerpt {
        display: none;
    }

    .news-card-date {
        font-size: 11px;
    }

    .news-card-link {
        font-size: 13px;
    }

    .news-card-badge {
        font-size: 9px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .news-carousel-section {
        padding: var(--space-10, 40px) 0;
    }

    .news-card-image {
        height: 100px;
    }

    .news-card-content {
        padding: 10px;
    }

    .news-card-title {
        font-size: 13px;
    }
}

/* ============================================ */
/* ANIMATIONS                                   */
/* ============================================ */

/* Initial state for cards */
.news-card {
    opacity: 0;
    transform: translateY(30px);
}

/* Animated state */
.news-card.animate-in {
    animation: cardFadeIn 0.6s var(--easing-custom, cubic-bezier(0.12, 0.23, 0.17, 0.99)) forwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section visible state */
.news-carousel-section.is-visible .news-carousel-title,
.news-carousel-section.is-visible .news-carousel-subtitle,
.news-carousel-section.is-visible .news-carousel-nav {
    animation: fadeInUp 0.6s var(--easing-custom, cubic-bezier(0.12, 0.23, 0.17, 0.99)) forwards;
}

.news-carousel-section .news-carousel-title,
.news-carousel-section .news-carousel-subtitle,
.news-carousel-section .news-carousel-nav {
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger delays for header elements */
.news-carousel-section.is-visible .news-carousel-title {
    animation-delay: 0s;
}

.news-carousel-section.is-visible .news-carousel-subtitle {
    animation-delay: 0.1s;
}

.news-carousel-section.is-visible .news-carousel-nav {
    animation-delay: 0.2s;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .news-card,
    .news-carousel-section .news-carousel-title,
    .news-carousel-section .news-carousel-subtitle,
    .news-carousel-section .news-carousel-nav {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .news-card:hover {
        transform: none;
    }
}
